Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert execute_blob and send_blob (#4266) #4290

Merged
merged 4 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ publish = false
workspace = true

[dependencies]

# Substrate
sp-core = { path = "../../../../../../../substrate/primitives/core", default-features = false, version = "32.0.0" }
sp-runtime = { path = "../../../../../../../substrate/primitives/runtime", default-features = false, version = "35.0.0" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,18 +362,18 @@ macro_rules! impl_send_transact_helpers_for_relay_chain {
recipient: $crate::impls::ParaId,
call: $crate::impls::DoubleEncoded<()>
) {
use $crate::impls::{bx, Chain, RelayChain, Encode};
use $crate::impls::{bx, Chain, RelayChain};

<Self as $crate::impls::TestExt>::execute_with(|| {
let root_origin = <Self as Chain>::RuntimeOrigin::root();
let destination: $crate::impls::Location = <Self as RelayChain>::child_location_of(recipient);
let xcm = $crate::impls::xcm_transact_unpaid_execution(call, $crate::impls::OriginKind::Superuser);

// Send XCM `Transact`
$crate::impls::assert_ok!(<Self as [<$chain RelayPallet>]>::XcmPallet::send_blob(
$crate::impls::assert_ok!(<Self as [<$chain RelayPallet>]>::XcmPallet::send(
root_origin,
bx!(destination.into()),
xcm.encode().try_into().unwrap(),
bx!(xcm),
));
Self::assert_xcm_pallet_sent();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_system_assets_works() {
)]);

PenpalA::execute_with(|| {
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send_blob(
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send(
root_origin,
bx!(system_para_destination),
xcm.encode().try_into().unwrap(),
bx!(xcm),
));

PenpalA::assert_xcm_pallet_sent();
Expand Down Expand Up @@ -159,10 +159,10 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
)]);

PenpalA::execute_with(|| {
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send_blob(
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send(
root_origin,
bx!(system_para_destination),
xcm.encode().try_into().unwrap(),
bx!(xcm),
));

PenpalA::assert_xcm_pallet_sent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,10 @@ fn pay_xcm_fee_with_some_asset_swapped_for_native() {
penpal.clone(),
);

assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send_blob(
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send(
penpal_root,
bx!(asset_hub_location),
xcm.encode().try_into().unwrap(),
bx!(xcm),
));

PenpalA::assert_xcm_pallet_sent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_system_assets_works() {
)]);

PenpalA::execute_with(|| {
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send_blob(
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send(
root_origin,
bx!(system_para_destination),
xcm.encode().try_into().unwrap(),
bx!(xcm),
));

PenpalA::assert_xcm_pallet_sent();
Expand Down Expand Up @@ -159,10 +159,10 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
)]);

PenpalA::execute_with(|| {
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send_blob(
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send(
root_origin,
bx!(system_para_destination),
xcm.encode().try_into().unwrap(),
bx!(xcm),
));

PenpalA::assert_xcm_pallet_sent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,10 @@ fn pay_xcm_fee_with_some_asset_swapped_for_native() {
penpal.clone(),
);

assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send_blob(
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send(
penpal_root,
bx!(asset_hub_location),
xcm.encode().try_into().unwrap(),
bx!(xcm),
));

PenpalA::assert_xcm_pallet_sent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// limitations under the License.

use crate::tests::*;
use codec::Encode;

#[test]
fn send_xcm_from_rococo_relay_to_westend_asset_hub_should_fail_on_not_applicable() {
Expand All @@ -27,7 +26,7 @@ fn send_xcm_from_rococo_relay_to_westend_asset_hub_should_fail_on_not_applicable

let remote_xcm = Xcm(vec![ClearOrigin]);

let xcm = VersionedXcm::from(Xcm::<()>(vec![
let xcm = VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit, check_origin },
ExportMessage {
network: WestendId.into(),
Expand All @@ -39,10 +38,10 @@ fn send_xcm_from_rococo_relay_to_westend_asset_hub_should_fail_on_not_applicable
// Rococo Global Consensus
// Send XCM message from Relay Chain to Bridge Hub source Parachain
Rococo::execute_with(|| {
assert_ok!(<Rococo as RococoPallet>::XcmPallet::send_blob(
assert_ok!(<Rococo as RococoPallet>::XcmPallet::send(
sudo_origin,
bx!(destination),
xcm.encode().try_into().unwrap(),
bx!(xcm),
));

type RuntimeEvent = <Rococo as Chain>::RuntimeEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn create_agent() {

let create_agent_call = SnowbridgeControl::Control(ControlCall::CreateAgent {});
// Construct XCM to create an agent for para 1001
let remote_xcm = VersionedXcm::from(Xcm::<()>(vec![
let remote_xcm = VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
DescendOrigin(Parachain(origin_para).into()),
Transact {
Expand All @@ -95,10 +95,10 @@ fn create_agent() {
// Rococo Global Consensus
// Send XCM message from Relay Chain to Bridge Hub source Parachain
Rococo::execute_with(|| {
assert_ok!(<Rococo as RococoPallet>::XcmPallet::send_blob(
assert_ok!(<Rococo as RococoPallet>::XcmPallet::send(
sudo_origin,
bx!(destination),
remote_xcm.encode().try_into().unwrap(),
bx!(remote_xcm),
));

type RuntimeEvent = <Rococo as Chain>::RuntimeEvent;
Expand Down Expand Up @@ -140,7 +140,7 @@ fn create_channel() {

let create_agent_call = SnowbridgeControl::Control(ControlCall::CreateAgent {});
// Construct XCM to create an agent for para 1001
let create_agent_xcm = VersionedXcm::from(Xcm::<()>(vec![
let create_agent_xcm = VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
DescendOrigin(Parachain(origin_para).into()),
Transact {
Expand All @@ -153,7 +153,7 @@ fn create_channel() {
let create_channel_call =
SnowbridgeControl::Control(ControlCall::CreateChannel { mode: OperatingMode::Normal });
// Construct XCM to create a channel for para 1001
let create_channel_xcm = VersionedXcm::from(Xcm::<()>(vec![
let create_channel_xcm = VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
DescendOrigin(Parachain(origin_para).into()),
Transact {
Expand All @@ -166,16 +166,16 @@ fn create_channel() {
// Rococo Global Consensus
// Send XCM message from Relay Chain to Bridge Hub source Parachain
Rococo::execute_with(|| {
assert_ok!(<Rococo as RococoPallet>::XcmPallet::send_blob(
assert_ok!(<Rococo as RococoPallet>::XcmPallet::send(
sudo_origin.clone(),
bx!(destination.clone()),
create_agent_xcm.encode().try_into().unwrap(),
bx!(create_agent_xcm),
));

assert_ok!(<Rococo as RococoPallet>::XcmPallet::send_blob(
assert_ok!(<Rococo as RococoPallet>::XcmPallet::send(
sudo_origin,
bx!(destination),
create_channel_xcm.encode().try_into().unwrap(),
bx!(create_channel_xcm),
));

type RuntimeEvent = <Rococo as Chain>::RuntimeEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ publish = false
workspace = true

[dependencies]
codec = { package = "parity-scale-codec", version = "3.6.0" }

# Substrate
frame-support = { path = "../../../../../../../substrate/frame/support", default-features = false, version = "32.0.0" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// limitations under the License.

use crate::tests::*;
use codec::Encode;

#[test]
fn send_xcm_from_westend_relay_to_rococo_asset_hub_should_fail_on_not_applicable() {
Expand All @@ -27,7 +26,7 @@ fn send_xcm_from_westend_relay_to_rococo_asset_hub_should_fail_on_not_applicable

let remote_xcm = Xcm(vec![ClearOrigin]);

let xcm = VersionedXcm::from(Xcm::<()>(vec![
let xcm = VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit, check_origin },
ExportMessage {
network: RococoId,
Expand All @@ -39,10 +38,10 @@ fn send_xcm_from_westend_relay_to_rococo_asset_hub_should_fail_on_not_applicable
// Westend Global Consensus
// Send XCM message from Relay Chain to Bridge Hub source Parachain
Westend::execute_with(|| {
assert_ok!(<Westend as WestendPallet>::XcmPallet::send_blob(
assert_ok!(<Westend as WestendPallet>::XcmPallet::send(
sudo_origin,
bx!(destination),
xcm.encode().try_into().unwrap(),
bx!(xcm),
));

type RuntimeEvent = <Westend as Chain>::RuntimeEvent;
Expand Down
Loading
Loading