boltvm

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 4 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	Ok     bool
	Result []byte
}

func Error

func Error(msg string) *Response

Error returns error result that will cause vm call error, and this transaction will be invalid

func Success

func Success(data []byte) *Response

Result returns normal result

type Stub

type Stub interface {
	// Caller
	Caller() string
	// Callee
	Callee() string
	// CurrentCaller
	CurrentCaller() string
	// Logger
	Logger() logrus.FieldLogger
	// GetTxHash returns the transaction hash
	GetTxHash() *types.Hash
	// GetTxIndex returns the transaction index in the block
	GetTxIndex() uint64
	// Has judges key
	Has(key string) bool
	// Get gets value from datastore by key
	Get(key string) (bool, []byte)
	// GetObject
	GetObject(key string, ret interface{}) bool
	// Set sets k-v
	Set(key string, value []byte)
	// SetObject sets k with object v, v will be marshaled using json
	SetObject(key string, value interface{})
	// AddObject adds k with object v, v will be marshaled using json
	AddObject(key string, value interface{})
	// Delete deletes k-v
	Delete(key string)
	// QueryByPrefix queries object by prefix
	Query(prefix string) (bool, [][]byte)
	// PostEvent posts event to external
	PostEvent(interface{})
	// PostInterchainEvent posts interchain event to external
	PostInterchainEvent(interface{})
	// Validator returns the instance of validator
	ValidationEngine() validator.Engine
	// CrossInvoke cross contract invoke
	CrossInvoke(address, method string, args ...*pb.Arg) *Response
}

Directories

Path Synopsis
Package mock_stub is a generated GoMock package.
Package mock_stub is a generated GoMock package.

Jump to

Keyboard shortcuts

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