mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Update SetDecided to include the validators
Necessary for light-client protocols to follow along with consensus. Arguably, anyone handling GRANDPA's consensus could peek at this through the consensus commit anyways, but we shouldn't so defer that.
This commit is contained in:
@@ -326,14 +326,20 @@ impl<Storage: SessionsStorage> Sessions for Storage {
|
||||
latest_decided_set,
|
||||
KeySharesStruct::try_from(total_key_shares).expect("amortization failure"),
|
||||
);
|
||||
for (key, key_shares) in selected_validators {
|
||||
for (key, key_shares) in &selected_validators {
|
||||
Storage::SelectedValidators::insert(
|
||||
selected_validators_key(latest_decided_set, key),
|
||||
selected_validators_key(latest_decided_set, *key),
|
||||
key_shares,
|
||||
);
|
||||
}
|
||||
|
||||
Core::<Storage::Config>::emit_event(Event::SetDecided { set: latest_decided_set });
|
||||
Core::<Storage::Config>::emit_event(Event::SetDecided {
|
||||
set: latest_decided_set,
|
||||
validators: selected_validators
|
||||
.into_iter()
|
||||
.map(|(key, key_shares)| (key.into(), key_shares))
|
||||
.collect(),
|
||||
});
|
||||
|
||||
true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user