Skip to content

Commit

Permalink
[polkadot-staging] Separate send_message() validations (paritytec…
Browse files Browse the repository at this point in the history
…h#2795)

* Fix xcm-bridge-hub build

* Move send_message definition to MessagesBridge impl

* Make send_message infallible

* Split `MessagesBridge` into 2 phases

Split `MessagesBridge` into 2 phases:
- message validation
- message sending
  • Loading branch information
serban300 committed Jan 18, 2024
1 parent c3e469e commit dfec8bc
Show file tree
Hide file tree
Showing 10 changed files with 206 additions and 196 deletions.
25 changes: 25 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ members = [
"modules/messages",
"modules/parachains",
"modules/relayers",
"modules/xcm-bridge-hub",
"modules/xcm-bridge-hub-router",
"primitives/beefy",
"primitives/chain-asset-hub-rococo",
Expand Down
4 changes: 2 additions & 2 deletions modules/messages/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use codec::Decode;
use frame_benchmarking::{account, benchmarks_instance_pallet};
use frame_support::weights::Weight;
use frame_system::RawOrigin;
use sp_runtime::traits::TrailingZeroInput;
use sp_runtime::{traits::TrailingZeroInput, BoundedVec};
use sp_std::{ops::RangeInclusive, prelude::*};

const SEED: u32 = 0;
Expand Down Expand Up @@ -443,7 +443,7 @@ benchmarks_instance_pallet! {

fn send_regular_message<T: Config<I>, I: 'static>() {
let mut outbound_lane = outbound_lane::<T, I>(T::bench_lane_id());
outbound_lane.send_message(vec![]).expect("We craft valid messages");
outbound_lane.send_message(BoundedVec::try_from(vec![]).expect("We craft valid messages"));
}

fn receive_messages<T: Config<I>, I: 'static>(nonce: MessageNonce) {
Expand Down
Loading

0 comments on commit dfec8bc

Please sign in to comment.