Skip to content

Commit

Permalink
Fix ts tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Cem Eliguzel committed Sep 26, 2023
1 parent 2afd212 commit a403c2d
Show file tree
Hide file tree
Showing 110 changed files with 3,130 additions and 2,753 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ describeDevMoonbeam("Fee Multiplier - XCM Executions", (context) => {
.as_v2();

await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -411,7 +411,7 @@ describeDevMoonbeam("Fee Multiplier - XCM Executions", (context) => {
.as_v2();

await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down
4 changes: 2 additions & 2 deletions archived_tests/archived_specs/test-pov/test-xcm-to-evm-pov.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ describeDevMoonbeam("XCM to EVM - PoV tests", (context) => {

// Send an XCM and create block to execute it
await injectHrmpMessage(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);
const { result, block } = await context.createBlock();
Expand Down Expand Up @@ -215,7 +215,7 @@ describeDevMoonbeam("XCM to EVM - PoV tests", (context) => {

// Send an XCM and create block to execute it
await injectHrmpMessage(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);
const { result, block } = await context.createBlock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transfer", (context) => {

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, statemint_para_id, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -205,7 +205,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transfer", (context) => {

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, statemint_para_id, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -279,7 +279,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transfer of DEV", (context) =

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, foreign_para_id, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -358,15 +358,15 @@ describeDevMoonbeam(

const chargedWeight = await weightMessage(
context,
context.polkadotApi.createType("XcmVersionedXcm", xcmMessage) as any
context.polkadotApi.createType("StagingXcmVersionedXcm", xcmMessage) as any
);
// We are charging chargedWeight
// chargedWeight * 50000 = chargedFee
const chargedFee = chargedWeight * 50000n;

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, foreign_para_id, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -493,7 +493,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transfer", (context) => {

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, foreign_para_id, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -577,7 +577,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transfer", (context) => {

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, statemint_para_id, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -700,7 +700,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transfer", (context) => {

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, foreign_para_id, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -752,7 +752,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transfer", (context) => {

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, statemint_para_id, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down
10 changes: 5 additions & 5 deletions archived_tests/archived_specs/test-xcm/test-mock-hrmp-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ describeDevMoonbeam("Mock XCMP - test XCMP execution", (context) => {
// one per para
for (let i = 0; i < numParaMsgs; i++) {
await injectHrmpMessage(context, i + 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);
}
Expand Down Expand Up @@ -375,7 +375,7 @@ describeDevMoonbeam("Mock XCMP - test XCMP execution", (context) => {
// one per para
for (let i = 0; i < numParaMsgs; i++) {
await injectHrmpMessage(context, i + 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);
}
Expand Down Expand Up @@ -483,12 +483,12 @@ describeDevMoonbeam("Mock XCMP - test XCMP execution", (context) => {
// now we start injecting messages
// two for para 1
await injectHrmpMessage(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessageNotExecuted,
} as RawXcmMessage);

await injectHrmpMessage(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessageExecuted,
} as RawXcmMessage);

Expand Down Expand Up @@ -542,7 +542,7 @@ describeDevMoonbeam("Mock XCMP - test XCMP execution", (context) => {
// now we start injecting messages
for (let i = 0; i < suspendThreshold + 1; i++) {
await injectHrmpMessage(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessageNotExecuted,
} as RawXcmMessage);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transact ETHEREUM (transfer)"

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -267,7 +267,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transact ETHEREUM (call)", (c

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -372,7 +372,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transact ETHEREUM (asset fee)

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, statemint_para_id, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -453,7 +453,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transact ETHEREUM (asset fee)

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -588,7 +588,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transact ETHEREUM (proxy)", (

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -728,7 +728,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transact ETHEREUM (proxy)", (

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -884,7 +884,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transact ETHEREUM (proxy)", (

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -1062,7 +1062,7 @@ describeDevMoonbeam("Mock XCM - transact ETHEREUM (proxy) disabled switch", (con

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -1212,7 +1212,7 @@ describeDevMoonbeam("Mock XCM - transact ETHEREUM (non-proxy) disabled switch",

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -1378,7 +1378,7 @@ describeDevMoonbeam("Mock XCM - transact ETHEREUM input size check succeeds", (c

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -1502,7 +1502,7 @@ describeDevMoonbeam("Mock XCM - transact ETHEREUM input size check fails", (cont

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -1626,7 +1626,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transact ETHEREUM (transfer)"

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transact", (context) => {

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -170,7 +170,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transact with two Descends",

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -252,7 +252,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transact without withdraw", (

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down Expand Up @@ -334,7 +334,7 @@ describeDevMoonbeam("Mock XCM - receive horizontal transact without buy executio

// Send an XCM and create block to execute it
await injectHrmpMessageAndSeal(context, 1, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describeDevMoonbeam("Mock XCM - Fails trying to pay fees with ERC20", (context)

// Mock the reception of the xcm message
await injectHrmpMessage(context, paraId, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);
await context.createBlock();
Expand Down Expand Up @@ -236,14 +236,14 @@ describeDevMoonbeam("Mock XCM - Trap ERC20", (context) => {

// Mock the reception of the xcm message
await injectHrmpMessage(context, paraId, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);
await context.createBlock();

const chargedWeight = await weightMessage(
context,
context.polkadotApi.createType("XcmVersionedXcm", xcmMessage) as any
context.polkadotApi.createType("StagingXcmVersionedXcm", xcmMessage) as any
);
// We are charging chargedWeight
// chargedWeight * 50000 = chargedFee
Expand Down Expand Up @@ -273,7 +273,7 @@ describeDevMoonbeam("Mock XCM - Trap ERC20", (context) => {

// Mock the reception of the xcm message
await injectHrmpMessage(context, paraId, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessageToClaimAssets,
} as RawXcmMessage);
await context.createBlock();
Expand All @@ -287,7 +287,7 @@ describeDevMoonbeam("Mock XCM - Trap ERC20", (context) => {

const chargedWeightForClaim = await weightMessage(
context,
context.polkadotApi.createType("XcmVersionedXcm", xcmMessageToClaimAssets) as any
context.polkadotApi.createType("StagingXcmVersionedXcm", xcmMessageToClaimAssets) as any
);
// We are charging chargedWeightForClaim
// chargedWeightForClaim * 50000 = chargedFeeForClaim
Expand All @@ -301,7 +301,7 @@ describeDevMoonbeam("Mock XCM - Trap ERC20", (context) => {

// Mock again the reception of the initial xcm message
await injectHrmpMessage(context, paraId, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);
await context.createBlock();
Expand Down Expand Up @@ -339,7 +339,7 @@ describeDevMoonbeam("Mock XCM - Trap ERC20", (context) => {
.as_v2();

await injectHrmpMessage(context, paraId, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessageFailedClaim,
} as RawXcmMessage);
await context.createBlock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ describeDevMoonbeam("Mock XCM - Receive two ERC20", (context) => {

// Mock the reception of the xcm message
await injectHrmpMessage(context, paraId, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);
await context.createBlock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ describeDevMoonbeamAllRuntimes("Mock XCM - Receive back erc20", (context) => {

// Mock the reception of the xcm message
await injectHrmpMessage(context, paraId, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);
await context.createBlock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describeDevMoonbeam("Mock XCM V3 - Receive erc20 via XCM", (context) => {

// Mock the reception of the xcm message
await injectHrmpMessage(context, paraId, {
type: "XcmVersionedXcm",
type: "StagingXcmVersionedXcm",
payload: xcmMessage,
} as RawXcmMessage);
await context.createBlock();
Expand Down
Loading

0 comments on commit a403c2d

Please sign in to comment.