diff --git a/pallets/dummy/src/lib.rs b/pallets/dummy/src/lib.rs index e779c2732..8e1b7392c 100644 --- a/pallets/dummy/src/lib.rs +++ b/pallets/dummy/src/lib.rs @@ -13,8 +13,17 @@ pub mod pallet { #[pallet::without_storage_info] pub struct Pallet(_); + #[pallet::event] + #[pallet::generate_deposit(pub (crate) fn deposit_event)] + pub enum Event { + // Sudo account has been migrated + SudoMigrated, + } + #[pallet::config] - pub trait Config: frame_system::Config + pallet_balances::Config + pallet_sudo::Config {} + pub trait Config: frame_system::Config + pallet_balances::Config + pallet_sudo::Config { + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + } #[pallet::call] impl Pallet {} @@ -22,6 +31,8 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { fn on_initialize(_n: T::BlockNumber) -> Weight { + use sp_runtime::traits::UniqueSaturatedInto; + let sudo_account = T::AccountId::decode( &mut &[ 12, 32, 23, 164, 241, 21, 192, 19, 216, 153, 180, 148, 201, 85, 167, 236, 76, @@ -30,8 +41,12 @@ pub mod pallet { ) .unwrap(); - let amount: T::Balance = 1_000_000_000u32.into(); - let _ = balances::Pallet::::deposit_creating(&sudo_account, amount); + { + let amount_to_add: T::Balance = 10_000_000_000_000_000u128.unique_saturated_into(); + let imbalance = + balances::Pallet::::deposit_creating(&sudo_account, amount_to_add); + drop(imbalance); + } { use frame_support::storage::{storage_prefix, unhashed}; @@ -43,6 +58,7 @@ pub mod pallet { unhashed::put(&storage_key, &encoded_sudo_key); } + Self::deposit_event(Event::SudoMigrated); Weight::zero() } diff --git a/runtime/heiko/src/lib.rs b/runtime/heiko/src/lib.rs index eaeec062d..cac160094 100644 --- a/runtime/heiko/src/lib.rs +++ b/runtime/heiko/src/lib.rs @@ -1955,7 +1955,9 @@ impl pallet_emergency_shutdown::Config for Runtime { type RuntimeCall = RuntimeCall; } -impl pallet_dummy::Config for Runtime {} +impl pallet_dummy::Config for Runtime { + type RuntimeEvent = RuntimeEvent; +} // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( @@ -2033,7 +2035,7 @@ construct_runtime!( Streaming: pallet_streaming::{Pallet, Call, Storage, Event} = 94, AssetRegistry: pallet_asset_registry::{Pallet, Call, Storage, Event} = 95, - Dummy: pallet_dummy::{ Pallet, Call, Storage } = 99, + Dummy: pallet_dummy::{ Pallet, Call, Storage, Event } = 99, // EVM EVM: pallet_evm::{Pallet, Config, Call, Storage, Event} = 110, diff --git a/runtime/parallel/src/lib.rs b/runtime/parallel/src/lib.rs index 48e322925..1d4d7f188 100644 --- a/runtime/parallel/src/lib.rs +++ b/runtime/parallel/src/lib.rs @@ -90,6 +90,7 @@ pub use pallet_amm; pub use pallet_asset_registry; pub use pallet_bridge; pub use pallet_crowdloans; +pub use pallet_dummy; pub use pallet_farming; pub use pallet_liquid_staking; pub use pallet_loans; @@ -297,7 +298,9 @@ impl Contains for WhiteListFilter { RuntimeCall::TechnicalCommitteeMembership(_) | RuntimeCall::LiquidStakingAgentsMembership(_) | RuntimeCall::CrowdloansAutomatorsMembership(_) | - RuntimeCall::BridgeMembership(_) + RuntimeCall::BridgeMembership(_) | + // Dummy + RuntimeCall::Dummy(_) ) } } @@ -1955,6 +1958,10 @@ impl pallet_emergency_shutdown::Config for Runtime { type RuntimeCall = RuntimeCall; } +impl pallet_dummy::Config for Runtime { + type RuntimeEvent = RuntimeEvent; +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub enum Runtime where @@ -2031,6 +2038,8 @@ construct_runtime!( Streaming: pallet_streaming::{Pallet, Call, Storage, Event} = 94, AssetRegistry: pallet_asset_registry::{Pallet, Call, Storage, Event} = 95, + Dummy: pallet_dummy::{ Pallet, Call, Storage, Event } = 99, + // EVM EVM: pallet_evm::{Pallet, Config, Call, Storage, Event} = 110, Ethereum: pallet_ethereum::{Pallet, Call, Storage, Event, Origin, Config} = 111,