1 |
|
2 |
|
3 | import { BinaryWriter, ECPoint, PrivateKey, UInt256, UInt256Hex } from '@neo-one/client-common';
|
4 | import { Equals, EquatableKey } from '../Equatable';
|
5 | import { DeserializeWireBaseOptions, DeserializeWireOptions, SerializableWire } from '../Serializable';
|
6 | import { VerifyScript } from '../vm';
|
7 | import { Witness } from '../Witness';
|
8 | import { UnsignedConsensusPayload, UnsignedConsensusPayloadAdd } from './UnsignedConsensusPayload';
|
9 | export interface ConsensusPayloadAdd extends UnsignedConsensusPayloadAdd {
|
10 | readonly script: Witness;
|
11 | }
|
12 | export interface ConsensusPayloadGetScriptHashesForVerifyingOptions {
|
13 | readonly getValidators: () => Promise<readonly ECPoint[]>;
|
14 | readonly currentBlockHash: UInt256;
|
15 | }
|
16 | export interface ConsensusPayloadVerifyOptions extends ConsensusPayloadGetScriptHashesForVerifyingOptions {
|
17 | readonly currentIndex: number;
|
18 | readonly verifyScript: VerifyScript;
|
19 | }
|
20 | export declare class ConsensusPayload extends UnsignedConsensusPayload implements SerializableWire<ConsensusPayload>, EquatableKey {
|
21 | static sign(payload: UnsignedConsensusPayload, key: PrivateKey): ConsensusPayload;
|
22 | static deserializeWireBase(options: DeserializeWireBaseOptions): ConsensusPayload;
|
23 | static deserializeWire(options: DeserializeWireOptions): ConsensusPayload;
|
24 | readonly script: Witness;
|
25 | readonly toKeyString: () => string;
|
26 | readonly equals: Equals;
|
27 | readonly getScriptHashesForVerifying: (input: ConsensusPayloadGetScriptHashesForVerifyingOptions) => Promise<Set<string>>;
|
28 | private readonly hashInternal;
|
29 | private readonly hashHexInternal;
|
30 | private readonly messageInternal;
|
31 | constructor({ version, previousHash, blockIndex, validatorIndex, timestamp, consensusMessage, script, }: ConsensusPayloadAdd);
|
32 | readonly hash: UInt256;
|
33 | readonly hashHex: UInt256Hex;
|
34 | readonly message: Buffer;
|
35 | serializeUnsigned(): Buffer;
|
36 | serializeWireBase(writer: BinaryWriter): void;
|
37 | verify({ verifyScript, getValidators, currentBlockHash, currentIndex, }: ConsensusPayloadVerifyOptions): Promise<void>;
|
38 | }
|