mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 15:57:55 +00:00
Split PrimaryPreDigest and SecondaryPreDigest (#5373)
* Split PrimaryPreDigest and SecondaryPreDigest * Update client/consensus/babe/src/lib.rs Co-Authored-By: André Silva <andre.beat@gmail.com> * Update primitives/consensus/babe/src/digests.rs Co-Authored-By: André Silva <andre.beat@gmail.com> * Update primitives/consensus/babe/src/digests.rs Co-Authored-By: André Silva <andre.beat@gmail.com> * Update primitives/consensus/babe/src/digests.rs Co-Authored-By: André Silva <andre.beat@gmail.com> Co-authored-by: André Silva <andre.beat@gmail.com>
This commit is contained in:
@@ -209,12 +209,7 @@ impl<T: Trait> FindAuthor<u32> for Module<T> {
|
||||
for (id, mut data) in digests.into_iter() {
|
||||
if id == BABE_ENGINE_ID {
|
||||
let pre_digest: RawPreDigest = RawPreDigest::decode(&mut data).ok()?;
|
||||
return Some(match pre_digest {
|
||||
RawPreDigest::Primary { authority_index, .. } =>
|
||||
authority_index,
|
||||
RawPreDigest::Secondary { authority_index, .. } =>
|
||||
authority_index,
|
||||
});
|
||||
return Some(pre_digest.authority_index())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,11 +421,11 @@ impl<T: Trait> Module<T> {
|
||||
|
||||
CurrentSlot::put(digest.slot_number());
|
||||
|
||||
if let RawPreDigest::Primary { vrf_output, .. } = digest {
|
||||
if let RawPreDigest::Primary(primary) = digest {
|
||||
// place the VRF output into the `Initialized` storage item
|
||||
// and it'll be put onto the under-construction randomness
|
||||
// later, once we've decided which epoch this block is in.
|
||||
Some(vrf_output)
|
||||
Some(primary.vrf_output)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user