lisk-framework
Version:
Lisk blockchain application platform
160 lines (159 loc) • 5.53 kB
TypeScript
import { GenesisBlockExecuteContext, BlockAfterExecuteContext } from '../../state_machine';
import { BaseModule, ModuleInitArgs, ModuleMetadata } from '../base_module';
import { PoSMethod } from './method';
import { RegisterValidatorCommand } from './commands/register_validator';
import { ReportMisbehaviorCommand } from './commands/report_misbehavior';
import { UnlockCommand } from './commands/unlock';
import { UpdateGeneratorKeyCommand } from './commands/update_generator_key';
import { StakeCommand } from './commands/stake';
import { ChangeCommissionCommand } from './commands/change_commission';
import { PoSEndpoint } from './endpoint';
import { RandomMethod, TokenMethod, ValidatorsMethod, FeeMethod } from './types';
import { ClaimRewardsCommand } from './commands/claim_rewards';
export declare class PoSModule extends BaseModule {
method: PoSMethod;
configSchema: {
$id: string;
type: string;
properties: {
factorSelfStakes: {
type: string;
format: string;
minimum: number;
};
maxLengthName: {
type: string;
format: string;
minimum: number;
maximum: number;
};
maxNumberSentStakes: {
type: string;
format: string;
minimum: number;
maximum: number;
};
maxNumberPendingUnlocks: {
type: string;
format: string;
minimum: number;
maximum: number;
};
failSafeMissedBlocks: {
type: string;
format: string;
minimum: number;
};
failSafeInactiveWindow: {
type: string;
format: string;
minimum: number;
maximum: number;
};
punishmentWindowSelfStaking: {
type: string;
format: string;
minimum: number;
maximum: number;
};
minWeightStandby: {
type: string;
format: string;
minimum: number;
};
numberActiveValidators: {
type: string;
format: string;
minimum: number;
maximum: number;
};
numberStandbyValidators: {
type: string;
format: string;
maximum: number;
};
posTokenID: {
type: string;
format: string;
};
validatorRegistrationFee: {
type: string;
format: string;
};
maxBFTWeightCap: {
type: string;
format: string;
minimum: number;
maximum: number;
};
commissionIncreasePeriod: {
type: string;
format: string;
};
maxCommissionIncreaseRate: {
type: string;
format: string;
minimum: number;
maximum: number;
};
useInvalidBLSKey: {
type: string;
};
baseStakeAmount: {
type: string;
format: string;
minimum: number;
};
lockingPeriodStaking: {
type: string;
format: string;
};
lockingPeriodSelfStaking: {
type: string;
format: string;
};
reportMisbehaviorReward: {
type: string;
format: string;
};
reportMisbehaviorLimitBanned: {
type: string;
format: string;
minimum: number;
};
};
required: string[];
};
endpoint: PoSEndpoint;
private readonly _registerValidatorCommand;
private readonly _reportMisbehaviorCommand;
private readonly _unlockCommand;
private readonly _updateGeneratorKeyCommand;
private readonly _stakeCommand;
private readonly _changeCommissionCommand;
private readonly _claimRewardsCommand;
commands: (RegisterValidatorCommand | ReportMisbehaviorCommand | UnlockCommand | UpdateGeneratorKeyCommand | StakeCommand | ChangeCommissionCommand | ClaimRewardsCommand)[];
private readonly _internalMethod;
private _randomMethod;
private _validatorsMethod;
private _tokenMethod;
private _feeMethod;
private _moduleConfig;
constructor();
get name(): string;
addDependencies(randomMethod: RandomMethod, validatorsMethod: ValidatorsMethod, tokenMethod: TokenMethod, feeMethod: FeeMethod): void;
metadata(): ModuleMetadata;
init(args: ModuleInitArgs): Promise<void>;
initGenesisState(context: GenesisBlockExecuteContext): Promise<void>;
finalizeGenesisState(context: GenesisBlockExecuteContext): Promise<void>;
afterTransactionsExecute(context: BlockAfterExecuteContext): Promise<void>;
private _createStakeWeightSnapshot;
private _updateValidators;
private _updateProductivity;
private _didBootstrapRoundsEnd;
private _getActiveValidators;
private _capWeightIfNeeded;
private _capWeight;
private _ceiling;
private _getConfigSchema;
}