diff options
author | Frankie <frankie.diamond@gmail.com> | 2018-11-27 03:29:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-27 03:29:14 +0800 |
commit | 8198ec9ae1020d7dc43bd17180351e37b48847e0 (patch) | |
tree | e0972c87b3a657d79b6ce0f3810115aa48a0aa7d /test/unit | |
parent | 97c1e6bcc145e60d6721ecba50d762791f94dc13 (diff) | |
download | tangerine-wallet-browser-8198ec9ae1020d7dc43bd17180351e37b48847e0.tar tangerine-wallet-browser-8198ec9ae1020d7dc43bd17180351e37b48847e0.tar.gz tangerine-wallet-browser-8198ec9ae1020d7dc43bd17180351e37b48847e0.tar.bz2 tangerine-wallet-browser-8198ec9ae1020d7dc43bd17180351e37b48847e0.tar.lz tangerine-wallet-browser-8198ec9ae1020d7dc43bd17180351e37b48847e0.tar.xz tangerine-wallet-browser-8198ec9ae1020d7dc43bd17180351e37b48847e0.tar.zst tangerine-wallet-browser-8198ec9ae1020d7dc43bd17180351e37b48847e0.zip |
Autofill gasPrice for retry attempts with either the recommended gasprice or a %10 bump (#5786)
* transactions - autofill gasPrice for retry attempts with either the recomened gasprice or a %10 bump
* lint
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/app/controllers/transactions/tx-controller-test.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/unit/app/controllers/transactions/tx-controller-test.js b/test/unit/app/controllers/transactions/tx-controller-test.js index b76f256b9..2fe4c47d1 100644 --- a/test/unit/app/controllers/transactions/tx-controller-test.js +++ b/test/unit/app/controllers/transactions/tx-controller-test.js @@ -28,6 +28,7 @@ describe('Transaction Controller', function () { blockTrackerStub.getLatestBlock = noop txController = new TransactionController({ provider, + getGasPrice: function () { return '0xee6b2800' }, networkStore: new ObservableStore(currentNetworkId), txHistoryLimit: 10, blockTracker: blockTrackerStub, @@ -415,8 +416,9 @@ describe('Transaction Controller', function () { }) describe('#retryTransaction', function () { - it('should create a new txMeta with the same txParams as the original one', function (done) { + it('should create a new txMeta with the same txParams as the original one but with a higher gasPrice', function (done) { const txParams = { + gasPrice: '0xee6b2800', nonce: '0x00', from: '0xB09d8505E1F4EF1CeA089D47094f5DD3464083d4', to: '0xB09d8505E1F4EF1CeA089D47094f5DD3464083d4', @@ -427,6 +429,7 @@ describe('Transaction Controller', function () { ]) txController.retryTransaction(1) .then((txMeta) => { + assert.equal(txMeta.txParams.gasPrice, '0x10642ac00', 'gasPrice should have a %10 gasPrice bump') assert.equal(txMeta.txParams.nonce, txParams.nonce, 'nonce should be the same') assert.equal(txMeta.txParams.from, txParams.from, 'from should be the same') assert.equal(txMeta.txParams.to, txParams.to, 'to should be the same') |