execution

package
v0.0.0-...-cff1f21 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateReward

func CalculateReward(ledger core.Ledger, view *st.StoreView, validatorSet *core.ValidatorSet,
	guardianVotes *core.AggregatedVotes, guardianPool *core.GuardianCandidatePool,
	eliteEdgeNodeVotes *core.AggregatedEENVotes, eliteEdgeNodePool core.EliteEdgeNodePool) map[string]types.Coins

CalculateReward calculates the block reward for each account

func NewExecTest

func NewExecTest() *execTest

func NewTestValidatorManager

func NewTestValidatorManager(proposer core.Validator, valSet *core.ValidatorSet) core.ValidatorManager

func RetrievePools

func RetrievePools(ledger core.Ledger, chain *blockchain.Chain, db database.Database, blockHeight uint64, guardianVotes *core.AggregatedVotes,
	eliteEdgeNodeVotes *core.AggregatedEENVotes) (guardianPool *core.GuardianCandidatePool, eliteEdgeNodePool core.EliteEdgeNodePool)

Types

type BigIntSort

type BigIntSort []*big.Int

func (BigIntSort) Len

func (s BigIntSort) Len() int

func (BigIntSort) Less

func (s BigIntSort) Less(i, j int) bool

func (BigIntSort) Swap

func (s BigIntSort) Swap(i, j int)

type CoinbaseTxExecutor

type CoinbaseTxExecutor struct {
	// contains filtered or unexported fields
}

CoinbaseTxExecutor implements the TxExecutor interface

func NewCoinbaseTxExecutor

func NewCoinbaseTxExecutor(db database.Database, chain *blockchain.Chain, state *st.LedgerState, consensus core.ConsensusEngine, valMgr core.ValidatorManager) *CoinbaseTxExecutor

NewCoinbaseTxExecutor creates a new instance of CoinbaseTxExecutor

type DepositStakeExecutor

type DepositStakeExecutor struct {
	// contains filtered or unexported fields
}

DepositStakeExecutor implements the TxExecutor interface

func NewDepositStakeExecutor

func NewDepositStakeExecutor(state *st.LedgerState) *DepositStakeExecutor

NewDepositStakeExecutor creates a new instance of DepositStakeExecutor

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

Executor executes the transactions

func NewExecutor

func NewExecutor(db database.Database, chain *blockchain.Chain, state *st.LedgerState, consensus core.ConsensusEngine, valMgr core.ValidatorManager, ledger core.Ledger) *Executor

NewExecutor creates a new instance of Executor

func (*Executor) CheckTx

func (exec *Executor) CheckTx(tx types.Tx) (common.Hash, result.Result)

CheckTx checks the validity of the given transaction

func (*Executor) ExecuteTx

func (exec *Executor) ExecuteTx(tx types.Tx) (common.Hash, result.Result)

ExecuteTx executes the given transaction

func (*Executor) GetTxInfo

func (exec *Executor) GetTxInfo(tx types.Tx) (*core.TxInfo, result.Result)

GetTxInfo extracts tx information used by mempool to sort Txs.

func (*Executor) ScreenTx

func (exec *Executor) ScreenTx(tx types.Tx) (common.Hash, result.Result)

ScreenTx checks the validity of the given transaction

func (*Executor) SetSkipSanityCheck

func (exec *Executor) SetSkipSanityCheck(skip bool)

SetSkipSanityCheck sets the flag for sanity check. Skip checks while replaying commmitted blocks.

type ReleaseFundTxExecutor

type ReleaseFundTxExecutor struct {
	// contains filtered or unexported fields
}

ReleaseFundTxExecutor implements the TxExecutor interface

func NewReleaseFundTxExecutor

func NewReleaseFundTxExecutor(state *st.LedgerState) *ReleaseFundTxExecutor

NewReleaseFundTxExecutor creates a new instance of ReleaseFundTxExecutor

type ReserveFundTxExecutor

type ReserveFundTxExecutor struct {
	// contains filtered or unexported fields
}

ReserveFundTxExecutor implements the TxExecutor interface

func NewReserveFundTxExecutor

func NewReserveFundTxExecutor(state *st.LedgerState) *ReserveFundTxExecutor

NewReserveFundTxExecutor creates a new instance of ReserveFundTxExecutor

type SendTxExecutor

type SendTxExecutor struct {
	// contains filtered or unexported fields
}

SendTxExecutor implements the TxExecutor interface

func NewSendTxExecutor

func NewSendTxExecutor(state *st.LedgerState) *SendTxExecutor

NewSendTxExecutor creates a new instance of SendTxExecutor

type ServicePaymentTxExecutor

type ServicePaymentTxExecutor struct {
	// contains filtered or unexported fields
}

ServicePaymentTxExecutor implements the TxExecutor interface

func NewServicePaymentTxExecutor

func NewServicePaymentTxExecutor(state *st.LedgerState) *ServicePaymentTxExecutor

NewServicePaymentTxExecutor creates a new instance of ServicePaymentTxExecutor

type SlashTxExecutor

type SlashTxExecutor struct {
	// contains filtered or unexported fields
}

func NewSlashTxExecutor

func NewSlashTxExecutor(consensus core.ConsensusEngine, valMgr core.ValidatorManager) *SlashTxExecutor

NewSlashTxExecutor creates a new instance of SlashTxExecutor

type SmartContractTxExecutor

type SmartContractTxExecutor struct {
	// contains filtered or unexported fields
}

SmartContractTxExecutor implements the TxExecutor interface

func NewSmartContractTxExecutor

func NewSmartContractTxExecutor(chain *blockchain.Chain, state *st.LedgerState, ledger core.Ledger) *SmartContractTxExecutor

NewSmartContractTxExecutor creates a new instance of SmartContractTxExecutor

type SplitRuleTxExecutor

type SplitRuleTxExecutor struct {
	// contains filtered or unexported fields
}

SplitRuleTxExecutor implements the TxExecutor interface

func NewSplitRuleTxExecutor

func NewSplitRuleTxExecutor(state *st.LedgerState) *SplitRuleTxExecutor

NewSplitRuleTxExecutor creates a new instance of SplitRuleTxExecutor

type StakeRewardDistributionTxExecutor

type StakeRewardDistributionTxExecutor struct {
	// contains filtered or unexported fields
}

StakeRewardDistributionTxExecutor implements the TxExecutor interface

func NewStakeRewardDistributionTxExecutor

func NewStakeRewardDistributionTxExecutor(state *st.LedgerState) *StakeRewardDistributionTxExecutor

NewStakeRewardDistributionTxExecutor creates a new instance of StakeRewardDistributionTxExecutor

type TestConsensusEngine

type TestConsensusEngine struct {
	// contains filtered or unexported fields
}

func NewTestConsensusEngine

func NewTestConsensusEngine(seed string) *TestConsensusEngine

func (*TestConsensusEngine) AddMessage

func (tce *TestConsensusEngine) AddMessage(msg interface{})

func (*TestConsensusEngine) FinalizedBlocks

func (tce *TestConsensusEngine) FinalizedBlocks() chan *core.Block

func (*TestConsensusEngine) GetEpoch

func (tce *TestConsensusEngine) GetEpoch() uint64

func (*TestConsensusEngine) GetLastFinalizedBlock

func (tce *TestConsensusEngine) GetLastFinalizedBlock() *core.ExtendedBlock

func (*TestConsensusEngine) GetLedger

func (tce *TestConsensusEngine) GetLedger() core.Ledger

func (*TestConsensusEngine) GetTip

func (*TestConsensusEngine) ID

func (tce *TestConsensusEngine) ID() string

func (*TestConsensusEngine) PrivateKey

func (tce *TestConsensusEngine) PrivateKey() *crypto.PrivateKey

type TestValidatorManager

type TestValidatorManager struct {
	// contains filtered or unexported fields
}

func (*TestValidatorManager) GetNextProposer

func (tvm *TestValidatorManager) GetNextProposer(blockHash common.Hash, epoch uint64) core.Validator

func (*TestValidatorManager) GetNextValidatorSet

func (tvm *TestValidatorManager) GetNextValidatorSet(blockHash common.Hash) *core.ValidatorSet

func (*TestValidatorManager) GetProposer

func (tvm *TestValidatorManager) GetProposer(blockHash common.Hash, epoch uint64) core.Validator

func (*TestValidatorManager) GetValidatorSet

func (tvm *TestValidatorManager) GetValidatorSet(blockHash common.Hash) *core.ValidatorSet

func (*TestValidatorManager) SetConsensusEngine

func (tvm *TestValidatorManager) SetConsensusEngine(consensus core.ConsensusEngine)

type TxExecutor

type TxExecutor interface {
	// contains filtered or unexported methods
}

TxExecutor defines the interface of the transaction executors

type WithdrawStakeExecutor

type WithdrawStakeExecutor struct {
	// contains filtered or unexported fields
}

WithdrawStakeExecutor implements the TxExecutor interface

func NewWithdrawStakeExecutor

func NewWithdrawStakeExecutor(state *st.LedgerState) *WithdrawStakeExecutor

NewWithdrawStakeExecutor creates a new instance of WithdrawStakeExecutor

Jump to

Keyboard shortcuts

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