Rename hashing functions in LibOrder and LibZeroExTransaction

This commit is contained in:
Amir Bandeali
2019-08-14 13:38:12 -07:00
parent 2da996f493
commit 1dae1d244c
17 changed files with 49 additions and 53 deletions

View File

@@ -45,7 +45,7 @@ blockchainTests('LibOrder', env => {
version: constants.EIP712_DOMAIN_VERSION,
}),
);
const orderHashHex = await libOrderContract.getOrderHash.callAsync(order, domainHash);
const orderHashHex = await libOrderContract.getTypedDataHash.callAsync(order, domainHash);
expect(orderHashUtils.getOrderHashHex(order)).to.be.equal(orderHashHex);
});
it('orderHash should differ if the domain hash is different', async () => {
@@ -64,8 +64,8 @@ blockchainTests('LibOrder', env => {
chainId: 1337,
}),
);
const orderHashHex1 = await libOrderContract.getOrderHash.callAsync(order, domainHash1);
const orderHashHex2 = await libOrderContract.getOrderHash.callAsync(order, domainHash2);
const orderHashHex1 = await libOrderContract.getTypedDataHash.callAsync(order, domainHash1);
const orderHashHex2 = await libOrderContract.getTypedDataHash.callAsync(order, domainHash2);
expect(orderHashHex1).to.be.not.equal(orderHashHex2);
});
});

View File

@@ -38,7 +38,7 @@ blockchainTests('LibZeroExTransaction', env => {
version: constants.EIP712_DOMAIN_VERSION,
}),
);
const orderHashHex = await libZeroExTransactionContract.getZeroExTransactionHash.callAsync(
const orderHashHex = await libZeroExTransactionContract.getTypedDataHash.callAsync(
zeroExTransaction,
domainHash,
);
@@ -60,11 +60,11 @@ blockchainTests('LibZeroExTransaction', env => {
chainId: 1337,
}),
);
const transactionHashHex1 = await libZeroExTransactionContract.getZeroExTransactionHash.callAsync(
const transactionHashHex1 = await libZeroExTransactionContract.getTypedDataHash.callAsync(
zeroExTransaction,
domainHash1,
);
const transactionHashHex2 = await libZeroExTransactionContract.getZeroExTransactionHash.callAsync(
const transactionHashHex2 = await libZeroExTransactionContract.getTypedDataHash.callAsync(
zeroExTransaction,
domainHash2,
);