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

Use current protocol version in MockEpochManager #12304

Merged
merged 2 commits into from
Oct 25, 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 chain/chain/src/test_utils/kv_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ impl EpochManagerAdapter for MockEpochManager {
HashMap::new(),
1,
1,
1,
PROTOCOL_VERSION,
RngSeed::default(),
Default::default(),
)))
Expand Down
45 changes: 34 additions & 11 deletions chain/client/src/tests/maintenance_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,41 @@ fn test_get_maintenance_windows_for_validator() {
GetMaintenanceWindows { account_id: "test".parse().unwrap() }.with_span_context(),
);

// block_height: 0 bp: test cps: [AccountId("test")]
// block_height: 1 bp: validator cps: [AccountId("validator")]
// block_height: 2 bp: test cps: [AccountId("test")]
// block_height: 3 bp: validator cps: [AccountId("validator")]
// block_height: 4 bp: test cps: [AccountId("test")]
// block_height: 5 bp: validator cps: [AccountId("validator")]
// block_height: 6 bp: test cps: [AccountId("test")]
// block_height: 7 bp: validator cps: [AccountId("validator")]
// block_height: 8 bp: test cps: [AccountId("test")]
// block_height: 9 bp: validator cps: [AccountId("validator")]
// shard_ids: [ShardId(0)]
// #0
// block producer: test
// chunk producer for shard 0: other
// #1
// block producer: other
// chunk producer for shard 0: other
// #2
// block producer: other
// chunk producer for shard 0: test
// #3
// block producer: test
// chunk producer for shard 0: test
// #4
// block producer: other
// chunk producer for shard 0: other
// #5
// block producer: test
// chunk producer for shard 0: test
// #6
// block producer: test
// chunk producer for shard 0: other
// #7
// block producer: other
// chunk producer for shard 0: test
// #8
// block producer: other
// chunk producer for shard 0: test
// #9
// block producer: other
// chunk producer for shard 0: test
//
// Maintenance heights (heights where it's not a block or chunk producer) for test: 1, 4
let actor = actor.then(|res| {
assert_eq!(res.unwrap().unwrap(), vec![1..2, 3..4, 5..6, 7..8, 9..10]);
assert_eq!(res.unwrap().unwrap(), [1..2, 4..5]);
System::current().stop();
future::ready(())
});
Expand Down
Loading