From 054776504f3318c1a826d49513778170b90b5174 Mon Sep 17 00:00:00 2001 From: tarikgul Date: Mon, 6 Nov 2023 09:15:25 -0500 Subject: [PATCH] fix(internal): remove createType(Call) where applicable --- scripts/testNetworkLiquidAssets.ts | 4 ++-- src/AssetTransferApi.ts | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/scripts/testNetworkLiquidAssets.ts b/scripts/testNetworkLiquidAssets.ts index c3a5e808..05d54ee4 100644 --- a/scripts/testNetworkLiquidAssets.ts +++ b/scripts/testNetworkLiquidAssets.ts @@ -43,13 +43,13 @@ const mintCall = (api: ApiPromise, to: KeyringPair, amount: number) => { const createLiquidityPoolCall = (api: ApiPromise) => { // For now, we have to override the types of the Assets until PJS is updated - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any return api.tx.assetConversion.createPool(native, asset); }; const addLiquidityCall = (api: ApiPromise, amountNative: number, amountAsset: number, to: KeyringPair) => { // For now, we have to override the types of the Assets until PJS is updated - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any return api.tx.assetConversion.addLiquidity(native, asset, amountNative, amountAsset, 0, 0, to.address); }; diff --git a/src/AssetTransferApi.ts b/src/AssetTransferApi.ts index cbf733be..8d391fdd 100644 --- a/src/AssetTransferApi.ts +++ b/src/AssetTransferApi.ts @@ -634,7 +634,6 @@ export class AssetTransferApi { origin: string, opts: { format?: T; paysWithFeeOrigin?: string; sendersAddr?: string } ): Promise> { - const { _api } = this; const { format, paysWithFeeOrigin, sendersAddr } = opts; const fmt = format ? format : 'payload'; const result: TxResult = { @@ -648,12 +647,7 @@ export class AssetTransferApi { }; if (fmt === 'call') { - result.tx = _api.registry - .createType('Call', { - callIndex: tx.callIndex, - args: tx.args, - }) - .toHex() as ConstructedFormat; + result.tx = tx.method.toHex() as ConstructedFormat; } if (fmt === 'submittable') { @@ -840,7 +834,7 @@ export class AssetTransferApi { const lastHeader = await this._api.rpc.chain.getHeader(); const blockNumber = this._api.registry.createType('BlockNumber', lastHeader.number.toNumber()); - const method = this._api.registry.createType('Call', tx); + const method = tx.method; const era = this._api.registry.createType('ExtrinsicEra', { current: lastHeader.number.toNumber(), period: 64,