Documentation ¶
Index ¶
- func CalculateReward(ledger core.Ledger, view *st.StoreView, validatorSet *core.ValidatorSet, ...) map[string]types.Coins
- func NewExecTest() *execTest
- func NewTestValidatorManager(proposer core.Validator, valSet *core.ValidatorSet) core.ValidatorManager
- type BigIntSort
- type CoinbaseTxExecutor
- type DepositStakeExecutor
- type Executor
- func (exec *Executor) CheckTx(tx types.Tx) (common.Hash, result.Result)
- func (exec *Executor) ExecuteTx(tx types.Tx) (common.Hash, result.Result)
- func (exec *Executor) GetTxInfo(tx types.Tx) (*core.TxInfo, result.Result)
- func (exec *Executor) ScreenTx(tx types.Tx) (common.Hash, result.Result)
- func (exec *Executor) SetSkipSanityCheck(skip bool)
- type HashRand
- type ReleaseFundTxExecutor
- type ReserveFundTxExecutor
- type SendTxExecutor
- type ServicePaymentTxExecutor
- type SlashTxExecutor
- type SmartContractTxExecutor
- type SplitRuleTxExecutor
- type TestConsensusEngine
- func (tce *TestConsensusEngine) AddMessage(msg interface{})
- func (tce *TestConsensusEngine) FinalizedBlocks() chan *core.Block
- func (tce *TestConsensusEngine) GetEpoch() uint64
- func (tce *TestConsensusEngine) GetLastFinalizedBlock() *core.ExtendedBlock
- func (tce *TestConsensusEngine) GetLedger() core.Ledger
- func (tce *TestConsensusEngine) GetTip(bool) *core.ExtendedBlock
- func (tce *TestConsensusEngine) ID() string
- func (tce *TestConsensusEngine) PrivateKey() *crypto.PrivateKey
- type TestValidatorManager
- func (tvm *TestValidatorManager) GetNextProposer(blockHash common.Hash, epoch uint64) core.Validator
- func (tvm *TestValidatorManager) GetNextValidatorSet(blockHash common.Hash) *core.ValidatorSet
- func (tvm *TestValidatorManager) GetProposer(blockHash common.Hash, epoch uint64) core.Validator
- func (tvm *TestValidatorManager) GetValidatorSet(blockHash common.Hash) *core.ValidatorSet
- func (tvm *TestValidatorManager) SetConsensusEngine(consensus core.ConsensusEngine)
- type TxExecutor
- type WithdrawStakeExecutor
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 ¶
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) *Executor
NewExecutor creates a new instance of Executor
func (*Executor) SetSkipSanityCheck ¶
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 ¶
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) *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 (tce *TestConsensusEngine) GetTip(bool) *core.ExtendedBlock
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 (*TestValidatorManager) GetNextValidatorSet ¶
func (tvm *TestValidatorManager) GetNextValidatorSet(blockHash common.Hash) *core.ValidatorSet
func (*TestValidatorManager) GetProposer ¶
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