difftreelog
Add RuntimeInstance trait
in: master
5 files changed
runtime/common/Cargo.tomldiffbeforeafterboth16 'codec/std',16 'codec/std',17 'frame-support/std',17 'frame-support/std',18 'frame-system/std',18 'frame-system/std',19 'sp-consensus-aura/std',20 'pallet-common/std',21 'fp-rpc/std',19]22]20runtime-benchmarks = [23runtime-benchmarks = [21 'sp-runtime/runtime-benchmarks',24 'sp-runtime/runtime-benchmarks',54git = 'https://github.com/paritytech/substrate.git'57git = 'https://github.com/paritytech/substrate.git'55branch = 'polkadot-v0.9.17'58branch = 'polkadot-v0.9.17'5960[dependencies.pallet-common]61default-features = false62path = "../../pallets/common"6364[dependencies.sp-consensus-aura]65default-features = false66git = 'https://github.com/paritytech/substrate.git'67branch = 'polkadot-v0.9.17'6869[dependencies.fp-rpc]70default-features = false71git = "https://github.com/uniquenetwork/frontier.git"72branch = "unique-polkadot-v0.9.17"5673runtime/common/src/types.rsdiffbeforeafterboth39/// Digest item type.39/// Digest item type.40pub type DigestItem = generic::DigestItem;40pub type DigestItem = generic::DigestItem;4142pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;4344pub trait RuntimeInstance {45 type CrossAccountId: pallet_common::account::CrossAccountId<sp_runtime::AccountId32>46 + Send + Sync + 'static;4748 type TransactionConverter: fp_rpc::ConvertTransaction<UncheckedExtrinsic>49 + Send + Sync + 'static;5051 fn get_transaction_converter() -> Self::TransactionConverter;52}4153runtime/opal/src/lib.rsdiffbeforeafterboth116116117pub const RUNTIME_NAME: &str = "Opal";117pub const RUNTIME_NAME: &str = "Opal";118118119pub type CrossAccountId = pallet_common::account::BasicCrossAccountId<Runtime>;119type CrossAccountId = pallet_common::account::BasicCrossAccountId<Runtime>;120121impl RuntimeInstance for Runtime {122 type CrossAccountId = self::CrossAccountId;123124 type TransactionConverter = self::TransactionConverter;125126 fn get_transaction_converter() -> TransactionConverter {127 TransactionConverter128 }129}120130121/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know131/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know122/// the specifics of the runtime. They can then be made to be agnostic over specific formats132/// the specifics of the runtime. They can then be made to be agnostic over specific formats128 use super::Aura;138 use super::Aura;129139130 pub use unique_runtime_common::types::*;140 pub use unique_runtime_common::types::*;131 pub use super::CrossAccountId;132141133 impl_opaque_keys! {142 impl_opaque_keys! {134 pub struct SessionKeys {143 pub struct SessionKeys {runtime/quartz/src/lib.rsdiffbeforeafterboth116116117pub const RUNTIME_NAME: &str = "Quartz";117pub const RUNTIME_NAME: &str = "Quartz";118118119pub type CrossAccountId = pallet_common::account::BasicCrossAccountId<Runtime>;119type CrossAccountId = pallet_common::account::BasicCrossAccountId<Runtime>;120121impl RuntimeInstance for Runtime {122 type CrossAccountId = self::CrossAccountId;123124 type TransactionConverter = self::TransactionConverter;125126 fn get_transaction_converter() -> TransactionConverter {127 TransactionConverter128 }129}120130121/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know131/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know122/// the specifics of the runtime. They can then be made to be agnostic over specific formats132/// the specifics of the runtime. They can then be made to be agnostic over specific formats128 use super::Aura;138 use super::Aura;129139130 pub use unique_runtime_common::types::*;140 pub use unique_runtime_common::types::*;131 pub use super::CrossAccountId;132141133 impl_opaque_keys! {142 impl_opaque_keys! {134 pub struct SessionKeys {143 pub struct SessionKeys {runtime/unique/src/lib.rsdiffbeforeafterboth85};85};868687// pub use pallet_timestamp::Call as TimestampCall;87// pub use pallet_timestamp::Call as TimestampCall;88pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;898890// Polkadot imports89// Polkadot imports91use pallet_xcm::XcmPassthrough;90use pallet_xcm::XcmPassthrough;116115117pub const RUNTIME_NAME: &str = "Unique";116pub const RUNTIME_NAME: &str = "Unique";118117119pub type CrossAccountId = pallet_common::account::BasicCrossAccountId<Runtime>;118type CrossAccountId = pallet_common::account::BasicCrossAccountId<Runtime>;119120impl RuntimeInstance for Runtime {121 type CrossAccountId = self::CrossAccountId;122123 type TransactionConverter = self::TransactionConverter;124125 fn get_transaction_converter() -> TransactionConverter {126 TransactionConverter127 }128}120129121/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know130/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know122/// the specifics of the runtime. They can then be made to be agnostic over specific formats131/// the specifics of the runtime. They can then be made to be agnostic over specific formats128 use super::Aura;137 use super::Aura;129138130 pub use unique_runtime_common::types::*;139 pub use unique_runtime_common::types::*;131 pub use super::CrossAccountId;132140133 impl_opaque_keys! {141 impl_opaque_keys! {134 pub struct SessionKeys {142 pub struct SessionKeys {207 .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)215 .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)208 .build_or_panic();216 .build_or_panic();209 pub const Version: RuntimeVersion = VERSION;217 pub const Version: RuntimeVersion = VERSION;210 pub const SS58Prefix: u8 = 7391;218 pub const SS58Prefix: u16 = 7391;211}219}212220213parameter_types! {221parameter_types! {