message: better variable names

This commit is contained in:
Daniel Cousens 2014-05-24 13:54:46 +10:00
parent 2114deba95
commit 1d6b1fe58b

View file

@ -24,13 +24,13 @@ describe('Message', function() {
fixtures.valid.verify.forEach(function(f) { fixtures.valid.verify.forEach(function(f) {
var network = networks[f.network] var network = networks[f.network]
var s1 = new Buffer(f.signature, 'base64') var signature = new Buffer(f.signature, 'base64')
assert.ok(Message.verify(f.address, s1, f.message, network)) assert.ok(Message.verify(f.address, signature, f.message, network))
if (f.compressed) { if (f.compressed) {
var s2 = new Buffer(f.compressed.signature, 'base64') var compressedSignature = new Buffer(f.compressed.signature, 'base64')
assert.ok(Message.verify(f.compressed.address, s2, f.message, network)) assert.ok(Message.verify(f.compressed.address, compressedSignature, f.message, network))
} }
}) })
}) })
@ -48,15 +48,15 @@ describe('Message', function() {
it(f.description, function() { it(f.description, function() {
var network = networks[f.network] var network = networks[f.network]
var k1 = new ECKey(new BigInteger(f.D), false) var privKey = new ECKey(new BigInteger(f.D), false)
var s1 = Message.sign(k1, f.message, network) var signature = Message.sign(privKey, f.message, network)
assert.equal(s1.toString('base64'), f.signature) assert.equal(signature.toString('base64'), f.signature)
if (f.compressed) { if (f.compressed) {
var k2 = new ECKey(new BigInteger(f.D)) var compressedPrivKey = new ECKey(new BigInteger(f.D))
var s2 = Message.sign(k2, f.message) var compressedSignature = Message.sign(compressedPrivKey, f.message)
assert.equal(s2.toString('base64'), f.compressed.signature) assert.equal(compressedSignature.toString('base64'), f.compressed.signature)
} }
}) })
}) })