mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 11:45:49 +00:00
Merge pull request #200 from boxbag/fix-max-fee
[FIX] fix test and do not set tx_json.Fee in maxFee method
This commit is contained in:
@@ -502,7 +502,6 @@ Transaction.prototype.lastLedger = function(sequence) {
|
|||||||
Transaction.prototype.maxFee = function(fee) {
|
Transaction.prototype.maxFee = function(fee) {
|
||||||
if (typeof fee === 'number' && fee >= 0) {
|
if (typeof fee === 'number' && fee >= 0) {
|
||||||
this._setMaxFee = true;
|
this._setMaxFee = true;
|
||||||
this.tx_json.Fee = String(fee);
|
|
||||||
this._maxFee = fee;
|
this._maxFee = fee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -839,15 +839,12 @@ describe('Transaction', function() {
|
|||||||
var transaction = new Transaction();
|
var transaction = new Transaction();
|
||||||
|
|
||||||
transaction.maxFee('a');
|
transaction.maxFee('a');
|
||||||
assert.strictEqual(transaction.tx_json.Fee, void(0));
|
assert(!transaction._setMaxFee);
|
||||||
assert(!transaction._setLastLedger);
|
|
||||||
|
|
||||||
transaction.maxFee(NaN);
|
transaction.maxFee(NaN);
|
||||||
assert.strictEqual(transaction.tx_json.Fee, void(0));
|
assert(!transaction._setMaxFee);
|
||||||
assert(!transaction._setLastLedger);
|
|
||||||
|
|
||||||
transaction.maxFee(1000);
|
transaction.maxFee(1000);
|
||||||
assert.strictEqual(transaction.tx_json.Fee, '1000');
|
|
||||||
assert.strictEqual(transaction._maxFee, 1000);
|
assert.strictEqual(transaction._maxFee, 1000);
|
||||||
assert.strictEqual(transaction._setMaxFee, true);
|
assert.strictEqual(transaction._setMaxFee, true);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user