diff --git a/parachain/modules/consensus/parachain/src/consensus.rs b/parachain/modules/consensus/parachain/src/consensus.rs index 730ab9c49..3bdc27fe6 100644 --- a/parachain/modules/consensus/parachain/src/consensus.rs +++ b/parachain/modules/consensus/parachain/src/consensus.rs @@ -126,6 +126,11 @@ where let id = codec::Decode::decode(&mut &key[(key.len() - 4)..]).map_err(|e| { Error::ImplementationSpecific(format!("Error decoding parachain header: {e}")) })?; + + if matches!(super::Parachains::::get(id), None) { + Err(Error::ImplementationSpecific(format!("Unknown parachain with Id({id})")))? + } + let header = header.ok_or_else(|| { Error::ImplementationSpecific(format!( "Cannot find parachain header for ParaId({id})", @@ -146,7 +151,7 @@ where Error::ImplementationSpecific(format!("Cannot slot: {e:?}")) })?; timestamp = Duration::from_millis(*slot * SLOT_DURATION).as_secs(); - } + }, DigestItem::Consensus(consensus_engine_id, value) if *consensus_engine_id == ISMP_ID => { @@ -157,9 +162,9 @@ where } overlay_root = H256::from_slice(&value); - } + }, // don't really care about the rest - _ => {} + _ => {}, }; } diff --git a/parachain/modules/consensus/parachain/src/lib.rs b/parachain/modules/consensus/parachain/src/lib.rs index f3a116d25..24b068ad0 100644 --- a/parachain/modules/consensus/parachain/src/lib.rs +++ b/parachain/modules/consensus/parachain/src/lib.rs @@ -205,6 +205,8 @@ pub mod pallet { } } +pub use pallet::*; + impl Pallet { /// Returns the list of parachains who's consensus updates will be inserted by the inherent /// data provider diff --git a/parachain/modules/consensus/sync-committee/src/lib.rs b/parachain/modules/consensus/sync-committee/src/lib.rs index 48a600979..7f31733e8 100644 --- a/parachain/modules/consensus/sync-committee/src/lib.rs +++ b/parachain/modules/consensus/sync-committee/src/lib.rs @@ -16,6 +16,7 @@ // Implementation of the ethereum beacon consensus client for ISMP // Ensure we're `no_std` when compiling for Wasm. #![cfg_attr(not(feature = "std"), no_std)] +#![allow(unused_variables)] extern crate alloc; diff --git a/parachain/modules/state-machine/src/lib.rs b/parachain/modules/state-machine/src/lib.rs index 53652baad..2f01e593d 100644 --- a/parachain/modules/state-machine/src/lib.rs +++ b/parachain/modules/state-machine/src/lib.rs @@ -105,7 +105,7 @@ where let request = Request::Post(post); let commitment = hash_request::>(&request); keys.push(pallet_ismp::RequestReceipts::::hashed_key_for(commitment)); - } + }, Request::Get(_) => continue, } } @@ -137,7 +137,7 @@ where Ok((key, value)) }) .collect::, _>>()? - } + }, HashAlgorithm::Blake2 => { let db = StorageProof::new(state_proof.storage_proof).into_memory_db::(); @@ -154,7 +154,7 @@ where Ok((key, value)) }) .collect::, _>>()? - } + }, }; Ok(data)