diff --git a/src.ts/_tests/test-hash-typeddata.ts b/src.ts/_tests/test-hash-typeddata.ts index 5b0a82744..95d675a9d 100644 --- a/src.ts/_tests/test-hash-typeddata.ts +++ b/src.ts/_tests/test-hash-typeddata.ts @@ -135,6 +135,15 @@ describe("Tests Typed Data (EIP-712) aliases", function() { const encoder = TypedDataEncoder.from(test.types); assert.equal(encoder.primaryType, "foo", "primaryType"); assert.equal(encoder.encodeData("foo", test.data), test.encoded, "encoded"); + + const encoderAlias = TypedDataEncoder.from(test.typesAlias); + assert.equal(encoderAlias.primaryType, "foo", "primaryType"); + assert.equal(encoderAlias.encodeData("foo", test.data), test.encoded, "encoded"); + + const payload = TypedDataEncoder.getPayload({ }, test.types, test.data); + const payloadAlias = TypedDataEncoder.getPayload({ }, test.typesAlias, test.data); + + assert.equal(JSON.stringify(payloadAlias), JSON.stringify(payload), "payload"); }); }