Correct the check for if we still need to set keys

The prior check had an edge case where once keys were pruned, it'd believe the
keys needed to be set ad infinitum.
This commit is contained in:
Luke Parker
2023-10-10 22:53:15 -04:00
parent 22371a6585
commit 1a0b4198ba
3 changed files with 35 additions and 8 deletions

View File

@@ -2,7 +2,7 @@ use sp_core::sr25519::{Public, Signature};
use serai_runtime::{validator_sets, ValidatorSets, Runtime};
pub use validator_sets::primitives;
use primitives::{ValidatorSet, KeyPair};
use primitives::{Session, ValidatorSet, KeyPair};
use subxt::utils::Encoded;
@@ -31,6 +31,14 @@ impl Serai {
.await
}
pub async fn get_session(
&self,
network: NetworkId,
at_hash: [u8; 32],
) -> Result<Option<Session>, SeraiError> {
self.storage(PALLET, "CurrentSession", Some(vec![scale_value(network)]), at_hash).await
}
pub async fn get_validator_set_participants(
&self,
network: NetworkId,