difftreelog
fix(xcm test) hooks for `Astar`\`Shiden`
in: master
5 files changed
tests/src/util/playgrounds/unique.xcm.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.xcm.ts
+++ b/tests/src/util/playgrounds/unique.xcm.ts
@@ -244,6 +244,10 @@
await this.helper.executeExtrinsic(signer, 'api.tx.assets.create', [assetId, admin, minimalBalance], true);
}
+ async forceCreate(signer: TSigner, assetId: number | bigint, admin: string, minimalBalance: bigint, isSufficient = true) {
+ await this.helper.executeExtrinsic(signer, 'api.tx.assets.forceCreate', [assetId, admin, isSufficient, minimalBalance], true);
+ }
+
async setMetadata(signer: TSigner, assetId: number | bigint, name: string, symbol: string, decimals: number) {
await this.helper.executeExtrinsic(signer, 'api.tx.assets.setMetadata', [assetId, name, symbol, decimals], true);
}
tests/src/xcm/lowLevelXcmQuartz.test.tsdiffbeforeafterboth--- a/tests/src/xcm/lowLevelXcmQuartz.test.ts
+++ b/tests/src/xcm/lowLevelXcmQuartz.test.ts
@@ -243,7 +243,7 @@
await usingShidenPlaygrounds(shidenUrl, async (helper) => {
if(!(await helper.callRpc('api.query.assets.asset', [QTZ_ASSET_ID_ON_SHIDEN])).toJSON()) {
console.log('1. Create foreign asset and metadata');
- await helper.assets.create(
+ await helper.getSudo().assets.forceCreate(
alice,
QTZ_ASSET_ID_ON_SHIDEN,
alice.address,
tests/src/xcm/lowLevelXcmUnique.test.tsdiffbeforeafterboth--- a/tests/src/xcm/lowLevelXcmUnique.test.ts
+++ b/tests/src/xcm/lowLevelXcmUnique.test.ts
@@ -309,7 +309,7 @@
await usingAstarPlaygrounds(astarUrl, async (helper) => {
if(!(await helper.callRpc('api.query.assets.asset', [UNQ_ASSET_ID_ON_ASTAR])).toJSON()) {
console.log('1. Create foreign asset and metadata');
- await helper.assets.create(
+ await helper.getSudo().assets.forceCreate(
alice,
UNQ_ASSET_ID_ON_ASTAR,
alice.address,
tests/src/xcm/xcmQuartz.test.tsdiffbeforeafterboth--- a/tests/src/xcm/xcmQuartz.test.ts
+++ b/tests/src/xcm/xcmQuartz.test.ts
@@ -1290,11 +1290,11 @@
const shidenInitialBalance = 1n * (10n ** SHIDEN_DECIMALS); // 1 SHD, existential deposit required to actually create the account on Shiden
const unitsPerSecond = 500_451_000_000_000_000_000n; // The value is taken from the live Shiden
const qtzToShidenTransferred = 10n * (10n ** QTZ_DECIMALS); // 10 QTZ
- const qtzToShidenArrived = 9_999_999_999_088_000_000n; // 9.999 ... QTZ, Shiden takes a commision in foreign tokens
+ const qtzToShidenArrived = 7_998_196_000_000_000_000n; // 7.99 ... QTZ, Shiden takes a commision in foreign tokens
// Shiden -> Quartz
const qtzFromShidenTransfered = 5n * (10n ** QTZ_DECIMALS); // 5 QTZ
- const qtzOnShidenLeft = qtzToShidenArrived - qtzFromShidenTransfered; // 4.999_999_999_088_000_000n QTZ
+ const qtzOnShidenLeft = qtzToShidenArrived - qtzFromShidenTransfered; // 2.99 ... QTZ
let balanceAfterQuartzToShidenXCM: bigint;
@@ -1311,7 +1311,7 @@
await usingShidenPlaygrounds(shidenUrl, async (helper) => {
if(!(await helper.callRpc('api.query.assets.asset', [QTZ_ASSET_ID_ON_SHIDEN])).toJSON()) {
console.log('1. Create foreign asset and metadata');
- await helper.assets.create(
+ await helper.getSudo().assets.forceCreate(
alice,
QTZ_ASSET_ID_ON_SHIDEN,
alice.address,
tests/src/xcm/xcmUnique.test.tsdiffbeforeafterboth1518 const astarInitialBalance = 1n * (10n ** ASTAR_DECIMALS); // 1 ASTR, existential deposit required to actually create the account on Astar.1518 const astarInitialBalance = 1n * (10n ** ASTAR_DECIMALS); // 1 ASTR, existential deposit required to actually create the account on Astar.1519 const unitsPerSecond = 9_451_000_000_000_000_000n; // The value is taken from the live Astar1519 const unitsPerSecond = 9_451_000_000_000_000_000n; // The value is taken from the live Astar1520 const unqToAstarTransferred = 10n * (10n ** UNQ_DECIMALS); // 10 UNQ1520 const unqToAstarTransferred = 10n * (10n ** UNQ_DECIMALS); // 10 UNQ1521 const unqToAstarArrived = 9_999_999_999_088_000_000n; // 9.999 ... UNQ, Astar takes a commision in foreign tokens1521 const unqToAstarArrived = 9_962_196_000_000_000_000n; // 9.962 ... UNQ, Astar takes a commision in foreign tokens152215221523 // Astar -> Unique1523 // Astar -> Unique1524 const unqFromAstarTransfered = 5n * (10n ** UNQ_DECIMALS); // 5 UNQ1524 const unqFromAstarTransfered = 5n * (10n ** UNQ_DECIMALS); // 5 UNQ1525 const unqOnAstarLeft = unqToAstarArrived - unqFromAstarTransfered; // 4.999_999_999_088_000_000n UNQ1525 const unqOnAstarLeft = unqToAstarArrived - unqFromAstarTransfered; // 4.962_219_600_000_000_000n UNQ152615261527 let balanceAfterUniqueToAstarXCM: bigint;1527 let balanceAfterUniqueToAstarXCM: bigint;152815281539 await usingAstarPlaygrounds(astarUrl, async (helper) => {1539 await usingAstarPlaygrounds(astarUrl, async (helper) => {1540 if(!(await helper.callRpc('api.query.assets.asset', [UNQ_ASSET_ID_ON_ASTAR])).toJSON()) {1540 if(!(await helper.callRpc('api.query.assets.asset', [UNQ_ASSET_ID_ON_ASTAR])).toJSON()) {1541 console.log('1. Create foreign asset and metadata');1541 console.log('1. Create foreign asset and metadata');1542 await helper.assets.create(1542 await helper.getSudo().assets.forceCreate(1543 alice,1543 alice,1544 UNQ_ASSET_ID_ON_ASTAR,1544 UNQ_ASSET_ID_ON_ASTAR,1545 alice.address,1545 alice.address,