Commit e3569511d2b9077dbe811b4eb5ac6e9defaf7184
Rename all instances of ethUtils to ethUtil
Alex Beregszaszi committed on 8/23/2016, 12:19:29 AMParent: 90958f4d99b2d6238ce08db7e2d226b9f5bc5ea8
Files changed
address.js | changed |
u256.js | changed |
address.js | ||
---|---|---|
@@ -1,16 +1,16 @@ | ||
1 | -const ethUtils = require('ethereumjs-util') | |
1 | +const ethUtil = require('ethereumjs-util') | |
2 | 2 | |
3 | 3 | module.exports = class Address extends Buffer { |
4 | 4 | constructor (value) { |
5 | 5 | if (value instanceof Address || value instanceof Uint8Array) { |
6 | 6 | super(value) |
7 | 7 | } else if (typeof value !== 'string') { |
8 | 8 | throw new Error('Invalid input to address') |
9 | - } else if (!ethUtils.isHexPrefixed(value)) { | |
9 | + } else if (!ethUtil.isHexPrefixed(value)) { | |
10 | 10 | throw new Error('Invalid address format') |
11 | 11 | } else { |
12 | - super(ethUtils.stripHexPrefix(value), 'hex') | |
12 | + super(ethUtil.stripHexPrefix(value), 'hex') | |
13 | 13 | } |
14 | 14 | |
15 | 15 | if (this.length !== 20) { |
16 | 16 | throw new Error('Invalid address length') |
u256.js | ||
---|---|---|
@@ -1,13 +1,13 @@ | ||
1 | 1 | const BN = require('bn.js') |
2 | -const ethUtils = require('ethereumjs-util') | |
2 | +const ethUtil = require('ethereumjs-util') | |
3 | 3 | |
4 | 4 | module.exports = class U256 { |
5 | 5 | constructor (value) { |
6 | 6 | // This is the case when data is copied from WASM |
7 | 7 | if (value instanceof Uint8Array) { |
8 | 8 | this._value = new BN(value, 16, 'le') |
9 | - } else if ((typeof value === 'string') && ethUtils.isHexPrefixed(value)) { | |
9 | + } else if ((typeof value === 'string') && ethUtil.isHexPrefixed(value)) { | |
10 | 10 | this._value = new BN(value, 16) |
11 | 11 | } else { |
12 | 12 | this._value = new BN(value, 10) |
13 | 13 | } |
Built with git-ssb-web