ethermint icon indicating copy to clipboard operation
ethermint copied to clipboard

Eip712 doesn't support `any` messages

Open facs95 opened this issue 2 years ago • 1 comments

Most messages with EIP712 are working fine, but the code is not working if some values that are not the cosmos transaction itself, are contained inside a proto.Any object.

The issue is that when we create read the transactions values, they are parsed using the JSON lib, for example, for public keys it returns the base64 representation of the pubkey as a string.

When the lib generates the types for the EIP712 message, it uses codec.UnpackAny if the message is contained inside a proto.Any object it will return {type:string, value:...} instead of the expected string

Expected

Add tests for any messages, here's a start: https://github.com/evmos/ethermint/pull/1076

facs95 avatar Aug 12 '22 14:08 facs95

@ramirocarlucho Lets try to avoid forking the sdk

danburck avatar Aug 12 '22 15:08 danburck

This issue is related to the amino encoding of the messages in the cosmos-sdk and out eip712 implementation. As long as the message supports amino encoding, the eip712 will work correctly.

Since updating to cosmos-sdk 0.46 all the problems were fixed, some test were added on this pr https://github.com/evmos/ethermint/pull/1346

ramacarlucho avatar Sep 19 '22 14:09 ramacarlucho