aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-11-14 09:09:58 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-11-14 09:09:58 +0800
commitda9de70bbcecc16fa3a7f6991623f5027628f2b3 (patch)
tree5ec1cdef371604aa360eeae4ae7cde3190a8783d /packages/utils
parentf03afe6f1b6a6bfa339507ee47b42c62550444a0 (diff)
parente02dc13805349a770506350c69e9061f596b48b2 (diff)
downloaddexon-sol-tools-da9de70bbcecc16fa3a7f6991623f5027628f2b3.tar
dexon-sol-tools-da9de70bbcecc16fa3a7f6991623f5027628f2b3.tar.gz
dexon-sol-tools-da9de70bbcecc16fa3a7f6991623f5027628f2b3.tar.bz2
dexon-sol-tools-da9de70bbcecc16fa3a7f6991623f5027628f2b3.tar.lz
dexon-sol-tools-da9de70bbcecc16fa3a7f6991623f5027628f2b3.tar.xz
dexon-sol-tools-da9de70bbcecc16fa3a7f6991623f5027628f2b3.tar.zst
dexon-sol-tools-da9de70bbcecc16fa3a7f6991623f5027628f2b3.zip
Merge https://github.com/0xProject/0x-monorepo into feature/instant/metamask-connect-flow
Diffstat (limited to 'packages/utils')
-rw-r--r--packages/utils/test/sign_typed_data_utils_test.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/utils/test/sign_typed_data_utils_test.ts b/packages/utils/test/sign_typed_data_utils_test.ts
index dcba08b04..3d2cb2496 100644
--- a/packages/utils/test/sign_typed_data_utils_test.ts
+++ b/packages/utils/test/sign_typed_data_utils_test.ts
@@ -136,5 +136,28 @@ describe('signTypedDataUtils', () => {
const hashHex = `0x${hash}`;
expect(hashHex).to.be.eq(orderSignTypedDataHashHex);
});
+ it('creates a hash of an uninitialized order', () => {
+ const uninitializedOrder = {
+ ...orderSignTypedData,
+ message: {
+ makerAddress: '0x0000000000000000000000000000000000000000',
+ takerAddress: '0x0000000000000000000000000000000000000000',
+ makerAssetAmount: 0,
+ takerAssetAmount: 0,
+ expirationTimeSeconds: 0,
+ makerFee: 0,
+ takerFee: 0,
+ feeRecipientAddress: '0x0000000000000000000000000000000000000000',
+ senderAddress: '0x0000000000000000000000000000000000000000',
+ salt: 0,
+ makerAssetData: '0x0000000000000000000000000000000000000000',
+ takerAssetData: '0x0000000000000000000000000000000000000000',
+ exchangeAddress: '0x0000000000000000000000000000000000000000',
+ },
+ };
+ const hash = signTypedDataUtils.generateTypedDataHash(uninitializedOrder).toString('hex');
+ const hashHex = `0x${hash}`;
+ expect(hashHex).to.be.eq('0xfaa49b35faeb9197e9c3ba7a52075e6dad19739549f153b77dfcf59408a4b422');
+ });
});
});