Align costs typing with queries (#2564)
* Align costs typing with queries * better... * ... and better * ... progress * better, down to 8 * ... down to 3 * ... 2 * Down to 1 * It builds. * ... it really builds
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
|
||||
// Copyright 2017-2020 @polkadot/metadata authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { Codec } from '@polkadot/types/types';
|
||||
import { ModuleConstantMetadataLatest } from '@polkadot/types/interfaces';
|
||||
|
||||
export type AugmentedConst<T extends Codec> = T & ConstantCodec;
|
||||
|
||||
export type ModuleConstants = Record<string, Codec>;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
export interface Constants {}
|
||||
|
||||
export interface ConstantCodec extends Codec {
|
||||
meta: ModuleConstantMetadataLatest;
|
||||
}
|
||||
@@ -2,15 +2,21 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { AugmentedConst, QueryableConsts, QueryableModuleConsts } from '@polkadot/api/types/consts';
|
||||
import { Codec } from '@polkadot/types/types';
|
||||
import { StorageEntry } from '@polkadot/types/primitive/StorageKey';
|
||||
|
||||
export * from './consts/types';
|
||||
|
||||
export interface ModuleStorage {
|
||||
[key: string]: StorageEntry;
|
||||
}
|
||||
|
||||
export type Constants = QueryableConsts<'rxjs'>;
|
||||
|
||||
export type ConstantCodec = Codec & AugmentedConst<'rxjs'>;
|
||||
|
||||
export type ModuleConstants = QueryableModuleConsts;
|
||||
|
||||
export interface Storage {
|
||||
[key: string]: ModuleStorage; // Will hold modules returned by state_getMetadata
|
||||
substrate: { [key: string]: StorageEntry };
|
||||
[key: string]: ModuleStorage;
|
||||
substrate: ModuleStorage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user