diff options
author | Fabio Berger <me@fabioberger.com> | 2018-02-28 01:58:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-28 01:58:09 +0800 |
commit | fce10548d2d992317e36af48638a5ee799e94e7c (patch) | |
tree | 51b9a6a2f0dbaee50a9758a7983fe201d5898354 /packages/web3-wrapper/src | |
parent | 709fa9e02ec21cee9fc145b4a578742c8dd190aa (diff) | |
parent | 6961169f89c4cd8480aca9c720cd8299aec9bbc0 (diff) | |
download | dexon-sol-tools-fce10548d2d992317e36af48638a5ee799e94e7c.tar dexon-sol-tools-fce10548d2d992317e36af48638a5ee799e94e7c.tar.gz dexon-sol-tools-fce10548d2d992317e36af48638a5ee799e94e7c.tar.bz2 dexon-sol-tools-fce10548d2d992317e36af48638a5ee799e94e7c.tar.lz dexon-sol-tools-fce10548d2d992317e36af48638a5ee799e94e7c.tar.xz dexon-sol-tools-fce10548d2d992317e36af48638a5ee799e94e7c.tar.zst dexon-sol-tools-fce10548d2d992317e36af48638a5ee799e94e7c.zip |
Merge pull request #373 from 0xProject/feature/0x.js/lowercase-addresses
Lowercase addresses in the Public API
Diffstat (limited to 'packages/web3-wrapper/src')
-rw-r--r-- | packages/web3-wrapper/src/index.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/web3-wrapper/src/index.ts b/packages/web3-wrapper/src/index.ts index a2878fc2a..7f3452c98 100644 --- a/packages/web3-wrapper/src/index.ts +++ b/packages/web3-wrapper/src/index.ts @@ -41,7 +41,8 @@ export class Web3Wrapper { } public async isSenderAddressAvailableAsync(senderAddress: string): Promise<boolean> { const addresses = await this.getAvailableAddressesAsync(); - return _.includes(addresses, senderAddress); + const normalizedAddress = senderAddress.toLowerCase(); + return _.includes(addresses, normalizedAddress); } public async getNodeVersionAsync(): Promise<string> { const nodeVersion = await promisify<string>(this._web3.version.getNode)(); @@ -96,7 +97,8 @@ export class Web3Wrapper { } public async getAvailableAddressesAsync(): Promise<string[]> { const addresses = await promisify<string[]>(this._web3.eth.getAccounts)(); - return addresses; + const normalizedAddresses = _.map(addresses, address => address.toLowerCase()); + return normalizedAddresses; } public async getLogsAsync(filter: Web3.FilterObject): Promise<Web3.LogEntry[]> { let fromBlock = filter.fromBlock; |