Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recovery pallet added and configured #512

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,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 }
Expand Down Expand Up @@ -252,6 +254,7 @@ std = [
"pallet-offences/std",
"pallet-preimage/std",
"pallet-randomness-collective-flip/std",
"pallet-recovery/std",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we need to add "pallet-recovery/try-runtime" below if it has this feature

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it works without it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course it works, but it is necessary for cases when we use try-runtime

"pallet-scheduler/std",
"pallet-session/std",
"pallet-staking/std",
Expand Down
20 changes: 20 additions & 0 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1942,6 +1942,24 @@ impl order_book::Config for Runtime {
type WeightInfo = order_book::weights::SubstrateWeight<Runtime>;
}

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<Runtime>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're supposed to benchmark it ourselves (with our reference hardware)

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<RuntimeCall, SignedExtra>;
Expand Down Expand Up @@ -2332,6 +2350,8 @@ construct_runtime! {
#[cfg(feature = "wip")] // order-book
OrderBook: order_book::{Pallet, Call, Storage, Event<T>} = 57,

Recovery: pallet_recovery::{Pallet, Call, Storage, Event<T>} = 58,

// Trustless bridges
#[cfg(feature = "wip")] // Trustless bridges
Mmr: pallet_mmr::{Pallet, Storage} = 90,
Expand Down