From 3d66feb89f8e4cfcb0b5251a96d02ef31f3ae34b Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Mon, 26 Feb 2018 13:41:03 -0800 Subject: Lowercase web3 wrapper addresses Ensure all of the user account addresses are lower case when returned from web3wrapper --- packages/web3-wrapper/src/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'packages/web3-wrapper/src') 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 { const addresses = await this.getAvailableAddressesAsync(); - return _.includes(addresses, senderAddress); + const normalizedAddress = senderAddress.toLowerCase(); + return _.includes(addresses, normalizedAddress); } public async getNodeVersionAsync(): Promise { const nodeVersion = await promisify(this._web3.version.getNode)(); @@ -96,7 +97,8 @@ export class Web3Wrapper { } public async getAvailableAddressesAsync(): Promise { const addresses = await promisify(this._web3.eth.getAccounts)(); - return addresses; + const normalizedAddresses = _.map(addresses, address => address.toLowerCase()); + return normalizedAddresses; } public async getLogsAsync(filter: Web3.FilterObject): Promise { let fromBlock = filter.fromBlock; -- cgit v1.2.3