difftreelog
Xcm tests completed
in: master
2 files changed
tests/package.jsondiffbeforeafterboth--- a/tests/package.json
+++ b/tests/package.json
@@ -68,6 +68,7 @@
"testPalletPresence": "mocha --timeout 9999999 -r ts-node/register ./**/pallet-presence.test.ts",
"testBlockProduction": "mocha --timeout 9999999 -r ts-node/register ./**/block-production.test.ts",
"testEnableDisableTransfers": "mocha --timeout 9999999 -r ts-node/register ./**/enableDisableTransfer.test.ts",
+ "testXcm": "mocha --timeout 9999999 -r ts-node/register ./**/xcmTransfer.test.ts",
"polkadot-types-from-defs": "ts-node ./node_modules/.bin/polkadot-types-from-defs --input src/interfaces/ --package .",
"polkadot-types-from-chain": "ts-node ./node_modules/.bin/polkadot-types-from-chain --endpoint ws://localhost:9944 --output src/interfaces/ --package .",
"polkadot-types": "yarn polkadot-types-from-defs && yarn polkadot-types-from-chain"
tests/src/xcmTransfer.test.tsdiffbeforeafterboth130 }, {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)});130 }, {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)});131 });131 });132132133 /// TODO Under construction. The test won't pass.134 it.skip('Should connect to Karura and send OPL back', async () => {133 it('Should connect to Karura and send OPL back', async () => {135 let balanceBefore: bigint;134 let balanceBefore: bigint;136 135 137 await usingApi(async (api) => {136 await usingApi(async (api) => {138 [balanceBefore] = await getBalance(api, [alicesPublicKey]);137 [balanceBefore] = await getBalance(api, [alicesPublicKey]);139 });138 });140139141 await usingApi(async (api) => {140 await usingApi(async (api) => {142 const destination = {143 V0: {144 X2: [145 'Parent',146 {147 Parachain: UNIQUE_CHAIN,148 },149 ],150 },151 };152153 const beneficiary = {141 const destination = {154 V0: {142 V0: {155 X1: {143 X3: [144 'Parent',145 {146 Parachain: UNIQUE_CHAIN,147 },148 {156 AccountId32: {149 AccountId32: {157 network: 'Any',150 network: 'Any',158 id: alice.addressRaw,151 id: alice.addressRaw,159 },152 },160 },153 },154 ],161 },155 },162 };156 };163157164 const assets = {158 const id = {165 V1: [159 ForeignAsset: 0,166 {167 id: {168 Concrete: {169 parents: 0,170 interior: 'Here',171 },172 },173 fun: {174 Fungible: 5000000000,175 },176 },177 ],178 };160 };179161180 const feeAssetItem = 0;162 const amount = 5000000000;181182 const weightLimit = {163 const destWeight = 50000000;183 Limited: 5000000000,164184 };185186 // todo The functionality to be tested is not complete yet. The metadata above are subject to change, as is the transaction below.187 const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit);165 const tx = api.tx.xTokens.transfer(id, amount, destination, destWeight);188 const events = await submitTransactionAsync(alice, tx);166 const events = await submitTransactionAsync(alice, tx);189 const result = getGenericResult(events);167 const result = getGenericResult(events);190 expect(result.success).to.be.true;168 expect(result.success).to.be.true;