Skip to content

Commit

Permalink
Add XCMP Remark Test and Update Build Workflow (#828)
Browse files Browse the repository at this point in the history
* add xcmp test

* tsst with locked

* fix tests
  • Loading branch information
asiniscalchi authored Nov 5, 2024
1 parent a502cf4 commit 3293b29
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:

- name: Test
run: |
SKIP_WASM_BUILD=1 cargo test
SKIP_WASM_BUILD=1 cargo test --locked
try-runtime:
runs-on:
Expand Down
28 changes: 28 additions & 0 deletions xcm-simulator/src/tests/laosish_xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,34 @@ fn ump_transfer_balance() {
});
}

#[test]
fn xcmp_remark_para_b() {
MockNet::reset();

let remark = parachain::RuntimeCall::System(
frame_system::Call::<parachain::Runtime>::remark_with_event { remark: vec![1, 2, 3] },
);

Laosish::execute_with(|| {
assert_ok!(LaosishPalletXcm::send_xcm(
Here,
(Parent, Parachain(PARA_B_ID)),
Xcm(vec![Transact {
origin_kind: OriginKind::SovereignAccount,
require_weight_at_most: Weight::from_parts(INITIAL_BALANCE as u64, 1024 * 1024),
call: remark.encode().into(),
}]),
));
});

ParaB::execute_with(|| {
assert!(parachain::System::events().iter().any(|r| matches!(
r.event,
parachain::RuntimeEvent::System(frame_system::Event::Remarked { .. })
)));
});
}

#[test]
fn xcmp_create_foreign_asset_in_para_b() {
MockNet::reset();
Expand Down

0 comments on commit 3293b29

Please sign in to comment.