diff --git a/test/message.js b/test/message.js index 5846a4d..d69a41f 100644 --- a/test/message.js +++ b/test/message.js @@ -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]