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

v1.18: Fix bank new_from_field for epoch reward status (backport of #34992) #35002

Merged
merged 1 commit into from
Jan 31, 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
2 changes: 1 addition & 1 deletion runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1840,7 +1840,7 @@ impl Bank {
fields.epoch,
))),
check_program_modification_slot: false,
epoch_reward_status: EpochRewardStatus::default(),
epoch_reward_status: fields.epoch_reward_status,
};
bank.finish_init(
genesis_config,
Expand Down
6 changes: 3 additions & 3 deletions runtime/src/bank/serde_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ mod tests {
);

// assert epoch_reward_status is the same as the set epoch reward status
let epoch_reward_status = bank
let epoch_reward_status = dbank
.get_epoch_reward_status_to_serialize()
.unwrap_or(&EpochRewardStatus::Inactive);
if let Some(rewards) = epoch_reward_status_active {
Expand Down Expand Up @@ -504,7 +504,7 @@ mod tests {
);

// assert epoch_reward_status is the same as the set epoch reward status
let epoch_reward_status = bank
let epoch_reward_status = dbank
.get_epoch_reward_status_to_serialize()
.unwrap_or(&EpochRewardStatus::Inactive);
if let Some(rewards) = epoch_reward_status_active {
Expand Down Expand Up @@ -593,7 +593,7 @@ mod tests {
assert_eq!(0, dbank.fee_rate_governor.lamports_per_signature);

// epoch_reward status should default to `Inactive`
let epoch_reward_status = bank
let epoch_reward_status = dbank
.get_epoch_reward_status_to_serialize()
.unwrap_or(&EpochRewardStatus::Inactive);
assert_matches!(epoch_reward_status, EpochRewardStatus::Inactive);
Expand Down
Loading