UNPKG

2.22 kBTypeScriptView Raw
1import { ECPoint, UInt160 } from '@neo-one/client-common';
2import { Account, StateTransaction, Transaction, Validator, ValidatorKey, ValidatorsCount, ValidatorsCountUpdate, ValidatorUpdate } from '@neo-one/node-core';
3import BN from 'bn.js';
4import { Blockchain } from './Blockchain';
5export interface AccountChanges {
6 [hash: string]: readonly ECPoint[];
7}
8export interface ValidatorVotesChanges {
9 [hash: string]: BN;
10}
11export interface ValidatorRegisteredChanges {
12 [hash: string]: boolean;
13}
14interface ValidatorChange {
15 readonly registered?: boolean;
16 readonly votes?: BN;
17}
18export interface ValidatorChanges {
19 [hash: string]: ValidatorChange;
20}
21export declare type ValidatorsCountChanges = BN[];
22export declare const getDescriptorChanges: ({ transactions, getAccount, governingTokenHash, }: {
23 readonly transactions: readonly StateTransaction[];
24 readonly getAccount: (hash: UInt160) => Promise<Account>;
25 readonly governingTokenHash: string;
26}) => Promise<{
27 readonly accountChanges: AccountChanges;
28 readonly validatorChanges: ValidatorChanges;
29 readonly validatorsCountChanges: BN[];
30}>;
31export declare const processStateTransaction: ({ validatorChanges, validatorsCountChanges, tryGetValidatorsCount, addValidatorsCount, updateValidatorsCount, tryGetValidator, addValidator, deleteValidator, updateValidator, }: {
32 readonly validatorChanges: ValidatorChanges;
33 readonly validatorsCountChanges: BN[];
34 readonly tryGetValidatorsCount: () => Promise<ValidatorsCount | undefined>;
35 readonly addValidatorsCount: (validatorsCount: ValidatorsCount) => Promise<void>;
36 readonly updateValidatorsCount: (validatorsCount: ValidatorsCount, update: ValidatorsCountUpdate) => Promise<void>;
37 readonly tryGetValidator: (key: ValidatorKey) => Promise<Validator | undefined>;
38 readonly addValidator: (validator: Validator) => Promise<void>;
39 readonly deleteValidator: (key: ValidatorKey) => Promise<void>;
40 readonly updateValidator: (validator: Validator, update: ValidatorUpdate) => Promise<Validator>;
41}) => Promise<void>;
42export declare const getValidators: (blockchain: Blockchain, transactions: readonly Transaction[]) => Promise<readonly ECPoint[]>;
43export {};