diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-05-22 06:59:58 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-05-31 08:11:30 +0800 |
commit | 822e319efea9c862702ddf589eb2344ff02e5bc5 (patch) | |
tree | ae5421da5b6ac84c318ed1aa66445222be45a579 /packages/contracts/test/exchange/core.ts | |
parent | 6d462fc961da2ba4d5502ad6b71654c1715550d9 (diff) | |
download | dexon-0x-contracts-822e319efea9c862702ddf589eb2344ff02e5bc5.tar.gz dexon-0x-contracts-822e319efea9c862702ddf589eb2344ff02e5bc5.tar.zst dexon-0x-contracts-822e319efea9c862702ddf589eb2344ff02e5bc5.zip |
Use last byte of signature as signature type
Diffstat (limited to 'packages/contracts/test/exchange/core.ts')
-rw-r--r-- | packages/contracts/test/exchange/core.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index be8d14cb0..bc476a5ee 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -460,10 +460,11 @@ describe('Exchange core', () => { makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), }); + const v = ethUtil.toBuffer(signedOrder.signature.slice(0, 4)); const invalidR = ethUtil.sha3('invalidR'); const invalidS = ethUtil.sha3('invalidS'); - const signatureTypeAndV = signedOrder.signature.slice(0, 6); - const invalidSigBuff = Buffer.concat([ethUtil.toBuffer(signatureTypeAndV), invalidR, invalidS]); + const signatureType = ethUtil.toBuffer(`0x${signedOrder.signature.slice(-2)}`); + const invalidSigBuff = Buffer.concat([v, invalidR, invalidS, signatureType]); const invalidSigHex = `0x${invalidSigBuff.toString('hex')}`; signedOrder.signature = invalidSigHex; return expect(exchangeWrapper.fillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith( |