txemulator

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func FindLibraries added in v1.2.1

func FindLibraries(cell *boc.Cell) ([]ton.Bits256, error)

FindLibraries looks for library cells inside the given cell tree and returns a list of hashes of found library cells.

func LibrariesToBase64 added in v1.2.1

func LibrariesToBase64(libraries map[ton.Bits256]*boc.Cell) (string, error)

LibrariesToBase64 converts a map with libraries to a base64 string.

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 added in v1.4.2

type ErrorWithExitCode struct {
	Message   string
	Iteration int
	ExitCode  int
}

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

func (ErrorWithExitCode) Error added in v1.4.2

func (e ErrorWithExitCode) Error() string

func (ErrorWithExitCode) Is added in v1.4.2

func (e ErrorWithExitCode) Is(err error) bool

type TraceOption added in v1.1.0

type TraceOption func(o *TraceOptions) error

func WithAccounts added in v1.1.0

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

func WithAccountsMap added in v1.1.0

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

func WithAccountsSource added in v1.1.0

func WithAccountsSource(b accountGetter) TraceOption

func WithConfig added in v1.1.0

func WithConfig(c *boc.Cell) TraceOption

func WithConfigBase64 added in v1.1.0

func WithConfigBase64(c string) TraceOption

func WithLimit added in v1.1.0

func WithLimit(l int) TraceOption

func WithSignatureCheck added in v1.1.0

func WithSignatureCheck() TraceOption

func WithSoftLimit added in v1.8.0

func WithSoftLimit(l int) TraceOption

func WithTestnet added in v1.1.0

func WithTestnet() TraceOption

func WithTime added in v1.1.0

func WithTime(t int64) TraceOption

type TraceOptions added in v1.1.0

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

type Tracer added in v1.1.0

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

func NewTraceBuilder added in v1.1.0

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

func (*Tracer) FinalStates added in v1.1.0

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

func (*Tracer) Run added in v1.1.0

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

type TxTree added in v1.1.0

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