Documentation ¶
Index ¶
- Constants
- Variables
- func GetFittestGeneratorSnapshotHash(chain vm_context.Chain, accAddr *types.Address, ...) (prevSbHash *types.Hash, fittestSbHash *types.Hash, err error)
- func RecoverVmContext(chain vm_context.Chain, block *ledger.AccountBlock) (vmContextList []vmctxt_interface.VmDatabase, resultErr error)
- type ConsensusMessage
- type GenResult
- type Generator
- func (gen *Generator) GenerateWithBlock(block *ledger.AccountBlock, signFunc SignFunc) (*GenResult, error)
- func (gen *Generator) GenerateWithMessage(message *IncomingMessage, signFunc SignFunc) (*GenResult, error)
- func (gen *Generator) GenerateWithOnroad(sendBlock ledger.AccountBlock, consensusMsg *ConsensusMessage, ...) (*GenResult, error)
- type IncomingMessage
- type SignFunc
Constants ¶
View Source
const DefaultHeightDifference uint64 = 10
Variables ¶
Functions ¶
func RecoverVmContext ¶ added in v1.3.0
func RecoverVmContext(chain vm_context.Chain, block *ledger.AccountBlock) (vmContextList []vmctxt_interface.VmDatabase, resultErr error)
Types ¶
type ConsensusMessage ¶
type GenResult ¶
type GenResult struct { BlockGenList []*vm_context.VmAccountBlock IsRetry bool Err error }
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
func (*Generator) GenerateWithBlock ¶
func (*Generator) GenerateWithMessage ¶
func (gen *Generator) GenerateWithMessage(message *IncomingMessage, signFunc SignFunc) (*GenResult, error)
func (*Generator) GenerateWithOnroad ¶
func (gen *Generator) GenerateWithOnroad(sendBlock ledger.AccountBlock, consensusMsg *ConsensusMessage, signFunc SignFunc, difficulty *big.Int) (*GenResult, error)
type IncomingMessage ¶
type IncomingMessage struct { BlockType byte AccountAddress types.Address ToAddress *types.Address FromBlockHash *types.Hash TokenId *types.TokenTypeId Amount *big.Int Fee *big.Int Data []byte Difficulty *big.Int }
func (*IncomingMessage) ToSendBlock ¶
func (im *IncomingMessage) ToSendBlock() (*ledger.AccountBlock, error)
Click to show internal directories.
Click to hide internal directories.