tests for txProposal 1
This commit is contained in:
parent
0e211426d7
commit
2fe421b14f
2 changed files with 6 additions and 10 deletions
|
|
@ -90,7 +90,7 @@ TxProposal._formatKeys = function(allowedPubKeys) {
|
||||||
return keys;
|
return keys;
|
||||||
};
|
};
|
||||||
|
|
||||||
TxProposal.prototype._verifySignatures = function(inKeys, scriptSig, txSigHash) {
|
TxProposal._verifySignatures = function(inKeys, scriptSig, txSigHash) {
|
||||||
preconditions.checkArgument(Buffer.isBuffer(txSigHash));
|
preconditions.checkArgument(Buffer.isBuffer(txSigHash));
|
||||||
preconditions.checkArgument(inKeys);
|
preconditions.checkArgument(inKeys);
|
||||||
preconditions.checkState(Buffer.isBuffer(inKeys[0]));
|
preconditions.checkState(Buffer.isBuffer(inKeys[0]));
|
||||||
|
|
|
||||||
|
|
@ -171,15 +171,11 @@ describe('TxProposal', function() {
|
||||||
ret.should.deep.equal([0, 3]);
|
ret.should.deep.equal([0, 3]);
|
||||||
});
|
});
|
||||||
it('#_keysFromRedeemScript', function() {
|
it('#_keysFromRedeemScript', function() {
|
||||||
var txp = dummyProposal;
|
var keys = TxProposal._keysFromRedeemScript(validScriptSig);
|
||||||
var keys =
|
keys.length.should.equal(5);
|
||||||
// Data taken from bitcore's TransactionBuilder test
|
for(var i in keys){
|
||||||
var txp = dummyProposal;
|
keys[i].toString('hex').should.equal(pubkeys[i].toString('hex'));
|
||||||
var ret = txp._updateSignedBy(pubkeys, new bitcore.Script(new Buffer(validScriptSig, 'hex')), new Buffer('31103626e162f1cbfab6b95b08c9f6e78aae128523261cb37f8dfd4783cb09a7', 'hex'));
|
}
|
||||||
ret.should.deep.equal([0, 3]);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue