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;
|
||||
};
|
||||
|
||||
TxProposal.prototype._verifySignatures = function(inKeys, scriptSig, txSigHash) {
|
||||
TxProposal._verifySignatures = function(inKeys, scriptSig, txSigHash) {
|
||||
preconditions.checkArgument(Buffer.isBuffer(txSigHash));
|
||||
preconditions.checkArgument(inKeys);
|
||||
preconditions.checkState(Buffer.isBuffer(inKeys[0]));
|
||||
|
|
|
|||
|
|
@ -171,15 +171,11 @@ describe('TxProposal', function() {
|
|||
ret.should.deep.equal([0, 3]);
|
||||
});
|
||||
it('#_keysFromRedeemScript', function() {
|
||||
var txp = dummyProposal;
|
||||
var keys =
|
||||
// Data taken from bitcore's TransactionBuilder test
|
||||
var txp = dummyProposal;
|
||||
var ret = txp._updateSignedBy(pubkeys, new bitcore.Script(new Buffer(validScriptSig, 'hex')), new Buffer('31103626e162f1cbfab6b95b08c9f6e78aae128523261cb37f8dfd4783cb09a7', 'hex'));
|
||||
ret.should.deep.equal([0, 3]);
|
||||
var keys = TxProposal._keysFromRedeemScript(validScriptSig);
|
||||
keys.length.should.equal(5);
|
||||
for(var i in keys){
|
||||
keys[i].toString('hex').should.equal(pubkeys[i].toString('hex'));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue