diff --git a/crates/rpc/rpc-types/src/eth/trace/parity.rs b/crates/rpc/rpc-types/src/eth/trace/parity.rs index 638e4cc9de..32465227fb 100644 --- a/crates/rpc/rpc-types/src/eth/trace/parity.rs +++ b/crates/rpc/rpc-types/src/eth/trace/parity.rs @@ -216,7 +216,7 @@ pub struct LocalizedTransactionTrace { #[serde(flatten)] pub trace: TransactionTrace, /// Transaction index within the block, None if pending. - pub transaction_position: Option, + pub transaction_position: Option, /// Hash of the transaction pub transaction_hash: Option, /// Block number the transaction is included in, None if pending. diff --git a/crates/rpc/rpc-types/src/eth/transaction/common.rs b/crates/rpc/rpc-types/src/eth/transaction/common.rs index fd02a66bc1..5b9b0a25a1 100644 --- a/crates/rpc/rpc-types/src/eth/transaction/common.rs +++ b/crates/rpc/rpc-types/src/eth/transaction/common.rs @@ -9,7 +9,7 @@ pub struct TransactionInfo { /// Hash of the transaction. pub hash: Option, /// Index of the transaction in the block - pub index: Option, + pub index: Option, /// Hash of the block. pub block_hash: Option, /// Number of the block. diff --git a/crates/rpc/rpc/src/eth/api/transactions.rs b/crates/rpc/rpc/src/eth/api/transactions.rs index e82571ee96..dbdf5e24c2 100644 --- a/crates/rpc/rpc/src/eth/api/transactions.rs +++ b/crates/rpc/rpc/src/eth/api/transactions.rs @@ -92,19 +92,17 @@ where return Ok(Some(TransactionSource::Pool(tx))) } - match self.client().transaction_by_hash(hash)? { + match self.client().transaction_by_hash_with_meta(hash)? { None => Ok(None), - Some(tx) => { + Some((tx, meta)) => { let transaction = tx.into_ecrecovered().ok_or(EthApiError::InvalidTransactionSignature)?; let tx = TransactionSource::Database { transaction, - // TODO: this is just stubbed out for now still need to fully implement tx => - // block - index: 0, - block_hash: Default::default(), - block_number: 0, + index: meta.index, + block_hash: meta.block_hash, + block_number: meta.block_number, }; Ok(Some(tx)) } @@ -210,7 +208,7 @@ pub enum TransactionSource { /// Transaction fetched via provider transaction: TransactionSignedEcRecovered, /// Index of the transaction in the block - index: usize, + index: u64, /// Hash of the block. block_hash: H256, /// Number of the block.