Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshOrndorff committed Dec 6, 2021
1 parent 7a9df35 commit f24c4d9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions nimbus-consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use tracing::error;
use sp_keystore::{SyncCryptoStorePtr, SyncCryptoStore};
use sp_core::crypto::Public;
use sp_std::convert::TryInto;
use nimbus_primitives::{AuthorFilterAPI, NimbusApi, NIMBUS_KEY_ID, NimbusId};
use nimbus_primitives::{AuthorFilterAPI, NimbusApi, NIMBUS_KEY_ID, NimbusId, digests::CompatibleDigestItem};
mod import_queue;

const LOG_TARGET: &str = "filtering-consensus";
Expand Down Expand Up @@ -315,7 +315,7 @@ where
.clone()
.try_into().ok()?;

let sig_digest = <sp_runtime::traits::DigestItemFor<B> as nimbus_primitives::digests::CompatibleDigestItem>::nimbus_seal(signature);
let sig_digest = <sp_runtime::DigestItem as CompatibleDigestItem>::nimbus_seal(signature);

let mut block_import_params = BlockImportParams::new(BlockOrigin::Own, header.clone());
block_import_params.post_digests.push(sig_digest.clone());
Expand Down
7 changes: 2 additions & 5 deletions nimbus-primitives/src/digests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@

use crate::{NIMBUS_ENGINE_ID, NimbusSignature, NimbusId};
use sp_runtime::generic::DigestItem;
use parity_scale_codec::{Encode, Codec};
use sp_std::fmt::Debug;
use parity_scale_codec::Encode;

/// A digest item which is usable with aura consensus.
pub trait CompatibleDigestItem: Sized {
Expand All @@ -43,9 +42,7 @@ pub trait CompatibleDigestItem: Sized {
fn as_nimbus_consensus_digest(&self) -> Option<NimbusId>;
}

impl<Hash> CompatibleDigestItem for DigestItem<Hash> where
Hash: Debug + Send + Sync + Eq + Clone + Codec + 'static
{
impl CompatibleDigestItem for DigestItem {
fn nimbus_seal(signature: NimbusSignature) -> Self {
DigestItem::Seal(NIMBUS_ENGINE_ID, signature.encode())
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/author-inherent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub mod pallet {
Author::<T>::put(&account);

// Add a consensus digest so the client-side worker can verify the block is signed by the right person.
frame_system::Pallet::<T>::deposit_log(DigestItem::<T::Hash>::Consensus(
frame_system::Pallet::<T>::deposit_log(DigestItem::Consensus(
NIMBUS_ENGINE_ID,
author.encode(),
));
Expand Down

0 comments on commit f24c4d9

Please sign in to comment.