Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
6,487 changes: 3,920 additions & 2,567 deletions Cargo.lock

Large diffs are not rendered by default.

251 changes: 127 additions & 124 deletions Cargo.toml

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ sp-arithmetic.workspace = true
frame-system.workspace = true
frame-support.workspace = true
pallet-balances.workspace = true
sp-std.workspace = true
sp-core.workspace = true
sp-keyring.workspace = true
sp-runtime.workspace = true
sp-io.workspace = true
pallet-dispenser.workspace = true
Expand Down Expand Up @@ -78,7 +78,7 @@ pallet-aura.workspace = true
pallet-session.workspace = true
pallet-proxy-bonding.workspace = true
pallet-skip-feeless-payment.workspace = true
xcm-fee-payment-runtime-api.workspace = true
xcm-runtime-apis.workspace = true
hex-literal.workspace = true
hex.workspace = true
assets-common.workspace = true
Expand Down Expand Up @@ -142,12 +142,11 @@ std = [
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
"rococo-runtime-constants/std",
"rococo-runtime/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm-fee-payment-runtime-api/std",
"xcm-runtime-apis/std",
"xcm/std",
"assets-common/std"
]
Expand Down Expand Up @@ -189,5 +188,7 @@ runtime-benchmarks = [
"rococo-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"xcm-fee-payment-runtime-api/runtime-benchmarks",
"xcm-runtime-apis/runtime-benchmarks",
"assets-common/runtime-benchmarks",
"pallet-transaction-payment/runtime-benchmarks"
]
3 changes: 0 additions & 3 deletions integration-tests/chopsticks/.papi/descriptors/.gitignore

This file was deleted.

30 changes: 20 additions & 10 deletions integration-tests/chopsticks/src/managers/PolimecManager.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { type Accounts, Asset, AssetLocation, AssetSourceRelation, Chains } from '@/types';
import { flatObject } from '@/utils.ts';
import { polimec } from '@polkadot-api/descriptors';
import { createClient } from 'polkadot-api';
import { withPolkadotSdkCompat } from 'polkadot-api/polkadot-sdk-compat';
import { getWsProvider } from 'polkadot-api/ws-provider/web';
import { BaseChainManager } from './BaseManager';
import {
type Accounts,
Asset,
AssetLocation,
AssetSourceRelation,
Chains,
} from "@/types";
import { flatObject } from "@/utils.ts";
import { polimec } from "@polkadot-api/descriptors";
import { createClient } from "polkadot-api";
import { withPolkadotSdkCompat } from "polkadot-api/polkadot-sdk-compat";
import { getWsProvider } from "polkadot-api/ws-provider/web";
import { BaseChainManager } from "./BaseManager";

export class PolimecManager extends BaseChainManager {
private chain = Chains.Polimec;
Expand Down Expand Up @@ -36,7 +42,7 @@ export class PolimecManager extends BaseChainManager {
}

getTreasuryAccount() {
return '58kXueYKLr5b8yCeY3Gd1nLQX2zSJLXjfMzTAuksNq25CFEL' as Accounts;
return "58kXueYKLr5b8yCeY3Gd1nLQX2zSJLXjfMzTAuksNq25CFEL" as Accounts;
}

getAssetSourceRelation(asset: Asset): AssetSourceRelation {
Expand All @@ -59,8 +65,12 @@ export class PolimecManager extends BaseChainManager {
const api = this.getApi(Chains.Polimec);
const asset_source_relation = this.getAssetSourceRelation(asset);
const asset_location = AssetLocation(asset, asset_source_relation).value;
const account_balances_result = await api.apis.FungiblesApi.query_account_balances(account);
if (account_balances_result.success === true && account_balances_result.value.type === 'V4') {
const account_balances_result =
await api.apis.FungiblesApi.query_account_balances(account);
if (
account_balances_result.success === true &&
account_balances_result.value.type === "V4"
) {
const assets = account_balances_result.value.value;
for (const asset of assets) {
if (Bun.deepEquals(flatObject(asset.id), flatObject(asset_location))) {
Expand Down
1 change: 1 addition & 0 deletions integration-tests/chopsticks/src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export class ChainSetup {
'wasm-override': POLIMEC_WASM,
'import-storage': polimec_storage,
'build-block-mode': BuildBlockMode.Instant,
'runtime-log-level': 5,
});
}

Expand Down
58 changes: 43 additions & 15 deletions integration-tests/chopsticks/src/tests/polimec.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,62 @@ describe('Polimec -> Hub Transfer Tests', () => {
});
afterAll(async () => await chainSetup.cleanup());

test(
'Send USDC to Hub',
() =>
transferTest.testTransfer({
account: Accounts.BOB,
assets: [[Asset.USDC, TRANSFER_AMOUNTS.TOKENS, AssetSourceRelation.Sibling]],
}),
{ timeout: 25000 },
);
// test(
// 'Send USDC to Hub',
// () =>
// transferTest.testTransfer({
// account: Accounts.BOB,
// assets: [[Asset.USDC, TRANSFER_AMOUNTS.TOKENS, AssetSourceRelation.Sibling]],
// }),
// { timeout: 25000 },
// );
//
// test(
// 'Send USDT to Hub',
// () =>
// transferTest.testTransfer({
// account: Accounts.BOB,
// assets: [[Asset.USDT, TRANSFER_AMOUNTS.TOKENS, AssetSourceRelation.Sibling]],
// }),
// { timeout: 25000 },
// );

// test(
// 'Send DOT to Hub',
// () =>
// transferTest.testTransfer({
// account: Accounts.BOB,
// assets: [[Asset.DOT, TRANSFER_AMOUNTS.NATIVE, AssetSourceRelation.Parent]],
// }),
// { timeout: 25000 },
// );

test(
'Send USDT to Hub',
'Send PLMC to Hub',
() =>
transferTest.testTransfer({
account: Accounts.BOB,
assets: [[Asset.USDT, TRANSFER_AMOUNTS.TOKENS, AssetSourceRelation.Sibling]],
assets: [
[Asset.PLMC, TRANSFER_AMOUNTS.NATIVE, AssetSourceRelation.Self],
[Asset.DOT, TRANSFER_AMOUNTS.NATIVE, AssetSourceRelation.Parent],
],
fee_asset_item: 1,
}),
{ timeout: 25000 },
{ timeout: 25000000 },
);

test(
'Send DOT to Hub',
'Send PLMC to Hub',
() =>
transferTest.testTransfer({
account: Accounts.BOB,
assets: [[Asset.DOT, TRANSFER_AMOUNTS.NATIVE, AssetSourceRelation.Parent]],
assets: [
[Asset.PLMC, TRANSFER_AMOUNTS.NATIVE, AssetSourceRelation.Self],
[Asset.DOT, TRANSFER_AMOUNTS.NATIVE, AssetSourceRelation.Parent],
],
fee_asset_item: 1,
}),
{ timeout: 25000 },
{ timeout: 25000000 },
);

test(
Expand Down
1 change: 1 addition & 0 deletions integration-tests/chopsticks/src/transfers/BaseTransfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export abstract class BaseTransferTest {
protected async verifyExecution() {
const events = await this.destManager.getMessageQueueEvents();

console.dir(events, { depth: null });
expect(events).not.toBeEmpty();
expect(events).toBeArray();
expect(events).toHaveLength(1);
Expand Down
Loading