ALL test passing
This commit is contained in:
parent
25631e641a
commit
d0c43f9bfb
3 changed files with 11 additions and 11 deletions
|
|
@ -159,9 +159,11 @@ TxProposal.prototype._check = function() {
|
||||||
if (!tx.ins.length)
|
if (!tx.ins.length)
|
||||||
throw new Error('Invalid tx proposal: no ins');
|
throw new Error('Invalid tx proposal: no ins');
|
||||||
|
|
||||||
var scriptSig = this.builder.vanilla.scriptSig;
|
for(var i in tx.ins){
|
||||||
if (!scriptSig || !scriptSig.length) {
|
var scriptSig = tx.ins[i].s;
|
||||||
throw new Error('Invalid tx proposal: no signatures');
|
if (!scriptSig || !scriptSig.length) {
|
||||||
|
throw new Error('Invalid tx proposal: no signatures');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = 0; i < tx.ins.length; i++) {
|
for (var i = 0; i < tx.ins.length; i++) {
|
||||||
|
|
|
||||||
|
|
@ -102,10 +102,7 @@ WalletFactory.prototype.read = function(walletId) {
|
||||||
|
|
||||||
WalletFactory.prototype.create = function(opts) {
|
WalletFactory.prototype.create = function(opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
this.log('### CREATING NEW WALLET.' +
|
this.log('### CREATING NEW WALLET.' + (opts.id ? ' USING ID: ' + opts.id : ' NEW ID') + (opts.privateKey ? ' USING PrivateKey: ' + opts.privateKey.getId() : ' NEW PrivateKey'));
|
||||||
(opts.id ? ' USING ID: ' + opts.id : ' NEW ID') +
|
|
||||||
(opts.privateKey ? ' USING PrivateKey: ' + opts.privateKey.getId() : ' NEW PrivateKey')
|
|
||||||
);
|
|
||||||
|
|
||||||
opts.privateKey = opts.privateKey || new PrivateKey({
|
opts.privateKey = opts.privateKey || new PrivateKey({
|
||||||
networkName: this.networkName
|
networkName: this.networkName
|
||||||
|
|
@ -121,7 +118,8 @@ WalletFactory.prototype.create = function(opts) {
|
||||||
});
|
});
|
||||||
opts.publicKeyRing.addCopayer(
|
opts.publicKeyRing.addCopayer(
|
||||||
opts.privateKey.deriveBIP45Branch().extendedPublicKeyString(),
|
opts.privateKey.deriveBIP45Branch().extendedPublicKeyString(),
|
||||||
opts.nickname);
|
opts.nickname
|
||||||
|
);
|
||||||
this.log('\t### PublicKeyRing Initialized');
|
this.log('\t### PublicKeyRing Initialized');
|
||||||
|
|
||||||
opts.txProposals = opts.txProposals || new TxProposalsSet({
|
opts.txProposals = opts.txProposals || new TxProposalsSet({
|
||||||
|
|
|
||||||
|
|
@ -214,10 +214,10 @@ describe('TxProposal', function() {
|
||||||
txp.builder.tx.getHashType.restore();
|
txp.builder.tx.getHashType.restore();
|
||||||
});
|
});
|
||||||
it('FAIL no signatures', function() {
|
it('FAIL no signatures', function() {
|
||||||
var backup = txp.builder.vanilla.scriptSig;
|
var backup = txp.builder.tx.ins[0].s;
|
||||||
txp.builder.vanilla.scriptSig = [];
|
txp.builder.tx.ins[0].s = undefined;
|
||||||
(function() { txp._check();} ).should.throw('no signatures');
|
(function() { txp._check();} ).should.throw('no signatures');
|
||||||
txp.builder.vanilla.scriptSig = backup;
|
txp.builder.tx.ins[0].s = backup;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('#merge', function() {
|
describe('#merge', function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue