Skip to content

Commit

Permalink
feat: InvArch - pallets utility and identity
Browse files Browse the repository at this point in the history
  • Loading branch information
arrudagates committed Nov 11, 2023
1 parent bfb3d7e commit 6092be3
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions invarch/Cargo.lock

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

2 changes: 2 additions & 0 deletions invarch/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-f
pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
pallet-identity = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
pallet-treasury = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
Expand Down
35 changes: 35 additions & 0 deletions invarch/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,37 @@ impl pallet_sudo::Config for Runtime {
type WeightInfo = pallet_sudo::weights::SubstrateWeight<Runtime>;
}

impl pallet_utility::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type PalletsOrigin = OriginCaller;
type WeightInfo = pallet_utility::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
pub BasicDeposit: Balance = 5 * UNIT;
pub FieldDeposit: Balance = 2 * UNIT;
pub const MaxAdditionalFields: u32 = 5;
pub const MaxRegistrars: u32 = 10;
pub const MaxSubAccounts: u32 = 10;
pub SubAccountDeposit: Balance = 5 * UNIT;
}

impl pallet_identity::Config for Runtime {
type BasicDeposit = BasicDeposit;
type Currency = Balances;
type RuntimeEvent = RuntimeEvent;
type FieldDeposit = FieldDeposit;
type ForceOrigin = EnsureRoot<AccountId>;
type MaxAdditionalFields = MaxAdditionalFields;
type MaxRegistrars = MaxRegistrars;
type MaxSubAccounts = MaxSubAccounts;
type RegistrarOrigin = EnsureRoot<AccountId>;
type Slashed = Treasury;
type SubAccountDeposit = SubAccountDeposit;
type WeightInfo = pallet_identity::weights::SubstrateWeight<Runtime>;
}

// Create the runtime by composing the FRAME pallets that were previously configured.
construct_runtime!(
pub enum Runtime where
Expand All @@ -384,6 +415,7 @@ construct_runtime!(
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2,
ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3,
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 4,
Utility: pallet_utility::{Pallet, Call, Event} = 5,

// Monetary stuff.
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 10,
Expand All @@ -405,6 +437,9 @@ construct_runtime!(
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33,
OrmlXcm: orml_xcm = 34,

// Extra
Identity: pallet_identity::{Pallet, Call, Storage, Event<T>} = 40,

}
);

Expand Down

0 comments on commit 6092be3

Please sign in to comment.