bug fixes

This commit is contained in:
akildemir
2024-02-27 17:32:50 +03:00
parent 360cd023a0
commit 4dfaf31c58
6 changed files with 34 additions and 65 deletions

View File

@@ -73,7 +73,7 @@ pub async fn allocate_stake(
nonce: u32,
) -> [u8; 32] {
// get the call
let tx = serai.sign(&pair, SeraiValidatorSets::allocate(network, amount), nonce, 0);
let tx = serai.sign(pair, SeraiValidatorSets::allocate(network, amount), nonce, 0);
publish_tx(serai, &tx).await
}
@@ -86,6 +86,6 @@ pub async fn deallocate_stake(
nonce: u32,
) -> [u8; 32] {
// get the call
let tx = serai.sign(&pair, SeraiValidatorSets::deallocate(network, amount), nonce, 0);
let tx = serai.sign(pair, SeraiValidatorSets::deallocate(network, amount), nonce, 0);
publish_tx(serai, &tx).await
}

View File

@@ -178,7 +178,7 @@ async fn validator_set_rotation() {
// we start the chain with 4 default participants that has a single key share each
participants.sort();
verify_session_and_active_validators(&serai, network, 0, &participants).await;
verify_session_and_active_validators(&serai, network, 0, participants).await;
// add 1 participant & verify
let hash =
@@ -190,7 +190,7 @@ async fn validator_set_rotation() {
&serai,
network,
get_active_session(&serai, network, hash).await,
&participants,
participants,
)
.await;
@@ -201,7 +201,7 @@ async fn validator_set_rotation() {
participants.swap_remove(participants.iter().position(|k| *k == pair2.public()).unwrap());
let active_session = get_active_session(&serai, network, hash).await;
participants.sort();
verify_session_and_active_validators(&serai, network, active_session, &participants).await;
verify_session_and_active_validators(&serai, network, active_session, participants).await;
// check pending deallocations
let pending = serai

View File

@@ -652,7 +652,7 @@ pub mod pallet {
// If not Serai, check the prior session had its keys cleared, which happens once its
// retired
return (network == NetworkId::Serai) ||
(Keys::<T>::contains_key(ValidatorSet {
(!Keys::<T>::contains_key(ValidatorSet {
network,
session: Session(current_session.0 - 1),
}));