message: add missing test for Address
This commit is contained in:
parent
55ff383c7b
commit
ee66c41dd4
1 changed files with 10 additions and 0 deletions
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue