utility

package
v0.0.1-pre-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2022 License: MIT Imports: 13 Imported by: 0

README

Utility Module

This document is meant to be a placeholder to serve as a living representation of the parent 'Utility Module' codebase until the code matches the 1.0 Utility Module specification.

The spirit of the documentation is to continuously update and inform the reader of the general scope of the Utility Module as breaking, rapid development occurs.

This document will be archived once the implementation is synonymous with the current 1.0 Utility specification, .

Origin Document

Currently, the Utility Module minimally implements the first iteration of an account based, state machine, blockchain protocol.

Synonymous technologies to this current iteration are 'MVP proof of stake' blockchain state machines, that are NOT Pocket Network specific.

The current implementation does add the fundamental Pocket Network 1.0 actors:

  • Accounts
  • Validators
  • Fishermen
  • Applications
  • Service Nodes

And implement the basic transaction functionality:

  • Send-Tx
  • Stake
  • Unstake
  • EditStake
  • Pause
  • Unpause

And a few additional skeleton implementations for pocket specific transactions:

  • FishermanPauseServiceNode [x] Implemented
  • TestScore [x] Placeholder // requires sessions & report card structures
  • ProveTestScore [x] Placeholder // requires sessions & report card structures

Added governance params:

  • BlocksPerSessionParamName

  • AppMinimumStakeParamName

  • AppMaxChainsParamName

  • AppBaselineStakeRateParamName

  • AppStakingAdjustmentParamName

  • AppUnstakingBlocksParamName

  • AppMinimumPauseBlocksParamName

  • AppMaxPauseBlocksParamName

  • ServiceNodeMinimumStakeParamName

  • ServiceNodeMaxChainsParamName

  • ServiceNodeUnstakingBlocksParamName

  • ServiceNodeMinimumPauseBlocksParamName

  • ServiceNodeMaxPauseBlocksParamName

  • ServiceNodesPerSessionParamName

  • FishermanMinimumStakeParamName

  • FishermanMaxChainsParamName

  • FishermanUnstakingBlocksParamName

  • FishermanMinimumPauseBlocksParamName

  • FishermanMaxPauseBlocksParamName

  • ValidatorMinimumStakeParamName

  • ValidatorUnstakingBlocksParamName

  • ValidatorMinimumPauseBlocksParamName

  • ValidatorMaxPausedBlocksParamName

  • ValidatorMaximumMissedBlocksParamName

  • ValidatorMaxEvidenceAgeInBlocksParamName

  • ProposerPercentageOfFeesParamName

  • MissedBlocksBurnPercentageParamName

  • DoubleSignBurnPercentageParamName

  • MessageDoubleSignFee

  • MessageSendFee

  • MessageStakeFishermanFee

  • MessageEditStakeFishermanFee

  • MessageUnstakeFishermanFee

  • MessagePauseFishermanFee

  • MessageUnpauseFishermanFee

  • MessageFishermanPauseServiceNodeFee

  • MessageTestScoreFee

  • MessageProveTestScoreFee

  • MessageStakeAppFee

  • MessageEditStakeAppFee

  • MessageUnstakeAppFee

  • MessagePauseAppFee

  • MessageUnpauseAppFee

  • MessageStakeValidatorFee

  • MessageEditStakeValidatorFee

  • MessageUnstakeValidatorFee

  • MessagePauseValidatorFee

  • MessageUnpauseValidatorFee

  • MessageStakeServiceNodeFee

  • MessageEditStakeServiceNodeFee

  • MessageUnstakeServiceNodeFee

  • MessagePauseServiceNodeFee

  • MessageUnpauseServiceNodeFee

  • MessageChangeParameterFee

  • AclOwner

  • BlocksPerSessionOwner

  • AppMinimumStakeOwner

  • AppMaxChainsOwner

  • AppBaselineStakeRateOwner

  • AppStakingAdjustmentOwner

  • AppUnstakingBlocksOwner

  • AppMinimumPauseBlocksOwner

  • AppMaxPausedBlocksOwner

  • ServiceNodeMinimumStakeOwner

  • ServiceNodeMaxChainsOwner

  • ServiceNodeUnstakingBlocksOwner

  • ServiceNodeMinimumPauseBlocksOwner

  • ServiceNodeMaxPausedBlocksOwner

  • ServiceNodesPerSessionOwner

  • FishermanMinimumStakeOwner

  • FishermanMaxChainsOwner

  • FishermanUnstakingBlocksOwner

  • FishermanMinimumPauseBlocksOwner

  • FishermanMaxPausedBlocksOwner

  • ValidatorMinimumStakeOwner

  • ValidatorUnstakingBlocksOwner

  • ValidatorMinimumPauseBlocksOwner

  • ValidatorMaxPausedBlocksOwner

  • ValidatorMaximumMissedBlocksOwner

  • ValidatorMaxEvidenceAgeInBlocksOwner

  • ProposerPercentageOfFeesOwner

  • MissedBlocksBurnPercentageOwner

  • DoubleSignBurnPercentageOwner

  • MessageDoubleSignFeeOwner

  • MessageSendFeeOwner

  • MessageStakeFishermanFeeOwner

  • MessageEditStakeFishermanFeeOwner

  • MessageUnstakeFishermanFeeOwner

  • MessagePauseFishermanFeeOwner

  • MessageUnpauseFishermanFeeOwner

  • MessageFishermanPauseServiceNodeFeeOwner

  • MessageTestScoreFeeOwner

  • MessageProveTestScoreFeeOwner

  • MessageStakeAppFeeOwner

  • MessageEditStakeAppFeeOwner

  • MessageUnstakeAppFeeOwner

  • MessagePauseAppFeeOwner

  • MessageUnpauseAppFeeOwner

  • MessageStakeValidatorFeeOwner

  • MessageEditStakeValidatorFeeOwner

  • MessageUnstakeValidatorFeeOwner

  • MessagePauseValidatorFeeOwner

  • MessageUnpauseValidatorFeeOwner

  • MessageStakeServiceNodeFeeOwner

  • MessageEditStakeServiceNodeFeeOwner

  • MessageUnstakeServiceNodeFeeOwner

  • MessagePauseServiceNodeFeeOwner

  • MessageUnpauseServiceNodeFeeOwner

  • MessageChangeParameterFeeOwner

And minimally satisfy the following interface:

CheckTransaction(tx []byte) error
GetTransactionsForProposal(proposer []byte, maxTransactionBytes int, lastBlockByzantineValidators [][]byte) (transactions [][]byte, err error)
ApplyBlock(Height int64, proposer []byte, transactions [][]byte, lastBlockByzantineValidators [][]byte) (appHash []byte, err error)

How to build

Utility Module does not come with its own cmd executables.

Rather, it is purposed to be a dependency (i.e. library) of other modules

How to use

Utility implements the UtilityModule and subsequent interface pocket/shared/modules/utility_module.go.

To use, simply initialize a Utility instance using the factory function like so:

utilityMod, err := utility.Create(config)

and use utilityMod as desired.

How to test

$ make test_utility_types && make test_utility_module

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(_ *config.Config) (modules.UtilityModule, error)

func CreateMockedModule

func CreateMockedModule(_ *config.Config) (modules.UtilityModule, error)

Types

type Context

type Context struct {
	modules.PersistenceContext
	SavePointsM map[string]struct{}
	SavePoints  [][]byte
}

func (*Context) Reset

func (c *Context) Reset() types.Error

type UtilityContext

type UtilityContext struct {
	LatestHeight int64
	Mempool      types.Mempool
	Context      *Context
}

func (*UtilityContext) AddAccountAmount

func (u *UtilityContext) AddAccountAmount(address []byte, amountToAdd *big.Int) types.Error

func (*UtilityContext) AddAccountAmountString

func (u *UtilityContext) AddAccountAmountString(address []byte, amountToAdd string) types.Error

func (*UtilityContext) AddPoolAmount

func (u *UtilityContext) AddPoolAmount(name string, amountToAdd *big.Int) types.Error

func (*UtilityContext) AnteHandleMessage

func (u *UtilityContext) AnteHandleMessage(tx *typesUtil.Transaction) (typesUtil.Message, types.Error)

func (*UtilityContext) ApplyBlock

func (u *UtilityContext) ApplyBlock(latestHeight int64, proposerAddress []byte, transactions [][]byte, lastBlockByzantineValidators [][]byte) ([]byte, error)

func (*UtilityContext) ApplyTransaction

func (u *UtilityContext) ApplyTransaction(tx *typesUtil.Transaction) types.Error

func (*UtilityContext) BeginBlock

func (u *UtilityContext) BeginBlock(previousBlockByzantineValidators [][]byte) types.Error

func (*UtilityContext) BeginUnstakingMaxPausedActors

func (u *UtilityContext) BeginUnstakingMaxPausedActors() types.Error

func (*UtilityContext) BeginUnstakingMaxPausedApps

func (u *UtilityContext) BeginUnstakingMaxPausedApps() types.Error

func (*UtilityContext) BeginUnstakingMaxPausedFishermen

func (u *UtilityContext) BeginUnstakingMaxPausedFishermen() types.Error

func (*UtilityContext) BeginUnstakingMaxPausedServiceNodes

func (u *UtilityContext) BeginUnstakingMaxPausedServiceNodes() types.Error

func (*UtilityContext) BeginUnstakingMaxPausedValidators

func (u *UtilityContext) BeginUnstakingMaxPausedValidators() types.Error

func (*UtilityContext) BurnValidator

func (u *UtilityContext) BurnValidator(address []byte, percentage int) types.Error

func (*UtilityContext) CalculateAppRelays

func (u *UtilityContext) CalculateAppRelays(stakedTokens string) (string, types.Error)

func (*UtilityContext) CalculateAppUnstakingHeight

func (u *UtilityContext) CalculateAppUnstakingHeight() (int64, types.Error)

func (*UtilityContext) CalculateFishermanUnstakingHeight

func (u *UtilityContext) CalculateFishermanUnstakingHeight() (int64, types.Error)

func (*UtilityContext) CalculateServiceNodeUnstakingHeight

func (u *UtilityContext) CalculateServiceNodeUnstakingHeight() (int64, types.Error)

func (*UtilityContext) CalculateUnstakingHeight

func (u *UtilityContext) CalculateUnstakingHeight(unstakingBlocks int64) (int64, types.Error)

func (*UtilityContext) CalculateValidatorUnstakingHeight

func (u *UtilityContext) CalculateValidatorUnstakingHeight() (int64, types.Error)

func (*UtilityContext) CheckTransaction

func (u *UtilityContext) CheckTransaction(transactionProtoBytes []byte) error

func (*UtilityContext) Codec

func (u *UtilityContext) Codec() types.Codec

func (*UtilityContext) DeleteApplication

func (u *UtilityContext) DeleteApplication(address []byte) types.Error

func (*UtilityContext) DeleteFisherman

func (u *UtilityContext) DeleteFisherman(address []byte) types.Error

func (*UtilityContext) DeleteServiceNode

func (u *UtilityContext) DeleteServiceNode(address []byte) types.Error

func (*UtilityContext) DeleteValidator

func (u *UtilityContext) DeleteValidator(address []byte) types.Error

func (*UtilityContext) EndBlock

func (u *UtilityContext) EndBlock(proposer []byte) types.Error

func (*UtilityContext) GetAccountAmount

func (u *UtilityContext) GetAccountAmount(address []byte) (*big.Int, types.Error)

func (*UtilityContext) GetAppExists

func (u *UtilityContext) GetAppExists(address []byte) (bool, types.Error)

func (*UtilityContext) GetAppHash

func (u *UtilityContext) GetAppHash() ([]byte, types.Error)

func (*UtilityContext) GetAppMaxChains

func (u *UtilityContext) GetAppMaxChains() (int, types.Error)

func (*UtilityContext) GetAppMaxPausedBlocks

func (u *UtilityContext) GetAppMaxPausedBlocks() (maxPausedBlocks int, err types.Error)

func (*UtilityContext) GetAppMinimumPauseBlocks

func (u *UtilityContext) GetAppMinimumPauseBlocks() (int, types.Error)

func (*UtilityContext) GetAppMinimumStake

func (u *UtilityContext) GetAppMinimumStake() (*big.Int, types.Error)

func (*UtilityContext) GetAppOutputAddress

func (u *UtilityContext) GetAppOutputAddress(operator []byte) ([]byte, types.Error)

func (*UtilityContext) GetAppPauseHeightIfExists

func (u *UtilityContext) GetAppPauseHeightIfExists(address []byte) (int64, types.Error)

func (*UtilityContext) GetAppStatus

func (u *UtilityContext) GetAppStatus(address []byte) (int, types.Error)

func (*UtilityContext) GetAppUnstakingBlocks

func (u *UtilityContext) GetAppUnstakingBlocks() (int64, types.Error)

func (*UtilityContext) GetAppsReadyToUnstake

func (u *UtilityContext) GetAppsReadyToUnstake() ([]*types.UnstakingActor, types.Error)

func (*UtilityContext) GetBaselineAppStakeRate

func (u *UtilityContext) GetBaselineAppStakeRate() (int, types.Error)

func (*UtilityContext) GetBlockHash

func (u *UtilityContext) GetBlockHash(height int64) ([]byte, types.Error)

func (*UtilityContext) GetBlocksPerSession

func (u *UtilityContext) GetBlocksPerSession() (int, types.Error)

func (*UtilityContext) GetDoubleSignBurnPercentage

func (u *UtilityContext) GetDoubleSignBurnPercentage() (burnPercentage int, err types.Error)

func (*UtilityContext) GetDoubleSignFeeOwner

func (u *UtilityContext) GetDoubleSignFeeOwner() (owner []byte, err types.Error)

func (*UtilityContext) GetFee

func (u *UtilityContext) GetFee(msg typesUtil.Message) (amount *big.Int, err types.Error)

func (*UtilityContext) GetFishermanExists

func (u *UtilityContext) GetFishermanExists(address []byte) (bool, types.Error)

func (*UtilityContext) GetFishermanMaxChains

func (u *UtilityContext) GetFishermanMaxChains() (int, types.Error)

func (*UtilityContext) GetFishermanMaxPausedBlocks

func (u *UtilityContext) GetFishermanMaxPausedBlocks() (maxPausedBlocks int, err types.Error)

func (*UtilityContext) GetFishermanMinimumPauseBlocks

func (u *UtilityContext) GetFishermanMinimumPauseBlocks() (int, types.Error)

func (*UtilityContext) GetFishermanMinimumStake

func (u *UtilityContext) GetFishermanMinimumStake() (*big.Int, types.Error)

func (*UtilityContext) GetFishermanOutputAddress

func (u *UtilityContext) GetFishermanOutputAddress(operator []byte) ([]byte, types.Error)

func (*UtilityContext) GetFishermanPauseHeightIfExists

func (u *UtilityContext) GetFishermanPauseHeightIfExists(address []byte) (int64, types.Error)

func (*UtilityContext) GetFishermanStatus

func (u *UtilityContext) GetFishermanStatus(address []byte) (int, types.Error)

func (*UtilityContext) GetFishermanUnstakingBlocks

func (u *UtilityContext) GetFishermanUnstakingBlocks() (int64, types.Error)

func (*UtilityContext) GetFishermenReadyToUnstake

func (u *UtilityContext) GetFishermenReadyToUnstake() ([]*types.UnstakingActor, types.Error)

func (*UtilityContext) GetLatestHeight

func (u *UtilityContext) GetLatestHeight() (int64, types.Error)

func (*UtilityContext) GetMaxEvidenceAgeInBlocks

func (u *UtilityContext) GetMaxEvidenceAgeInBlocks() (maxMissedBlocks int, err types.Error)

func (*UtilityContext) GetMessageChangeParameterFee

func (u *UtilityContext) GetMessageChangeParameterFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageChangeParameterSignerCandidates

func (u *UtilityContext) GetMessageChangeParameterSignerCandidates(msg *typesUtil.MessageChangeParameter) ([][]byte, types.Error)

func (*UtilityContext) GetMessageDoubleSignFee

func (u *UtilityContext) GetMessageDoubleSignFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageDoubleSignSignerCandidates

func (u *UtilityContext) GetMessageDoubleSignSignerCandidates(msg *typesUtil.MessageDoubleSign) ([][]byte, types.Error)

func (*UtilityContext) GetMessageEditStakeAppFee

func (u *UtilityContext) GetMessageEditStakeAppFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageEditStakeAppSignerCandidates

func (u *UtilityContext) GetMessageEditStakeAppSignerCandidates(msg *typesUtil.MessageEditStakeApp) ([][]byte, types.Error)

func (*UtilityContext) GetMessageEditStakeFishermanFee

func (u *UtilityContext) GetMessageEditStakeFishermanFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageEditStakeFishermanSignerCandidates

func (u *UtilityContext) GetMessageEditStakeFishermanSignerCandidates(msg *typesUtil.MessageEditStakeFisherman) ([][]byte, types.Error)

func (*UtilityContext) GetMessageEditStakeServiceNodeFee

func (u *UtilityContext) GetMessageEditStakeServiceNodeFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageEditStakeServiceNodeSignerCandidates

func (u *UtilityContext) GetMessageEditStakeServiceNodeSignerCandidates(msg *typesUtil.MessageEditStakeServiceNode) ([][]byte, types.Error)

func (*UtilityContext) GetMessageEditStakeValidatorFee

func (u *UtilityContext) GetMessageEditStakeValidatorFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageEditStakeValidatorSignerCandidates

func (u *UtilityContext) GetMessageEditStakeValidatorSignerCandidates(msg *typesUtil.MessageEditStakeValidator) ([][]byte, types.Error)

func (*UtilityContext) GetMessageFishermanPauseServiceNodeFee

func (u *UtilityContext) GetMessageFishermanPauseServiceNodeFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageFishermanPauseServiceNodeSignerCandidates

func (u *UtilityContext) GetMessageFishermanPauseServiceNodeSignerCandidates(msg *typesUtil.MessageFishermanPauseServiceNode) ([][]byte, types.Error)

func (*UtilityContext) GetMessagePauseAppFee

func (u *UtilityContext) GetMessagePauseAppFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessagePauseAppSignerCandidates

func (u *UtilityContext) GetMessagePauseAppSignerCandidates(msg *typesUtil.MessagePauseApp) ([][]byte, types.Error)

func (*UtilityContext) GetMessagePauseFishermanFee

func (u *UtilityContext) GetMessagePauseFishermanFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessagePauseFishermanSignerCandidates

func (u *UtilityContext) GetMessagePauseFishermanSignerCandidates(msg *typesUtil.MessagePauseFisherman) ([][]byte, types.Error)

func (*UtilityContext) GetMessagePauseServiceNodeFee

func (u *UtilityContext) GetMessagePauseServiceNodeFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessagePauseServiceNodeSignerCandidates

func (u *UtilityContext) GetMessagePauseServiceNodeSignerCandidates(msg *typesUtil.MessagePauseServiceNode) ([][]byte, types.Error)

func (*UtilityContext) GetMessagePauseValidatorFee

func (u *UtilityContext) GetMessagePauseValidatorFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessagePauseValidatorSignerCandidates

func (u *UtilityContext) GetMessagePauseValidatorSignerCandidates(msg *typesUtil.MessagePauseValidator) ([][]byte, types.Error)

func (*UtilityContext) GetMessageProveTestScoreFee

func (u *UtilityContext) GetMessageProveTestScoreFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageSendFee

func (u *UtilityContext) GetMessageSendFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageSendSignerCandidates

func (u *UtilityContext) GetMessageSendSignerCandidates(msg *typesUtil.MessageSend) ([][]byte, types.Error)

func (*UtilityContext) GetMessageStakeAppFee

func (u *UtilityContext) GetMessageStakeAppFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageStakeAppSignerCandidates

func (u *UtilityContext) GetMessageStakeAppSignerCandidates(msg *typesUtil.MessageStakeApp) ([][]byte, types.Error)

func (*UtilityContext) GetMessageStakeFishermanFee

func (u *UtilityContext) GetMessageStakeFishermanFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageStakeFishermanSignerCandidates

func (u *UtilityContext) GetMessageStakeFishermanSignerCandidates(msg *typesUtil.MessageStakeFisherman) ([][]byte, types.Error)

func (*UtilityContext) GetMessageStakeServiceNodeFee

func (u *UtilityContext) GetMessageStakeServiceNodeFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageStakeServiceNodeSignerCandidates

func (u *UtilityContext) GetMessageStakeServiceNodeSignerCandidates(msg *typesUtil.MessageStakeServiceNode) ([][]byte, types.Error)

func (*UtilityContext) GetMessageStakeValidatorFee

func (u *UtilityContext) GetMessageStakeValidatorFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageStakeValidatorSignerCandidates

func (u *UtilityContext) GetMessageStakeValidatorSignerCandidates(msg *typesUtil.MessageStakeValidator) ([][]byte, types.Error)

func (*UtilityContext) GetMessageTestScoreFee

func (u *UtilityContext) GetMessageTestScoreFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageUnpauseAppFee

func (u *UtilityContext) GetMessageUnpauseAppFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageUnpauseAppSignerCandidates

func (u *UtilityContext) GetMessageUnpauseAppSignerCandidates(msg *typesUtil.MessageUnpauseApp) ([][]byte, types.Error)

func (*UtilityContext) GetMessageUnpauseFishermanFee

func (u *UtilityContext) GetMessageUnpauseFishermanFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageUnpauseFishermanSignerCandidates

func (u *UtilityContext) GetMessageUnpauseFishermanSignerCandidates(msg *typesUtil.MessageUnpauseFisherman) ([][]byte, types.Error)

func (*UtilityContext) GetMessageUnpauseServiceNodeFee

func (u *UtilityContext) GetMessageUnpauseServiceNodeFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageUnpauseServiceNodeSignerCandidates

func (u *UtilityContext) GetMessageUnpauseServiceNodeSignerCandidates(msg *typesUtil.MessageUnpauseServiceNode) ([][]byte, types.Error)

func (*UtilityContext) GetMessageUnpauseValidatorFee

func (u *UtilityContext) GetMessageUnpauseValidatorFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageUnpauseValidatorSignerCandidates

func (u *UtilityContext) GetMessageUnpauseValidatorSignerCandidates(msg *typesUtil.MessageUnpauseValidator) ([][]byte, types.Error)

func (*UtilityContext) GetMessageUnstakeAppFee

func (u *UtilityContext) GetMessageUnstakeAppFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageUnstakeAppSignerCandidates

func (u *UtilityContext) GetMessageUnstakeAppSignerCandidates(msg *typesUtil.MessageUnstakeApp) ([][]byte, types.Error)

func (*UtilityContext) GetMessageUnstakeFishermanFee

func (u *UtilityContext) GetMessageUnstakeFishermanFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageUnstakeFishermanSignerCandidates

func (u *UtilityContext) GetMessageUnstakeFishermanSignerCandidates(msg *typesUtil.MessageUnstakeFisherman) ([][]byte, types.Error)

func (*UtilityContext) GetMessageUnstakeServiceNodeFee

func (u *UtilityContext) GetMessageUnstakeServiceNodeFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageUnstakeServiceNodeSignerCandidates

func (u *UtilityContext) GetMessageUnstakeServiceNodeSignerCandidates(msg *typesUtil.MessageUnstakeServiceNode) ([][]byte, types.Error)

func (*UtilityContext) GetMessageUnstakeValidatorFee

func (u *UtilityContext) GetMessageUnstakeValidatorFee() (*big.Int, types.Error)

func (*UtilityContext) GetMessageUnstakeValidatorSignerCandidates

func (u *UtilityContext) GetMessageUnstakeValidatorSignerCandidates(msg *typesUtil.MessageUnstakeValidator) ([][]byte, types.Error)

func (*UtilityContext) GetMissedBlocksBurnPercentage

func (u *UtilityContext) GetMissedBlocksBurnPercentage() (burnPercentage int, err types.Error)

func (*UtilityContext) GetParamOwner

func (u *UtilityContext) GetParamOwner(paramName string) ([]byte, error)

func (*UtilityContext) GetPersistenceContext

func (u *UtilityContext) GetPersistenceContext() modules.PersistenceContext

func (*UtilityContext) GetPoolAmount

func (u *UtilityContext) GetPoolAmount(name string) (*big.Int, types.Error)

func (*UtilityContext) GetProposerPercentageOfFees

func (u *UtilityContext) GetProposerPercentageOfFees() (proposerPercentage int, err types.Error)

func (*UtilityContext) GetServiceNodeCount

func (u *UtilityContext) GetServiceNodeCount(chain string, height int64) (int, types.Error)

func (*UtilityContext) GetServiceNodeExists

func (u *UtilityContext) GetServiceNodeExists(address []byte) (bool, types.Error)

func (*UtilityContext) GetServiceNodeMaxChains

func (u *UtilityContext) GetServiceNodeMaxChains() (int, types.Error)

func (*UtilityContext) GetServiceNodeMaxPausedBlocks

func (u *UtilityContext) GetServiceNodeMaxPausedBlocks() (maxPausedBlocks int, err types.Error)

func (*UtilityContext) GetServiceNodeMinimumPauseBlocks

func (u *UtilityContext) GetServiceNodeMinimumPauseBlocks() (int, types.Error)

func (*UtilityContext) GetServiceNodeMinimumStake

func (u *UtilityContext) GetServiceNodeMinimumStake() (*big.Int, types.Error)

func (*UtilityContext) GetServiceNodeOutputAddress

func (u *UtilityContext) GetServiceNodeOutputAddress(operator []byte) ([]byte, types.Error)

func (*UtilityContext) GetServiceNodePauseHeightIfExists

func (u *UtilityContext) GetServiceNodePauseHeightIfExists(address []byte) (int64, types.Error)

func (*UtilityContext) GetServiceNodeStatus

func (u *UtilityContext) GetServiceNodeStatus(address []byte) (int, types.Error)

func (*UtilityContext) GetServiceNodeUnstakingBlocks

func (u *UtilityContext) GetServiceNodeUnstakingBlocks() (int64, types.Error)

func (*UtilityContext) GetServiceNodesPerSession

func (u *UtilityContext) GetServiceNodesPerSession(height int64) (int, types.Error)

func (*UtilityContext) GetServiceNodesReadyToUnstake

func (u *UtilityContext) GetServiceNodesReadyToUnstake() ([]*types.UnstakingActor, types.Error)

func (*UtilityContext) GetSignerCandidates

func (u *UtilityContext) GetSignerCandidates(msg typesUtil.Message) ([][]byte, types.Error)

func (*UtilityContext) GetStabilityAdjustment

func (u *UtilityContext) GetStabilityAdjustment() (int, types.Error)

func (*UtilityContext) GetTransactionsForProposal

func (u *UtilityContext) GetTransactionsForProposal(proposer []byte, maxTransactionBytes int, lastBlockByzantineValidators [][]byte) ([][]byte, error)

func (*UtilityContext) GetValidatorExists

func (u *UtilityContext) GetValidatorExists(address []byte) (bool, types.Error)

func (*UtilityContext) GetValidatorMaxMissedBlocks

func (u *UtilityContext) GetValidatorMaxMissedBlocks() (maxMissedBlocks int, err types.Error)

func (*UtilityContext) GetValidatorMaxPausedBlocks

func (u *UtilityContext) GetValidatorMaxPausedBlocks() (maxPausedBlocks int, err types.Error)

func (*UtilityContext) GetValidatorMinimumPauseBlocks

func (u *UtilityContext) GetValidatorMinimumPauseBlocks() (int, types.Error)

func (*UtilityContext) GetValidatorMinimumStake

func (u *UtilityContext) GetValidatorMinimumStake() (*big.Int, types.Error)

func (*UtilityContext) GetValidatorMissedBlocks

func (u *UtilityContext) GetValidatorMissedBlocks(address []byte) (int, types.Error)

func (*UtilityContext) GetValidatorOutputAddress

func (u *UtilityContext) GetValidatorOutputAddress(operator []byte) ([]byte, types.Error)

func (*UtilityContext) GetValidatorPauseHeightIfExists

func (u *UtilityContext) GetValidatorPauseHeightIfExists(address []byte) (int64, types.Error)

func (*UtilityContext) GetValidatorStakedTokens

func (u *UtilityContext) GetValidatorStakedTokens(address []byte) (*big.Int, types.Error)

func (*UtilityContext) GetValidatorStatus

func (u *UtilityContext) GetValidatorStatus(address []byte) (int, types.Error)

func (*UtilityContext) GetValidatorUnstakingBlocks

func (u *UtilityContext) GetValidatorUnstakingBlocks() (int64, types.Error)

func (*UtilityContext) GetValidatorsReadyToUnstake

func (u *UtilityContext) GetValidatorsReadyToUnstake() ([]*types.UnstakingActor, types.Error)

func (*UtilityContext) HandleByzantineValidators

func (u *UtilityContext) HandleByzantineValidators(lastBlockByzantineValidators [][]byte) types.Error

func (*UtilityContext) HandleMessage

func (u *UtilityContext) HandleMessage(msg typesUtil.Message) types.Error

func (*UtilityContext) HandleMessageChangeParameter

func (u *UtilityContext) HandleMessageChangeParameter(message *typesUtil.MessageChangeParameter) types.Error

func (*UtilityContext) HandleMessageDoubleSign

func (u *UtilityContext) HandleMessageDoubleSign(message *typesUtil.MessageDoubleSign) types.Error

func (*UtilityContext) HandleMessageEditStakeApp

func (u *UtilityContext) HandleMessageEditStakeApp(message *typesUtil.MessageEditStakeApp) types.Error

func (*UtilityContext) HandleMessageEditStakeFisherman

func (u *UtilityContext) HandleMessageEditStakeFisherman(message *typesUtil.MessageEditStakeFisherman) types.Error

func (*UtilityContext) HandleMessageEditStakeServiceNode

func (u *UtilityContext) HandleMessageEditStakeServiceNode(message *typesUtil.MessageEditStakeServiceNode) types.Error

func (*UtilityContext) HandleMessageEditStakeValidator

func (u *UtilityContext) HandleMessageEditStakeValidator(message *typesUtil.MessageEditStakeValidator) types.Error

func (*UtilityContext) HandleMessageFishermanPauseServiceNode

func (u *UtilityContext) HandleMessageFishermanPauseServiceNode(message *typesUtil.MessageFishermanPauseServiceNode) types.Error

func (*UtilityContext) HandleMessagePauseApp

func (u *UtilityContext) HandleMessagePauseApp(message *typesUtil.MessagePauseApp) types.Error

func (*UtilityContext) HandleMessagePauseFisherman

func (u *UtilityContext) HandleMessagePauseFisherman(message *typesUtil.MessagePauseFisherman) types.Error

func (*UtilityContext) HandleMessagePauseServiceNode

func (u *UtilityContext) HandleMessagePauseServiceNode(message *typesUtil.MessagePauseServiceNode) types.Error

func (*UtilityContext) HandleMessagePauseValidator

func (u *UtilityContext) HandleMessagePauseValidator(message *typesUtil.MessagePauseValidator) types.Error

func (*UtilityContext) HandleMessageProveTestScore

func (u *UtilityContext) HandleMessageProveTestScore(message *typesUtil.MessageProveTestScore) types.Error

func (*UtilityContext) HandleMessageSend

func (u *UtilityContext) HandleMessageSend(message *typesUtil.MessageSend) types.Error

func (*UtilityContext) HandleMessageStakeApp

func (u *UtilityContext) HandleMessageStakeApp(message *typesUtil.MessageStakeApp) types.Error

func (*UtilityContext) HandleMessageStakeFisherman

func (u *UtilityContext) HandleMessageStakeFisherman(message *typesUtil.MessageStakeFisherman) types.Error

func (*UtilityContext) HandleMessageStakeServiceNode

func (u *UtilityContext) HandleMessageStakeServiceNode(message *typesUtil.MessageStakeServiceNode) types.Error

func (*UtilityContext) HandleMessageStakeValidator

func (u *UtilityContext) HandleMessageStakeValidator(message *typesUtil.MessageStakeValidator) types.Error

func (*UtilityContext) HandleMessageTestScore

func (u *UtilityContext) HandleMessageTestScore(message *typesUtil.MessageTestScore) types.Error

func (*UtilityContext) HandleMessageUnpauseApp

func (u *UtilityContext) HandleMessageUnpauseApp(message *typesUtil.MessageUnpauseApp) types.Error

func (*UtilityContext) HandleMessageUnpauseFisherman

func (u *UtilityContext) HandleMessageUnpauseFisherman(message *typesUtil.MessageUnpauseFisherman) types.Error

func (*UtilityContext) HandleMessageUnpauseServiceNode

func (u *UtilityContext) HandleMessageUnpauseServiceNode(message *typesUtil.MessageUnpauseServiceNode) types.Error

func (*UtilityContext) HandleMessageUnpauseValidator

func (u *UtilityContext) HandleMessageUnpauseValidator(message *typesUtil.MessageUnpauseValidator) types.Error

func (*UtilityContext) HandleMessageUnstakeApp

func (u *UtilityContext) HandleMessageUnstakeApp(message *typesUtil.MessageUnstakeApp) types.Error

func (*UtilityContext) HandleMessageUnstakeFisherman

func (u *UtilityContext) HandleMessageUnstakeFisherman(message *typesUtil.MessageUnstakeFisherman) types.Error

func (*UtilityContext) HandleMessageUnstakeServiceNode

func (u *UtilityContext) HandleMessageUnstakeServiceNode(message *typesUtil.MessageUnstakeServiceNode) types.Error

func (*UtilityContext) HandleMessageUnstakeValidator

func (u *UtilityContext) HandleMessageUnstakeValidator(message *typesUtil.MessageUnstakeValidator) types.Error

func (*UtilityContext) HandleProposalRewards

func (u *UtilityContext) HandleProposalRewards(proposer []byte) types.Error

func (*UtilityContext) InsertApplication

func (u *UtilityContext) InsertApplication(address, publicKey, output []byte, maxRelays, amount string, chains []string) types.Error

func (*UtilityContext) InsertFisherman

func (u *UtilityContext) InsertFisherman(address, publicKey, output []byte, serviceURL, amount string, chains []string) types.Error

func (*UtilityContext) InsertPool

func (u *UtilityContext) InsertPool(name string, address []byte, amount string) types.Error

func (*UtilityContext) InsertServiceNode

func (u *UtilityContext) InsertServiceNode(address, publicKey, output []byte, serviceURL, amount string, chains []string) types.Error

func (*UtilityContext) InsertValidator

func (u *UtilityContext) InsertValidator(address, publicKey, output []byte, serviceURL, amount string) types.Error

func (*UtilityContext) NewSavePoint

func (u *UtilityContext) NewSavePoint(transactionHash []byte) types.Error

func (*UtilityContext) ReleaseContext

func (u *UtilityContext) ReleaseContext()

func (*UtilityContext) RevertLastSavePoint

func (u *UtilityContext) RevertLastSavePoint() types.Error

func (*UtilityContext) SetAccountAmount

func (u *UtilityContext) SetAccountAmount(address []byte, amount *big.Int) types.Error

func (*UtilityContext) SetAccountWithAmountString

func (u *UtilityContext) SetAccountWithAmountString(address []byte, amount string) types.Error

func (*UtilityContext) SetAppPauseHeight

func (u *UtilityContext) SetAppPauseHeight(address []byte, height int64) types.Error

func (*UtilityContext) SetAppUnstakingHeightAndStatus

func (u *UtilityContext) SetAppUnstakingHeightAndStatus(address []byte, unstakingHeight int64) types.Error

func (*UtilityContext) SetFishermanPauseHeight

func (u *UtilityContext) SetFishermanPauseHeight(address []byte, height int64) types.Error

func (*UtilityContext) SetFishermanUnstakingHeightAndStatus

func (u *UtilityContext) SetFishermanUnstakingHeightAndStatus(address []byte, unstakingHeight int64) types.Error

func (*UtilityContext) SetPoolAmount

func (u *UtilityContext) SetPoolAmount(name string, amount *big.Int) types.Error

func (*UtilityContext) SetServiceNodePauseHeight

func (u *UtilityContext) SetServiceNodePauseHeight(address []byte, height int64) types.Error

func (*UtilityContext) SetServiceNodeUnstakingHeightAndStatus

func (u *UtilityContext) SetServiceNodeUnstakingHeightAndStatus(address []byte, unstakingHeight int64) types.Error

func (*UtilityContext) SetValidatorMissedBlocks

func (u *UtilityContext) SetValidatorMissedBlocks(address []byte, missedBlocks int) types.Error

func (*UtilityContext) SetValidatorPauseHeight

func (u *UtilityContext) SetValidatorPauseHeight(address []byte, height int64) types.Error

func (*UtilityContext) SetValidatorPauseHeightAndMissedBlocks

func (u *UtilityContext) SetValidatorPauseHeightAndMissedBlocks(address []byte, pauseHeight int64, missedBlocks int) types.Error

func (*UtilityContext) SetValidatorStakedTokens

func (u *UtilityContext) SetValidatorStakedTokens(address []byte, tokens *big.Int) types.Error

func (*UtilityContext) SetValidatorUnstakingHeightAndStatus

func (u *UtilityContext) SetValidatorUnstakingHeightAndStatus(address []byte, unstakingHeight int64) types.Error

func (*UtilityContext) Store

func (u *UtilityContext) Store() *Context

func (*UtilityContext) SubPoolAmount

func (u *UtilityContext) SubPoolAmount(name string, amountToSub string) types.Error

func (*UtilityContext) SubtractAccountAmount

func (u *UtilityContext) SubtractAccountAmount(address []byte, amountToSubtract *big.Int) types.Error

func (*UtilityContext) UnstakeActorsThatAreReady

func (u *UtilityContext) UnstakeActorsThatAreReady() types.Error

func (*UtilityContext) UnstakeAppsPausedBefore

func (u *UtilityContext) UnstakeAppsPausedBefore(pausedBeforeHeight int64) types.Error

func (*UtilityContext) UnstakeAppsThatAreReady

func (u *UtilityContext) UnstakeAppsThatAreReady() types.Error

func (*UtilityContext) UnstakeFishermenPausedBefore

func (u *UtilityContext) UnstakeFishermenPausedBefore(pausedBeforeHeight int64) types.Error

func (*UtilityContext) UnstakeFishermenThatAreReady

func (u *UtilityContext) UnstakeFishermenThatAreReady() types.Error

func (*UtilityContext) UnstakeServiceNodesPausedBefore

func (u *UtilityContext) UnstakeServiceNodesPausedBefore(pausedBeforeHeight int64) types.Error

func (*UtilityContext) UnstakeServiceNodesThatAreReady

func (u *UtilityContext) UnstakeServiceNodesThatAreReady() types.Error

func (*UtilityContext) UnstakeValidatorsPausedBefore

func (u *UtilityContext) UnstakeValidatorsPausedBefore(pausedBeforeHeight int64) types.Error

func (*UtilityContext) UnstakeValidatorsThatAreReady

func (u *UtilityContext) UnstakeValidatorsThatAreReady() types.Error

func (*UtilityContext) UpdateApplication

func (u *UtilityContext) UpdateApplication(address []byte, maxRelays, amount string, chains []string) types.Error

TODO (Team) re-evaluate whether the delta should be here or the updated value

func (*UtilityContext) UpdateFisherman

func (u *UtilityContext) UpdateFisherman(address []byte, serviceURL, amount string, chains []string) types.Error

func (*UtilityContext) UpdateParam

func (u *UtilityContext) UpdateParam(paramName string, value interface{}) types.Error

func (*UtilityContext) UpdateServiceNode

func (u *UtilityContext) UpdateServiceNode(address []byte, serviceURL, amount string, chains []string) types.Error

func (*UtilityContext) UpdateValidator

func (u *UtilityContext) UpdateValidator(address []byte, serviceURL, amount string) types.Error

type UtilityModule

type UtilityModule struct {
	Mempool types.Mempool
	// contains filtered or unexported fields
}

func (*UtilityModule) GetBus

func (u *UtilityModule) GetBus() modules.Bus

func (*UtilityModule) NewContext

func (u *UtilityModule) NewContext(height int64) (modules.UtilityContext, error)

func (*UtilityModule) SetBus

func (u *UtilityModule) SetBus(bus modules.Bus)

func (*UtilityModule) Start

func (u *UtilityModule) Start() error

func (*UtilityModule) Stop

func (u *UtilityModule) Stop() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL