Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/main' into A0-1525
  • Loading branch information
kostekIV committed Nov 2, 2022
commit cf778a3748e270ee1e9e8526720c19c25fe1e915
3 changes: 3 additions & 0 deletions .github/workflows/e2e-tests-main-devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,9 @@ jobs:
run-e2e-rewards-points-basic,
run-e2e-authorities-are-staking,
run-e2e-ban-automatic,
run-e2e-ban-counter-clearing,
run-e2e-ban-manual,
run-e2e-version-upgrade,
run-e2e-permissionless-ban,
]
name: Check e2e test suite completion
Expand Down
27 changes: 0 additions & 27 deletions aleph-client/src/elections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,33 +96,6 @@ pub fn get_ban_reason_for_validator<C: ReadStorage>(
connection.read_storage_map(PALLET, "Banned", account_id, None)
}

pub fn ban_from_committee(
connection: &RootConnection,
to_be_banned: &AccountId,
reason: &Vec<u8>,
status: XtStatus,
) {
let call_name = "ban_from_committee";

let ban_from_committee_call = compose_call!(
connection.as_connection().metadata,
PALLET,
call_name,
to_be_banned,
reason
);

let xt = compose_extrinsic!(
connection.as_connection(),
"Sudo",
"sudo_unchecked_weight",
ban_from_committee_call,
0_u64
);

send_xt(connection, xt, Some(call_name), status);
}

pub fn change_ban_config(
sudo_connection: &RootConnection,
minimal_expected_performance: Option<u8>,
Expand Down
1 change: 0 additions & 1 deletion e2e-tests/src/cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ pub fn possible_test_cases() -> PossibleTestCases {
"clearing_session_count",
test_clearing_session_count as TestCase,
),
("ban_automatic", test_ban_automatic as TestCase),
("permissionless_ban", test_permissionless_ban as TestCase),
]
}
17 changes: 11 additions & 6 deletions e2e-tests/src/test/ban.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
use std::collections::HashSet;
use aleph_client::{ban_from_committee, change_ban_config, change_validators, get_current_era, get_current_era_non_reserved_validators, get_current_era_validators, get_current_session, get_next_era_non_reserved_validators, get_next_era_reserved_validators, get_underperformed_validator_session_count, set_elections_openness, wait_for_at_least_session, wait_for_full_era_completion, SignedConnection, XtStatus, wait_for_next_era};

use aleph_client::{
ban_from_committee, change_ban_config, change_validators, get_current_era,
get_current_era_non_reserved_validators, get_current_era_validators, get_current_session,
get_next_era_non_reserved_validators, get_next_era_reserved_validators,
get_underperformed_validator_session_count, set_elections_openness, wait_for_at_least_session,
wait_for_full_era_completion, wait_for_next_era, SignedConnection, XtStatus,
};
use log::info;
use primitives::{
BanInfo, BanReason, CommitteeSeats, ElectionOpenness, SessionCount,
BanInfo, BanReason, BoundedVec, CommitteeSeats, ElectionOpenness, SessionCount,
DEFAULT_BAN_MINIMAL_EXPECTED_PERFORMANCE, DEFAULT_BAN_SESSION_COUNT_THRESHOLD,
DEFAULT_CLEAN_SESSION_COUNTER_DELAY,
};
Expand Down Expand Up @@ -271,15 +278,13 @@ pub fn permissionless_ban(config: &Config) -> anyhow::Result<()> {
XtStatus::InBlock,
);
wait_for_full_era_completion(&root_connection)?;
let without_banned =
HashSet::<_>::from_iter(non_reserved_without_banned);
let without_banned = HashSet::<_>::from_iter(non_reserved_without_banned);
let non_reserved =
HashSet::<_>::from_iter(get_current_era_non_reserved_validators(&root_connection));
assert_eq!(without_banned, non_reserved);

wait_for_next_era(&root_connection)?;
let expected_non_reserved =
HashSet::<_>::from_iter(non_reserved_validators);
let expected_non_reserved = HashSet::<_>::from_iter(non_reserved_validators);
let non_reserved =
HashSet::<_>::from_iter(get_current_era_non_reserved_validators(&root_connection));

Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/src/test/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub use ban::{ban_automatic, clearing_session_count, permissionless_ban};
pub use ban::{ban_automatic, ban_manual, clearing_session_count, permissionless_ban};
pub use electing_validators::authorities_are_staking;
pub use era_payout::era_payouts_calculated_correctly;
pub use era_validators::era_validators;
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.