Initial version of Call::decode dispatch. (#300)

* Initial version of call dispatch.

* cargo fmt --all

* Remove unused stuff.

* cargo fmt --all

* weight is part of msg + events

* should_fail_on_weight_mismatch

* plug into runtime

* cargo fmt --all

* fix benchmarks compilation?

* expected/actual values in events

* return actual weight from MessageDispatch::dispatch()

* MessageOrigin -> InstanceId + move bridge_account_id to bp-runtime

* fix benchmarks again

* cargo fmt --all

* clippy

Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
This commit is contained in:
Tomasz Drwięga
2020-09-04 13:09:49 +02:00
committed by Bastian Köcher
parent c7437c7d91
commit 858940050a
8 changed files with 523 additions and 1 deletions
+7
View File
@@ -268,6 +268,12 @@ impl pallet_bridge_currency_exchange::Trait<KovanCurrencyExchange> for Runtime {
type DepositInto = DepositInto;
}
impl pallet_bridge_call_dispatch::Trait for Runtime {
type Event = Event;
type MessageId = (bp_message_lane::LaneId, bp_message_lane::MessageNonce);
type Call = Call;
}
pub struct DepositInto;
impl bp_currency_exchange::DepositInto for DepositInto {
@@ -463,6 +469,7 @@ construct_runtime!(
BridgeKovan: pallet_bridge_eth_poa::<Instance2>::{Module, Call, Config, Storage, ValidateUnsigned},
BridgeRialtoCurrencyExchange: pallet_bridge_currency_exchange::<Instance1>::{Module, Call},
BridgeKovanCurrencyExchange: pallet_bridge_currency_exchange::<Instance2>::{Module, Call},
BridgeCallDispatch: pallet_bridge_call_dispatch::{Module, Event<T>},
System: frame_system::{Module, Call, Config, Storage, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},