Add Transaction Fee RPC to Statemint/Statemine (#559)

* add payment rpc to parachains

* connect payment rpc to parachains clients

* fix the rumtime_api bound/ add separate start node implementation for shell

* use cumulus/parachain specific primitives

* Update polkadot-parachains/src/rpc.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* rename txpool dependency

* fix the package name

* move parachain primitives to separate module

* Refactor Shared Primitves for Payment Info (#577)

* rename to parachains-common

* refactor shared opaque

* remove primitives

* Update service.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
hamidra
2021-08-17 09:55:56 -07:00
committed by GitHub
parent 2a519e01cb
commit 0436b76f93
18 changed files with 560 additions and 261 deletions
@@ -62,7 +62,7 @@ cumulus-pallet-xcm = { path = "../../pallets/xcm", default-features = false }
cumulus-pallet-session-benchmarking = {path = "../../pallets/session-benchmarking", default-features = false, version = "3.0.0"}
cumulus-ping = { path = "../pallets/ping", default-features = false }
pallet-collator-selection = { path = "../../pallets/collator-selection", default-features = false }
statemint-common = { path = "../statemint-common", default-features = false }
parachains-common = { path = "../parachains-common", default-features = false }
# Polkadot dependencies
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
@@ -149,5 +149,5 @@ std = [
"xcm-executor/std",
"sp-consensus-aura/std",
"node-primitives/std",
"statemint-common/std",
"parachains-common/std",
]
+17 -32
View File
@@ -54,12 +54,13 @@ use frame_system::{
limits::{BlockLength, BlockWeights},
EnsureRoot,
};
use sp_runtime::Perbill;
pub use statemint_common as common;
use statemint_common::{
impls::DealWithFees, AccountId, AuraId, Balance, BlockNumber, Hash, Header, Index, Signature,
AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
pub use parachains_common as common;
use parachains_common::{
impls::DealWithFees, opaque, AccountId, AuraId, Balance, BlockNumber, Hash, Header, Index,
Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO,
SLOT_DURATION,
};
use sp_runtime::Perbill;
#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
@@ -78,23 +79,9 @@ use xcm_builder::{
};
use xcm_executor::{Config, XcmExecutor};
/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know
/// the specifics of the runtime. They can then be made to be agnostic over specific formats
/// of data like extrinsics, allowing for them to continue syncing the network through upgrades
/// to even the core data structures.
pub mod opaque {
use super::*;
pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic;
/// Opaque block type.
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type SessionHandlers = ();
impl_opaque_keys! {
pub struct SessionKeys {
pub aura: Aura,
}
impl_opaque_keys! {
pub struct SessionKeys {
pub aura: Aura,
}
}
@@ -233,7 +220,7 @@ impl pallet_sudo::Config for Runtime {
type Call = Call;
}
pub type AssetsForceOrigin = EnsureRoot<AccountId>;
pub type AssetsForceOrigin = EnsureRoot<AccountId>;
parameter_types! {
pub const AssetDeposit: Balance = 100 * UNITS; // 100 WND deposit to create asset
@@ -326,10 +313,9 @@ impl InstanceFilter<Call> for ProxyType {
fn filter(&self, c: &Call) -> bool {
match self {
ProxyType::Any => true,
ProxyType::NonTransfer => !matches!(
c,
Call::Balances(..) | Call::Assets(..) | Call::Uniques(..)
),
ProxyType::NonTransfer => {
!matches!(c, Call::Balances(..) | Call::Assets(..) | Call::Uniques(..))
}
ProxyType::CancelProxy => matches!(
c,
Call::Proxy(pallet_proxy::Call::reject_announcement(..))
@@ -583,9 +569,8 @@ impl pallet_session::Config for Runtime {
type NextSessionRotation = pallet_session::PeriodicSessions<Period, Offset>;
type SessionManager = CollatorSelection;
// Essentially just Aura, but lets be pedantic.
type SessionHandler =
<opaque::SessionKeys as sp_runtime::traits::OpaqueKeys>::KeyTypeIdProviders;
type Keys = opaque::SessionKeys;
type SessionHandler = <SessionKeys as sp_runtime::traits::OpaqueKeys>::KeyTypeIdProviders;
type Keys = SessionKeys;
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
type WeightInfo = weights::pallet_session::WeightInfo<Runtime>;
}
@@ -803,13 +788,13 @@ impl_runtime_apis! {
impl sp_session::SessionKeys<Block> for Runtime {
fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {
opaque::SessionKeys::generate(seed)
SessionKeys::generate(seed)
}
fn decode_session_keys(
encoded: Vec<u8>,
) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {
opaque::SessionKeys::decode_into_raw_public_keys(&encoded)
SessionKeys::decode_into_raw_public_keys(&encoded)
}
}