Skip to content

Commit 04e7c43

Browse files
committedFeb 19, 2025
PLMC AH transfer test
1 parent 7129d98 commit 04e7c43

29 files changed

+9063
-110
lines changed
 

‎Cargo.lock

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ members = [
77
"macros",
88
"macros/tests",
99
"polimec-common/*",
10+
"pallet-xcm-temp",
1011
]
1112
default-members = ["nodes/*", "pallets/*"]
1213
resolver = "2"
@@ -247,4 +248,7 @@ cumulus-pallet-session-benchmarking = { version = "16.0.0", default-features = f
247248
# Runtimes
248249
polimec-runtime = { path = "runtimes/polimec" }
249250
rococo-runtime-constants = { version = "14.0.0" }
250-
rococo-runtime = { version = "14.0.0" }
251+
rococo-runtime = { version = "14.0.0" }
252+
253+
[patch.crates-io]
254+
pallet-xcm = { path = "pallet-xcm-temp" }

‎integration-tests/chopsticks/.papi/descriptors/.gitignore

-3
This file was deleted.

‎integration-tests/chopsticks/.papi/descriptors/package.json

-24
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.

‎integration-tests/chopsticks/.papi/polkadot-api.json

-21
This file was deleted.

‎integration-tests/chopsticks/src/managers/PolimecManager.ts

+12-5
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ export class PolimecManager extends BaseChainManager {
5050
case Asset.WETH:
5151
// Placeholder
5252
return AssetSourceRelation.Self;
53+
case Asset.PLMC:
54+
return AssetSourceRelation.Self;
5355
}
5456
}
5557

@@ -69,12 +71,17 @@ export class PolimecManager extends BaseChainManager {
6971
return 0n;
7072
}
7173

72-
async getLocalXcmFee() {
74+
async getXcmFee() {
7375
const api = this.getApi(Chains.Polimec);
7476
const events = await api.event.PolkadotXcm.FeesPaid.pull();
75-
if (!events.length) return 0n;
76-
const fees = events[0]?.payload?.fees;
77-
if (!fees?.length) return 0n;
78-
return (fees[0]?.fun?.value as bigint) || 0n;
77+
console.dir(events, { depth: null });
78+
79+
return events[0]?.payload.fees?.[0]?.fun?.value ?? 0n;
80+
}
81+
82+
async getTransactionFee() {
83+
const api = this.getApi(Chains.Polimec);
84+
const events = await api.event.TransactionPayment.TransactionFeePaid.pull();
85+
return (events[0]?.payload.actual_fee as bigint) || 0n;
7986
}
8087
}

‎integration-tests/chopsticks/src/managers/PolkadotHubManager.ts

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ export class PolkadotHubManager extends BaseChainManager {
4646
case Asset.WETH:
4747
// This is not actually used, so we use Self as a placeholder
4848
return AssetSourceRelation.Self;
49+
case Asset.PLMC:
50+
return AssetSourceRelation.Sibling;
4951
}
5052
}
5153

‎integration-tests/chopsticks/src/setup.ts

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export class ChainSetup {
100100
'wasm-override': POLIMEC_WASM,
101101
'import-storage': polimec_storage,
102102
'build-block-mode': BuildBlockMode.Instant,
103+
'runtime-log-level': 5,
103104
});
104105
}
105106

‎integration-tests/chopsticks/src/tests/polimec.test.ts

+35-21
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,47 @@ describe('Polimec -> Hub Transfer Tests', () => {
1919
});
2020
afterAll(async () => await chainSetup.cleanup());
2121

22-
test(
23-
'Send USDC to Hub',
24-
() =>
25-
transferTest.testTransfer({
26-
account: Accounts.BOB,
27-
assets: [[Asset.USDC, TRANSFER_AMOUNTS.TOKENS, AssetSourceRelation.Sibling]],
28-
}),
29-
{ timeout: 25000 },
30-
);
22+
// test(
23+
// 'Send USDC to Hub',
24+
// () =>
25+
// transferTest.testTransfer({
26+
// account: Accounts.BOB,
27+
// assets: [[Asset.USDC, TRANSFER_AMOUNTS.TOKENS, AssetSourceRelation.Sibling]],
28+
// }),
29+
// { timeout: 25000 },
30+
// );
31+
//
32+
// test(
33+
// 'Send USDT to Hub',
34+
// () =>
35+
// transferTest.testTransfer({
36+
// account: Accounts.BOB,
37+
// assets: [[Asset.USDT, TRANSFER_AMOUNTS.TOKENS, AssetSourceRelation.Sibling]],
38+
// }),
39+
// { timeout: 25000 },
40+
// );
3141

32-
test(
33-
'Send USDT to Hub',
34-
() =>
35-
transferTest.testTransfer({
36-
account: Accounts.BOB,
37-
assets: [[Asset.USDT, TRANSFER_AMOUNTS.TOKENS, AssetSourceRelation.Sibling]],
38-
}),
39-
{ timeout: 25000 },
40-
);
42+
// test(
43+
// 'Send DOT to Hub',
44+
// () =>
45+
// transferTest.testTransfer({
46+
// account: Accounts.BOB,
47+
// assets: [[Asset.DOT, TRANSFER_AMOUNTS.NATIVE, AssetSourceRelation.Parent]],
48+
// }),
49+
// { timeout: 25000 },
50+
// );
4151

4252
test(
43-
'Send DOT to Hub',
53+
'Send PLMC to Hub',
4454
() =>
4555
transferTest.testTransfer({
4656
account: Accounts.BOB,
47-
assets: [[Asset.DOT, TRANSFER_AMOUNTS.NATIVE, AssetSourceRelation.Parent]],
57+
assets: [
58+
[Asset.PLMC, TRANSFER_AMOUNTS.NATIVE, AssetSourceRelation.Self],
59+
[Asset.DOT, TRANSFER_AMOUNTS.NATIVE, AssetSourceRelation.Parent],
60+
],
61+
fee_asset_item: 1,
4862
}),
49-
{ timeout: 25000 },
63+
{ timeout: 25000000 },
5064
);
5165
});

‎integration-tests/chopsticks/src/transfers/BaseTransfer.ts

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { sleep } from 'bun';
1313
export interface TransferOptions {
1414
account: Accounts;
1515
assets: [Asset, bigint, AssetSourceRelation][];
16+
fee_asset_item?: number;
1617
}
1718

1819
export abstract class BaseTransferTest {
@@ -63,6 +64,7 @@ export abstract class BaseTransferTest {
6364
protected async verifyExecution() {
6465
const events = await this.destManager.getMessageQueueEvents();
6566

67+
console.dir(events, { depth: null });
6668
expect(events).not.toBeEmpty();
6769
expect(events).toBeArray();
6870
expect(events).toHaveLength(1);

0 commit comments

Comments
 (0)