mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 18:31:05 +00:00
Allow Substrate Pallet to be Initialized via Dipatchable (#481)
* Add dispatchable for intializing pallet * Add Polkadot JS types for Substrate bridge pallet * Ensure Root is the only one that can initialize the pallet * Add some tests * Pack initialization data into struct * Only allow pallet to be initialized once * Use new initialization config in nodes * Rename ScheduledChange in Ethereum pallet We're renaming it to prevent clashes with Substrate bridge pallet type of the same name. This is relevant when importing types to Polkadot JS Apps. * Move all Polkadot JS types into one file * Appease Clippy
This commit is contained in:
committed by
Bastian Köcher
parent
d4fc7bebdc
commit
cac8319480
@@ -24,6 +24,22 @@ use sp_finality_grandpa::{AuthorityList, SetId};
|
||||
use sp_runtime::traits::Header as HeaderT;
|
||||
use sp_runtime::RuntimeDebug;
|
||||
|
||||
/// Data required for initializing the bridge pallet.
|
||||
///
|
||||
/// The bridge needs to know where to start its sync from, and this provides that initial context.
|
||||
#[derive(Default, Encode, Decode, RuntimeDebug, PartialEq, Clone)]
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||||
pub struct InitializationData<H: HeaderT> {
|
||||
/// The header from which we should start syncing.
|
||||
pub header: H,
|
||||
/// The initial authorities of the pallet.
|
||||
pub authority_list: AuthorityList,
|
||||
/// The ID of the initial authority set.
|
||||
pub set_id: SetId,
|
||||
/// The first scheduled authority set change of the pallet.
|
||||
pub scheduled_change: Option<ScheduledChange<H::Number>>,
|
||||
}
|
||||
|
||||
/// A Grandpa Authority List and ID.
|
||||
#[derive(Default, Encode, Decode, RuntimeDebug, PartialEq, Clone)]
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||||
|
||||
Reference in New Issue
Block a user