[FIX] fix test and do not set tx_json.Fee in maxFee method

This commit is contained in:
Bo Chen
2014-11-05 15:59:57 -08:00
parent 76cfb69d9f
commit 237c46d5a0
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) {
if (typeof fee === 'number' && fee >= 0) {
this._setMaxFee = true;
this.tx_json.Fee = String(fee);
this._maxFee = fee;
}

View File

@@ -839,15 +839,12 @@ describe('Transaction', function() {
var transaction = new Transaction();
transaction.maxFee('a');
assert.strictEqual(transaction.tx_json.Fee, void(0));
assert(!transaction._setLastLedger);
assert(!transaction._setMaxFee);
transaction.maxFee(NaN);
assert.strictEqual(transaction.tx_json.Fee, void(0));
assert(!transaction._setLastLedger);
assert(!transaction._setMaxFee);
transaction.maxFee(1000);
assert.strictEqual(transaction.tx_json.Fee, '1000');
assert.strictEqual(transaction._maxFee, 1000);
assert.strictEqual(transaction._setMaxFee, true);
});