persist feeLevel as part of txp
This commit is contained in:
parent
c5e4c4b9a4
commit
04b8d2afa2
|
@ -46,6 +46,7 @@ TxProposal.create = function(opts) {
|
|||
x.requiredRejections = Math.min(x.walletM, x.walletN - x.walletM + 1),
|
||||
x.status = 'temporary';
|
||||
x.actions = [];
|
||||
x.feeLevel = opts.feeLevel;
|
||||
x.feePerKb = opts.feePerKb;
|
||||
x.excludeUnconfirmedUtxos = opts.excludeUnconfirmedUtxos;
|
||||
|
||||
|
@ -98,6 +99,7 @@ TxProposal.fromObj = function(obj) {
|
|||
});
|
||||
x.outputOrder = obj.outputOrder;
|
||||
x.fee = obj.fee;
|
||||
x.feeLevel = obj.feeLevel;
|
||||
x.feePerKb = obj.feePerKb;
|
||||
x.excludeUnconfirmedUtxos = obj.excludeUnconfirmedUtxos;
|
||||
x.addressType = obj.addressType;
|
||||
|
|
|
@ -1860,6 +1860,7 @@ WalletService.prototype.createTx = function(opts, cb) {
|
|||
outputs: opts.outputs,
|
||||
message: opts.message,
|
||||
changeAddress: changeAddress,
|
||||
feeLevel: opts.feeLevel,
|
||||
feePerKb: feePerKb,
|
||||
payProUrl: opts.payProUrl,
|
||||
walletM: wallet.m,
|
||||
|
|
|
@ -2286,6 +2286,7 @@ describe('Wallet service', function() {
|
|||
tx.isTemporary().should.equal.true;
|
||||
tx.amount.should.equal(helpers.toSatoshi(0.8));
|
||||
tx.feePerKb.should.equal(123e2);
|
||||
should.not.exist(tx.feeLevel);
|
||||
server.getPendingTxs({}, function(err, txs) {
|
||||
should.not.exist(err);
|
||||
txs.should.be.empty;
|
||||
|
@ -2766,6 +2767,7 @@ describe('Wallet service', function() {
|
|||
should.not.exist(err);
|
||||
should.exist(txp);
|
||||
txp.feePerKb.should.equal(180e2);
|
||||
txp.feeLevel.should.equal('economy');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
@ -2805,6 +2807,7 @@ describe('Wallet service', function() {
|
|||
should.not.exist(err);
|
||||
should.exist(txp);
|
||||
txp.feePerKb.should.equal(200e2);
|
||||
txp.feeLevel.should.equal('normal');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue