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

chore: add get_account method in EthApi trait #9632

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion crates/rpc/rpc-eth-api/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use alloy_dyn_abi::TypedData;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::{Address, BlockId, BlockNumberOrTag, Bytes, B256, B64, U256, U64};
use reth_primitives::{Account, Address, BlockId, BlockNumberOrTag, Bytes, B256, B64, U256, U64};
use reth_rpc_server_types::{result::internal_rpc_err, ToRpcResult};
use reth_rpc_types::{
serde_helpers::JsonStorageKey,
Expand Down Expand Up @@ -245,6 +245,10 @@ pub trait EthApi {
#[method(name = "gasPrice")]
async fn gas_price(&self) -> RpcResult<U256>;

/// Returns the account details by specifying an address and a block number/tag
#[method(name = "getAccount")]
async fn get_account(&self, address: Address, block: BlockId) -> RpcResult<Account>;

/// Introduced in EIP-1559, returns suggestion for the priority for dynamic fee transactions.
#[method(name = "maxPriorityFeePerGas")]
async fn max_priority_fee_per_gas(&self) -> RpcResult<U256>;
Expand Down Expand Up @@ -621,6 +625,11 @@ where
return Ok(EthFees::gas_price(self).await?)
}

/// Handler for: `eth_getAccount`
async fn get_account(&self, _address: Address, _block: BlockId) -> RpcResult<Account> {
Err(internal_rpc_err("unimplemented"))
}

/// Handler for: `eth_maxPriorityFeePerGas`
async fn max_priority_fee_per_gas(&self) -> RpcResult<U256> {
trace!(target: "rpc::eth", "Serving eth_maxPriorityFeePerGas");
Expand Down
Loading