1 |
|
2 |
|
3 | import { ECPoint, UInt160, UInt256, UInt256Hex } from '@neo-one/client-common';
|
4 | import { Block } from '@neo-one/node-core';
|
5 | import BN from 'bn.js';
|
6 | import { Context } from './Context';
|
7 | import { Transactions, Type } from './types';
|
8 | interface HeaderContextAdd {
|
9 | readonly type: Type;
|
10 | readonly viewNumber: number;
|
11 | readonly myIndex: number;
|
12 | readonly primaryIndex: number;
|
13 | readonly expectedView: readonly number[];
|
14 | readonly validators: readonly ECPoint[];
|
15 | readonly blockReceivedTimeSeconds: number;
|
16 | readonly transactions: Transactions;
|
17 | readonly signatures: ReadonlyArray<Buffer | undefined>;
|
18 | readonly header: {
|
19 | readonly type: 'new';
|
20 | readonly previousHash: UInt256;
|
21 | readonly transactionHashes: readonly UInt256Hex[];
|
22 | readonly blockIndex: number;
|
23 | readonly nonce: BN;
|
24 | readonly timestamp: number;
|
25 | readonly nextConsensus: UInt160;
|
26 | } | {
|
27 | readonly type: 'existing';
|
28 | readonly block: Block;
|
29 | readonly transactionHashes: readonly UInt256Hex[];
|
30 | };
|
31 | }
|
32 | export declare class HeaderContext<T extends HeaderContext<T> = HeaderContext<any>> extends Context<T> {
|
33 | readonly transactions: Transactions;
|
34 | readonly transactionHashes: readonly UInt256Hex[];
|
35 | readonly transactionHashesSet: Set<UInt256Hex>;
|
36 | readonly signatures: ReadonlyArray<Buffer | undefined>;
|
37 | readonly header: Block;
|
38 | constructor({ type, viewNumber, myIndex, primaryIndex, expectedView, validators, blockReceivedTimeSeconds, transactions, signatures, header, }: HeaderContextAdd);
|
39 | cloneSignatures(_options: {
|
40 | readonly signatures: ReadonlyArray<Buffer | undefined>;
|
41 | }): T;
|
42 | toJSON(): object;
|
43 | }
|
44 | export {};
|