Documentation ¶
Index ¶
- func SetVerbosityLevel(level int) error
- type Config
- type Emulator
- func (e *Emulator) RunSmcMethod(ctx context.Context, accountId ton.AccountID, method string, ...) (uint32, tlb.VmStack, error)
- func (e *Emulator) RunSmcMethodByID(ctx context.Context, accountId ton.AccountID, methodID int, params tlb.VmStack) (uint32, tlb.VmStack, error)
- func (e *Emulator) SetBalance(balance int64)
- func (e *Emulator) SetGasLimit(gasLimit int64) error
- func (e *Emulator) SetLibs(libs *boc.Cell) error
- type Option
- func WithBalance(balance int64) Option
- func WithConfig(config *Config) Option
- func WithIgnoreLibraryCells(ignore bool) Option
- func WithLazyC7Optimization() Option
- func WithLibrariesBase64(libraries string) Option
- func WithLibraryResolver(resolver libResolver) Option
- func WithVerbosityLevel(level txemulator.VerbosityLevel) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetVerbosityLevel ¶ added in v1.2.1
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 Config ¶ added in v1.9.2
type Config struct {
// contains filtered or unexported fields
}
func CreateConfig ¶ added in v1.9.2
type Emulator ¶
type Emulator struct {
// contains filtered or unexported fields
}
func NewEmulator ¶
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 ¶
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 (*Emulator) RunSmcMethodByID ¶ added in v1.0.1
func (*Emulator) SetBalance ¶
func (*Emulator) SetGasLimit ¶
type Option ¶ added in v1.0.8
type Option func(o *Options)
func WithBalance ¶ added in v1.0.8
func WithConfig ¶ added in v1.9.2
func WithIgnoreLibraryCells ¶ added in v1.8.7
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
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.