-
|
I'm currently use Here is the API I'm talking about: reth/crates/rpc/rpc-eth-api/src/core.rs Line 51 in 4cc50f9 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
I think I've answered my question: use alloy::eips::BlockNumberOrTag;
use alloy::network::Ethereum;
use alloy::network::Network;
use jsonrpsee::http_client::HttpClient;
#[tokio::main]
async fn main() {
let client = HttpClient::builder()
.build("RPC_URL")
.unwrap();
type TxReq = <Ethereum as Network>::TransactionRequest;
type T = <Ethereum as Network>::TransactionResponse;
type B = <Ethereum as Network>::BlockResponse;
type R = <Ethereum as Network>::ReceiptResponse;
type H = <Ethereum as Network>::HeaderResponse;
let result = <HttpClient as reth_rpc_api::EthApiClient<TxReq, T, B, R, H>>::block_by_number(
&client,
BlockNumberOrTag::Pending,
false,
).await.unwrap();
println!("result: {:#?}", result.unwrap().header);
} |
Beta Was this translation helpful? Give feedback.
-
|
yeah these client traits are mainly only useful when doing like e2e testing via the generics |
Beta Was this translation helpful? Give feedback.
I think I've answered my question: