Add validation and tests for spendUnconfirmed = false

This commit is contained in:
Yemel Jardi 2014-06-19 10:30:53 -03:00
commit 26c829f6de
4 changed files with 47 additions and 7 deletions

View file

@ -30,6 +30,20 @@ FakeBlockchain.prototype.getUnspent = function(addresses, cb) {
}]);
};
FakeBlockchain.prototype.getUnspent2 = function(addresses, cb) {
if (!addresses || !addresses.length) return cb(null, []);
return cb(null, this.u || [{
'address': 'mji7zocy8QzYywQakwWf99w9bCT6orY1C1',
'txid': '0be0fb4579911be829e3077202e1ab47fcc12cf3ab8f8487ccceae768e1f95fa',
'vout': 0,
'ts': 1402323949,
'scriptPubKey': '21032ca453c1d9a93b7de8cf3d44d7bb8d52a45dbdf8fff63f69de4e51b740bb1da3ac',
'amount': 25.0001,
'confirmations': 1,
'confirmationsFromCache': false
}]);
};
FakeBlockchain.prototype.sendRawTransaction = function(rawtx, cb) {
var txid = '0be0fb4579911be829e3077202e1ab47fcc12cf3ab8f8487ccceae768e1f95fa';
return cb(txid);