boltvm

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBoltContract

func GetBoltContract(address string, boltRegister map[string]agency.Contract) (contract agency.Contract, err error)

func Register

func Register(contracts []*BoltContract) map[string]agency.Contract

register contract

Types

type BoltContract

type BoltContract struct {
	// enable/disable bolt contract
	Enabled bool
	// contract name
	Name string
	// contract address
	Address string
	// Contract is contract object
	Contract agency.Contract
}

type BoltStubImpl

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

func (*BoltStubImpl) Add added in v1.0.1

func (b *BoltStubImpl) Add(key string, value []byte)

func (*BoltStubImpl) AddObject added in v1.0.1

func (b *BoltStubImpl) AddObject(key string, value interface{})

func (*BoltStubImpl) Callee

func (b *BoltStubImpl) Callee() string

func (*BoltStubImpl) Caller

func (b *BoltStubImpl) Caller() string

func (*BoltStubImpl) CrossInvoke

func (b *BoltStubImpl) CrossInvoke(address, method string, args ...*pb.Arg) *boltvm.Response

func (*BoltStubImpl) CrossInvokeEVM added in v1.10.0

func (b *BoltStubImpl) CrossInvokeEVM(address string, data []byte) *boltvm.Response

func (*BoltStubImpl) CurrentCaller added in v1.6.1

func (b *BoltStubImpl) CurrentCaller() string

func (*BoltStubImpl) Delete

func (b *BoltStubImpl) Delete(key string)

func (*BoltStubImpl) Get

func (b *BoltStubImpl) Get(key string) (bool, []byte)

func (*BoltStubImpl) GetAccount added in v1.8.0

func (b *BoltStubImpl) GetAccount(address string) interface{}

func (*BoltStubImpl) GetCurrentHeight added in v1.12.0

func (b *BoltStubImpl) GetCurrentHeight() uint64

func (*BoltStubImpl) GetObject

func (b *BoltStubImpl) GetObject(key string, ret interface{}) bool

func (*BoltStubImpl) GetTxHash

func (b *BoltStubImpl) GetTxHash() *types.Hash

GetTxHash returns the transaction hash

func (*BoltStubImpl) GetTxIndex

func (b *BoltStubImpl) GetTxIndex() uint64

func (*BoltStubImpl) GetTxTimeStamp added in v1.10.0

func (b *BoltStubImpl) GetTxTimeStamp() int64

func (*BoltStubImpl) Has

func (b *BoltStubImpl) Has(key string) bool

func (*BoltStubImpl) Logger

func (b *BoltStubImpl) Logger() logrus.FieldLogger

func (*BoltStubImpl) PostEvent

func (b *BoltStubImpl) PostEvent(eventType pb.Event_EventType, event interface{})

func (*BoltStubImpl) PostInterchainEvent

func (b *BoltStubImpl) PostInterchainEvent(event interface{})

func (*BoltStubImpl) Query

func (b *BoltStubImpl) Query(prefix string) (bool, [][]byte)

func (*BoltStubImpl) Set

func (b *BoltStubImpl) Set(key string, value []byte)

func (*BoltStubImpl) SetObject

func (b *BoltStubImpl) SetObject(key string, value interface{})

func (*BoltStubImpl) ValidationEngine

func (b *BoltStubImpl) ValidationEngine() validator.Engine

type BoltVM

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

func New

func New(ctx *vm.Context, ve validator.Engine, evm *evm.EVM, contracts map[string]agency.Contract) *BoltVM

New creates a blot vm object

func (*BoltVM) HandleIBTP added in v1.0.1

func (bvm *BoltVM) HandleIBTP(ibtp *pb.IBTP) (ret []byte, err error)

func (*BoltVM) InvokeBVM added in v1.12.0

func (bvm *BoltVM) InvokeBVM(address string, input []byte) (ret []byte, _ uint64, err error)

func (*BoltVM) Run

func (bvm *BoltVM) Run(input []byte, _ uint64) (ret []byte, gasUsed uint64, err error)

type Context

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

func NewContext

func NewContext(tx pb.Transaction, txIndex uint64, data *pb.TransactionData, ledger *ledger.Ledger, logger logrus.FieldLogger) *Context

func (*Context) Callee

func (ctx *Context) Callee() string

func (*Context) Caller

func (ctx *Context) Caller() string

func (*Context) Logger

func (ctx *Context) Logger() logrus.FieldLogger

func (*Context) TransactionHash

func (ctx *Context) TransactionHash() *types.Hash

func (*Context) TransactionIndex

func (ctx *Context) TransactionIndex() uint64

Jump to

Keyboard shortcuts

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