coinbase / mesh-geth-sdk

go-ethereum based sdk for Mesh API
https://docs.cdp.coinbase.com/mesh/docs/getting-started/
Apache License 2.0
28 stars 29 forks source link

[Feature] Support encoded data for a contract call #92

Closed qiwu7 closed 1 year ago

qiwu7 commented 1 year ago

Fixes # .

Motivation

Current geth-sdk does not support passing in already encoded data to construct a contract call transaction. There are cases where the argument is a tuple, and the rosetta impl will not be able to correct encode. So we would want the caller to handle data encoding and pass in the already encoded data.

For example, in EAS, the attest method takes in a struct instead of a list of args like most of the other methods. There is no way to support such data encoding with a list of args as the input. This requires incursive parsing of the args to be able to properly encode it in rosetta.

Solution

Delegate the data construction to the caller.

Open questions

cb-heimdall commented 1 year ago

Review Error for MrSaints @ 2023-06-21 14:51:21 UTC User must have write permissions to review

GeekArthur commented 1 year ago

please add the license for new file and add the corresponding test cases, IMO unit tests for the function should be good enough

cb-heimdall commented 1 year ago

Review Error for GeekArthur @ 2023-06-23 20:27:00 UTC User failed mfa authentication, see go/mfa-help