UNPKG

@moonsong-labs/moonwall-util

Version:

Testing framework for the Moon family of projects

59 lines (56 loc) 2.63 kB
import * as _polkadot_types_codec_types from '@polkadot/types-codec/types'; import { ITuple } from '@polkadot/types-codec/types'; import { ApiPromise } from '@polkadot/api'; import { RuntimeDispatchInfo, BlockHash, Event, Extrinsic, RuntimeDispatchInfoV1 } from '@polkadot/types/interfaces'; import { SpWeightsWeightV2Weight, FrameSystemEventRecord } from '@polkadot/types/lookup'; import { GenericExtrinsic, u64, Option, u32 } from '@polkadot/types'; import { Block } from '@polkadot/types/interfaces/runtime/types'; import { TxWithEvent } from '@polkadot/api-derive/types'; import Bottleneck from 'bottleneck'; declare function createAndFinalizeBlock(api: ApiPromise, parentHash?: string, finalize?: boolean): Promise<{ duration: number; hash: string; }>; declare function calculateFeePortions(amount: bigint): { burnt: bigint; treasury: bigint; }; interface TxWithEventAndFee extends TxWithEvent { fee: RuntimeDispatchInfo; } interface BlockDetails { block: Block; txWithEvents: TxWithEventAndFee[]; } interface BlockRangeOption { from: number; to: number; concurrency?: number; } declare const getBlockExtrinsic: (api: ApiPromise, blockHash: string | BlockHash, section: string, method: string) => Promise<{ block: Block; extrinsic: GenericExtrinsic<_polkadot_types_codec_types.AnyTuple>; events: Event[]; resultEvent: Event; }>; declare const getBlockTime: (signedBlock: any) => any; declare const checkBlockFinalized: (api: ApiPromise, number: number) => Promise<{ number: number; finalized: boolean; }>; declare const fetchHistoricBlockNum: (api: ApiPromise, blockNumber: number, targetTime: number) => any; declare const getBlockArray: (api: ApiPromise, timePeriod: number, limiter?: Bottleneck) => Promise<number[]>; declare function extractWeight(weightV1OrV2: u64 | Option<u64> | SpWeightsWeightV2Weight | Option<SpWeightsWeightV2Weight>): u64; declare function extractPreimageDeposit(request: Option<ITuple<any>> | { readonly deposit: ITuple<any>; readonly len: u32; } | { readonly deposit: Option<ITuple<any>>; readonly count: u32; readonly len: Option<u32>; }): { accountId: any; amount: any; }; declare function mapExtrinsics(extrinsics: Extrinsic[], records: FrameSystemEventRecord[], fees?: RuntimeDispatchInfo[] | RuntimeDispatchInfoV1[]): TxWithEventAndFee[]; export { BlockDetails, BlockRangeOption, TxWithEventAndFee, calculateFeePortions, checkBlockFinalized, createAndFinalizeBlock, extractPreimageDeposit, extractWeight, fetchHistoricBlockNum, getBlockArray, getBlockExtrinsic, getBlockTime, mapExtrinsics };