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: early return for JsonStorageKey to String #261

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

greged93
Copy link
Contributor

Motivation

Solves the serialization issue for the JsonStorageKey type which serializes the 0 key to 0x. As per the hive tests, it should serialize to 0x0 (https://github.com/ethereum/execution-apis/blob/main/tests/eth_getProof/get-account-proof-with-storage.io).

Solution

Add an early return on the conversion of the storage key to a String, in order to manually return 0x0. This is similar to the implementation found in geth (https://github.com/ethereum/go-ethereum/blob/b87b9b45331f87fb1da379c5f17a81ebc3738c6e/internal/ethapi/api.go#L727-L729).

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@onbjerg
Copy link
Member

onbjerg commented Mar 11, 2024

lgtm, please add a test

@onbjerg onbjerg merged commit 63af0c4 into alloy-rs:main Mar 11, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants