Add block_time to getConfirmedSignaturesForAddress2 and getConfirmedTransaction (#14572)
* add block_time to get_confirmed_signatures_for_address2 and protobuf implementation for tx_by_addr * add tests for convert * update cargo lock * run cargo format after rebase * introduce legacy TransactionByAddrInfo * move LegacyTransactionByAddrInfo back to storage-bigtable
This commit is contained in:
@@ -2023,12 +2023,14 @@ impl Blockstore {
|
||||
let transaction = self
|
||||
.find_transaction_in_slot(slot, signature)?
|
||||
.ok_or(BlockstoreError::TransactionStatusSlotMismatch)?; // Should not happen
|
||||
let block_time = self.get_block_time(slot)?;
|
||||
Ok(Some(ConfirmedTransaction {
|
||||
slot,
|
||||
transaction: TransactionWithStatusMeta {
|
||||
transaction,
|
||||
meta: Some(status),
|
||||
},
|
||||
block_time,
|
||||
}))
|
||||
} else {
|
||||
Ok(None)
|
||||
@@ -2323,11 +2325,13 @@ impl Blockstore {
|
||||
None => None,
|
||||
Some((_slot, status)) => status.status.err(),
|
||||
};
|
||||
let block_time = self.get_block_time(slot)?;
|
||||
infos.push(ConfirmedTransactionStatusWithSignature {
|
||||
signature,
|
||||
slot,
|
||||
err,
|
||||
memo: None,
|
||||
block_time,
|
||||
});
|
||||
}
|
||||
get_status_info_timer.stop();
|
||||
@@ -6590,7 +6594,11 @@ pub mod tests {
|
||||
let signature = transaction.transaction.signatures[0];
|
||||
assert_eq!(
|
||||
blockstore.get_confirmed_transaction(signature).unwrap(),
|
||||
Some(ConfirmedTransaction { slot, transaction })
|
||||
Some(ConfirmedTransaction {
|
||||
slot,
|
||||
transaction,
|
||||
block_time: None
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user