|
15 | 15 | solana_sdk::{
|
16 | 16 | account::{Account, AccountSharedData, ReadableAccount},
|
17 | 17 | clock::{Epoch, Slot},
|
| 18 | + feature_set, |
18 | 19 | fee::FeeDetails,
|
19 | 20 | hash::Hash,
|
20 | 21 | inner_instruction::InnerInstructionsList,
|
@@ -123,6 +124,8 @@ pub struct BankHashComponents {
|
123 | 124 | pub last_blockhash: String,
|
124 | 125 | #[serde(skip_serializing_if = "Option::is_none")]
|
125 | 126 | pub epoch_accounts_hash: Option<String>,
|
| 127 | + #[serde(skip_serializing_if = "Option::is_none")] |
| 128 | + pub accounts_lt_hash_checksum: Option<String>, |
126 | 129 | pub accounts: AccountsDetails,
|
127 | 130 | }
|
128 | 131 |
|
@@ -155,6 +158,17 @@ impl SlotDetails {
|
155 | 158 | epoch_accounts_hash: bank
|
156 | 159 | .wait_get_epoch_accounts_hash()
|
157 | 160 | .map(|hash| hash.as_ref().to_string()),
|
| 161 | + accounts_lt_hash_checksum: bank |
| 162 | + .feature_set |
| 163 | + .is_active(&feature_set::accounts_lt_hash::id()) |
| 164 | + .then(|| { |
| 165 | + bank.accounts_lt_hash |
| 166 | + .lock() |
| 167 | + .unwrap() |
| 168 | + .0 |
| 169 | + .checksum() |
| 170 | + .to_string() |
| 171 | + }), |
158 | 172 | accounts: AccountsDetails { accounts },
|
159 | 173 | })
|
160 | 174 | } else {
|
@@ -338,6 +352,11 @@ pub mod tests {
|
338 | 352 | } else {
|
339 | 353 | None
|
340 | 354 | },
|
| 355 | + accounts_lt_hash_checksum: if slot % 3 == 0 { |
| 356 | + Some("accounts_lt_hash_checksum".into()) |
| 357 | + } else { |
| 358 | + None |
| 359 | + }, |
341 | 360 | accounts,
|
342 | 361 | }),
|
343 | 362 | transactions: vec![],
|
|
0 commit comments