aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-03-08 14:47:35 +0800
committerkumavis <aaron@kumavis.me>2017-03-08 14:47:35 +0800
commitc063fab9932c6b90414fd7db7849012d6594afb7 (patch)
tree9507b086979ffaef2df0aeb568d63416ad32d995 /test
parent68b99dfb086c282fa3f2e76fbaf93673e92f097d (diff)
downloadtangerine-wallet-browser-c063fab9932c6b90414fd7db7849012d6594afb7.tar
tangerine-wallet-browser-c063fab9932c6b90414fd7db7849012d6594afb7.tar.gz
tangerine-wallet-browser-c063fab9932c6b90414fd7db7849012d6594afb7.tar.bz2
tangerine-wallet-browser-c063fab9932c6b90414fd7db7849012d6594afb7.tar.lz
tangerine-wallet-browser-c063fab9932c6b90414fd7db7849012d6594afb7.tar.xz
tangerine-wallet-browser-c063fab9932c6b90414fd7db7849012d6594afb7.tar.zst
tangerine-wallet-browser-c063fab9932c6b90414fd7db7849012d6594afb7.zip
tx-utils - stricter naming type-based convention
Diffstat (limited to 'test')
-rw-r--r--test/unit/tx-utils-test.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/unit/tx-utils-test.js b/test/unit/tx-utils-test.js
index c0ed9addd..641b4942f 100644
--- a/test/unit/tx-utils-test.js
+++ b/test/unit/tx-utils-test.js
@@ -15,11 +15,11 @@ describe('txUtils', function() {
describe('addGasBuffer', function() {
it('multiplies by 1.5, when within block gas limit', function() {
// naive estimatedGas: 0x123fad (~1.2 mil)
- const input = '0x123fad'
+ const inputHex = '0x123fad'
// dummy gas limit: 0x3d4c52 (4 mil)
- const blockGasLimit = '0x3d4c52'
- const output = txUtils.addGasBuffer(input, blockGasLimit)
- const inputBn = new BN(ethUtil.stripHexPrefix(input), 'hex')
+ const blockGasLimitHex = '0x3d4c52'
+ const output = txUtils.addGasBuffer(inputHex, blockGasLimitHex)
+ const inputBn = new BN(ethUtil.stripHexPrefix(inputHex), 'hex')
const outputBn = new BN(ethUtil.stripHexPrefix(output), 'hex')
const expectedBn = inputBn.muln(1.5)
assert(outputBn.eq(expectedBn), 'returns 1.5 the input value')
@@ -27,25 +27,25 @@ describe('txUtils', function() {
it('uses original estimatedGas, when above block gas limit', function() {
// naive estimatedGas: 0x123fad (~1.2 mil)
- const input = '0x123fad'
+ const inputHex = '0x123fad'
// dummy gas limit: 0x0f4240 (1 mil)
- const blockGasLimit = '0x0f4240'
- const output = txUtils.addGasBuffer(input, blockGasLimit)
- const inputBn = new BN(ethUtil.stripHexPrefix(input), 'hex')
+ const blockGasLimitHex = '0x0f4240'
+ const output = txUtils.addGasBuffer(inputHex, blockGasLimitHex)
+ const inputBn = new BN(ethUtil.stripHexPrefix(inputHex), 'hex')
const outputBn = new BN(ethUtil.stripHexPrefix(output), 'hex')
- const expectedBn = new BN(ethUtil.stripHexPrefix(input), 'hex')
+ const expectedBn = new BN(ethUtil.stripHexPrefix(inputHex), 'hex')
assert(outputBn.eq(expectedBn), 'returns the original estimatedGas value')
})
it('buffers up to block gas limit', function() {
// naive estimatedGas: 0x123fad (~1.2 mil)
- const input = '0x1e8480'
+ const inputHex = '0x1e8480'
// dummy gas limit: 0x1e8480 (2 mil)
- const blockGasLimit = '0x1e8480'
- const output = txUtils.addGasBuffer(input, blockGasLimit)
- const inputBn = new BN(ethUtil.stripHexPrefix(input), 'hex')
+ const blockGasLimitHex = '0x1e8480'
+ const output = txUtils.addGasBuffer(inputHex, blockGasLimitHex)
+ const inputBn = new BN(ethUtil.stripHexPrefix(inputHex), 'hex')
const outputBn = new BN(ethUtil.stripHexPrefix(output), 'hex')
- const expectedBn = new BN(ethUtil.stripHexPrefix(blockGasLimit), 'hex')
+ const expectedBn = new BN(ethUtil.stripHexPrefix(blockGasLimitHex), 'hex')
assert(outputBn.eq(expectedBn), 'returns the block gas limit value')
})
})