From ee66c41dd45a92af28512fa5cf06c98e0e8c75a0 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Sat, 14 Jun 2014 10:21:38 +1000 Subject: [PATCH] message: add missing test for Address --- test/message.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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]