From fb92948bfac1bc18a9fa08451d68d1c54b6e6414 Mon Sep 17 00:00:00 2001 From: Diego Date: Mon, 23 Dec 2024 19:27:47 -0300 Subject: [PATCH] Improve xcm ump dancelight test --- .../xcm/test-xcm-send-upward.ts | 42 +++++-------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/test/suites/dev-tanssi-relay/xcm/test-xcm-send-upward.ts b/test/suites/dev-tanssi-relay/xcm/test-xcm-send-upward.ts index fa0a6bd58..ae8b154d8 100644 --- a/test/suites/dev-tanssi-relay/xcm/test-xcm-send-upward.ts +++ b/test/suites/dev-tanssi-relay/xcm/test-xcm-send-upward.ts @@ -1,7 +1,5 @@ -import { beforeAll, customDevRpcRequest, describeSuite, expect } from "@moonwall/cli"; -import { KeyringPair } from "@moonwall/util"; -import { ApiPromise, Keyring } from "@polkadot/api"; -import { u8aToHex } from "@polkadot/util"; +import { beforeAll, customDevRpcRequest, describeSuite } from "@moonwall/cli"; +import { ApiPromise } from "@polkadot/api"; import { jumpToSession } from "util/block"; import { injectUmpMessageAndSeal, RawXcmMessage, XcmFragment } from "../../../util/xcm"; @@ -12,16 +10,9 @@ describeSuite({ foundationMethods: "dev", testCases: ({ context, it }) => { let polkadotJs: ApiPromise; - let alice: KeyringPair; - let transferredBalance; beforeAll(async function () { polkadotJs = context.polkadotJs(); - alice = new Keyring({ type: "sr25519" }).addFromUri("//Alice", { - name: "Alice default", - }); - - transferredBalance = 10_000_000_000_000n; }); it({ @@ -30,20 +21,10 @@ describeSuite({ test: async function () { // Basic xcm message const xcmMessage = new XcmFragment({ - assets: [ - { - multilocation: { - parents: 0, - interior: { Here: null }, - }, - fungible: transferredBalance, - }, - ], - beneficiary: u8aToHex(alice.addressRaw), + assets: [], }) - .withdraw_asset() - .clear_origin() - .as_v3(); + .clear_origin() + .as_v3(); // Enable para inherent to process xcm message await customDevRpcRequest("mock_enableParaInherentCandidate", []); @@ -59,17 +40,14 @@ describeSuite({ await context.createBlock(); // Check message was processed ok - const events = await polkadotJs.query.system.events(); - - const xcmEvent = events.find((event) => { - console.log("Event", event) - + const events = await polkadotJs.query.system.events() - return event.event.section === 'xcmpQueue' && - event.event.method === 'Success' + const processedEvent = events.find((event) => { + return event.event.section === 'messageQueue' && + event.event.method === 'Processed' }); - expect(xcmEvent).to.not.be.undefined; + expect(processedEvent).to.not.be.undefined; }, }); },