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:
Geert Weening
2014-11-05 16:07:01 -08:00
2 changed files with 2 additions and 6 deletions

View File

@@ -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;
} }

View File

@@ -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);
}); });