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

using the geth library to get latest block after calling evm_mine returns an error hex string of odd length #2088

Closed
2 tasks done
krasi-georgiev opened this issue Jun 23, 2022 · 1 comment
Labels
C-anvil Command: anvil T-bug Type: bug

Comments

@krasi-georgiev
Copy link

krasi-georgiev commented Jun 23, 2022

Component

Anvil

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (9b2d95d 2022-06-23T00:13:03.193579407Z)

What command(s) is the bug in?

No response

Operating System

Linux

Describe the bug

steps to replicate

anvil --fork-url https://eth-mainnet.alchemyapi.io/v2/....
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"evm_mine","id":67}' http://localhost:8545

client, err := ethclient.Dial("http://localhost:8545")
if err != nil {
	panic(err)
}

_, err = client.BlockByNumber(context.Background(), nil) // panic: hex string of odd length
if err != nil {
	panic(err)
}

the same works fine with hardhat

@krasi-georgiev krasi-georgiev added the T-bug Type: bug label Jun 23, 2022
@krasi-georgiev krasi-georgiev changed the title using geth library to get latest block after calling evm_mine returns an error hex string of odd length using geth library to get latest block returns an error hex string of odd length Jun 23, 2022
@krasi-georgiev krasi-georgiev changed the title using geth library to get latest block returns an error hex string of odd length using geth library to get latest block after calling evm_mine returns an error hex string of odd length Jun 23, 2022
@krasi-georgiev krasi-georgiev changed the title using geth library to get latest block after calling evm_mine returns an error hex string of odd length using the geth library to get latest block after calling evm_mine returns an error hex string of odd length Jun 23, 2022
@onbjerg onbjerg added the C-anvil Command: anvil label Jun 23, 2022
@mattsse
Copy link
Member

mattsse commented Jun 23, 2022

thanks for flagging

this will be fixed by gakonst/ethers-rs#1396

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-anvil Command: anvil T-bug Type: bug
Projects
Archived in project
Development

No branches or pull requests

3 participants