Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(chain): prefix data with 0x in eth_calls #2314

Merged
merged 9 commits into from
Jul 24, 2024
Merged

fix(chain): prefix data with 0x in eth_calls #2314

merged 9 commits into from
Jul 24, 2024

Conversation

folex
Copy link
Member

@folex folex commented Jul 19, 2024

Per Ethereum Spec https://eips.ethereum.org/EIPS/eip-1474#data, Data values must be prefixed with 0x.

Some blockchains – ie IPC – did allow us to pass it without 0x prefix, but others – ie Gelato – return an error in that case.

invalid argument 0: json: cannot unmarshal hex string without 0x prefix into Go struct field TransactionArgs.data of type hexutil.Bytes

This PR brings Nox one step closer to the ETH RPC spec. I will test it manually before merging.

@folex folex added the e2e Run e2e workflow label Jul 19, 2024
@gurinderu
Copy link
Contributor

gurinderu commented Jul 22, 2024

Where is the pr description? I don't understand why we needed that.

@folex folex merged commit c3d54ca into master Jul 24, 2024
14 checks passed
@folex folex deleted the 0x_eth_call branch July 24, 2024 14:11
folex added a commit that referenced this pull request Jul 24, 2024
* fix(chain): prefix data with 0x in eth_calls

* chore: fmt

* fix(hex): add 0x prefixes to topics

* fix(hex): unify hex encoding

* fix(test): use hex_utils in unit test

* chore(doc): add docs for hex_utils functions

* fix(tx): fix double 0x prefix

* fix(deps): add hex to chain-connector tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants