E2E testing (#177)
* Move e2e tests to provider * Rx subscriptions * Import @polkadot/api-provider, fix package names * Decrease verbosity, skip all e2e tests
This commit is contained in:
@@ -6,7 +6,7 @@ import hexToU8a from '@polkadot/util/hex/toU8a';
|
||||
import isHex from '@polkadot/util/is/hex';
|
||||
import u8aConcat from '@polkadot/util/u8a/concat';
|
||||
|
||||
import Base, { l } from './Base';
|
||||
import Base from './Base';
|
||||
|
||||
// A Struct defines an Object with key/values - where the values are Base<T> values. It removes
|
||||
// a lot of repetition from the actual coding, define a structure type, pass it the key/Base<T>
|
||||
@@ -43,7 +43,7 @@ export default class Struct <
|
||||
}
|
||||
|
||||
static decode <S, V, T> (Types: S, value: V | Array<any>, isTuple: boolean): T {
|
||||
l.debug(() => ['Struct.decode', { Types, value }]);
|
||||
// l.debug(() => ['Struct.decode', { Types, value }]);
|
||||
|
||||
return Object
|
||||
.keys(Types)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import assert from '@polkadot/util/assert';
|
||||
|
||||
import * as Types from '../index';
|
||||
import Base, { l } from './Base';
|
||||
import Base from './Base';
|
||||
import Tuple from './Tuple';
|
||||
import Vector from './Vector';
|
||||
|
||||
@@ -64,7 +64,7 @@ export function typeSplit (type: string): Array<string> {
|
||||
|
||||
// Handle Vector types, i.e Vec<AccountId> or Vec<(AccountId, Balance)>
|
||||
export function getVectorType (type: string): Constructor {
|
||||
l.debug(() => ['getVectorType', { type }]);
|
||||
// l.debug(() => ['getVectorType', { type }]);
|
||||
|
||||
assert(type.substr(0, 4) === 'Vec<' && type[type.length - 1] === '>', `Expected Vec wrapped with <>`);
|
||||
|
||||
@@ -79,7 +79,7 @@ export function getVectorType (type: string): Constructor {
|
||||
// Handle tuple types, (u32, String, AccountId). It could be nested and wrapped in other
|
||||
// types, i.e. (u32, Vec<(AccountId, Balance)>)
|
||||
export function getTupleType (type: string): Constructor {
|
||||
l.debug(() => ['getTupleType', { type }]);
|
||||
// l.debug(() => ['getTupleType', { type }]);
|
||||
|
||||
assert(type[0] === '(' && type[type.length - 1] === ')', `Expected tuple wrapped with ()`);
|
||||
|
||||
@@ -99,7 +99,7 @@ export function getTupleType (type: string): Constructor {
|
||||
export function getType (_type: string): Constructor {
|
||||
const type = _type.trim();
|
||||
|
||||
l.debug(() => ['getType', { type }]);
|
||||
// l.debug(() => ['getType', { type }]);
|
||||
|
||||
if (type[0] === '(') {
|
||||
return getTupleType(type);
|
||||
@@ -115,7 +115,7 @@ export function getType (_type: string): Constructor {
|
||||
}
|
||||
|
||||
export default function createType (type: string, value?: any): Base {
|
||||
l.debug(() => ['createType', { type, value }]);
|
||||
// l.debug(() => ['createType', { type, value }]);
|
||||
|
||||
const Type = getType(type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user