-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: reth rpc should provide results for pending block related queries (
#623)
- Loading branch information
Showing
3 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import flexitest | ||
|
||
from envs import testenv | ||
|
||
|
||
@flexitest.register | ||
class ElPendingBlock(testenv.StrataTester): | ||
def __init__(self, ctx: flexitest.InitContext): | ||
ctx.set_env("basic") | ||
|
||
def main(self, ctx: flexitest.RunContext): | ||
reth = ctx.get_service("reth") | ||
address = reth.create_web3().address | ||
|
||
rethrpc = reth.create_rpc() | ||
block = rethrpc.eth_getBlockByNumber("pending", True) | ||
|
||
assert block is not None, "get pending block" | ||
|
||
gas = rethrpc.eth_estimateGas( | ||
{ | ||
"chainId": "0x3039", | ||
"from": address, | ||
"to": "0x" + "00" * 20, | ||
"nonce": "0x0", | ||
}, | ||
"pending", | ||
) | ||
|
||
assert gas is not None, "estimate gas on pending block" |