mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 02:21:03 +00:00
Add proxy and utility pallets. (#2774)
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Generated
+2
@@ -7132,6 +7132,7 @@ dependencies = [
|
|||||||
"pallet-im-online",
|
"pallet-im-online",
|
||||||
"pallet-indices",
|
"pallet-indices",
|
||||||
"pallet-offences",
|
"pallet-offences",
|
||||||
|
"pallet-proxy",
|
||||||
"pallet-session",
|
"pallet-session",
|
||||||
"pallet-staking",
|
"pallet-staking",
|
||||||
"pallet-staking-reward-curve",
|
"pallet-staking-reward-curve",
|
||||||
@@ -7139,6 +7140,7 @@ dependencies = [
|
|||||||
"pallet-timestamp",
|
"pallet-timestamp",
|
||||||
"pallet-transaction-payment",
|
"pallet-transaction-payment",
|
||||||
"pallet-transaction-payment-rpc-runtime-api",
|
"pallet-transaction-payment-rpc-runtime-api",
|
||||||
|
"pallet-utility",
|
||||||
"parity-scale-codec",
|
"parity-scale-codec",
|
||||||
"polkadot-parachain",
|
"polkadot-parachain",
|
||||||
"polkadot-primitives",
|
"polkadot-primitives",
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ frame-executive = { git = "https://github.com/paritytech/substrate", branch = "m
|
|||||||
pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||||
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||||
pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||||
|
pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||||
|
pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||||
authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||||
|
|
||||||
frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
use pallet_transaction_payment::CurrencyAdapter;
|
use pallet_transaction_payment::CurrencyAdapter;
|
||||||
use sp_std::prelude::*;
|
use sp_std::prelude::*;
|
||||||
use sp_std::collections::btree_map::BTreeMap;
|
use sp_std::collections::btree_map::BTreeMap;
|
||||||
use parity_scale_codec::Encode;
|
use parity_scale_codec::{Encode, Decode};
|
||||||
use primitives::v1::{
|
use primitives::v1::{
|
||||||
AccountId, AccountIndex, Balance, BlockNumber, Hash, Nonce, Signature, Moment,
|
AccountId, AccountIndex, Balance, BlockNumber, Hash, Nonce, Signature, Moment,
|
||||||
GroupRotationInfo, CoreState, Id, ValidationCode, CandidateEvent,
|
GroupRotationInfo, CoreState, Id, ValidationCode, CandidateEvent,
|
||||||
@@ -38,11 +38,7 @@ use runtime_parachains::{
|
|||||||
self,
|
self,
|
||||||
runtime_api_impl::v1 as runtime_api_impl,
|
runtime_api_impl::v1 as runtime_api_impl,
|
||||||
};
|
};
|
||||||
use frame_support::{
|
use frame_support::{construct_runtime, parameter_types, traits::{Filter, KeyOwnerProofSystem, Randomness}, weights::Weight};
|
||||||
construct_runtime, parameter_types,
|
|
||||||
traits::{Filter, KeyOwnerProofSystem, Randomness},
|
|
||||||
weights::Weight,
|
|
||||||
};
|
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
create_runtime_str, generic, impl_opaque_keys,
|
create_runtime_str, generic, impl_opaque_keys,
|
||||||
ApplyExtrinsicResult, KeyTypeId, Perbill, ModuleId,
|
ApplyExtrinsicResult, KeyTypeId, Perbill, ModuleId,
|
||||||
@@ -59,7 +55,7 @@ use sp_version::NativeVersion;
|
|||||||
use sp_version::RuntimeVersion;
|
use sp_version::RuntimeVersion;
|
||||||
use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo};
|
use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo};
|
||||||
use pallet_grandpa::{AuthorityId as GrandpaId, fg_primitives};
|
use pallet_grandpa::{AuthorityId as GrandpaId, fg_primitives};
|
||||||
use sp_core::OpaqueMetadata;
|
use sp_core::{OpaqueMetadata, RuntimeDebug};
|
||||||
use sp_staking::SessionIndex;
|
use sp_staking::SessionIndex;
|
||||||
use pallet_session::historical as session_historical;
|
use pallet_session::historical as session_historical;
|
||||||
use frame_system::EnsureRoot;
|
use frame_system::EnsureRoot;
|
||||||
@@ -89,6 +85,7 @@ use xcm_builder::{
|
|||||||
SignedAccountId32AsNative, ChildSystemParachainAsSuperuser, LocationInverter,
|
SignedAccountId32AsNative, ChildSystemParachainAsSuperuser, LocationInverter,
|
||||||
};
|
};
|
||||||
use constants::{time::*, currency::*, fee::*};
|
use constants::{time::*, currency::*, fee::*};
|
||||||
|
use frame_support::traits::InstanceFilter;
|
||||||
|
|
||||||
/// Constant values used within the runtime.
|
/// Constant values used within the runtime.
|
||||||
pub mod constants;
|
pub mod constants;
|
||||||
@@ -103,7 +100,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
|||||||
spec_name: create_runtime_str!("rococo"),
|
spec_name: create_runtime_str!("rococo"),
|
||||||
impl_name: create_runtime_str!("parity-rococo-v1-1"),
|
impl_name: create_runtime_str!("parity-rococo-v1-1"),
|
||||||
authoring_version: 0,
|
authoring_version: 0,
|
||||||
spec_version: 215,
|
spec_version: 227,
|
||||||
impl_version: 0,
|
impl_version: 0,
|
||||||
#[cfg(not(feature = "disable-runtime-api"))]
|
#[cfg(not(feature = "disable-runtime-api"))]
|
||||||
apis: RUNTIME_API_VERSIONS,
|
apis: RUNTIME_API_VERSIONS,
|
||||||
@@ -220,6 +217,9 @@ construct_runtime! {
|
|||||||
|
|
||||||
// Validator Manager pallet.
|
// Validator Manager pallet.
|
||||||
ValidatorManager: validator_manager::{Pallet, Call, Storage, Event<T>},
|
ValidatorManager: validator_manager::{Pallet, Call, Storage, Event<T>},
|
||||||
|
|
||||||
|
Utility: pallet_utility::{Pallet, Call, Event} = 90,
|
||||||
|
Proxy: pallet_proxy::{Pallet, Call, Storage, Event<T>} = 91,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -690,6 +690,62 @@ impl validator_manager::Config for Runtime {
|
|||||||
type PrivilegedOrigin = EnsureRoot<AccountId>;
|
type PrivilegedOrigin = EnsureRoot<AccountId>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl pallet_utility::Config for Runtime {
|
||||||
|
type Event = Event;
|
||||||
|
type Call = Call;
|
||||||
|
type WeightInfo = ();
|
||||||
|
}
|
||||||
|
|
||||||
|
parameter_types! {
|
||||||
|
// One storage item; key size 32, value size 8; .
|
||||||
|
pub const ProxyDepositBase: Balance = 10;
|
||||||
|
// Additional storage item size of 33 bytes.
|
||||||
|
pub const ProxyDepositFactor: Balance = 10;
|
||||||
|
pub const MaxProxies: u16 = 32;
|
||||||
|
pub const AnnouncementDepositBase: Balance = 10;
|
||||||
|
pub const AnnouncementDepositFactor: Balance = 10;
|
||||||
|
pub const MaxPending: u16 = 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The type used to represent the kinds of proxying allowed.
|
||||||
|
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug)]
|
||||||
|
pub enum ProxyType {
|
||||||
|
Any,
|
||||||
|
CancelProxy,
|
||||||
|
}
|
||||||
|
impl Default for ProxyType { fn default() -> Self { Self::Any } }
|
||||||
|
impl InstanceFilter<Call> for ProxyType {
|
||||||
|
fn filter(&self, c: &Call) -> bool {
|
||||||
|
match self {
|
||||||
|
ProxyType::Any => true,
|
||||||
|
ProxyType::CancelProxy => matches!(c,
|
||||||
|
Call::Proxy(pallet_proxy::Call::reject_announcement(..))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fn is_superset(&self, o: &Self) -> bool {
|
||||||
|
match (self, o) {
|
||||||
|
(ProxyType::Any, _) => true,
|
||||||
|
_ => false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl pallet_proxy::Config for Runtime {
|
||||||
|
type Event = Event;
|
||||||
|
type Call = Call;
|
||||||
|
type Currency = Balances;
|
||||||
|
type ProxyType = ProxyType;
|
||||||
|
type ProxyDepositBase = ProxyDepositBase;
|
||||||
|
type ProxyDepositFactor = ProxyDepositFactor;
|
||||||
|
type MaxProxies = MaxProxies;
|
||||||
|
type WeightInfo = ();
|
||||||
|
type MaxPending = MaxPending;
|
||||||
|
type CallHasher = BlakeTwo256;
|
||||||
|
type AnnouncementDepositBase = AnnouncementDepositBase;
|
||||||
|
type AnnouncementDepositFactor = AnnouncementDepositFactor;
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "disable-runtime-api"))]
|
#[cfg(not(feature = "disable-runtime-api"))]
|
||||||
sp_api::impl_runtime_apis! {
|
sp_api::impl_runtime_apis! {
|
||||||
impl sp_api::Core<Block> for Runtime {
|
impl sp_api::Core<Block> for Runtime {
|
||||||
|
|||||||
Reference in New Issue
Block a user