1 | import { ECPoint, PrivateKey } from '@neo-one/client-common';
|
2 | import { Blockchain, ConsensusMessage, Node, Transaction } from '@neo-one/node-core';
|
3 | import { ConsensusContext } from './ConsensusContext';
|
4 | import { BlockSentContext, Context, HeaderContext, InitialContext, RequestReceivedContext, SignatureSentContext, ViewChangingContext } from './context';
|
5 | import { Result } from './types';
|
6 | export declare const signAndRelay: ({ node, privateKey, context, consensusMessage, }: {
|
7 | readonly node: Node;
|
8 | readonly privateKey: PrivateKey;
|
9 | readonly context: Context<Context<any>>;
|
10 | readonly consensusMessage: ConsensusMessage;
|
11 | }) => void;
|
12 | export declare const getInitialContextAdd: ({ blockchain, publicKey, validators, blockReceivedTimeSeconds, }: {
|
13 | readonly blockchain: Blockchain;
|
14 | readonly publicKey: ECPoint;
|
15 | readonly validators: ReadonlyArray<ECPoint>;
|
16 | readonly blockReceivedTimeSeconds?: number | undefined;
|
17 | }) => {
|
18 | type: string;
|
19 | previousHash: import("../../neo-one-client-common/src").UInt256;
|
20 | blockIndex: number;
|
21 | viewNumber: number;
|
22 | myIndex: number;
|
23 | primaryIndex: number;
|
24 | expectedView: number[];
|
25 | validators: ReadonlyArray<ECPoint>;
|
26 | blockReceivedTimeSeconds: number | undefined;
|
27 | };
|
28 | export declare const initializeNewConsensus: ({ blockchain, publicKey, consensusContext, }: {
|
29 | readonly blockchain: Blockchain;
|
30 | readonly publicKey: ECPoint;
|
31 | readonly consensusContext: ConsensusContext;
|
32 | }) => Promise<Result<InitialContext>>;
|
33 | export declare const initializeConsensus: ({ node, context: contextIn, viewNumber, consensusContext, }: {
|
34 | readonly node: Node;
|
35 | readonly context: Context<Context<any>>;
|
36 | readonly viewNumber: number;
|
37 | readonly consensusContext: ConsensusContext;
|
38 | }) => Result<InitialContext | SignatureSentContext>;
|
39 | export declare function checkSignatures<TContext extends HeaderContext>({ node, context, }: {
|
40 | readonly node: Node;
|
41 | readonly context: TContext;
|
42 | }): Promise<Result<TContext | BlockSentContext>>;
|
43 | export declare const signAndRelayChangeView: ({ node, privateKey, context, }: {
|
44 | readonly node: Node;
|
45 | readonly privateKey: PrivateKey;
|
46 | readonly context: Context<Context<any>>;
|
47 | }) => void;
|
48 | export declare const checkExpectedView: ({ context, viewNumber, }: {
|
49 | readonly context: Context<Context<any>>;
|
50 | readonly viewNumber: number;
|
51 | }) => boolean;
|
52 | export declare const initializeConsensusInitial: ({ blockchain, context, viewNumber, consensusContext, }: {
|
53 | readonly blockchain: Blockchain;
|
54 | readonly context: Context<Context<any>>;
|
55 | readonly viewNumber: number;
|
56 | readonly consensusContext: ConsensusContext;
|
57 | }) => Result<InitialContext>;
|
58 | export declare const incrementExpectedView: (context: Context<Context<any>>) => ReadonlyArray<number>;
|
59 | export declare const addTransaction: ({ context: contextIn, node, privateKey, transaction, verify, consensusContext, }: {
|
60 | readonly context: RequestReceivedContext;
|
61 | readonly node: Node;
|
62 | readonly privateKey: PrivateKey;
|
63 | readonly transaction: Transaction;
|
64 | readonly verify: boolean;
|
65 | readonly consensusContext: ConsensusContext;
|
66 | }) => Promise<Result<BlockSentContext | InitialContext | SignatureSentContext | ViewChangingContext | RequestReceivedContext>>;
|