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

eth_getCode returning 0x0 instead of 0x for non-contract addresses #394

Closed
tom-hbar opened this issue Aug 1, 2022 · 0 comments · Fixed by #419
Closed

eth_getCode returning 0x0 instead of 0x for non-contract addresses #394

tom-hbar opened this issue Aug 1, 2022 · 0 comments · Fixed by #419
Assignees
Labels
bug Something isn't working P1
Milestone

Comments

@tom-hbar
Copy link

tom-hbar commented Aug 1, 2022

Description

When making a request using the eth_getCode method for a non-contract address, the result value returned is 0x0. Other relays (such as Ethereum or BSC relays) return 0x. This can cause issues if applications or libraries are expecting 0x but not 0x0.

It might be worth modifying the result value to return 0x to cover applications or libraries that do not expect 0x0, especially if this is standard for relays on other chains.

Steps to reproduce

  1. Make a request to the JSON RPC relay with the eth_getCode method for a non-contract address

curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":"2","method":"eth_getCode","params":["0x0000000000000000000000000000000000000000", "latest"]}' https://testnet.hashio.io/api

Response received:
{"result":"0x0","jsonrpc":"2.0","id":"2"}

Response expected:
{"result":"0x","jsonrpc":"2.0","id":"2"}

Additional context

No response

Hedera network

mainnet, testnet, previewnet, other

Version

v0.3.0

Operating system

macOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1
Projects
Archived in project
3 participants