Support ABI files with wasm (.contract output) (#2841)
* Support ABI files with wasm (.contract output) * AbiBase exports * Additional default exports * Remove any * Fix build
This commit is contained in:
@@ -7,7 +7,7 @@ import { AnyJson, CallFunction, Registry, RegistryMetadataCall } from '@polkadot
|
||||
import { assert, stringCamelCase } from '@polkadot/util';
|
||||
|
||||
/** @internal */
|
||||
export default function createUnchecked (registry: Registry, section: string, callIndex: Uint8Array, callMetadata: RegistryMetadataCall): CallFunction {
|
||||
export function createUnchecked (registry: Registry, section: string, callIndex: Uint8Array, callMetadata: RegistryMetadataCall): CallFunction {
|
||||
const expectedArgs = callMetadata.args;
|
||||
const funcName = stringCamelCase(callMetadata.name);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Calls, ModulesWithCalls, Registry, RegistryMetadata, RegistryMetadataMo
|
||||
|
||||
import { stringCamelCase } from '@polkadot/util';
|
||||
|
||||
import createUnchecked from './createUnchecked';
|
||||
import { createUnchecked } from './createUnchecked';
|
||||
import extrinsics from '.';
|
||||
|
||||
/** @internal */
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Text } from '@polkadot/types';
|
||||
import { TypeRegistry } from '@polkadot/types/create';
|
||||
import { u8aToHex } from '@polkadot/util';
|
||||
|
||||
import createFunction from './createFunction';
|
||||
import { createFunction } from './createFunction';
|
||||
|
||||
describe('createFunction', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -174,7 +174,7 @@ function extendPrefixedMap (registry: Registry, itemFn: CreateItemFn, storageFn:
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export default function createFunction (registry: Registry, itemFn: CreateItemFn, options: CreateItemOptions): StorageEntry {
|
||||
export function createFunction (registry: Registry, itemFn: CreateItemFn, options: CreateItemOptions): StorageEntry {
|
||||
const { meta: { type } } = itemFn;
|
||||
const [hasher, key2Hasher] = getHashers(itemFn);
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ import { ModuleStorage, Storage } from '../types';
|
||||
import { stringCamelCase, stringLowerFirst } from '@polkadot/util';
|
||||
|
||||
import { Metadata } from '../../Metadata';
|
||||
import createFunction from './createFunction';
|
||||
import getStorage from './storage';
|
||||
import { createFunction } from './createFunction';
|
||||
import { getStorage } from './storage';
|
||||
|
||||
/** @internal */
|
||||
export function storageFromMeta (registry: Registry, metadata: Metadata): Storage {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2020 @polkadot/metadata authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import getStorage from './storage';
|
||||
import { getStorage } from './storage';
|
||||
|
||||
export default getStorage;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types/create';
|
||||
|
||||
import getStorage from './storage';
|
||||
import { getStorage } from './storage';
|
||||
|
||||
describe('storage', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Storage } from '../types';
|
||||
import * as substrate from './substrate';
|
||||
|
||||
/** @internal */
|
||||
export default function getStorage (registry: Registry, metaVersion: number): Storage {
|
||||
export function getStorage (registry: Registry, metaVersion: number): Storage {
|
||||
return {
|
||||
substrate: Object
|
||||
.entries(substrate)
|
||||
|
||||
@@ -5,7 +5,7 @@ import { StorageEntryMetadataLatest } from '@polkadot/types/interfaces';
|
||||
import { StorageEntry } from '@polkadot/types/primitive/types';
|
||||
import { Registry } from '@polkadot/types/types';
|
||||
|
||||
import createFunction from './createFunction';
|
||||
import { createFunction } from './createFunction';
|
||||
|
||||
interface SubstrateMetadata {
|
||||
documentation: string;
|
||||
|
||||
Reference in New Issue
Block a user