In @0x/contracts-test-utils
add generatePseudoRandomOrderHash()
to orderUtils
.
This commit is contained in:
committed by
Amir Bandeali
parent
3a6664282c
commit
79cf9156eb
@@ -1,3 +1,5 @@
|
||||
import { generatePseudoRandomSalt } from '@0x/order-utils';
|
||||
import { crypto } from '@0x/order-utils/lib/src/crypto';
|
||||
import { OrderWithoutDomain, SignedOrder } from '@0x/types';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import * as _ from 'lodash';
|
||||
@@ -42,4 +44,10 @@ export const orderUtils = {
|
||||
fill.right.takerAssetData = constants.NULL_BYTES;
|
||||
return fill;
|
||||
},
|
||||
generatePseudoRandomOrderHash(): string {
|
||||
const randomBigNum = generatePseudoRandomSalt();
|
||||
const randomBuff = crypto.solSHA3([randomBigNum]);
|
||||
const randomHash = `0x${randomBuff.toString('hex')}`;
|
||||
return randomHash;
|
||||
},
|
||||
};
|
||||
|
Reference in New Issue
Block a user