diff --git a/src/utils/processWhitelist.js b/src/utils/processWhitelist.js index cedc29736..6d220e2e0 100644 --- a/src/utils/processWhitelist.js +++ b/src/utils/processWhitelist.js @@ -1,6 +1,5 @@ -import { validateAddress } from './utils' +import Web3 from 'web3' -const isAddress = (address) => validateAddress(address) const isNumber = (number) => !isNaN(parseFloat(number)) /** @@ -18,7 +17,7 @@ export default function (rows, cb) { const [addr, min, max] = row - if (!isAddress(addr) || !isNumber(min) || !isNumber(max)) return + if (!Web3.utils.isAddress(addr) || !isNumber(min) || !isNumber(max)) return cb({ addr, min, max }) diff --git a/src/utils/processWhitelist.spec.js b/src/utils/processWhitelist.spec.js index f7d05f919..b03d9fa42 100644 --- a/src/utils/processWhitelist.spec.js +++ b/src/utils/processWhitelist.spec.js @@ -75,8 +75,10 @@ describe('processWhitelist function', () => { it('should ignore invalid addresses', () => { // Given const rows = [ - ['0x123456789012345678901234567890123456789', '1', '10'], - ['0x12345678901234567890123456789012345678901', '1', '10'] + ['0x123456789012345678901234567890123456789', '1', '10'], // 41 characters + ['0x12345678901234567890123456789012345678901', '1', '10'], // 43 characters + ['0x90F8bf6A479f320ead074411a4B0e7944Ea8c9CG', '1', '10'], // invalid character + ['0x90F8bf6A479f320ead074411a4B0e7944Ea8c9c1', '1', '10'] // invalid checksum ] const cb = jest.fn() diff --git a/submodules/token-wizard-test-automation b/submodules/token-wizard-test-automation index 483a59572..03c628515 160000 --- a/submodules/token-wizard-test-automation +++ b/submodules/token-wizard-test-automation @@ -1 +1 @@ -Subproject commit 483a595722c15b24eba6e5fb050a0e37d20eb304 +Subproject commit 03c6285158aa1fca89c19f7ce9163c39d00fe5ce