header

package
v2.9.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenResult

type GenResult struct {
	VMBlock *vm_db.VmAccountBlock
	IsRetry bool
	Err     error
}

GenResult represents the result of a block being validated by vm.

type Generator

type Generator interface {
	GenerateWithBlock(block *ledger.AccountBlock, fromBlock *ledger.AccountBlock) (*GenResult, error)
	GenerateWithMessage(message *IncomingMessage, producer *types.Address, signFunc SignFunc) (*GenResult, error)
	GenerateWithOnRoad(sendBlock *ledger.AccountBlock, producer *types.Address, signFunc SignFunc, difficulty *big.Int) (*GenResult, error)
	GetVMDB() vm_db.VmDb
}

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
}

IncomingMessage carries the necessary transaction info.

type SignFunc

type SignFunc func(addr types.Address, data []byte) (signedData, pubkey []byte, err error)

SignFunc is the function type defining the callback when a block requires a method to sign the transaction in generator.

Jump to

Keyboard shortcuts

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