Skip to content

Commit

Permalink
Rm calls to mock_attest_validate in staking pallet test as fn is now …
Browse files Browse the repository at this point in the history
…removed
  • Loading branch information
ameba23 committed Oct 24, 2024
1 parent a6c5cea commit 841b167
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions pallets/staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

use crate::{
mock::*, pck::MOCK_PCK_DERIVED_FROM_NULL_ARRAY, tests::RuntimeEvent, Error, IsValidatorSynced,
JoiningServerInfo, NextSignerInfo, NextSigners, ServerInfo, Signers, ThresholdServers,
ThresholdToStash,
JoiningServerInfo, NextSignerInfo, NextSigners, ServerInfo, Signers, ThresholdToStash,
};
use codec::Encode;
use frame_support::{assert_noop, assert_ok};
Expand Down Expand Up @@ -77,8 +76,6 @@ fn it_takes_in_an_endpoint() {
VALID_QUOTE.to_vec(),
));

mock_attest_validate(1, joining_server_info);

let ServerInfo { tss_account, endpoint, .. } = Staking::threshold_server(1).unwrap();
assert_eq!(endpoint, vec![20]);
assert_eq!(tss_account, 3);
Expand Down Expand Up @@ -140,8 +137,6 @@ fn it_will_not_allow_validator_to_use_existing_tss_account() {
VALID_QUOTE.to_vec(),
));

mock_attest_validate(1, joining_server_info.clone());

// Attempt to call validate with a TSS account which already exists
assert_ok!(FrameStaking::bond(
RuntimeOrigin::signed(2),
Expand Down Expand Up @@ -182,8 +177,6 @@ fn it_changes_endpoint() {
VALID_QUOTE.to_vec(),
));

mock_attest_validate(1, joining_server_info);

assert_ok!(Staking::change_endpoint(RuntimeOrigin::signed(1), vec![30]));
assert_eq!(Staking::threshold_server(1).unwrap().endpoint, vec![30]);

Expand Down Expand Up @@ -216,8 +209,6 @@ fn it_changes_threshold_account() {
VALID_QUOTE.to_vec(),
));

mock_attest_validate(1, joining_server_info);

assert_ok!(Staking::change_threshold_accounts(RuntimeOrigin::signed(1), 4, NULL_ARR));
assert_eq!(Staking::threshold_server(1).unwrap().tss_account, 4);
assert_eq!(Staking::threshold_to_stash(4).unwrap(), 1);
Expand Down Expand Up @@ -247,8 +238,6 @@ fn it_changes_threshold_account() {
VALID_QUOTE.to_vec(),
));

mock_attest_validate(2, joining_server_info);

assert_noop!(
Staking::change_threshold_accounts(RuntimeOrigin::signed(1), 5, NULL_ARR),
Error::<Test>::TssAccountAlreadyExists
Expand Down Expand Up @@ -303,7 +292,6 @@ fn it_will_not_allow_existing_tss_account_when_changing_threshold_account() {
joining_server_info.clone(),
VALID_QUOTE.to_vec(),
));
mock_attest_validate(2, joining_server_info);

assert_noop!(
Staking::change_threshold_accounts(RuntimeOrigin::signed(1), 5, NULL_ARR),
Expand Down Expand Up @@ -337,8 +325,6 @@ fn it_deletes_when_no_bond_left() {
VALID_QUOTE.to_vec(),
));

mock_attest_validate(2, joining_server_info);

IsValidatorSynced::<Test>::insert(2, true);

let ServerInfo { tss_account, endpoint, .. } = Staking::threshold_server(2).unwrap();
Expand Down

0 comments on commit 841b167

Please sign in to comment.