Skip to content

Commit

Permalink
Merge branch 'master' into migrating-polkadot-runtime-common-auctions…
Browse files Browse the repository at this point in the history
…-benchmarking-to-v2
  • Loading branch information
bkchr authored Dec 10, 2024
2 parents 3f0ad42 + fe4846f commit 9b36491
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 26 deletions.
14 changes: 0 additions & 14 deletions bridges/snowbridge/pallets/inbound-queue/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,20 +248,6 @@ impl inbound_queue::Config for Test {
type AssetTransactor = SuccessfulTransactor;
}

pub fn last_events(n: usize) -> Vec<RuntimeEvent> {
frame_system::Pallet::<Test>::events()
.into_iter()
.rev()
.take(n)
.rev()
.map(|e| e.event)
.collect()
}

pub fn expect_events(e: Vec<RuntimeEvent>) {
assert_eq!(last_events(e.len()), e);
}

pub fn setup() {
System::set_block_number(1);
Balances::mint_into(
Expand Down
23 changes: 11 additions & 12 deletions bridges/snowbridge/pallets/inbound-queue/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use sp_keyring::Sr25519Keyring as Keyring;
use sp_runtime::DispatchError;
use sp_std::convert::From;

use crate::{Error, Event as InboundQueueEvent};
use crate::Error;

use crate::mock::*;

Expand All @@ -35,17 +35,16 @@ fn test_submit_happy_path() {
assert_eq!(Balances::balance(&channel_sovereign), initial_fund);

assert_ok!(InboundQueue::submit(origin.clone(), message.clone()));
expect_events(vec![InboundQueueEvent::MessageReceived {
channel_id: hex!("c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539")
.into(),
nonce: 1,
message_id: [
118, 166, 139, 182, 84, 52, 165, 189, 54, 14, 178, 73, 2, 228, 192, 97, 153, 201,
4, 75, 151, 15, 82, 6, 164, 187, 162, 133, 26, 183, 186, 126,
],
fee_burned: 110000000000,
}
.into()]);

let events = frame_system::Pallet::<Test>::events();
assert!(
events.iter().any(|event| matches!(
event.event,
RuntimeEvent::InboundQueue(Event::MessageReceived { nonce, ..})
if nonce == 1
)),
"no event emit."
);

let delivery_cost = InboundQueue::calculate_delivery_cost(message.encode().len() as u32);
assert!(
Expand Down
4 changes: 4 additions & 0 deletions polkadot/xcm/src/v5/junction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,20 @@ pub enum NetworkId {
/// The Kusama canary-net Relay-chain.
Kusama,
/// An Ethereum network specified by its chain ID.
#[codec(index = 7)]
Ethereum {
/// The EIP-155 chain ID.
#[codec(compact)]
chain_id: u64,
},
/// The Bitcoin network, including hard-forks supported by Bitcoin Core development team.
#[codec(index = 8)]
BitcoinCore,
/// The Bitcoin network, including hard-forks supported by Bitcoin Cash developers.
#[codec(index = 9)]
BitcoinCash,
/// The Polkadot Bulletin chain.
#[codec(index = 10)]
PolkadotBulletin,
}

Expand Down
10 changes: 10 additions & 0 deletions prdoc/pr_6503.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
title: "xcm: minor fix for compatibility with V4"

doc:
- audience: ["Runtime Dev", "Runtime User"]
description: |
Following the removal of `Rococo`, `Westend` and `Wococo` from `NetworkId`, fixed `xcm::v5::NetworkId` encoding/decoding to be compatible with `xcm::v4::NetworkId`

crates:
- name: staging-xcm
bump: patch

0 comments on commit 9b36491

Please sign in to comment.