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:
Hernando Castano
2020-11-05 14:19:20 -05:00
committed by Bastian Köcher
parent d4fc7bebdc
commit cac8319480
8 changed files with 193 additions and 76 deletions
+2 -2
View File
@@ -277,7 +277,7 @@ pub(crate) mod tests {
use super::*;
use crate::mock::{run_test, validators_addresses, validators_change_receipt, TestRuntime};
use crate::DefaultInstance;
use crate::{BridgeStorage, Headers, ScheduledChange, ScheduledChanges, StoredHeader};
use crate::{AuraScheduledChange, BridgeStorage, Headers, ScheduledChanges, StoredHeader};
use bp_eth_poa::compute_merkle_root;
use frame_support::StorageMap;
@@ -428,7 +428,7 @@ pub(crate) mod tests {
next_validators_set_id: 0,
last_signal_block: scheduled_at,
};
let scheduled_change = ScheduledChange {
let scheduled_change = AuraScheduledChange {
validators: validators_addresses(1),
prev_signal_block: None,
};