Skip to content

Commit eda616d

Browse files
committed
update tests
1 parent 0099078 commit eda616d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test/accountParser.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
const assert = require('assert');
33
const sinon = require('sinon');
44
const AccountParser = require('../lib/contracts/accountParser');
5+
const utils = require('../lib/utils/utils');
56
let TestLogger = require('../lib/tests/test_logger.js');
67
const Web3 = require('web3');
78
const i18n = require('../lib/i18n/i18n.js');
@@ -75,38 +76,38 @@ describe('embark.AccountParser', function () {
7576

7677
describe('getHexBalance', () => {
7778
it('should return default if no balance', () => {
78-
const hexBalance = AccountParser.getHexBalance(null, Web3);
79+
const hexBalance = utils.getHexBalanceFromString(null, Web3);
7980

8081
assert.strictEqual(hexBalance, 0xFFFFFFFFFFFFFFFFFF);
8182
});
8283

8384
it('should return the balance string if already hexadecimal', () => {
84-
const hexBalance = AccountParser.getHexBalance('0xFFF', Web3);
85+
const hexBalance = utils.getHexBalanceFromString('0xFFF', Web3);
8586

8687
assert.strictEqual(hexBalance, '0xFFF');
8788
});
8889

8990
it('should convert to hex when decimal', () => {
90-
const hexBalance = AccountParser.getHexBalance('500', Web3);
91+
const hexBalance = utils.getHexBalanceFromString('500', Web3);
9192

9293
assert.strictEqual(hexBalance, '0x1f4');
9394
});
9495

9596
it('should convert to hex with eth string', () => {
96-
const hexBalance = AccountParser.getHexBalance('4ether', Web3);
97+
const hexBalance = utils.getHexBalanceFromString('4ether', Web3);
9798

9899
assert.strictEqual(hexBalance, '0x3782dace9d900000');
99100
});
100101

101102
it('should convert to hex with eth string with space', () => {
102-
const hexBalance = AccountParser.getHexBalance('673 shannon', Web3);
103+
const hexBalance = utils.getHexBalanceFromString('673 shannon', Web3);
103104

104105
assert.strictEqual(hexBalance, '0x9cb1ed0a00');
105106
});
106107

107108
it('should fail when string is not good', () => {
108109
try {
109-
AccountParser.getHexBalance('nogood', Web3);
110+
utils.getHexBalanceFromString('nogood', Web3);
110111
assert.fail('Should have failed at getHexBalance');
111112
} catch (e) {
112113
// Ok

0 commit comments

Comments
 (0)