Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat/stableswap-runtime' into fe…
Browse files Browse the repository at this point in the history
…at/stableswap-runtime

# Conflicts:
#	Cargo.lock
#	pallets/dca/Cargo.toml
  • Loading branch information
dmoka committed Jul 31, 2023
2 parents 14993a6 + 3d2f6e8 commit 8ac3dcf
Show file tree
Hide file tree
Showing 36 changed files with 2,467 additions and 156 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Upload to codecov.io
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
fail_ci_if_error: false
- name: Build release
run: time cargo build --release --quiet --locked
- name: Version info
Expand Down
69 changes: 25 additions & 44 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "runtime-integration-tests"
version = "1.8.0"
version = "1.8.2"
description = "Integration tests"
authors = ["GalacticCouncil"]
edition = "2021"
Expand Down
18 changes: 17 additions & 1 deletion integration-tests/src/call_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use frame_support::{
assert_ok,
sp_runtime::{FixedU128, Permill},
traits::Contains,
weights::Weight,
};
use polkadot_xcm::latest::prelude::*;
use polkadot_xcm::VersionedXcm;
Expand Down Expand Up @@ -206,7 +207,7 @@ fn transfer_should_not_work_when_transfering_omnipool_assets_to_omnipool_account
}

#[test]
fn calling_pallet_xcm_extrinsic_should_be_filtered_by_call_filter() {
fn calling_pallet_xcm_send_extrinsic_should_not_be_filtered_by_call_filter() {
TestNet::reset();

Hydra::execute_with(|| {
Expand All @@ -216,6 +217,21 @@ fn calling_pallet_xcm_extrinsic_should_be_filtered_by_call_filter() {
message: Box::new(VersionedXcm::from(Xcm(vec![]))),
});

assert!(hydradx_runtime::CallFilter::contains(&call));
});
}

#[test]
fn calling_pallet_xcm_extrinsic_should_be_filtered_by_call_filter() {
TestNet::reset();

Hydra::execute_with(|| {
// the values here don't need to make sense, all we need is a valid Call
let call = hydradx_runtime::RuntimeCall::PolkadotXcm(pallet_xcm::Call::execute {
message: Box::new(VersionedXcm::from(Xcm(vec![]))),
max_weight: Weight::zero(),
});

assert!(!hydradx_runtime::CallFilter::contains(&call));
});
}
Expand Down
24 changes: 24 additions & 0 deletions integration-tests/src/cross_chain_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,3 +427,27 @@ fn claim_asset(asset: MultiAsset, recipient: [u8; 32]) {
));
});
}

#[test]
fn polkadot_xcm_execute_extrinsic_should_not_be_allowed() {
TestNet::reset();

Hydra::execute_with(|| {
let message = VersionedXcm::V3(Xcm(vec![
WithdrawAsset((Here, 410000000000u128).into()),
BuyExecution {
fees: (Here, 400000000000u128).into(),
weight_limit: Unlimited,
},
]));

assert_noop!(
hydradx_runtime::PolkadotXcm::execute(
hydradx_runtime::RuntimeOrigin::signed(ALICE.into()),
Box::new(message),
Weight::from_ref_time(400_000_000_000)
),
pallet_xcm::Error::<hydradx_runtime::Runtime>::Filtered
);
});
}
Loading

0 comments on commit 8ac3dcf

Please sign in to comment.