ethermint
ethermint copied to clipboard
Eip712 doesn't support `any` messages
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
@ramirocarlucho Lets try to avoid forking the sdk
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