txemulator

package
v1.15.4 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = `` /* 1500-byte string literal not displayed */

Functions

This section is empty.

Types

type EmulationResult

type EmulationResult struct {
	Success   bool
	Emulation *struct {
		ShardAccount   tlb.ShardAccount
		Transaction    tlb.Transaction
		RawTransaction string
	}
	Logs  string
	Error *struct {
		ExitCode int
		Text     string
	}
}

type Emulator

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

func NewEmulator

func NewEmulator(config *boc.Cell, verbosityLevel VerbosityLevel) (*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 (*Emulator) Emulate

func (e *Emulator) Emulate(shardAccount tlb.ShardAccount, message tlb.Message) (EmulationResult, error)

func (*Emulator) SetConfig

func (e *Emulator) SetConfig(config *boc.Cell) error

func (*Emulator) SetIgnoreSignatureCheck

func (e *Emulator) SetIgnoreSignatureCheck(ignore bool) error

func (*Emulator) SetLT

func (e *Emulator) SetLT(lt uint64) error

func (*Emulator) SetLibs

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

func (*Emulator) SetRandomSeed

func (e *Emulator) SetRandomSeed(seed [32]byte) error

func (*Emulator) SetUnixtime

func (e *Emulator) SetUnixtime(utime uint32) error

func (*Emulator) SetVerbosityLevel

func (e *Emulator) SetVerbosityLevel(level int) error

SetVerbosityLevel verbosity level (0 - never, 1 - error, 2 - warning, 3 - info, 4 - debug)

type ErrorWithExitCode

type ErrorWithExitCode struct {
	Message   string
	Iteration int
	ExitCode  int
}

ErrorWithExitCode is an error returned when emulation failed with exit code.

func (ErrorWithExitCode) Error

func (e ErrorWithExitCode) Error() string

func (ErrorWithExitCode) Is

func (e ErrorWithExitCode) Is(err error) bool

type TraceOption

type TraceOption func(o *TraceOptions) error

func WithAccounts

func WithAccounts(accounts ...tlb.ShardAccount) TraceOption

func WithAccountsMap

func WithAccountsMap(m map[ton.AccountID]tlb.ShardAccount) TraceOption

func WithAccountsSource

func WithAccountsSource(b accountGetter) TraceOption

func WithConfig

func WithConfig(c *boc.Cell) TraceOption

func WithConfigBase64

func WithConfigBase64(c string) TraceOption

func WithLimit

func WithLimit(l int) TraceOption

func WithSignatureCheck

func WithSignatureCheck() TraceOption

func WithSoftLimit

func WithSoftLimit(l int) TraceOption

func WithTestnet

func WithTestnet() TraceOption

func WithTime

func WithTime(t int64) TraceOption

type TraceOptions

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

type Tracer

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

func NewTraceBuilder

func NewTraceBuilder(options ...TraceOption) (*Tracer, error)

func (*Tracer) FinalStates

func (t *Tracer) FinalStates() map[ton.AccountID]tlb.ShardAccount

func (*Tracer) Run

func (t *Tracer) Run(ctx context.Context, message tlb.Message) (*TxTree, error)

type TxTree

type TxTree struct {
	TX       tlb.Transaction
	Children []*TxTree
}

type VerbosityLevel

type VerbosityLevel int
const (
	LogTruncated VerbosityLevel = iota
	LogUnlimited
	CellHashAndOffsetForCommand
	PrintsAllStackValuesForCommand
)

Jump to

Keyboard shortcuts

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