Add a NewSet event to validator-sets

Updates to the latest serai-dex/substrate due to depending on
10ccaca0eb498a2316bbf627d419b29b1a75933a.
This commit is contained in:
Luke Parker
2023-04-15 00:40:33 -04:00
parent 2e2bc59703
commit 124b994c23
5 changed files with 165 additions and 131 deletions

View File

@@ -11,6 +11,15 @@ const PALLET: &str = "ValidatorSets";
pub type ValidatorSetsEvent = validator_sets::Event<Runtime>;
impl Serai {
pub async fn get_new_set_events(
&self,
block: [u8; 32],
) -> Result<Vec<ValidatorSetsEvent>, SeraiError> {
self
.events::<ValidatorSets, _>(block, |event| matches!(event, ValidatorSetsEvent::NewSet { .. }))
.await
}
pub async fn get_vote_events(
&self,
block: [u8; 32],