Update transaction hashing and tests
This commit is contained in:
@@ -134,6 +134,7 @@ export const constants = {
|
||||
parameters: [
|
||||
{ name: 'salt', type: 'uint256' },
|
||||
{ name: 'expirationTimeSeconds', type: 'uint256' },
|
||||
{ name: 'gasPrice', type: 'uint256' },
|
||||
{ name: 'signerAddress', type: 'address' },
|
||||
{ name: 'data', type: 'bytes' },
|
||||
],
|
||||
|
@@ -59,6 +59,7 @@ describe('EIP712 Utils', () => {
|
||||
const typedData = eip712Utils.createZeroExTransactionTypedData({
|
||||
salt: new BigNumber(0),
|
||||
expirationTimeSeconds: new BigNumber(0),
|
||||
gasPrice: new BigNumber(0),
|
||||
data: constants.NULL_BYTES,
|
||||
signerAddress: constants.NULL_ADDRESS,
|
||||
domain: {
|
||||
|
@@ -55,6 +55,7 @@ describe('Signature utils', () => {
|
||||
signerAddress: makerAddress,
|
||||
data: '0x6927e990021d23b1eb7b8789f6a6feaf98fe104bb0cf8259421b79f9a34222b0',
|
||||
expirationTimeSeconds: new BigNumber(0),
|
||||
gasPrice: new BigNumber(0),
|
||||
};
|
||||
});
|
||||
describe('#isValidSignatureAsync', () => {
|
||||
|
@@ -14,13 +14,14 @@ const expect = chai.expect;
|
||||
|
||||
describe('0x transaction hashing', () => {
|
||||
describe('#getTransactionHashHex', () => {
|
||||
const expectedTransactionHash = '0x9779e4ca195f8c9c6f137f495599e9a1944806310b64748479bfa6c6b1ae7eb4';
|
||||
const expectedTransactionHash = '0x420b19f08d5b09c012f381f4bf80a97740b8629f2bac7f42dd7f6aefbb24f3c0';
|
||||
const fakeVerifyingContractAddress = '0x5e72914535f202659083db3a02c984188fa26e9f';
|
||||
const fakeChainId = 1337;
|
||||
const transaction: ZeroExTransaction = {
|
||||
signerAddress: constants.NULL_ADDRESS,
|
||||
salt: new BigNumber(0),
|
||||
expirationTimeSeconds: new BigNumber(0),
|
||||
gasPrice: new BigNumber(0),
|
||||
data: constants.NULL_BYTES,
|
||||
domain: {
|
||||
verifyingContractAddress: fakeVerifyingContractAddress,
|
||||
@@ -40,6 +41,7 @@ describe('0x transaction hashing', () => {
|
||||
...transaction,
|
||||
salt: '0',
|
||||
expirationTimeSeconds: '0',
|
||||
gasPrice: '0',
|
||||
} as any);
|
||||
expect(transactionHash).to.be.equal(expectedTransactionHash);
|
||||
});
|
||||
|
Reference in New Issue
Block a user