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: use correct type in getAccount #10023

Merged
merged 5 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions crates/primitives-traits/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use reth_codecs::{reth_codec, Compact};
use revm_primitives::{AccountInfo, Bytecode as RevmBytecode, JumpTable};
use serde::{Deserialize, Serialize};

pub use alloy_consensus::Account as AccountTrie;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sincerely, I don't think this name is idiomatic. I think we can found a better name for it 👍🏻

mvares marked this conversation as resolved.
Show resolved Hide resolved
/// An Ethereum account.
#[reth_codec]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives-traits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub use constants::gas_units::{format_gas, format_gas_throughput};

/// Minimal account
pub mod account;
pub use account::{Account, Bytecode};
pub use account::{Account, AccountTrie, Bytecode};
mvares marked this conversation as resolved.
Show resolved Hide resolved

mod integer_list;
pub use integer_list::{IntegerList, RoaringBitmapError};
Expand Down
4 changes: 2 additions & 2 deletions crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ pub use receipt::{
gas_spent_by_transactions, Receipt, ReceiptWithBloom, ReceiptWithBloomRef, Receipts,
};
pub use reth_primitives_traits::{
logs_bloom, Account, Bytecode, GotExpected, GotExpectedBoxed, Header, HeaderError, Log,
LogData, Request, Requests, SealedHeader, StorageEntry, Withdrawal, Withdrawals,
logs_bloom, Account, AccountTrie, Bytecode, GotExpected, GotExpectedBoxed, Header, HeaderError,
Log, LogData, Request, Requests, SealedHeader, StorageEntry, Withdrawal, Withdrawals,
};
pub use static_file::StaticFileSegment;

Expand Down
8 changes: 4 additions & 4 deletions crates/rpc/rpc-eth-api/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
use alloy_dyn_abi::TypedData;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::{
transaction::AccessListResult, Account, Address, BlockId, BlockNumberOrTag, Bytes, B256, B64,
U256, U64,
transaction::AccessListResult, AccountTrie, Address, BlockId, BlockNumberOrTag, Bytes, B256,
mvares marked this conversation as resolved.
Show resolved Hide resolved
B64, U256, U64,
};
use reth_rpc_server_types::{result::internal_rpc_err, ToRpcResult};
use reth_rpc_types::{
Expand Down Expand Up @@ -250,7 +250,7 @@ pub trait EthApi {

/// 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>;
async fn get_account(&self, address: Address, block: BlockId) -> RpcResult<AccountTrie>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
async fn get_account(&self, address: Address, block: BlockId) -> RpcResult<AccountTrie>;
async fn get_account(&self, address: Address, block: BlockId) -> RpcResult<reth_rpc_types::Account>;


/// Introduced in EIP-1559, returns suggestion for the priority for dynamic fee transactions.
#[method(name = "maxPriorityFeePerGas")]
Expand Down Expand Up @@ -626,7 +626,7 @@ where
}

/// Handler for: `eth_getAccount`
async fn get_account(&self, _address: Address, _block: BlockId) -> RpcResult<Account> {
async fn get_account(&self, _address: Address, _block: BlockId) -> RpcResult<AccountTrie> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
async fn get_account(&self, _address: Address, _block: BlockId) -> RpcResult<AccountTrie> {
async fn get_account(&self, _address: Address, _block: BlockId) -> RpcResult<reth_rpc_types::Account> {

Err(internal_rpc_err("unimplemented"))
}

Expand Down
Loading