mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 15:11:02 +00:00
Refactor primitives (#1383)
* create a v1 primitives module * Improve guide on availability types * punctuate * new parachains runtime uses new primitives * tests of new runtime now use new primitives * add ErasureChunk to guide * export erasure chunk from v1 primitives * subsystem crate uses v1 primitives * node-primitives uses new v1 primitives * port overseer to new primitives * new-proposer uses v1 primitives (no ParachainHost anymore) * fix no-std compilation for primitives * service-new uses v1 primitives * network-bridge uses new primitives * statement distribution uses v1 primitives * PoV distribution uses v1 primitives; add PoV::hash fn * move parachain to v0 * remove inclusion_inherent module and place into v1 * remove everything from primitives crate root * remove some unused old types from v0 primitives * point everything else at primitives::v0 * squanch some warns up * add RuntimeDebug import to no-std as well * port over statement-table and validation * fix final errors in validation and node-primitives * add dummy Ord impl to committed candidate receipt * guide: update CandidateValidationMessage * add primitive for validationoutputs * expand CandidateValidationMessage further * bikeshed * add some impls to omitted-validation-data and available-data * expand CandidateValidationMessage * make erasure-coding generic over v1/v0 * update usages of erasure-coding * implement commitments.hash() * use Arc<Pov> for CandidateValidation * improve new erasure-coding method names * fix up candidate backing * update docs a bit * fix most tests and add short-circuiting to make_pov_available * fix remainder of candidate backing tests * squanching warns * squanch it up * some fallout * overseer fallout * free from polkadot-test-service hell
This commit is contained in:
committed by
GitHub
parent
6957847b6b
commit
3b13cd9a85
@@ -16,7 +16,7 @@
|
||||
|
||||
/// Money matters.
|
||||
pub mod currency {
|
||||
use primitives::Balance;
|
||||
use primitives::v0::Balance;
|
||||
|
||||
pub const DOTS: Balance = 1_000_000_000_000;
|
||||
pub const DOLLARS: Balance = DOTS / 6;
|
||||
@@ -30,7 +30,7 @@ pub mod currency {
|
||||
|
||||
/// Time and blocks.
|
||||
pub mod time {
|
||||
use primitives::{Moment, BlockNumber};
|
||||
use primitives::v0::{Moment, BlockNumber};
|
||||
// Kusama & mainnet
|
||||
pub const MILLISECS_PER_BLOCK: Moment = 6000;
|
||||
// Testnet
|
||||
@@ -55,7 +55,7 @@ pub mod time {
|
||||
/// Fee-related.
|
||||
pub mod fee {
|
||||
pub use sp_runtime::Perbill;
|
||||
use primitives::Balance;
|
||||
use primitives::v0::Balance;
|
||||
use runtime_common::ExtrinsicBaseWeight;
|
||||
use frame_support::weights::{
|
||||
WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients,
|
||||
|
||||
@@ -23,9 +23,10 @@
|
||||
use sp_std::prelude::*;
|
||||
use sp_core::u32_trait::{_1, _2, _3, _4, _5};
|
||||
use codec::{Encode, Decode};
|
||||
use primitives::{
|
||||
use primitives::v0::{
|
||||
self as parachain,
|
||||
AccountId, AccountIndex, Balance, BlockNumber, Hash, Nonce, Signature, Moment,
|
||||
parachain::{self, ActiveParas, AbridgedCandidateReceipt, SigningContext},
|
||||
ActiveParas, AbridgedCandidateReceipt, SigningContext,
|
||||
};
|
||||
use runtime_common::{
|
||||
attestations, claims, parachains, registrar, slots, SlowAdjustingFeeUpdate,
|
||||
@@ -560,7 +561,7 @@ impl grandpa::Trait for Runtime {
|
||||
|
||||
type HandleEquivocation = grandpa::EquivocationHandler<
|
||||
Self::KeyOwnerIdentification,
|
||||
primitives::fisherman::FishermanAppCrypto,
|
||||
primitives::v0::fisherman::FishermanAppCrypto,
|
||||
Runtime,
|
||||
Offences,
|
||||
>;
|
||||
@@ -596,7 +597,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl parachains::Trait for Runtime {
|
||||
type AuthorityId = primitives::fisherman::FishermanAppCrypto;
|
||||
type AuthorityId = primitives::v0::fisherman::FishermanAppCrypto;
|
||||
type Origin = Origin;
|
||||
type Call = Call;
|
||||
type ParachainCurrency = Balances;
|
||||
@@ -939,7 +940,7 @@ impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
|
||||
construct_runtime! {
|
||||
pub enum Runtime where
|
||||
Block = Block,
|
||||
NodeBlock = primitives::Block,
|
||||
NodeBlock = primitives::v0::Block,
|
||||
UncheckedExtrinsic = UncheckedExtrinsic
|
||||
{
|
||||
// Basic stuff; balances is uncallable initially.
|
||||
@@ -1147,7 +1148,7 @@ sp_api::impl_runtime_apis! {
|
||||
fn signing_context() -> SigningContext {
|
||||
Parachains::signing_context()
|
||||
}
|
||||
fn downward_messages(id: parachain::Id) -> Vec<primitives::DownwardMessage> {
|
||||
fn downward_messages(id: parachain::Id) -> Vec<primitives::v0::DownwardMessage> {
|
||||
Parachains::downward_messages(id)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user