aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-05-17 04:22:03 +0800
committerDan Finlay <dan@danfinlay.com>2017-05-17 04:22:03 +0800
commita15e753c800617879384634a7096497550588eaf (patch)
treec91fd4dd1e497b8a1c28cf9c4d14770e1cfe5f27 /test/unit
parenta00941c8894258a7534f8373405a0f8f4d27a904 (diff)
downloadtangerine-wallet-browser-a15e753c800617879384634a7096497550588eaf.tar
tangerine-wallet-browser-a15e753c800617879384634a7096497550588eaf.tar.gz
tangerine-wallet-browser-a15e753c800617879384634a7096497550588eaf.tar.bz2
tangerine-wallet-browser-a15e753c800617879384634a7096497550588eaf.tar.lz
tangerine-wallet-browser-a15e753c800617879384634a7096497550588eaf.tar.xz
tangerine-wallet-browser-a15e753c800617879384634a7096497550588eaf.tar.zst
tangerine-wallet-browser-a15e753c800617879384634a7096497550588eaf.zip
Add gas updating test to tx controller tests
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/tx-controller-test.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/test/unit/tx-controller-test.js b/test/unit/tx-controller-test.js
index d0b32ff41..51e0b9a17 100644
--- a/test/unit/tx-controller-test.js
+++ b/test/unit/tx-controller-test.js
@@ -9,7 +9,7 @@ const currentNetworkId = 42
const otherNetworkId = 36
const privKey = new Buffer('8718b9618a37d1fc78c436511fc6df3c8258d3250635bba617f33003270ec03e', 'hex')
-describe('Transaction Manager', function () {
+describe('Transaction Controller', function () {
let txController
beforeEach(function () {
@@ -170,6 +170,25 @@ describe('Transaction Manager', function () {
var result = txController.getTx('1')
assert.equal(result.hash, 'foo')
})
+
+ it('updates gas price', function () {
+ const originalGasPrice = '0x01'
+ const desiredGasPriced = '0x02'
+
+ const txMeta = {
+ id: '1',
+ status: 'unapproved',
+ metamaskNetworkId: currentNetworkId,
+ txParams: {
+ gasPrice: originalGasPrice,
+ },
+ }
+
+ txController.addTx(txMeta)
+ txMeta.txParams.gasPrice = desiredGasPriced
+ var result = txController.getTx('1')
+ assert.equal(result.txParams.gasPrice, desiredGasPriced, 'gas price updated')
+ })
})
describe('#getUnapprovedTxList', function () {
@@ -234,4 +253,5 @@ describe('Transaction Manager', function () {
})
})
})
+
})