Skip to content

Commit

Permalink
chore: add get_account method in EthApi trait (#9632)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvares authored Jul 19, 2024
1 parent 516acef commit 5e9b66f
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 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,14 @@ 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_reference: BlockNumberOrTag,
) -> 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 +629,15 @@ where
return Ok(EthFees::gas_price(self).await?)
}

/// Handler for: `eth_getAccount`
async fn get_account(
&self,
_address: Address,
_block_reference: BlockNumberOrTag,
) -> RpcResult<Account> {
unimplemented!();
}

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

0 comments on commit 5e9b66f

Please sign in to comment.