difftreelog
fix set safe xcm version in tests
in: master
3 files changed
tests/src/util/playgrounds/unique.tsdiffbeforeafterboth2951 await this.helper.executeExtrinsic(signer, `api.tx.${this.palletName}.limitedReserveTransferAssets`, [destination, beneficiary, assets, feeAssetItem, weightLimit], true);2951 await this.helper.executeExtrinsic(signer, `api.tx.${this.palletName}.limitedReserveTransferAssets`, [destination, beneficiary, assets, feeAssetItem, weightLimit], true);2952 }2952 }29532954 async setSafeXcmVersion(signer: TSigner, version: number) {2955 await this.helper.executeExtrinsic(signer, `api.tx.${this.palletName}.forceDefaultXcmVersion`, [version], true);2956 }295329572954 async teleportAssets(signer: TSigner, destination: any, beneficiary: any, assets: any, feeAssetItem: number) {2958 async teleportAssets(signer: TSigner, destination: any, beneficiary: any, assets: any, feeAssetItem: number) {2955 await this.helper.executeExtrinsic(signer, `api.tx.${this.palletName}.teleportAssets`, [destination, beneficiary, assets, feeAssetItem], true);2959 await this.helper.executeExtrinsic(signer, `api.tx.${this.palletName}.teleportAssets`, [destination, beneficiary, assets, feeAssetItem], true);tests/src/xcm/xcmQuartz.test.tsdiffbeforeafterboth49const USDT_ASSET_METADATA_MINIMAL_BALANCE = 1n;49const USDT_ASSET_METADATA_MINIMAL_BALANCE = 1n;50const USDT_ASSET_AMOUNT = 10_000_000_000_000_000_000_000_000n;50const USDT_ASSET_AMOUNT = 10_000_000_000_000_000_000_000_000n;5152const SAFE_XCM_VERSION = 2;515352describeXCM('[XCM] Integration test: Exchanging USDT with Statemine', () => {54describeXCM('[XCM] Integration test: Exchanging USDT with Statemine', () => {53 let alice: IKeyringPair;55 let alice: IKeyringPair;6971707271 before(async () => {73 before(async () => {72 await usingPlaygrounds(async (_helper, privateKey) => {74 await usingPlaygrounds(async (helper, privateKey) => {73 alice = await privateKey('//Alice');75 alice = await privateKey('//Alice');74 bob = await privateKey('//Bob'); // sovereign account on Statemine(t) funds donor76 bob = await privateKey('//Bob'); // sovereign account on Statemine(t) funds donor7778 // Set the default version to wrap the first message to other chains.79 await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION);75 });80 });768177 await usingRelayPlaygrounds(relayUrl, async (helper) => {82 await usingRelayPlaygrounds(relayUrl, async (helper) => {314319315 // the commission has been paid in parachain native token320 // the commission has been paid in parachain native token316 balanceQuartzFinal = await helper.balance.getSubstrate(alice.address);321 balanceQuartzFinal = await helper.balance.getSubstrate(alice.address);317 console.log('[Quartz -> Statemine] transaction fees on Quartz: %s QTZ', helper.util.bigIntToDecimals(balanceQuartzFinal - balanceQuartzAfter));322 console.log('[Quartz -> Statemine] transaction fees on Quartz: %s QTZ', helper.util.bigIntToDecimals(balanceQuartzAfter - balanceQuartzFinal));318 expect(balanceQuartzAfter > balanceQuartzFinal).to.be.true;323 expect(balanceQuartzAfter > balanceQuartzFinal).to.be.true;319324320 await usingStateminePlaygrounds(statemineUrl, async (helper) => {325 await usingStateminePlaygrounds(statemineUrl, async (helper) => {467 alice = await privateKey('//Alice');472 alice = await privateKey('//Alice');468 [randomAccount] = await helper.arrange.createAccounts([0n], alice);473 [randomAccount] = await helper.arrange.createAccounts([0n], alice);474475 // Set the default version to wrap the first message to other chains.476 await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION);469 });477 });470478471 await usingKaruraPlaygrounds(karuraUrl, async (helper) => {479 await usingKaruraPlaygrounds(karuraUrl, async (helper) => {636 let alice: IKeyringPair;644 let alice: IKeyringPair;637645638 before(async () => {646 before(async () => {639 await usingPlaygrounds(async (_helper, privateKey) => {647 await usingPlaygrounds(async (helper, privateKey) => {640 alice = await privateKey('//Alice');648 alice = await privateKey('//Alice');649650 // Set the default version to wrap the first message to other chains.651 await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION);641 });652 });642 });653 });643654727738728 balanceForeignQtzTokenInit = 0n;739 balanceForeignQtzTokenInit = 0n;740 741 // Set the default version to wrap the first message to other chains.742 const alice = quartzDonor;743 await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION);729 });744 });730745731 await usingMoonriverPlaygrounds(moonriverUrl, async (helper) => {746 await usingMoonriverPlaygrounds(moonriverUrl, async (helper) => {tests/src/xcm/xcmUnique.test.tsdiffbeforeafterboth49const USDT_ASSET_METADATA_MINIMAL_BALANCE = 1n;49const USDT_ASSET_METADATA_MINIMAL_BALANCE = 1n;50const USDT_ASSET_AMOUNT = 10_000_000_000_000_000_000_000_000n;50const USDT_ASSET_AMOUNT = 10_000_000_000_000_000_000_000_000n;5152const SAFE_XCM_VERSION = 2;515352describeXCM('[XCM] Integration test: Exchanging USDT with Statemint', () => {54describeXCM('[XCM] Integration test: Exchanging USDT with Statemint', () => {53 let alice: IKeyringPair;55 let alice: IKeyringPair;6971707271 before(async () => {73 before(async () => {72 await usingPlaygrounds(async (_helper, privateKey) => {74 await usingPlaygrounds(async (helper, privateKey) => {73 alice = await privateKey('//Alice');75 alice = await privateKey('//Alice');74 bob = await privateKey('//Bob'); // sovereign account on Statemint funds donor76 bob = await privateKey('//Bob'); // sovereign account on Statemint funds donor7778 // Set the default version to wrap the first message to other chains.79 await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION);75 });80 });768177 await usingRelayPlaygrounds(relayUrl, async (helper) => {82 await usingRelayPlaygrounds(relayUrl, async (helper) => {314319315 // the commission has been paid in parachain native token320 // the commission has been paid in parachain native token316 balanceUniqueFinal = await helper.balance.getSubstrate(alice.address);321 balanceUniqueFinal = await helper.balance.getSubstrate(alice.address);317 console.log('[Unique -> Statemint] transaction fees on Unique: %s UNQ', helper.util.bigIntToDecimals(balanceUniqueFinal - balanceUniqueAfter));322 console.log('[Unique -> Statemint] transaction fees on Unique: %s UNQ', helper.util.bigIntToDecimals(balanceUniqueAfter - balanceUniqueFinal));318 expect(balanceUniqueAfter > balanceUniqueFinal).to.be.true;323 expect(balanceUniqueAfter > balanceUniqueFinal).to.be.true;319324320 await usingStatemintPlaygrounds(statemintUrl, async (helper) => {325 await usingStatemintPlaygrounds(statemintUrl, async (helper) => {467 alice = await privateKey('//Alice');472 alice = await privateKey('//Alice');468 [randomAccount] = await helper.arrange.createAccounts([0n], alice);473 [randomAccount] = await helper.arrange.createAccounts([0n], alice);474475 // Set the default version to wrap the first message to other chains.476 await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION);469 });477 });470478471 await usingAcalaPlaygrounds(acalaUrl, async (helper) => {479 await usingAcalaPlaygrounds(acalaUrl, async (helper) => {637 let alice: IKeyringPair;645 let alice: IKeyringPair;638646639 before(async () => {647 before(async () => {640 await usingPlaygrounds(async (_helper, privateKey) => {648 await usingPlaygrounds(async (helper, privateKey) => {641 alice = await privateKey('//Alice');649 alice = await privateKey('//Alice');650651 // Set the default version to wrap the first message to other chains.652 await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION);642 });653 });643 });654 });644655728739729 balanceForeignUnqTokenInit = 0n;740 balanceForeignUnqTokenInit = 0n;741742 // Set the default version to wrap the first message to other chains.743 const alice = uniqueDonor;744 await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION);730 });745 });731746732 await usingMoonbeamPlaygrounds(moonbeamUrl, async (helper) => {747 await usingMoonbeamPlaygrounds(moonbeamUrl, async (helper) => {