Remove BuilderMockV0
This commit is contained in:
parent
a0c7d2cb66
commit
5f666aef66
3 changed files with 2 additions and 36 deletions
|
|
@ -1,26 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
|
|
||||||
var bitcore = require('bitcore');
|
|
||||||
var Transaction = bitcore.Transaction;
|
|
||||||
|
|
||||||
function BuilderMockV0 (data) {
|
|
||||||
this.vanilla = data;
|
|
||||||
this.tx = new Transaction();
|
|
||||||
this.tx.parse(new Buffer(data.tx, 'hex'));
|
|
||||||
};
|
|
||||||
|
|
||||||
BuilderMockV0.prototype.build = function() {
|
|
||||||
return this.tx;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
BuilderMockV0.prototype.getSelectedUnspent = function() {
|
|
||||||
return [];
|
|
||||||
};
|
|
||||||
|
|
||||||
BuilderMockV0.prototype.toObj = function() {
|
|
||||||
return this.vanilla;
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = BuilderMockV0;
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore');
|
||||||
var util = bitcore.util;
|
var util = bitcore.util;
|
||||||
var Transaction = bitcore.Transaction;
|
var Transaction = bitcore.Transaction;
|
||||||
var BuilderMockV0 = require('./BuilderMockV0');;
|
|
||||||
var TransactionBuilder = bitcore.TransactionBuilder;
|
var TransactionBuilder = bitcore.TransactionBuilder;
|
||||||
var Script = bitcore.Script;
|
var Script = bitcore.Script;
|
||||||
var Key = bitcore.Key;
|
var Key = bitcore.Key;
|
||||||
|
|
@ -136,12 +135,7 @@ TxProposal.fromObj = function(o, forceOpts) {
|
||||||
}
|
}
|
||||||
o.builder = TransactionBuilder.fromObj(o.builderObj);
|
o.builder = TransactionBuilder.fromObj(o.builderObj);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
throw new Error("Old version of wallet detected.");
|
||||||
// backwards (V0) compatatibility fix.
|
|
||||||
if (!o.version) {
|
|
||||||
o.builder = new BuilderMockV0(o.builderObj);
|
|
||||||
o.readonly = 1;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
return new TxProposal(o);
|
return new TxProposal(o);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var BuilderMockV0 = require('./BuilderMockV0');;
|
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore');
|
||||||
var util = bitcore.util;
|
var util = bitcore.util;
|
||||||
var Transaction = bitcore.Transaction;
|
var Transaction = bitcore.Transaction;
|
||||||
var BuilderMockV0 = require('./BuilderMockV0');;
|
var TxProposal = require('./TxProposal');
|
||||||
var TxProposal = require('./TxProposal');;
|
|
||||||
var Script = bitcore.Script;
|
var Script = bitcore.Script;
|
||||||
var Key = bitcore.Key;
|
var Key = bitcore.Key;
|
||||||
var buffertools = bitcore.buffertools;
|
var buffertools = bitcore.buffertools;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue