diff options
author | Leonid <logvinov.leon@gmail.com> | 2017-08-22 19:27:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-22 19:27:40 +0800 |
commit | 0bc9083bff341cc7841fb1ccd84fa50e6749151d (patch) | |
tree | c188a96044d78d9446213fe565152d13a33a0858 /test | |
parent | e376189bc69682b2445f344966332c63d8e9fa4d (diff) | |
parent | 4207400f8a9ebd8e7cbf0b7f9edf72e6f01db7db (diff) | |
download | dexon-sol-tools-0bc9083bff341cc7841fb1ccd84fa50e6749151d.tar dexon-sol-tools-0bc9083bff341cc7841fb1ccd84fa50e6749151d.tar.gz dexon-sol-tools-0bc9083bff341cc7841fb1ccd84fa50e6749151d.tar.bz2 dexon-sol-tools-0bc9083bff341cc7841fb1ccd84fa50e6749151d.tar.lz dexon-sol-tools-0bc9083bff341cc7841fb1ccd84fa50e6749151d.tar.xz dexon-sol-tools-0bc9083bff341cc7841fb1ccd84fa50e6749151d.tar.zst dexon-sol-tools-0bc9083bff341cc7841fb1ccd84fa50e6749151d.zip |
Merge pull request #124 from 0xProject/reject-checksummed-addresses
Reject checksummed addresses
Diffstat (limited to 'test')
-rw-r--r-- | test/0x.js_test.ts | 2 | ||||
-rw-r--r-- | test/schema_test.ts | 12 | ||||
-rw-r--r-- | test/token_wrapper_test.ts | 2 |
3 files changed, 11 insertions, 5 deletions
diff --git a/test/0x.js_test.ts b/test/0x.js_test.ts index 03bf21e96..2b4e80ea3 100644 --- a/test/0x.js_test.ts +++ b/test/0x.js_test.ts @@ -57,7 +57,7 @@ describe('ZeroEx library', () => { ).to.become(false); }); it('should return false if the address doesn\'t pertain to the signature & data', async () => { - const validUnrelatedAddress = '0x8b0292B11a196601eD2ce54B665CaFEca0347D42'; + const validUnrelatedAddress = '0x8b0292b11a196601ed2ce54b665cafeca0347d42'; expect(ZeroEx.isValidSignature(dataHex, signature, validUnrelatedAddress)).to.be.false(); return expect( (zeroEx.exchange as any)._isValidSignatureUsingContractCallAsync(dataHex, signature, diff --git a/test/schema_test.ts b/test/schema_test.ts index 1fac2b380..e47f8b8e5 100644 --- a/test/schema_test.ts +++ b/test/schema_test.ts @@ -42,11 +42,17 @@ describe('Schema', () => { }); describe('#addressSchema', () => { it('should validate valid addresses', () => { - const testCases = ['0x8b0292B11a196601eD2ce54B665CaFEca0347D42', constants.NULL_ADDRESS]; + const testCases = ['0x8b0292b11a196601ed2ce54b665cafeca0347d42', constants.NULL_ADDRESS]; validateAgainstSchema(testCases, addressSchema); }); it('should fail for invalid addresses', () => { - const testCases = ['0x', '0', '0x00', '0xzzzzzzB11a196601eD2ce54B665CaFEca0347D42']; + const testCases = [ + '0x', + '0', + '0x00', + '0xzzzzzzB11a196601eD2ce54B665CaFEca0347D42', + '0x8b0292B11a196601eD2ce54B665CaFEca0347D42', + ]; const shouldFail = true; validateAgainstSchema(testCases, addressSchema, shouldFail); }); @@ -159,7 +165,7 @@ describe('Schema', () => { name: 'Zero Ex', symbol: 'ZRX', decimals: 100500, - address: '0x8b0292B11a196601eD2ce54B665CaFEca0347D42', + address: '0x8b0292b11a196601ed2ce54b665cafeca0347d42', url: 'https://0xproject.com', }; it('should validate valid token', () => { diff --git a/test/token_wrapper_test.ts b/test/token_wrapper_test.ts index 45d5caa5b..8c680b754 100644 --- a/test/token_wrapper_test.ts +++ b/test/token_wrapper_test.ts @@ -165,7 +165,7 @@ describe('TokenWrapper', () => { }); it('should return a balance of 0 for a non-existent owner address', async () => { const token = tokens[0]; - const nonExistentOwner = '0x198C6Ad858F213Fb31b6FE809E25040E6B964593'; + const nonExistentOwner = '0x198c6ad858f213fb31b6fe809e25040e6b964593'; const balance = await zeroEx.token.getBalanceAsync(token.address, nonExistentOwner); const expectedBalance = new BigNumber(0); return expect(balance).to.be.bignumber.equal(expectedBalance); |