--- a/tests/src/eth/util/playgrounds/types.ts +++ b/tests/src/eth/util/playgrounds/types.ts @@ -1,3 +1,5 @@ +import {EthUniqueHelper} from './unique.dev'; + export interface ContractImports { solPath: string; fsPath: string; @@ -13,3 +15,5 @@ event: string, args: { [key: string]: string } }; + +export type EthUniqueHelperConstructor = new (...args: any[]) => EthUniqueHelper; --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -18,7 +18,7 @@ import {DevUniqueHelper} from '../../../util/playgrounds/unique.dev'; -import {ContractImports, CompiledContract, NormalizedEvent} from './types'; +import {ContractImports, CompiledContract, NormalizedEvent, EthUniqueHelperConstructor} from './types'; // Native contracts ABI import collectionHelpersAbi from '../../collectionHelpersAbi.json'; @@ -340,7 +340,6 @@ return '0x' + address.substring(address.length - 40); } } - export type EthUniqueHelperConstructor = new (...args: any[]) => EthUniqueHelper; export class EthUniqueHelper extends DevUniqueHelper { --- a/tests/src/util/playgrounds/types.ts +++ b/tests/src/util/playgrounds/types.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import {IKeyringPair} from '@polkadot/types/types'; +import {UniqueHelper} from './unique'; export interface IEvent { section: string; --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -11,6 +11,7 @@ import {ICrossAccountId} from './types'; import {FrameSystemEventRecord} from '@polkadot/types/lookup'; import {VoidFn} from '@polkadot/api/types'; +import {FrameSystemEventRecord} from '@polkadot/types/lookup'; export class SilentLogger { log(_msg: any, _level: any): void { } @@ -496,13 +497,13 @@ async startCapture() { this.stopCapture(); - this.unsubscribe = await this.helper.getApi().query.system.events(eventRecords => { + this.unsubscribe = (await this.helper.getApi().query.system.events((eventRecords: FrameSystemEventRecord[]) => { const newEvents = eventRecords.filter(r => { return r.event.section == this.eventSection && r.event.method == this.eventMethod; }); this.events.push(...newEvents); - }); + })) as any; } stopCapture() { --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -2439,6 +2439,10 @@ } class SchedulerGroup extends HelperGroup { + constructor(helper: UniqueHelper) { + super(helper); + } + async cancelScheduled(signer: TSigner, scheduledId: string) { return this.helper.executeExtrinsic( signer, @@ -2828,7 +2832,6 @@ expectSuccess?: boolean, ): Promise { const call = this.constructApiCall(extrinsic, params); - return super.executeExtrinsic( sender, 'api.tx.sudo.sudo', @@ -2964,10 +2967,6 @@ getSudo() { return new UniqueBaseCollection(this.collectionId, this.helper.getSudo()); - } - - getSudo() { - return new UniqueCollectionBase(this.collectionId, this.helper.getSudo()); } }