Skip to content

Commit

Permalink
fix: remove xcm V4 from support (#1755)
Browse files Browse the repository at this point in the history
Co-authored-by: pgolovkin <[email protected]>
  • Loading branch information
Asmadek and pgolovkin authored May 9, 2024
1 parent d3a57e1 commit 605b0a2
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/renderer/shared/lib/utils/substrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { Address, CallData, CallHash, XcmPallets, ProxyType } from '@shared/core
import { XcmTransferType } from '../../api/xcm';
import { DEFAULT_TIME, ONE_DAY, THRESHOLD } from './constants';

const V3_LABEL = 'V3';
// TODO: Add V3, V4 support
const SUPPORTED_VERSIONS = ['V2'];
const UNUSED_LABEL = 'unused';

/**
Expand Down Expand Up @@ -121,14 +122,9 @@ export const getCreatedDateFromApi = async (neededBlock: number, api: ApiPromise

export const getTypeVersion = (api: ApiPromise, typeName: string): string => {
const enumValues = getTypeEnumValues(api, typeName);
const notV3orUnused = enumValues.filter((value) => {
const isV3 = value === V3_LABEL;
const isUnused = value.toLowerCase().includes(UNUSED_LABEL);

return !isV3 && !isUnused;
});
const supportedVersions = enumValues.filter((value) => SUPPORTED_VERSIONS.includes(value));

return notV3orUnused.pop() || '';
return supportedVersions.pop() || '';
};

export const getProxyTypes = (api: ApiPromise): ProxyType[] => {
Expand Down

0 comments on commit 605b0a2

Please sign in to comment.