Skip to content

Commit

Permalink
fix: add override types for asset hub conversation pallet (#1354)
Browse files Browse the repository at this point in the history
* fix: main patch

* final touches
  • Loading branch information
TarikGul committed Nov 16, 2023
1 parent 1a249a3 commit 21e016d
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { getControllersForSpec } from './chains-config';
import { consoleOverride } from './logging/consoleOverride';
import { Log } from './logging/Log';
import * as middleware from './middleware';
import tempTypesBundle from './override-types/typesBundle';
import { parseArgs } from './parseArgs';
import { SidecarConfig } from './SidecarConfig';
import Metrics_App from './util/metrics';
Expand All @@ -51,7 +52,7 @@ async function main() {
/* eslint-disable @typescript-eslint/no-var-requires */
typesBundle: TYPES_BUNDLE
? (require(TYPES_BUNDLE) as OverrideBundleType)
: undefined,
: (tempTypesBundle as OverrideBundleType),
typesChain: TYPES_CHAIN
? (require(TYPES_CHAIN) as Record<string, RegistryTypes>)
: undefined,
Expand Down
59 changes: 59 additions & 0 deletions src/override-types/typesBundle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { OverrideBundleDefinition } from '@polkadot/types/types';

const definitionsWestmint: OverrideBundleDefinition = {
types: [
{
minmax: [0, 9434],
types: {
TempAssetId: 'Option<AssetId>',
},
},
{
minmax: [9435, undefined],
types: {
TempAssetId: 'Option<MultiLocation>',
},
},
],
signedExtensions: {
ChargeAssetTxPayment: {
extrinsic: {
tip: 'Compact<Balance>',
// eslint-disable-next-line sort-keys
assetId: 'TempAssetId',
},
payload: {},
},
},
};

const definitionsStatemine: OverrideBundleDefinition = {
types: [
{
minmax: [0, 9999],
types: {
TempAssetId: 'Option<AssetId>',
},
},
{
minmax: [10000, undefined],
types: {
TempAssetId: 'Option<MultiLocation>',
},
},
],
signedExtensions: {
ChargeAssetTxPayment: {
extrinsic: {
tip: 'Compact<Balance>',
// eslint-disable-next-line sort-keys
assetId: 'TempAssetId',
},
payload: {},
},
},
};

export default {
spec: { statemine: definitionsStatemine, westmint: definitionsWestmint },
};

0 comments on commit 21e016d

Please sign in to comment.