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
+12
View File
@@ -45,6 +45,11 @@ version = "0.1.0"
default-features = false
path = "../../../modules/ethereum"
[dependencies.pallet-bridge-call-dispatch]
version = "0.1.0"
default-features = false
path = "../../../modules/call-dispatch"
[dependencies.pallet-bridge-currency-exchange]
version = "0.1.0"
default-features = false
@@ -216,6 +221,11 @@ version = "0.1.0"
default-features = false
path = "../../../primitives/header-chain"
[dependencies.bp-message-lane]
version = "0.1.0"
default-features = false
path = "../../../primitives/message-lane"
# Dev Dependencies
[dev-dependencies.libsecp256k1]
@@ -240,6 +250,7 @@ default = ["std"]
std = [
"bp-currency-exchange/std",
"bp-eth-poa/std",
"bp-message-lane/std",
"codec/std",
"frame-benchmarking/std",
"frame-executive/std",
@@ -248,6 +259,7 @@ std = [
"frame-system/std",
"pallet-aura/std",
"pallet-balances/std",
"pallet-bridge-call-dispatch/std",
"pallet-bridge-currency-exchange/std",
"pallet-bridge-eth-poa/std",
"pallet-grandpa/std",
+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},