BridgeHub[Rococo/Wococo] test batched relaying of messages and their dispatch (#2578)

Added some tests that aim to cover the runtime configuration
that is exercised when BH receives relayed complex message.

* checks correct importing of proofs for:
  bridged chain finality, bridged para heads, bridged messages,
* checks relayer extension correctly configured to reward
  submitting relayer,
* checks relayed message is successfully dispatched.

Also moved generic test-utils from
  `asset-test-utils: parachains/runtimes/assets/test-utils`
one level up to new crate
  `parachains-runtimes-test-utils: parachains/runtimes/test-utils`
to be reused by BridgeHubs.

Signed-off-by: acatangiu <adrian@parity.io>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
This commit is contained in:
Adrian Catangiu
2023-05-18 18:10:36 +03:00
committed by GitHub
parent 93cf3908e0
commit 4e4799927a
21 changed files with 1723 additions and 980 deletions
@@ -10,20 +10,26 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features =
log = { version = "0.4.17", default-features = false }
# Substrate
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
# Cumulus
asset-test-utils = { path = "../../assets/test-utils"}
cumulus-pallet-dmp-queue = { path = "../../../../pallets/dmp-queue", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
cumulus-pallet-parachain-system = { path = "../../../../pallets/parachain-system", default-features = false }
cumulus-pallet-xcmp-queue = { path = "../../../../pallets/xcmp-queue", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
parachain-info = { path = "../../../../parachains/pallets/parachain-info", default-features = false }
asset-test-utils = { path = "../../assets/test-utils"}
parachains-runtimes-test-utils = { path = "../../test-utils", default-features = false }
# Polkadot
pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
@@ -33,13 +39,19 @@ xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features
xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
# Bridges
bp-bridge-hub-rococo = { path = "../../../../bridges/primitives/chain-bridge-hub-rococo", default-features = false }
bp-bridge-hub-wococo = { path = "../../../../bridges/primitives/chain-bridge-hub-wococo", default-features = false }
bp-header-chain = { path = "../../../../bridges/primitives/header-chain", default-features = false }
bp-messages = { path = "../../../../bridges/primitives/messages", default-features = false }
bp-parachains = { path = "../../../../bridges/primitives/parachains", default-features = false }
bp-polkadot-core = { path = "../../../../bridges/primitives/polkadot-core", default-features = false }
bp-relayers = { path = "../../../../bridges/primitives/relayers", default-features = false }
bp-runtime = { path = "../../../../bridges/primitives/runtime", default-features = false }
bp-test-utils = { path = "../../../../bridges/primitives/test-utils", default-features = false }
pallet-bridge-grandpa = { path = "../../../../bridges/modules/grandpa", default-features = false }
pallet-bridge-parachains = { path = "../../../../bridges/modules/parachains", default-features = false }
pallet-bridge-messages = { path = "../../../../bridges/modules/messages", default-features = false }
pallet-bridge-relayers = { path = "../../../../bridges/modules/relayers", default-features = false }
bridge-runtime-common = { path = "../../../../bridges/bin/runtime-common", default-features = false }
[features]
@@ -47,20 +59,28 @@ default = [ "std" ]
std = [
"codec/std",
"log/std",
"frame-benchmarking/std",
"frame-executive/std",
"frame-support/std",
"frame-system/std",
"bp-messages/std",
"bp-parachains/std",
"bp-polkadot-core/std",
"bp-header-chain/std",
"bp-relayers/std",
"bp-runtime/std",
"bp-test-utils/std",
"bridge-runtime-common/std",
"pallet-bridge-grandpa/std",
"pallet-bridge-parachains/std",
"pallet-bridge-messages/std",
"pallet-bridge-relayers/std",
"parachain-info/std",
"parachains-runtimes-test-utils/std",
"cumulus-pallet-parachain-system/std",
"cumulus-pallet-xcmp-queue/std",
"pallet-xcm/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"xcm/std",
@@ -70,4 +90,5 @@ std = [
"cumulus-pallet-dmp-queue/std",
"pallet-session/std",
"pallet-balances/std",
"pallet-utility/std",
]