UNPKG

incubed

Version:

Typescript-version of the incubed client

21 lines (20 loc) 882 B
import { Block, BlockData } from './serialize'; import ChainContext from '../../client/ChainContext'; import { ChainSpec } from '../../types/types'; /** Authority specification for proof of authority chains */ export interface AuthSpec { /** List of validator addresses storead as an buffer array*/ authorities: Buffer[]; /** chain specification */ spec: ChainSpec; /** proposer of the block this authspec belongs */ proposer: Buffer; } /** * verify a Blockheader and returns the percentage of finality * @param blocks * @param getChainSpec */ export declare function checkBlockSignatures(blockHeaders: (Buffer | string | BlockData | Block)[], getChainSpec: (data: Block) => Promise<AuthSpec>): Promise<number>; export declare function getSigner(data: Block): Buffer; export declare function getChainSpec(b: Block, ctx: ChainContext): Promise<AuthSpec>;