From 088a0b9e48c60c08962f33370ea7616a12b543c5 Mon Sep 17 00:00:00 2001 From: godlin Date: Thu, 1 Jun 2023 13:27:03 +0200 Subject: [PATCH] Recovery pallet added and configured --- Cargo.lock | 16 ++++++++++++++++ runtime/Cargo.toml | 3 +++ runtime/src/lib.rs | 21 +++++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index d64b8f2ff1..342209db83 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4600,6 +4600,7 @@ dependencies = [ "pallet-offences", "pallet-preimage", "pallet-randomness-collective-flip", + "pallet-recovery", "pallet-scheduler", "pallet-session", "pallet-staking", @@ -8209,6 +8210,21 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-recovery" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-scheduler" version = "4.0.0-dev" diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index d284e4f09d..591b88d959 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -136,6 +136,8 @@ pallet-transaction-payment = { git = "https://github.com/sora-xor/substrate.git" pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/sora-xor/substrate.git", branch = "polkadot-v0.9.38", default-features = false } pallet-utility = { git = "https://github.com/sora-xor/substrate.git", branch = "polkadot-v0.9.38", default-features = false } pallet-bags-list = { git = "https://github.com/sora-xor/substrate.git", branch = "polkadot-v0.9.38", default-features = false } +pallet-recovery = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.38", default-features = false } + sp-api = { git = "https://github.com/sora-xor/substrate.git", branch = "polkadot-v0.9.38", default-features = false } sp-block-builder = { git = "https://github.com/sora-xor/substrate.git", branch = "polkadot-v0.9.38", default-features = false } @@ -249,6 +251,7 @@ std = [ "pallet-offences/std", "pallet-preimage/std", "pallet-randomness-collective-flip/std", + "pallet-recovery/std", "pallet-scheduler/std", "pallet-session/std", "pallet-staking/std", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 61cf7e2903..108ecae502 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -2012,6 +2012,25 @@ impl order_book::Config for Runtime { type WeightInfo = order_book::weights::SubstrateWeight; } +parameter_types! { + + pub const ConfigDepositBase: Balance = balance!(5); + pub const FriendDepositFactor: Balance = balance!(3); + pub const MaxFriends: u16 = 10; + pub const RecoveryDeposit: Balance = balance!(5); +} + +impl pallet_recovery::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = pallet_recovery::weights::SubstrateWeight; + type RuntimeCall = RuntimeCall; + type Currency = Balances; + type ConfigDepositBase = ConfigDepositBase; + type FriendDepositFactor = FriendDepositFactor; + type MaxFriends = MaxFriends; + type RecoveryDeposit = RecoveryDeposit; +} + /// Payload data to be signed when making signed transaction from off-chain workers, /// inside `create_transaction` function. pub type SignedPayload = generic::SignedPayload; @@ -2394,6 +2413,8 @@ construct_runtime! { #[cfg(feature = "wip")] // order-book OrderBook: order_book::{Pallet, Call, Storage, Event} = 57, + Recovery: pallet_recovery::{Pallet, Call, Storage, Event} = 58, + // Trustless bridges #[cfg(feature = "wip")] // Bridges Mmr: pallet_mmr::{Pallet, Storage} = 90,