Skip to content

Commit

Permalink
index in block
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMDunn committed Aug 26, 2024
1 parent de855b7 commit adbde40
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions cli/src/cluster_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2103,6 +2103,7 @@ pub fn process_transaction_history(
block_time,
slot,
transaction: transaction_with_meta,
index_in_block: _,
} = confirmed_transaction;

let decoded_transaction =
Expand Down
1 change: 1 addition & 0 deletions cli/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ pub fn process_confirm(
block_time,
slot,
transaction: transaction_with_meta,
index_in_block: _,
} = confirmed_transaction;

let decoded_transaction =
Expand Down
1 change: 1 addition & 0 deletions rpc-client/src/mock_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ impl RpcSender for MockSender {
}),
},
block_time: Some(1628633791),
index_in_block: 0,
})?,
"getTransactionCount" => json![1234],
"getSlot" => json![0],
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,7 @@ impl JsonRpcRequestProcessor {

let encode_transaction =
|confirmed_tx_with_meta: ConfirmedTransactionWithStatusMeta| -> Result<EncodedConfirmedTransactionWithStatusMeta> {
Ok(confirmed_tx_with_meta.encode(encoding, max_supported_transaction_version).map_err(RpcCustomError::from)?)
Ok(confirmed_tx_with_meta.encode(encoding, max_supported_transaction_version, 0).map_err(RpcCustomError::from)?)
};

match confirmed_transaction.unwrap_or(None) {
Expand Down
3 changes: 3 additions & 0 deletions transaction-status/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,7 @@ impl ConfirmedTransactionWithStatusMeta {
self,
encoding: UiTransactionEncoding,
max_supported_transaction_version: Option<u8>,
index_in_block: usize,
) -> Result<EncodedConfirmedTransactionWithStatusMeta, EncodeError> {
Ok(EncodedConfirmedTransactionWithStatusMeta {
slot: self.slot,
Expand All @@ -1112,6 +1113,7 @@ impl ConfirmedTransactionWithStatusMeta {
true,
)?,
block_time: self.block_time,
index_in_block,
})
}

Expand All @@ -1127,6 +1129,7 @@ pub struct EncodedConfirmedTransactionWithStatusMeta {
#[serde(flatten)]
pub transaction: EncodedTransactionWithStatusMeta,
pub block_time: Option<UnixTimestamp>,
pub index_in_block: usize,
}

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
Expand Down

0 comments on commit adbde40

Please sign in to comment.