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_getBlockByNumber does not support symbolic block names #87

Open
mahileeb opened this issue Aug 9, 2022 · 0 comments
Open

eth_getBlockByNumber does not support symbolic block names #87

mahileeb opened this issue Aug 9, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@mahileeb
Copy link

mahileeb commented Aug 9, 2022

eth_getBlockByNumber does not support symbolic block names

Steps To Reproduce

Call eth_getBlockByNumber with a symbolic block number like "earliest" or "latest"

Expected behavior

Appropriate block number should be returned

Actual behavior

Exception is thrown:

java.lang.IllegalArgumentException: Illegal character 'r' found at index 2 in hex binary representation
	at org.apache.tuweni.bytes.BytesValues.fromRawHexString(BytesValues.java:63)
	at org.apache.tuweni.bytes.Bytes32.fromHexStringLenient(Bytes32.java:216)
	at org.apache.tuweni.units.bigints.UInt256.fromHexString(UInt256.java:152)
	at org.web3j.evm.EmbeddedEthereum$Companion.hexToULong(EmbeddedEthereum.kt:353)
	at org.web3j.evm.EmbeddedEthereum$Companion.access$hexToULong(EmbeddedEthereum.kt:349)
	at org.web3j.evm.EmbeddedEthereum.ethBlockByNumber(EmbeddedEthereum.kt:235)
	at org.web3j.evm.EmbeddedWeb3jService.ethBlockByNumber(EmbeddedWeb3jService.kt:248)
	at org.web3j.evm.EmbeddedWeb3jService.send(EmbeddedWeb3jService.kt:80)
	at org.web3j.evm.EmbeddedWeb3jService.send(EmbeddedWeb3jService.kt:57)
	at org.web3j.protocol.core.Request.send(Request.java:87)
	at org.web3j.protocol.core.Request$send.call(Unknown Source)

Environment

Describe the environment in which the issue occurs

  • Web3J 4.9.4
  • Java 17
  • Operating System macOs
@mahileeb mahileeb added the bug Something isn't working label Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant