message: add missing test for Address

This commit is contained in:
Daniel Cousens 2014-06-14 10:21:38 +10:00
parent 55ff383c7b
commit ee66c41dd4

View file

@ -1,6 +1,7 @@
var assert = require('assert')
var networks = require('../src/networks')
var Address = require('../src/address')
var BigInteger = require('bigi')
var ECKey = require('../src/eckey')
var Message = require('../src/message')
@ -20,6 +21,15 @@ describe('Message', function() {
})
describe('verify', function() {
it('accepts an Address object', function() {
var f = fixtures.valid.verify[0]
var network = networks[f.network]
var address = Address.fromBase58Check(f.address)
var signature = new Buffer(f.signature, 'base64')
assert.ok(Message.verify(address, signature, f.message, network))
})
fixtures.valid.verify.forEach(function(f) {
it('verifies a valid signature for \"' + f.message + '\" (' + f.network + ')', function() {
var network = networks[f.network]