git.delta.rocks / unique-network / refs/commits / 5861f4f5f981

difftreelog

fix use destWeight struct

Daniel Shiposha2022-12-20parent: #e23fc19.patch.diff
in: master

1 file changed

modifiedtests/src/util/playgrounds/unique.tsdiffbeforeafterboth
2740 this.palletName = palletName;2740 this.palletName = palletName;
2741 }2741 }
27422742
2743 async limitedReserveTransferAssets(signer: TSigner, destination: any, beneficiary: any, assets: any, feeAssetItem: number, weightLimit: number) {2743 async limitedReserveTransferAssets(signer: TSigner, destination: any, beneficiary: any, assets: any, feeAssetItem: number, weightLimit: any) {
2744 await this.helper.executeExtrinsic(signer, `api.tx.${this.palletName}.limitedReserveTransferAssets`, [destination, beneficiary, assets, feeAssetItem, {Limited: weightLimit}], true);2744 await this.helper.executeExtrinsic(signer, `api.tx.${this.palletName}.limitedReserveTransferAssets`, [destination, beneficiary, assets, feeAssetItem, weightLimit], true);
2745 }2745 }
2746
2747 async teleportAssets(signer: TSigner, destination: any, beneficiary: any, assets: any, feeAssetItem: number) {
2748 await this.helper.executeExtrinsic(signer, `api.tx.${this.palletName}.teleportAssets`, [destination, beneficiary, assets, feeAssetItem], true);
2749 }
2750
2751 async teleportNativeAsset(signer: TSigner, destinationParaId: number, targetAccount: Uint8Array, amount: bigint) {
2752 const destination = {
2753 V1: {
2754 parents: 0,
2755 interior: {
2756 X1: {
2757 Parachain: destinationParaId,
2758 },
2759 },
2760 },
2761 };
2762
2763 const beneficiary = {
2764 V1: {
2765 parents: 0,
2766 interior: {
2767 X1: {
2768 AccountId32: {
2769 network: 'Any',
2770 id: targetAccount,
2771 },
2772 },
2773 },
2774 },
2775 };
2776
2777 const assets = {
2778 V1: [
2779 {
2780 id: {
2781 Concrete: {
2782 parents: 0,
2783 interior: 'Here',
2784 },
2785 },
2786 fun: {
2787 Fungible: amount,
2788 },
2789 },
2790 ],
2791 };
2792
2793 const feeAssetItem = 0;
2794
2795 await this.teleportAssets(signer, destination, beneficiary, assets, feeAssetItem);
2796 }
2746}2797}
27472798
2748class XTokensGroup<T extends ChainHelperBase> extends HelperGroup<T> {2799class XTokensGroup<T extends ChainHelperBase> extends HelperGroup<T> {
2749 async transfer(signer: TSigner, currencyId: any, amount: bigint, destination: any, destWeight: number) {2800 async transfer(signer: TSigner, currencyId: any, amount: bigint, destination: any, destWeight: any) {
2750 await this.helper.executeExtrinsic(signer, 'api.tx.xTokens.transfer', [currencyId, amount, destination, destWeight], true);2801 await this.helper.executeExtrinsic(signer, 'api.tx.xTokens.transfer', [currencyId, amount, destination, destWeight], true);
2751 }2802 }
27522803
2753 async transferMultiasset(signer: TSigner, asset: any, destination: any, destWeight: number) {2804 async transferMultiasset(signer: TSigner, asset: any, destination: any, destWeight: any) {
2754 await this.helper.executeExtrinsic(signer, 'api.tx.xTokens.transferMultiasset', [asset, destination, destWeight], true);2805 await this.helper.executeExtrinsic(signer, 'api.tx.xTokens.transferMultiasset', [asset, destination, destWeight], true);
2755 }2806 }
27562807
2757 async transferMulticurrencies(signer: TSigner, currencies: any[], feeItem: number, destLocation: any, destWeight: number) {2808 async transferMulticurrencies(signer: TSigner, currencies: any[], feeItem: number, destLocation: any, destWeight: any) {
2758 await this.helper.executeExtrinsic(signer, 'api.tx.xTokens.transferMulticurrencies', [currencies, feeItem, destLocation, destWeight], true);2809 await this.helper.executeExtrinsic(signer, 'api.tx.xTokens.transferMulticurrencies', [currencies, feeItem, destLocation, destWeight], true);
2759 }2810 }
2760}2811}