mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 16:21:02 +00:00
Kill the light client, CHTs and change tries. (#10080)
* Remove light client, change tries and CHTs * Update tests * fmt * Restore changes_root * Fixed benches * Cargo fmt * fmt * fmt
This commit is contained in:
@@ -21,7 +21,7 @@ use super::Error;
|
||||
|
||||
use sc_consensus::BlockImportParams;
|
||||
use sp_inherents::InherentData;
|
||||
use sp_runtime::traits::{Block as BlockT, DigestFor};
|
||||
use sp_runtime::{traits::Block as BlockT, Digest};
|
||||
|
||||
pub mod babe;
|
||||
|
||||
@@ -32,11 +32,7 @@ pub trait ConsensusDataProvider<B: BlockT>: Send + Sync {
|
||||
type Transaction;
|
||||
|
||||
/// Attempt to create a consensus digest.
|
||||
fn create_digest(
|
||||
&self,
|
||||
parent: &B::Header,
|
||||
inherents: &InherentData,
|
||||
) -> Result<DigestFor<B>, Error>;
|
||||
fn create_digest(&self, parent: &B::Header, inherents: &InherentData) -> Result<Digest, Error>;
|
||||
|
||||
/// set up the neccessary import params.
|
||||
fn append_block_import(
|
||||
|
||||
@@ -49,7 +49,8 @@ use sp_consensus_slots::Slot;
|
||||
use sp_inherents::{InherentData, InherentDataProvider, InherentIdentifier};
|
||||
use sp_runtime::{
|
||||
generic::{BlockId, Digest},
|
||||
traits::{Block as BlockT, DigestFor, DigestItemFor, Header, Zero},
|
||||
traits::{Block as BlockT, Header, Zero},
|
||||
DigestItem,
|
||||
};
|
||||
use sp_timestamp::{InherentType, TimestampInherentData, INHERENT_IDENTIFIER};
|
||||
|
||||
@@ -193,11 +194,7 @@ where
|
||||
{
|
||||
type Transaction = TransactionFor<C, B>;
|
||||
|
||||
fn create_digest(
|
||||
&self,
|
||||
parent: &B::Header,
|
||||
inherents: &InherentData,
|
||||
) -> Result<DigestFor<B>, Error> {
|
||||
fn create_digest(&self, parent: &B::Header, inherents: &InherentData) -> Result<Digest, Error> {
|
||||
let slot = inherents
|
||||
.babe_inherent_data()?
|
||||
.ok_or_else(|| Error::StringError("No babe inherent data".into()))?;
|
||||
@@ -207,7 +204,7 @@ where
|
||||
let logs = if let Some((predigest, _)) =
|
||||
authorship::claim_slot(slot, &epoch, &self.keystore)
|
||||
{
|
||||
vec![<DigestItemFor<B> as CompatibleDigestItem>::babe_pre_digest(predigest)]
|
||||
vec![<DigestItem as CompatibleDigestItem>::babe_pre_digest(predigest)]
|
||||
} else {
|
||||
// well we couldn't claim a slot because this is an existing chain and we're not in the
|
||||
// authorities. we need to tell BabeBlockImport that the epoch has changed, and we put
|
||||
@@ -244,13 +241,13 @@ where
|
||||
});
|
||||
|
||||
vec![
|
||||
DigestItemFor::<B>::PreRuntime(BABE_ENGINE_ID, predigest.encode()),
|
||||
DigestItemFor::<B>::Consensus(BABE_ENGINE_ID, next_epoch.encode()),
|
||||
DigestItem::PreRuntime(BABE_ENGINE_ID, predigest.encode()),
|
||||
DigestItem::Consensus(BABE_ENGINE_ID, next_epoch.encode()),
|
||||
]
|
||||
},
|
||||
ViableEpochDescriptor::UnimportedGenesis(_) => {
|
||||
// since this is the genesis, secondary predigest works for now.
|
||||
vec![DigestItemFor::<B>::PreRuntime(BABE_ENGINE_ID, predigest.encode())]
|
||||
vec![DigestItem::PreRuntime(BABE_ENGINE_ID, predigest.encode())]
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user