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

Refactor PoS crate #2253

Merged
merged 7 commits into from
Dec 29, 2023
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: 2 additions & 0 deletions .changelog/unreleased/improvements/2253-pos-crate-refactor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Refactor the PoS crate by breaking up the lib and tests code into smaller
files. ([\#2253](https://github.com/anoma/namada/pull/2253))
8 changes: 5 additions & 3 deletions apps/src/lib/bench_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ impl Default for BenchShell {
source: Some(defaults::albert_address()),
};
let params =
proof_of_stake::read_pos_params(&shell.wl_storage).unwrap();
proof_of_stake::storage::read_pos_params(&shell.wl_storage)
.unwrap();
let mut bench_shell = BenchShell {
inner: shell,
tempdir,
Expand Down Expand Up @@ -398,13 +399,14 @@ impl BenchShell {

pub fn advance_epoch(&mut self) {
let params =
proof_of_stake::read_pos_params(&self.inner.wl_storage).unwrap();
proof_of_stake::storage::read_pos_params(&self.inner.wl_storage)
.unwrap();

self.wl_storage.storage.block.epoch =
self.wl_storage.storage.block.epoch.next();
let current_epoch = self.wl_storage.storage.block.epoch;

proof_of_stake::copy_validator_sets_and_positions(
proof_of_stake::validator_set_update::copy_validator_sets_and_positions(
&mut self.wl_storage,
&params,
current_epoch,
Expand Down
Loading