vm

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: ISC Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildEVMBlock added in v1.0.21

func BuildEVMBlock(block *types.SerializedBlock) (consensus.Block, error)

Types

type Block

type Block struct {
	Id   *hash.Hash
	Txs  []model.Tx
	Time time.Time
}

func (*Block) Accept

func (b *Block) Accept() error

func (*Block) Bytes

func (b *Block) Bytes() []byte

func (*Block) Height

func (b *Block) Height() uint64

func (*Block) ID

func (b *Block) ID() *hash.Hash

func (*Block) Parent

func (b *Block) Parent() *hash.Hash

func (*Block) Reject

func (b *Block) Reject() error

func (*Block) SetStatus

func (b *Block) SetStatus(status consensus.Status)

func (*Block) Status

func (b *Block) Status() consensus.Status

func (*Block) String

func (b *Block) String() string

func (*Block) Timestamp

func (b *Block) Timestamp() time.Time

func (*Block) Transactions

func (b *Block) Transactions() []model.Tx

func (*Block) Verify

func (b *Block) Verify() error

type ChainState

type ChainState struct {
}

type Context

type Context struct {
	context.Context
	Cfg       *config.Config
	Tp        model.TxPool
	Notify    consensus.Notify
	Consensus model.Consensus
}

func (*Context) GetConfig

func (ctx *Context) GetConfig() *config.Config

func (Context) GetConsensus added in v1.0.21

func (ctx Context) GetConsensus() model.Consensus

func (*Context) GetNotify

func (ctx *Context) GetNotify() consensus.Notify

func (*Context) GetTxPool

func (ctx *Context) GetTxPool() model.TxPool

type ExportTx

type ExportTx struct {
	*Tx
	*types.Transaction
}

func NewExportTx

func NewExportTx(tx *types.Transaction) (*ExportTx, error)

func (*ExportTx) CheckSanity

func (etx *ExportTx) CheckSanity() error

type ImportTx

type ImportTx struct {
	*Tx
	*types.Transaction
}

func NewImportTx

func NewImportTx(tx *types.Transaction) (*ImportTx, error)

func (*ImportTx) CheckSanity

func (itx *ImportTx) CheckSanity() error

func (*ImportTx) GetPKAddress

func (itx *ImportTx) GetPKAddress() (*address.SecpPubKeyAddress, error)

func (*ImportTx) GetPKScript

func (itx *ImportTx) GetPKScript() ([]byte, error)

func (*ImportTx) GetTransactionForEngine

func (itx *ImportTx) GetTransactionForEngine() (*types.Transaction, error)

func (*ImportTx) SetCoinbaseTx

func (itx *ImportTx) SetCoinbaseTx(tx *types.Transaction) error

func (*ImportTx) Sign

func (itx *ImportTx) Sign(privateKey ecc.PrivateKey) error

type Tx

type Tx struct {
	Type  types.TxType
	From  string
	To    string
	Value uint64
	Data  []byte
}

func (*Tx) GetData

func (tx *Tx) GetData() []byte

func (*Tx) GetFrom

func (tx *Tx) GetFrom() string

func (*Tx) GetTo

func (tx *Tx) GetTo() string

func (*Tx) GetTxType

func (tx *Tx) GetTxType() types.TxType

func (*Tx) GetValue

func (tx *Tx) GetValue() uint64

type VMTx

type VMTx struct {
	*Tx
	*types.Transaction
	// contains filtered or unexported fields
}

func NewVMTx

func NewVMTx(tx *types.Transaction) (*VMTx, error)

func (*VMTx) CheckSanity

func (vt *VMTx) CheckSanity() error

func (*VMTx) SetCoinbaseTx

func (vt *VMTx) SetCoinbaseTx(tx *types.Transaction) error

func (*VMTx) SetVMI

func (vt *VMTx) SetVMI(vmi model.VMI)

Jump to

Keyboard shortcuts

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