execution

package
v0.0.0-...-4d9f4f2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: GPL-3.0 Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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) 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

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 {
}

DepositStakeExecutor implements the TxExecutor interface

func NewDepositStakeExecutor

func NewDepositStakeExecutor() *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) *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 HashRand

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

HashRand generate infinite number of random bytes by repeatedly hashing the seed

func NewHashRand

func NewHashRand(seed []byte) *HashRand

func (*HashRand) Read

func (r *HashRand) Read(buf []byte) (int, error)

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 {
}

SendTxExecutor implements the TxExecutor interface

func NewSendTxExecutor

func NewSendTxExecutor() *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) *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 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