Skip to content

Commit

Permalink
fix last TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
TarikGul committed Oct 25, 2023
1 parent 0c99786 commit 4fca041
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/errors/checkXcmTxInputs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ describe('checkParaAssets', () => {
expect(registry.cacheLookupPoolAsset('0')).toEqual({
lpToken: '0',
pairInfo:
'[[{"parents":0,"interior":{"here":null}},{"parents":0,"interior":{"x2":[{"palletInstance":50},{"generalIndex":100}]}}]]',
'[[{"parents":"0","interior":{"Here":""}},{"parents":"0","interior":{"X2":[{"PalletInstance":"50"},{"GeneralIndex":"100"}]}}]]',
});
});
});
Expand Down
7 changes: 1 addition & 6 deletions src/errors/checkXcmTxInputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,6 @@ export const checkLiquidTokenValidity = async (
for (let i = 0; i < poolAssets.length; i++) {
const poolAsset = poolAssets[i];
const poolAssetData = JSON.stringify(poolAsset[0].toHuman()).replace(/(\d),/g, '$1');
// TODO: remove this createType
const palletAssetConversionNativeOrAssetIdData = api.registry.createType(
'Vec<Vec<MultiLocation>>',
JSON.parse(poolAssetData)
);

const poolAssetInfo = poolAsset[1].unwrap();
if (poolAssetInfo.lpToken.toString() === assetId) {
Expand All @@ -374,7 +369,7 @@ export const checkLiquidTokenValidity = async (
pairInfo: string;
} = {
lpToken: assetId,
pairInfo: JSON.stringify(palletAssetConversionNativeOrAssetIdData.toJSON()),
pairInfo: poolAssetData,
};

// cache the queried liquidToken asset
Expand Down

0 comments on commit 4fca041

Please sign in to comment.