debug

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TransferTracer = `` /* 6553-byte string literal not displayed */

Functions

func ReadTracer

func ReadTracer(path string) (*string, error)

ReadTracer reads a tracer file from the filesystem

Types

type DebugClient

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

DebugClient defines typed wrappers for the Debug RPC API.

func NewClient

func NewClient(c *rpc.Client) *DebugClient

NewClient creates a client that uses the given RPC client.

func (*DebugClient) TraceTransaction

func (dc *DebugClient) TraceTransaction(ctx context.Context, result interface{}, txhash common.Hash, traceConfig *tracers.TraceConfig) error

TraceTransactions performs a tracer over a transaction. Can use a custom tracer or default one result type depends on the tracer, and it's the caller reponsability to use the proper one

func (*DebugClient) TransactionTransfers

func (dc *DebugClient) TransactionTransfers(ctx context.Context, txhash common.Hash) ([]Transfer, error)

TransactionTransfers is deprecated, use DebugClient.TraceTransaction with TransferTracer and TransferTracerResponse instead. e.g.

var res TransferTracerResponse
var timeout = "50s"
conf := &eth.TraceConfig{Tracer: &TransferTracer, Timeout: &timeout}
err := dc.TraceTransaction(ctx, &res, txhash, conf)

type Transfer

type Transfer struct {
	From   common.Address `json:"from"`
	To     common.Address `json:"to"`
	Value  *big.Int       `json:"value"`
	Status TransferStatus `json:"status"`
}

func (*Transfer) UnmarshalJSON

func (t *Transfer) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type TransferStatus

type TransferStatus string
const (
	TransferStatusSuccess TransferStatus = "success"
	TransferStatusRevert  TransferStatus = "revert"
)

func (TransferStatus) String

func (ts TransferStatus) String() string

type TransferTracerResponse added in v0.2.2

type TransferTracerResponse struct {
	Transfers []Transfer `json:"transfers"`
}

Jump to

Keyboard shortcuts

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