Bump dev & adjust duplicated exports (#5651)

This commit is contained in:
Jaco
2023-05-21 12:40:07 +03:00
committed by GitHub
parent 0e46592f4d
commit 3d0a1701fa
45 changed files with 418 additions and 123 deletions
+2 -2
View File
@@ -198,14 +198,14 @@ describe('createType', (): void => {
it('allows for re-registration of a type', (): void => {
const balDef = registry.createType('Balance');
expect(balDef instanceof registry.createClass('Balance'));
expect(balDef instanceof registry.createClass('Balance')).toBe(true);
expect(balDef.bitLength()).toEqual(128);
registry.register({ Balance: 'u32' });
const balu32 = registry.createType('Balance');
expect(balu32 instanceof registry.createClass('Balance'));
expect(balu32 instanceof registry.createClass('Balance')).toBe(true);
expect(balu32.bitLength()).toEqual(32);
});
+1 -1
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
// all external
export * from '@polkadot/types-create';
export * from '@polkadot/types-create/exports';
// all local
export * from './createClass.js';
+1 -1
View File
@@ -31,7 +31,7 @@ describe('TypeRegistry', (): void => {
expect(Type).toBeDefined();
// eslint-disable-next-line no-prototype-builtins
expect(isChildClass(DoNotConstruct, Type));
expect(isChildClass(DoNotConstruct, Type)).toBe(true);
});
it('can register single type', (): void => {
@@ -1,6 +1,8 @@
// Copyright 2017-2023 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable jest/expect-expect */
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import { BN } from '@polkadot/util';
@@ -55,7 +55,7 @@ describe('ChainProperties', (): void => {
expect(tokenSymbol.unwrap().eq(['KSM'])).toBe(true);
});
it('has a sane toHuman', (): void => {
it('has a sane toHuman (single tokenDecimals)', (): void => {
expect(
registry.createType('ChainProperties', {
ss58Format: 42,
@@ -69,7 +69,7 @@ describe('ChainProperties', (): void => {
});
});
it('has a sane toHuman', (): void => {
it('has a sane toHuman (multiple tokenDecimals)', (): void => {
expect(
registry.createType('ChainProperties', {
ss58Format: 2,
+5 -1
View File
@@ -30,7 +30,7 @@ const metadata = new Metadata(registry, metadataStatic);
registry.setMetadata(metadata);
function testTypes (type: string, typeNames: string[]): void {
describe(type, (): void => {
describe(`${type}`, (): void => {
describe(`${type}:: default creation`, (): void => {
typeNames.forEach((name): void => {
it(`creates an empty ${name}`, (): void => {
@@ -38,8 +38,10 @@ function testTypes (type: string, typeNames: string[]): void {
registry.createType(name);
if (UNCONSTRUCTABLE.includes(name.toLowerCase())) {
// eslint-disable-next-line jest/no-conditional-expect
expect(constructFn).toThrow();
} else {
// eslint-disable-next-line jest/no-conditional-expect
expect(constructFn).not.toThrow();
}
});
@@ -53,8 +55,10 @@ function testTypes (type: string, typeNames: string[]): void {
registry.createType(name, registry.createType('Bytes'));
if (UNCONSTRUCTABLE.includes(name.toLowerCase())) {
// eslint-disable-next-line jest/no-conditional-expect
expect(constructFn).toThrow();
} else {
// eslint-disable-next-line jest/no-conditional-expect
expect(constructFn).not.toThrow();
}
});
@@ -53,7 +53,7 @@ describe('type definitions', (): void => {
);
for (const [key, { types }] of allTypes) {
describe(key, (): void => {
describe(`${key}`, (): void => {
const typesKeys = Object.keys(types).filter((type) =>
// meant to fail
type !== 'ExtrinsicUnknown' &&
@@ -80,11 +80,11 @@ describe('rpc definitions', (): void => {
);
for (const [section, { rpc }] of rpcs) {
describe(section, (): void => {
describe(`${section}`, (): void => {
const methodsEntries = Object.entries<DefinitionRpc>(rpc);
for (const [method, { params, type }] of methodsEntries) {
describe(method, (): void => {
describe(`${method}`, (): void => {
// We cannot constuct V0, so just ignore
if (section !== 'state' || method !== 'getMetadata') {
it(`output ${type} is known`, (): void => {
@@ -114,17 +114,17 @@ describe('runtime definitions', (): void => {
);
for (const [key, { runtime }] of runtimes) {
describe(key, (): void => {
describe(`${key}`, (): void => {
const versionsEntries = Object.entries<DefinitionsCallEntry[]>(runtime);
for (const [key, versions] of versionsEntries) {
describe(key, (): void => {
describe(`${key}`, (): void => {
for (const { methods, version } of versions) {
describe(`version ${version}`, (): void => {
const methodsEntries = Object.entries<DefinitionCall>(methods);
for (const [key, { params, type }] of methodsEntries) {
describe(key, (): void => {
describe(`${key}`, (): void => {
// Applied from runtime, used in Funglibles
if (type !== 'Result<Vec<XcmV3MultiAsset>, FungiblesAccessError>') {
it(`output ${type} is known`, (): void => {
@@ -3,6 +3,8 @@
/// <reference types="@polkadot/dev-test/globals.d.ts" />
/* global describe, it, expect */
import type { Registry } from '@polkadot/types-codec/types';
import type { Check } from './types.js';