Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add sudo to template node #2748

Merged
merged 5 commits into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions parachain-template/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ pub fn development_config() -> ChainSpec {
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
get_account_id_from_seed::<sr25519::Public>("Alice"),
1000.into(),
)
},
Expand Down Expand Up @@ -156,6 +157,7 @@ pub fn local_testnet_config() -> ChainSpec {
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
get_account_id_from_seed::<sr25519::Public>("Alice"),
1000.into(),
)
},
Expand All @@ -180,6 +182,7 @@ pub fn local_testnet_config() -> ChainSpec {
fn testnet_genesis(
invulnerables: Vec<(AccountId, AuraId)>,
endowed_accounts: Vec<AccountId>,
root: AccountId,
id: ParaId,
) -> parachain_template_runtime::GenesisConfig {
parachain_template_runtime::GenesisConfig {
Expand Down Expand Up @@ -218,5 +221,6 @@ fn testnet_genesis(
safe_xcm_version: Some(SAFE_XCM_VERSION),
},
transaction_payment: Default::default(),
sudo: parachain_template_runtime::SudoConfig { key: Some(root) },
}
}
1 change: 1 addition & 0 deletions parachain-template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ runtime-benchmarks = [
"pallet-collator-selection/runtime-benchmarks",
"pallet-parachain-template/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"pallet-sudo/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
Expand Down
12 changes: 11 additions & 1 deletion parachain-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,12 @@ impl pallet_transaction_payment::Config for Runtime {
type OperationalFeeMultiplier = ConstU8<5>;
}

impl pallet_sudo::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type WeightInfo = ();
}

parameter_types! {
pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
Expand Down Expand Up @@ -479,6 +485,9 @@ construct_runtime!(
Balances: pallet_balances = 10,
TransactionPayment: pallet_transaction_payment = 11,

// Governance
Sudo: pallet_sudo = 15,

// Collator support. The order of these 4 are important and shall not change.
Authorship: pallet_authorship = 20,
CollatorSelection: pallet_collator_selection = 21,
Expand All @@ -493,7 +502,7 @@ construct_runtime!(
DmpQueue: cumulus_pallet_dmp_queue = 33,

// Template
TemplatePallet: pallet_parachain_template = 40,
TemplatePallet: pallet_parachain_template = 50,
}
);

Expand All @@ -504,6 +513,7 @@ mod benches {
[pallet_balances, Balances]
[pallet_session, SessionBench::<Runtime>]
[pallet_timestamp, Timestamp]
[pallet_sudo, Sudo]
[pallet_collator_selection, CollatorSelection]
[cumulus_pallet_xcmp_queue, XcmpQueue]
);
Expand Down