Cleanup module-specific type-overrides (#1756)
This commit is contained in:
@@ -10,8 +10,6 @@ const ALLOWED_BOXES = ['BTreeMap', 'BTreeSet', 'Compact', 'Linkage', 'Result', '
|
||||
const mappings: Mapper[] = [
|
||||
// alias <T::InherentOfflineReport as InherentOfflineReport>::Inherent -> InherentOfflineReport
|
||||
_alias('<T::InherentOfflineReport as InherentOfflineReport>::Inherent', 'InherentOfflineReport'),
|
||||
// alias TreasuryProposal from Proposal<T::AccountId, BalanceOf<T>>
|
||||
_alias('Proposal<T::AccountId, BalanceOf<T>>', 'TreasuryProposal'),
|
||||
// <T::Balance as HasCompact>
|
||||
_cleanupCompact(),
|
||||
// Remove all the trait prefixes
|
||||
|
||||
@@ -48,6 +48,6 @@ export function getChainTypes (chainName: Text, { specName, specVersion }: Runti
|
||||
|
||||
// get types for specific modules (metadata override)
|
||||
/** @internal */
|
||||
export function getModuleTypes (section: string): OverrideModuleType[] {
|
||||
return TYPES_MODULES[section] || [];
|
||||
export function getModuleTypes (section: string): OverrideModuleType {
|
||||
return TYPES_MODULES[section] || {};
|
||||
}
|
||||
|
||||
@@ -4,24 +4,21 @@
|
||||
|
||||
import { OverrideModuleType, OverrideVersionedType } from './types';
|
||||
|
||||
// type overrides for modules (where dupliacted between modules do exist)
|
||||
const TYPES_MODULES: Record<string, OverrideModuleType[]> = {
|
||||
identity: [
|
||||
{
|
||||
name: 'Judgement',
|
||||
override: 'IdentityJudgement'
|
||||
}
|
||||
],
|
||||
society: [
|
||||
{
|
||||
name: 'Judgement',
|
||||
override: 'SocietyJudgement'
|
||||
},
|
||||
{
|
||||
name: 'Vote',
|
||||
override: 'SocietyVote'
|
||||
}
|
||||
]
|
||||
// type overrides for modules (where duplication between modules exist)
|
||||
const TYPES_MODULES: Record<string, OverrideModuleType> = {
|
||||
contracts: {
|
||||
StorageKey: 'ContractStorageKey'
|
||||
},
|
||||
identity: {
|
||||
Judgement: 'IdentityJudgement'
|
||||
},
|
||||
society: {
|
||||
Judgement: 'SocietyJudgement',
|
||||
Vote: 'SocietyVote'
|
||||
},
|
||||
treasury: {
|
||||
Proposal: 'TreasuryProposal'
|
||||
}
|
||||
};
|
||||
|
||||
// these are override types for Polkadot & Kusama chains
|
||||
|
||||
@@ -9,7 +9,4 @@ export interface OverrideVersionedType {
|
||||
types: RegistryTypes;
|
||||
}
|
||||
|
||||
export interface OverrideModuleType {
|
||||
name: string;
|
||||
override: string;
|
||||
}
|
||||
export type OverrideModuleType = Record<string, string>;
|
||||
|
||||
Reference in New Issue
Block a user