persist EpochRewardStatus::Active (#31697)
persist `EpochRewardStatus::Active`
This commit is contained in:
parent
c5d72fc480
commit
0291454876
|
@ -7730,6 +7730,13 @@ impl Bank {
|
||||||
Some(epoch_accounts_hash)
|
Some(epoch_accounts_hash)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Return the epoch_reward_status field on the bank to serialize
|
||||||
|
/// Returns none if we are NOT in the reward interval.
|
||||||
|
pub(crate) fn get_epoch_reward_status_to_serialize(&self) -> Option<&EpochRewardStatus> {
|
||||||
|
matches!(self.epoch_reward_status, EpochRewardStatus::Active(_))
|
||||||
|
.then_some(&self.epoch_reward_status)
|
||||||
|
}
|
||||||
|
|
||||||
/// Convenience fn to get the Epoch Accounts Hash
|
/// Convenience fn to get the Epoch Accounts Hash
|
||||||
pub fn epoch_accounts_hash(&self) -> Option<EpochAccountsHash> {
|
pub fn epoch_accounts_hash(&self) -> Option<EpochAccountsHash> {
|
||||||
self.rc
|
self.rc
|
||||||
|
|
|
@ -202,7 +202,9 @@ impl<'a> TypeContext<'a> for Context {
|
||||||
let ancestors = HashMap::from(&serializable_bank.bank.ancestors);
|
let ancestors = HashMap::from(&serializable_bank.bank.ancestors);
|
||||||
let fields = serializable_bank.bank.get_fields_to_serialize(&ancestors);
|
let fields = serializable_bank.bank.get_fields_to_serialize(&ancestors);
|
||||||
let lamports_per_signature = fields.fee_rate_governor.lamports_per_signature;
|
let lamports_per_signature = fields.fee_rate_governor.lamports_per_signature;
|
||||||
let epoch_reward_status = None;
|
let epoch_reward_status = serializable_bank
|
||||||
|
.bank
|
||||||
|
.get_epoch_reward_status_to_serialize();
|
||||||
match get_serialize_bank_fields(
|
match get_serialize_bank_fields(
|
||||||
SerializableVersionedBank::from(fields),
|
SerializableVersionedBank::from(fields),
|
||||||
SerializableAccountsDb::<'a, Self> {
|
SerializableAccountsDb::<'a, Self> {
|
||||||
|
|
|
@ -721,7 +721,7 @@ mod test_bank_serialize {
|
||||||
|
|
||||||
// This some what long test harness is required to freeze the ABI of
|
// This some what long test harness is required to freeze the ABI of
|
||||||
// Bank's serialization due to versioned nature
|
// Bank's serialization due to versioned nature
|
||||||
#[frozen_abi(digest = "GbEcrk8sgqbQ5kJ8mAaHTh2REmHyESQ6GXnGWxkGbxDe")]
|
#[frozen_abi(digest = "8aBQnNxnfKDxGEmMwaq9uLeMh3fw5sKsMGZBsCp15Dmv")]
|
||||||
#[derive(Serialize, AbiExample)]
|
#[derive(Serialize, AbiExample)]
|
||||||
pub struct BankAbiTestWrapperNewer {
|
pub struct BankAbiTestWrapperNewer {
|
||||||
#[serde(serialize_with = "wrapper_newer")]
|
#[serde(serialize_with = "wrapper_newer")]
|
||||||
|
|
Loading…
Reference in New Issue