diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-09-08 03:52:25 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-09-08 03:52:25 +0800 |
commit | 532a4040de191d455053aa11432dcb9b407c9bf4 (patch) | |
tree | adea962fc02315b50563cff276d5d9133bacf044 /test | |
parent | c616581001a7413a289b108b347005d53fb14732 (diff) | |
download | tangerine-wallet-browser-532a4040de191d455053aa11432dcb9b407c9bf4.tar tangerine-wallet-browser-532a4040de191d455053aa11432dcb9b407c9bf4.tar.gz tangerine-wallet-browser-532a4040de191d455053aa11432dcb9b407c9bf4.tar.bz2 tangerine-wallet-browser-532a4040de191d455053aa11432dcb9b407c9bf4.tar.lz tangerine-wallet-browser-532a4040de191d455053aa11432dcb9b407c9bf4.tar.xz tangerine-wallet-browser-532a4040de191d455053aa11432dcb9b407c9bf4.tar.zst tangerine-wallet-browser-532a4040de191d455053aa11432dcb9b407c9bf4.zip |
Add test for computing gas price
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/pending-balance-test.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/pending-balance-test.js b/test/unit/pending-balance-test.js index e1d5f9303..3029a849c 100644 --- a/test/unit/pending-balance-test.js +++ b/test/unit/pending-balance-test.js @@ -27,6 +27,22 @@ describe('PendingBalanceCalculator', function () { const result = balanceCalculator.valueFor(pendingTxs[0]) assert.equal(result.toString(), etherBn.toString(), 'computes one ether') }) + + it('calculates gas costs as well', function () { + const txGen = new MockTxGen() + pendingTxs = txGen.generate({ + status: 'submitted', + txParams: { + value: '0x0', + gasPrice: '0x2', + gas: '0x3', + } + }, { count: 1 }) + + const balanceCalculator = generateBalanceCalcWith([], zeroBn) + const result = balanceCalculator.valueFor(pendingTxs[0]) + assert.equal(result.toString(), '6', 'computes one ether') + }) }) describe('if you have no pending txs and one ether', function () { |