From af643f51cc3403fe170da68d92bebde40e244068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Castro-Castilla?= Date: Mon, 22 Mar 2021 17:17:06 +0200 Subject: [PATCH] Add Utility pallet (#323) --- parachain/Cargo.lock | 3 +++ parachain/runtime/local/Cargo.toml | 2 ++ parachain/runtime/local/src/lib.rs | 7 +++++++ parachain/runtime/rococo/Cargo.toml | 2 ++ parachain/runtime/rococo/src/lib.rs | 7 +++++++ parachain/runtime/snowbridge/Cargo.toml | 2 ++ parachain/runtime/snowbridge/src/lib.rs | 7 +++++++ 7 files changed, 30 insertions(+) diff --git a/parachain/Cargo.lock b/parachain/Cargo.lock index a98c364d18d9e..18d2deb9a30c6 100644 --- a/parachain/Cargo.lock +++ b/parachain/Cargo.lock @@ -3881,6 +3881,7 @@ dependencies = [ "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", + "pallet-utility", "pallet-verifier-lightclient", "parachain-info", "parity-scale-codec", @@ -6950,6 +6951,7 @@ dependencies = [ "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", + "pallet-utility", "pallet-verifier-lightclient", "parachain-info", "parity-scale-codec", @@ -8508,6 +8510,7 @@ dependencies = [ "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", + "pallet-utility", "pallet-verifier-lightclient", "parachain-info", "parity-scale-codec", diff --git a/parachain/runtime/local/Cargo.toml b/parachain/runtime/local/Cargo.toml index 892510a898997..d97b91fb22dd2 100644 --- a/parachain/runtime/local/Cargo.toml +++ b/parachain/runtime/local/Cargo.toml @@ -21,6 +21,7 @@ frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate. pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } @@ -76,6 +77,7 @@ std = [ "pallet-balances/std", "pallet-randomness-collective-flip/std", "pallet-timestamp/std", + "pallet-utility/std", "pallet-transaction-payment/std", "pallet-transaction-payment-rpc-runtime-api/std", "sp-api/std", diff --git a/parachain/runtime/local/src/lib.rs b/parachain/runtime/local/src/lib.rs index 7afe113ac1db1..4e586b3ef5086 100644 --- a/parachain/runtime/local/src/lib.rs +++ b/parachain/runtime/local/src/lib.rs @@ -211,6 +211,12 @@ impl pallet_timestamp::Config for Runtime { type WeightInfo = (); } +impl pallet_utility::Config for Runtime { + type Event = Event; + type Call = Call; + type WeightInfo = (); +} + parameter_types! { pub const ExistentialDeposit: u128 = 500; pub const MaxLocks: u32 = 50; @@ -509,6 +515,7 @@ construct_runtime!( LocalXcmHandler: cumulus_pallet_xcm_handler::{Module, Event, Origin} = 18, Transfer: artemis_transfer::{Module, Call, Event} = 19, + Utility: pallet_utility::{Module, Call, Event, Storage} = 20, ETH: eth_app::{Module, Call, Config, Storage, Event} = 12, ERC20: erc20_app::{Module, Call, Config, Storage, Event} = 13, diff --git a/parachain/runtime/rococo/Cargo.toml b/parachain/runtime/rococo/Cargo.toml index 6ba251349352e..92b1f91b8fb06 100644 --- a/parachain/runtime/rococo/Cargo.toml +++ b/parachain/runtime/rococo/Cargo.toml @@ -21,6 +21,7 @@ frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate. pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } @@ -76,6 +77,7 @@ std = [ "pallet-balances/std", "pallet-randomness-collective-flip/std", "pallet-timestamp/std", + "pallet-utility/std", "pallet-transaction-payment/std", "pallet-transaction-payment-rpc-runtime-api/std", "sp-api/std", diff --git a/parachain/runtime/rococo/src/lib.rs b/parachain/runtime/rococo/src/lib.rs index f460eb659fb10..f48d7b9be2ee4 100644 --- a/parachain/runtime/rococo/src/lib.rs +++ b/parachain/runtime/rococo/src/lib.rs @@ -213,6 +213,12 @@ impl pallet_timestamp::Config for Runtime { type WeightInfo = weights::pallet_timestamp_weights::WeightInfo; } +impl pallet_utility::Config for Runtime { + type Event = Event; + type Call = Call; + type WeightInfo = (); +} + parameter_types! { pub const ExistentialDeposit: u128 = 500; pub const MaxLocks: u32 = 50; @@ -511,6 +517,7 @@ construct_runtime!( LocalXcmHandler: cumulus_pallet_xcm_handler::{Module, Event, Origin} = 18, Transfer: artemis_transfer::{Module, Call, Event} = 19, + Utility: pallet_utility::{Module, Call, Event, Storage} = 20, ETH: eth_app::{Module, Call, Config, Storage, Event} = 12, ERC20: erc20_app::{Module, Call, Config, Storage, Event} = 13, diff --git a/parachain/runtime/snowbridge/Cargo.toml b/parachain/runtime/snowbridge/Cargo.toml index 5971eb85321c2..71e74b08ca49c 100644 --- a/parachain/runtime/snowbridge/Cargo.toml +++ b/parachain/runtime/snowbridge/Cargo.toml @@ -21,6 +21,7 @@ frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate. pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1", default-features = false } @@ -76,6 +77,7 @@ std = [ "pallet-balances/std", "pallet-randomness-collective-flip/std", "pallet-timestamp/std", + "pallet-utility/std", "pallet-transaction-payment/std", "pallet-transaction-payment-rpc-runtime-api/std", "sp-api/std", diff --git a/parachain/runtime/snowbridge/src/lib.rs b/parachain/runtime/snowbridge/src/lib.rs index c253cd67a4cdc..706c6d581f389 100644 --- a/parachain/runtime/snowbridge/src/lib.rs +++ b/parachain/runtime/snowbridge/src/lib.rs @@ -213,6 +213,12 @@ impl pallet_timestamp::Config for Runtime { type WeightInfo = weights::pallet_timestamp_weights::WeightInfo; } +impl pallet_utility::Config for Runtime { + type Event = Event; + type Call = Call; + type WeightInfo = (); +} + parameter_types! { pub const ExistentialDeposit: u128 = 500; pub const MaxLocks: u32 = 50; @@ -511,6 +517,7 @@ construct_runtime!( LocalXcmHandler: cumulus_pallet_xcm_handler::{Module, Event, Origin} = 18, Transfer: artemis_transfer::{Module, Call, Event} = 19, + Utility: pallet_utility::{Module, Call, Event, Storage} = 20, ETH: eth_app::{Module, Call, Config, Storage, Event} = 12, ERC20: erc20_app::{Module, Call, Config, Storage, Event} = 13,