[BREAKING] Migrate messages pallet to frame v2 (#1088)

* get rid of frame_support::traits::Instance usage in messaging

* migrate messages pallet to frame v2

* fix benchmarks

* remove dummy event + add Parameter to metadata

* review

* typo
This commit is contained in:
Svyatoslav Nikolsky
2021-09-01 11:49:09 +03:00
committed by Bastian Köcher
parent 8cbdc8244d
commit fc9363619a
24 changed files with 529 additions and 537 deletions
+1 -1
View File
@@ -136,7 +136,7 @@ impl Alternative {
get_account_id_from_seed::<sr25519::Public>("Harry//stash"),
pallet_bridge_messages::Pallet::<
millau_runtime::Runtime,
pallet_bridge_messages::DefaultInstance,
millau_runtime::WithRialtoMessagesInstance,
>::relayer_fund_account_id(),
derive_account_from_rialto_id(bp_runtime::SourceAccount::Account(
get_account_id_from_seed::<sr25519::Public>("Alice"),
+1 -1
View File
@@ -366,7 +366,7 @@ parameter_types! {
}
/// Instance of the messages pallet used to relay messages to/from Rialto chain.
pub type WithRialtoMessagesInstance = pallet_bridge_messages::DefaultInstance;
pub type WithRialtoMessagesInstance = ();
impl pallet_bridge_messages::Config<WithRialtoMessagesInstance> for Runtime {
type Event = Event;
@@ -80,10 +80,10 @@ impl MessageBridge for WithRialtoMessageBridge {
const RELAYER_FEE_PERCENT: u32 = 10;
const THIS_CHAIN_ID: ChainId = MILLAU_CHAIN_ID;
const BRIDGED_CHAIN_ID: ChainId = RIALTO_CHAIN_ID;
const BRIDGED_MESSAGES_PALLET_NAME: &'static str = bp_rialto::WITH_MILLAU_MESSAGES_PALLET_NAME;
type ThisChain = Millau;
type BridgedChain = Rialto;
type BridgedMessagesInstance = crate::WithRialtoMessagesInstance;
fn bridged_balance_to_this_balance(bridged_balance: bp_rialto::Balance) -> bp_millau::Balance {
bp_millau::Balance::try_from(RialtoToMillauConversionRate::get().saturating_mul_int(bridged_balance))