Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
TarikGul committed Oct 20, 2023
1 parent 355ca39 commit 1abab3d
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 56 deletions.
6 changes: 1 addition & 5 deletions src/createXcmTypes/ParaToPara.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

import type { ApiPromise } from '@polkadot/api';
import type { u32 } from '@polkadot/types';
import type {
MultiAssetsV2,
VersionedMultiAssets,
WeightLimitV2,
} from '@polkadot/types/interfaces';
import type { MultiAssetsV2, VersionedMultiAssets, WeightLimitV2 } from '@polkadot/types/interfaces';
import type { XcmV3MultiassetMultiAssets } from '@polkadot/types/lookup';
import type { AnyJson } from '@polkadot/types/types';

Expand Down
6 changes: 1 addition & 5 deletions src/createXcmTypes/ParaToSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

import type { ApiPromise } from '@polkadot/api';
import type { u32 } from '@polkadot/types';
import type {
MultiAssetsV2,
VersionedMultiAssets,
WeightLimitV2,
} from '@polkadot/types/interfaces';
import type { MultiAssetsV2, VersionedMultiAssets, WeightLimitV2 } from '@polkadot/types/interfaces';
import type { XcmV3MultiassetMultiAssets } from '@polkadot/types/lookup';
import type { AnyJson } from '@polkadot/types/types';

Expand Down
6 changes: 1 addition & 5 deletions src/createXcmTypes/RelayToPara.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

import type { ApiPromise } from '@polkadot/api';
import { u32 } from '@polkadot/types';
import type {
MultiAssetsV2,
VersionedMultiAssets,
WeightLimitV2,
} from '@polkadot/types/interfaces';
import type { MultiAssetsV2, VersionedMultiAssets, WeightLimitV2 } from '@polkadot/types/interfaces';
import type { XcmV3MultiassetMultiAssets } from '@polkadot/types/lookup';
import { isEthereumAddress } from '@polkadot/util-crypto';

Expand Down
6 changes: 1 addition & 5 deletions src/createXcmTypes/RelayToSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

import type { ApiPromise } from '@polkadot/api';
import { u32 } from '@polkadot/types';
import type {
MultiAssetsV2,
VersionedMultiAssets,
WeightLimitV2,
} from '@polkadot/types/interfaces';
import type { MultiAssetsV2, VersionedMultiAssets, WeightLimitV2 } from '@polkadot/types/interfaces';
import type { XcmV3MultiassetMultiAssets } from '@polkadot/types/lookup';

import { CreateWeightLimitOpts, ICreateXcmType, IWeightLimit, XcmBase } from './types';
Expand Down
10 changes: 2 additions & 8 deletions src/createXcmTypes/SystemToPara.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ describe('SystemToPara XcmVersioned Generation', () => {
expect(beneficiary).toStrictEqual(expectedRes);
});
it('Should work for V2 for an Ethereum Address', () => {
const beneficiary = SystemToPara.createBeneficiary(
'0x96Bd611EbE3Af39544104e26764F4939924F6Ece',
2
);
const beneficiary = SystemToPara.createBeneficiary('0x96Bd611EbE3Af39544104e26764F4939924F6Ece', 2);

const expectedRes = {
V2: {
Expand Down Expand Up @@ -75,10 +72,7 @@ describe('SystemToPara XcmVersioned Generation', () => {
expect(beneficiary).toStrictEqual(expectedRes);
});
it('Should work for V3 for an Ethereum Address', () => {
const beneficiary = SystemToPara.createBeneficiary(
'0x96Bd611EbE3Af39544104e26764F4939924F6Ece',
3
);
const beneficiary = SystemToPara.createBeneficiary('0x96Bd611EbE3Af39544104e26764F4939924F6Ece', 3);

const expectedRes = {
V3: {
Expand Down
15 changes: 9 additions & 6 deletions src/createXcmTypes/SystemToPara.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

import type { ApiPromise } from '@polkadot/api';
import type { u32 } from '@polkadot/types';
import type {
MultiAssetsV2,
VersionedMultiAssets,
WeightLimitV2,
} from '@polkadot/types/interfaces';
import type { MultiAssetsV2, VersionedMultiAssets, WeightLimitV2 } from '@polkadot/types/interfaces';
import type { XcmV3MultiassetMultiAssets } from '@polkadot/types/lookup';
import { isEthereumAddress } from '@polkadot/util-crypto';

Expand All @@ -16,7 +12,14 @@ import { FungibleStrMultiAsset, UnionXcmMultiLocation } from '../types';
import { getFeeAssetItemIndex } from '../util/getFeeAssetItemIndex';
import { normalizeArrToStr } from '../util/normalizeArrToStr';
import { validateNumber } from '../validate';
import { CreateAssetsOpts, CreateFeeAssetItemOpts, CreateWeightLimitOpts, ICreateXcmType, IWeightLimit, XcmBase } from './types';
import {
CreateAssetsOpts,
CreateFeeAssetItemOpts,
CreateWeightLimitOpts,
ICreateXcmType,
IWeightLimit,
XcmBase,
} from './types';
import { constructForeignAssetMultiLocationFromAssetId } from './util/constructForeignAssetMultiLocationFromAssetId';
import { dedupeMultiAssets } from './util/dedupeMultiAssets';
import { fetchPalletInstanceId } from './util/fetchPalletInstanceId';
Expand Down
6 changes: 1 addition & 5 deletions src/createXcmTypes/SystemToRelay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

import type { ApiPromise } from '@polkadot/api';
import { u32 } from '@polkadot/types';
import type {
MultiAssetsV2,
VersionedMultiAssets,
WeightLimitV2,
} from '@polkadot/types/interfaces';
import type { MultiAssetsV2, VersionedMultiAssets, WeightLimitV2 } from '@polkadot/types/interfaces';
import type { XcmV3MultiassetMultiAssets } from '@polkadot/types/lookup';

import { CreateWeightLimitOpts, ICreateXcmType, IWeightLimit, XcmBase } from './types';
Expand Down
17 changes: 9 additions & 8 deletions src/createXcmTypes/SystemToSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

import type { ApiPromise } from '@polkadot/api';
import { u32 } from '@polkadot/types';
import type {
MultiAssetsV2,
VersionedMultiAssets,
WeightLimitV2,
} from '@polkadot/types/interfaces';
import type { MultiAssetsV2, VersionedMultiAssets, WeightLimitV2 } from '@polkadot/types/interfaces';
import type { XcmV3MultiassetMultiAssets } from '@polkadot/types/lookup';

import { BaseError, BaseErrorsEnum } from '../errors';
Expand All @@ -16,16 +12,21 @@ import { normalizeArrToStr } from '../util/normalizeArrToStr';
import { resolveMultiLocation } from '../util/resolveMultiLocation';
import { validateNumber } from '../validate';
import { FungibleStrMultiAsset, UnionXcmMultiLocation } from './../types';
import { CreateAssetsOpts, CreateFeeAssetItemOpts, CreateWeightLimitOpts, ICreateXcmType, IWeightLimit, XcmBase } from './types';
import {
CreateAssetsOpts,
CreateFeeAssetItemOpts,
CreateWeightLimitOpts,
ICreateXcmType,
IWeightLimit,
XcmBase,
} from './types';
import { dedupeMultiAssets } from './util/dedupeMultiAssets';
import { fetchPalletInstanceId } from './util/fetchPalletInstanceId';
import { getAssetId } from './util/getAssetId';
import { isRelayNativeAsset } from './util/isRelayNativeAsset';
import { isSystemChain } from './util/isSystemChain';
import { sortMultiAssetsAscending } from './util/sortMultiAssetsAscending';



export const SystemToSystem: ICreateXcmType = {
/**
* Create a XcmVersionedMultiLocation type for a beneficiary.
Expand Down
18 changes: 9 additions & 9 deletions src/createXcmTypes/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ import type { RequireOnlyOne, XCMDestBenificiary, XcmMultiLocation, XcmVersioned

export type XcmBase = {
[x: string]: {
parents: number,
parents: number;
interior: {
[x: string]: RequireOnlyOne<XcmJunction> | null
}
}
}
[x: string]: RequireOnlyOne<XcmJunction> | null;
};
};
};

export type XcmJunction = {
AccountId32: {
network?: string;
id: string;
},
};
AccountKey20: {
network?: string;
key: string;
}
Parachain: string
}
};
Parachain: string;
};

export interface CreateAssetsOpts {
registry: Registry;
Expand Down

0 comments on commit 1abab3d

Please sign in to comment.