aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-09-08 03:43:10 +0800
committerDan Finlay <dan@danfinlay.com>2017-09-08 03:43:10 +0800
commit7b92268428cc2de4374bc669c524bb61959801f1 (patch)
tree853c05b0ad08515b6aa03ac00fee86bfbda41505 /test/unit
parent40585744365c128d1f64c5bf93ee8cedc9e91dae (diff)
downloadtangerine-wallet-browser-7b92268428cc2de4374bc669c524bb61959801f1.tar
tangerine-wallet-browser-7b92268428cc2de4374bc669c524bb61959801f1.tar.gz
tangerine-wallet-browser-7b92268428cc2de4374bc669c524bb61959801f1.tar.bz2
tangerine-wallet-browser-7b92268428cc2de4374bc669c524bb61959801f1.tar.lz
tangerine-wallet-browser-7b92268428cc2de4374bc669c524bb61959801f1.tar.xz
tangerine-wallet-browser-7b92268428cc2de4374bc669c524bb61959801f1.tar.zst
tangerine-wallet-browser-7b92268428cc2de4374bc669c524bb61959801f1.zip
Fix valueFor test
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/pending-balance-test.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/unit/pending-balance-test.js b/test/unit/pending-balance-test.js
index 7f20270cb..0937579e2 100644
--- a/test/unit/pending-balance-test.js
+++ b/test/unit/pending-balance-test.js
@@ -4,6 +4,7 @@ const MockTxGen = require('../lib/mock-tx-gen')
const BN = require('ethereumjs-util').BN
let providerResultStub = {}
+const zeroBn = new BN(0)
const etherBn = new BN(String(1e18))
const ether = '0x' + etherBn.toString(16)
@@ -22,7 +23,7 @@ describe('PendingBalanceCalculator', function () {
}
}, { count: 1 })
- const balanceCalculator = generateBalaneCalcWith([], '0x0')
+ const balanceCalculator = generateBalanceCalcWith([], zeroBn)
const result = balanceCalculator.valueFor(pendingTxs[0])
assert.equal(result.toString(), etherBn.toString(), 'computes one ether')
})
@@ -31,7 +32,7 @@ describe('PendingBalanceCalculator', function () {
describe('if you have no pending txs and one ether', function () {
beforeEach(function () {
- balanceCalculator = generateBalaneCalcWith([], ether)
+ balanceCalculator = generateBalanceCalcWith([], zeroBn)
})
it('returns the network balance', async function () {
@@ -52,7 +53,7 @@ describe('PendingBalanceCalculator', function () {
}
}, { count: 1 })
- balanceCalculator = generateBalaneCalcWith(pendingTxs, ether)
+ balanceCalculator = generateBalanceCalcWith(pendingTxs, etherBn)
})
it('returns the network balance', async function () {
@@ -69,7 +70,7 @@ describe('PendingBalanceCalculator', function () {
})
})
-function generateBalaneCalcWith (transactions, providerStub = '0x0') {
+function generateBalanceCalcWith (transactions, providerStub = zeroBn) {
const getPendingTransactions = () => Promise.resolve(transactions)
const getBalance = () => Promise.resolve(providerStub)
providerResultStub.result = providerStub