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 4 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) },
}
}
12 changes: 11 additions & 1 deletion parachain-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,12 @@ impl pallet_parachain_template::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
}

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

// Create the runtime by composing the FRAME pallets that were previously configured.
construct_runtime!(
pub enum Runtime where
Expand All @@ -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 @@ -506,6 +515,7 @@ mod benches {
[pallet_timestamp, Timestamp]
[pallet_collator_selection, CollatorSelection]
[cumulus_pallet_xcmp_queue, XcmpQueue]
[pallet_sudo, Sudo]
);
}

Expand Down