tvm

package
v1.8.13 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 15 Imported by: 4

README

Go binding for C++ TVM library.

This library implements bindings for interacting with C++ tvm library.

TVM description you can find here:

Usage

Example

How to link or recompile shared library you can find in /lib directory depending on your OS.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetVerbosityLevel added in v1.2.1

func SetVerbosityLevel(level int) error

SetVerbosityLevel sets verbosity level of TVM emulator. This is a global setting that affects all emulators. verbosity level (0 - never, 1 - error, 2 - warning, 3 - info, 4 - debug)

Types

type Emulator

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

func NewEmulator

func NewEmulator(code, data, config *boc.Cell, opts ...Option) (*Emulator, error)

NewEmulator Verbosity level of VM log. 0 - log truncated to last 256 characters. 1 - unlimited length log. 2 - for each command prints its cell hash and offset. 3 - for each command log prints all stack values.

func NewEmulatorFromBOCsBase64

func NewEmulatorFromBOCsBase64(code, data, config string, opts ...Option) (*Emulator, error)

NewEmulatorFromBOCsBase64 Verbosity level of VM log. 0 - log truncated to last 256 characters. 1 - unlimited length log. 2 - for each command prints its cell hash and offset. 3 - for each command log prints all stack values.

func (*Emulator) RunSmcMethod added in v1.0.1

func (e *Emulator) RunSmcMethod(ctx context.Context, accountId ton.AccountID, method string, params tlb.VmStack) (uint32, tlb.VmStack, error)

func (*Emulator) RunSmcMethodByID added in v1.0.1

func (e *Emulator) RunSmcMethodByID(ctx context.Context, accountId ton.AccountID, methodID int, params tlb.VmStack) (uint32, tlb.VmStack, error)

func (*Emulator) SetBalance

func (e *Emulator) SetBalance(balance int64)

func (*Emulator) SetGasLimit

func (e *Emulator) SetGasLimit(gasLimit int64) error

func (*Emulator) SetLibs

func (e *Emulator) SetLibs(libs *boc.Cell) error

type Option added in v1.0.8

type Option func(o *Options)

func WithBalance added in v1.0.8

func WithBalance(balance int64) Option

func WithIgnoreLibraryCells added in v1.8.7

func WithIgnoreLibraryCells(ignore bool) Option

func WithLazyC7Optimization added in v1.0.8

func WithLazyC7Optimization() Option

WithLazyC7Optimization allows to make two attempts to execute a get method. At the first attempt an emulator invokes a get method without C7. This works for most get methods and significantly decreases the execution time. If the first attempt fails, an emulator invokes the same get method again but with configured C7.

func WithLibrariesBase64 added in v1.2.1

func WithLibrariesBase64(libraries string) Option

WithLibrariesBase64 provides a list of available libraries as a base64 string. Take a look at LibrariesToBase64() to convert a map with libraries to such a string.

func WithLibraryResolver added in v1.8.7

func WithLibraryResolver(resolver libResolver) Option

func WithVerbosityLevel added in v1.0.8

func WithVerbosityLevel(level txemulator.VerbosityLevel) Option

WithVerbosityLevel sets verbosity level of a TVM emulator instance. TODO: find a way to expose logs to the caller.

type Options added in v1.0.8

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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