Normalize EIP-712 types before computing the payload (#4541).

This commit is contained in:
Richard Moore 2024-01-17 20:33:38 -05:00
parent 319d475648
commit 56c1361ee8

@ -607,6 +607,9 @@ export class TypedDataEncoder {
const encoder = TypedDataEncoder.from(types); const encoder = TypedDataEncoder.from(types);
// Get the normalized types
types = encoder.types;
const typesWithDomain = Object.assign({ }, types); const typesWithDomain = Object.assign({ }, types);
assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types); assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types);