From 52ac8c225181a3252553b3c47d61719542a5e319 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 21 Aug 2017 19:06:13 +0200 Subject: Reject checksummed addresses --- test/0x.js_test.ts | 2 +- test/schema_test.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'test') 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..d791ece24 100644 --- a/test/schema_test.ts +++ b/test/schema_test.ts @@ -42,11 +42,15 @@ 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 +163,7 @@ describe('Schema', () => { name: 'Zero Ex', symbol: 'ZRX', decimals: 100500, - address: '0x8b0292B11a196601eD2ce54B665CaFEca0347D42', + address: '0x8b0292b11a196601ed2ce54b665cafeca0347d42', url: 'https://0xproject.com', }; it('should validate valid token', () => { -- cgit v1.2.3