From 2abfe2317173921edbbd119c76f8f2051673b884 Mon Sep 17 00:00:00 2001 From: ftupas <35031356+ftupas@users.noreply.github.com> Date: Fri, 18 Aug 2023 23:37:52 +0200 Subject: [PATCH] dev: use U64 for `transaction_index` (#4261) Co-authored-by: Matthias Seitz --- crates/rpc/rpc-types/src/eth/transaction/receipt.rs | 2 +- crates/rpc/rpc/src/eth/api/transactions.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/rpc/rpc-types/src/eth/transaction/receipt.rs b/crates/rpc/rpc-types/src/eth/transaction/receipt.rs index 9e0f2250f218..b4a9fef21ad0 100644 --- a/crates/rpc/rpc-types/src/eth/transaction/receipt.rs +++ b/crates/rpc/rpc-types/src/eth/transaction/receipt.rs @@ -9,7 +9,7 @@ pub struct TransactionReceipt { /// Transaction Hash. pub transaction_hash: Option, /// Index within the block. - pub transaction_index: Option, + pub transaction_index: U64, /// Hash of the block this transaction was included within. pub block_hash: Option, /// Number of the block this transaction was included within. diff --git a/crates/rpc/rpc/src/eth/api/transactions.rs b/crates/rpc/rpc/src/eth/api/transactions.rs index 770a9e8c1e15..87d72789267a 100644 --- a/crates/rpc/rpc/src/eth/api/transactions.rs +++ b/crates/rpc/rpc/src/eth/api/transactions.rs @@ -859,7 +859,7 @@ pub(crate) fn build_transaction_receipt_with_block_receipts( let mut res_receipt = TransactionReceipt { transaction_hash: Some(meta.tx_hash), - transaction_index: Some(U256::from(meta.index)), + transaction_index: meta.index.into(), block_hash: Some(meta.block_hash), block_number: Some(U256::from(meta.block_number)), from: transaction.signer(),