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

SF-5242: index in block #11

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 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