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 ¶
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 ¶
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 ¶
func (*Emulator) RunSmcMethodByID ¶
func (*Emulator) SetBalance ¶
func (*Emulator) SetGasLimit ¶
type Option ¶
type Option func(o *Options)
func WithBalance ¶
func WithConfig ¶
func WithIgnoreLibraryCells ¶
func WithLazyC7Optimization ¶
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 ¶
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 ¶
func WithLibraryResolver(resolver libResolver) Option
func WithVerbosityLevel ¶
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.