diff --git a/docs/src/apps/jsonrpc-api.md b/docs/src/apps/jsonrpc-api.md index 4b94a91d88..aedb557b8f 100644 --- a/docs/src/apps/jsonrpc-api.md +++ b/docs/src/apps/jsonrpc-api.md @@ -307,6 +307,7 @@ The result field will be an object with the following fields: * `rewards: ` - an array of JSON objects containing: * `pubkey: ` - The public key, as base-58 encoded string, of the account that received the reward * `lamports: `- number of reward lamports credited or debited by the account, as a i64 + * `blockTime: ` - estimated production time, as Unix timestamp (seconds since the Unix epoch). null if not available #### Example: diff --git a/ledger/src/blockstore.rs b/ledger/src/blockstore.rs index 352bfaefb5..3eed86d3b0 100644 --- a/ledger/src/blockstore.rs +++ b/ledger/src/blockstore.rs @@ -1649,6 +1649,7 @@ impl Blockstore { slot_transaction_iterator, ), rewards, + block_time: None, // See https://github.com/solana-labs/solana/issues/10089 }; return Ok(block); } @@ -5334,6 +5335,7 @@ pub mod tests { blockhash: blockhash.to_string(), previous_blockhash: Hash::default().to_string(), rewards: vec![], + block_time: None, }; // The previous_blockhash of `expected_block` is default because its parent slot is a // root, but empty of entries. This is special handling for snapshot root slots. @@ -5355,6 +5357,7 @@ pub mod tests { blockhash: blockhash.to_string(), previous_blockhash: blockhash.to_string(), rewards: vec![], + block_time: None, }; assert_eq!(confirmed_block, expected_block); diff --git a/transaction-status/src/lib.rs b/transaction-status/src/lib.rs index fb42d20748..1a9c612489 100644 --- a/transaction-status/src/lib.rs +++ b/transaction-status/src/lib.rs @@ -2,7 +2,7 @@ extern crate serde_derive; use solana_sdk::{ - clock::Slot, + clock::{Slot, UnixTimestamp}, commitment_config::CommitmentConfig, message::MessageHeader, transaction::{Result, Transaction, TransactionError}, @@ -91,6 +91,7 @@ pub struct ConfirmedBlock { pub parent_slot: Slot, pub transactions: Vec, pub rewards: Rewards, + pub block_time: Option, } #[derive(Debug, PartialEq, Serialize, Deserialize)]