diff options
Diffstat (limited to 'packages/utils')
-rw-r--r-- | packages/utils/src/sign_typed_data_utils.ts | 6 | ||||
-rw-r--r-- | packages/utils/test/sign_typed_data_utils_test.ts | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/packages/utils/src/sign_typed_data_utils.ts b/packages/utils/src/sign_typed_data_utils.ts index 657a59ed0..cd5bcb42f 100644 --- a/packages/utils/src/sign_typed_data_utils.ts +++ b/packages/utils/src/sign_typed_data_utils.ts @@ -6,11 +6,11 @@ import { EIP712Object, EIP712ObjectValue, EIP712TypedData, EIP712Types } from '@ export const signTypedDataUtils = { /** - * Computes the Sign Typed Data hash + * Generates the EIP712 Typed Data hash for signing * @param typedData An object that conforms to the EIP712TypedData interface - * @return A Buffer containing the hash of the sign typed data. + * @return A Buffer containing the hash of the typed data. */ - signTypedDataHash(typedData: EIP712TypedData): Buffer { + generateTypedDataHash(typedData: EIP712TypedData): Buffer { return ethUtil.sha3( Buffer.concat([ Buffer.from('1901', 'hex'), diff --git a/packages/utils/test/sign_typed_data_utils_test.ts b/packages/utils/test/sign_typed_data_utils_test.ts index e1cb4f6e1..dcba08b04 100644 --- a/packages/utils/test/sign_typed_data_utils_test.ts +++ b/packages/utils/test/sign_typed_data_utils_test.ts @@ -127,12 +127,12 @@ describe('signTypedDataUtils', () => { primaryType: 'Order', }; it('creates a hash of the test sign typed data', () => { - const hash = signTypedDataUtils.signTypedDataHash(simpleSignTypedData).toString('hex'); + const hash = signTypedDataUtils.generateTypedDataHash(simpleSignTypedData).toString('hex'); const hashHex = `0x${hash}`; expect(hashHex).to.be.eq(simpleSignTypedDataHashHex); }); it('creates a hash of the order sign typed data', () => { - const hash = signTypedDataUtils.signTypedDataHash(orderSignTypedData).toString('hex'); + const hash = signTypedDataUtils.generateTypedDataHash(orderSignTypedData).toString('hex'); const hashHex = `0x${hash}`; expect(hashHex).to.be.eq(orderSignTypedDataHashHex); }); |