Move inherents to primitives (#4126)

* Split Aura and Timestamp inherents out of paint

* fixup node depedencies

* move babe inherents to primitives

* move authorship inherents into primitives

* Move finalty tracker inherents into primitives

* fix aura primitives import
This commit is contained in:
Benjamin Kampmann
2019-11-20 12:18:36 +01:00
committed by GitHub
parent 5979a8c3e5
commit 303843f483
38 changed files with 654 additions and 404 deletions
+1 -1
View File
@@ -11,10 +11,10 @@ primitives = { package = "substrate-primitives", path = "../../../primitives/cor
sr-primitives = { path = "../../../primitives/sr-primitives" }
client-api = { package = "substrate-client-api", path = "../../api" }
block-builder-api = { package = "substrate-block-builder-runtime-api", path = "../../../primitives/block-builder/runtime-api" }
paint-timestamp = { path = "../../../paint/timestamp" }
inherents = { package = "substrate-inherents", path = "../../../primitives/inherents" }
pow-primitives = { package = "substrate-consensus-pow-primitives", path = "../../../primitives/consensus/pow" }
consensus-common = { package = "substrate-consensus-common", path = "../../../primitives/consensus/common" }
log = "0.4.8"
futures-preview = { version = "0.3.0-alpha.19", features = ["compat"] }
sp-timestamp = { path = "../../../primitives/timestamp" }
derive_more = "0.15.0"
+3 -3
View File
@@ -40,7 +40,7 @@ use block_builder_api::BlockBuilder as BlockBuilderApi;
use sr_primitives::{Justification, RuntimeString};
use sr_primitives::generic::{BlockId, Digest, DigestItem};
use sr_primitives::traits::{Block as BlockT, Header as HeaderT, ProvideRuntimeApi};
use paint_timestamp::{TimestampInherentData, InherentError as TIError};
use sp_timestamp::{TimestampInherentData, InherentError as TIError};
use pow_primitives::{Seal, TotalDifficulty, POW_ENGINE_ID};
use primitives::H256;
use inherents::{InherentDataProviders, InherentData};
@@ -316,9 +316,9 @@ impl<B: BlockT<Hash=H256>, C, S, Algorithm> Verifier<B> for PowVerifier<B, C, S,
pub fn register_pow_inherent_data_provider(
inherent_data_providers: &InherentDataProviders,
) -> Result<(), consensus_common::Error> {
if !inherent_data_providers.has_provider(&paint_timestamp::INHERENT_IDENTIFIER) {
if !inherent_data_providers.has_provider(&sp_timestamp::INHERENT_IDENTIFIER) {
inherent_data_providers
.register_provider(paint_timestamp::InherentDataProvider)
.register_provider(sp_timestamp::InherentDataProvider)
.map_err(Into::into)
.map_err(consensus_common::Error::InherentData)
} else {