Skip to content

Commit

Permalink
Cleanup debug tracer
Browse files Browse the repository at this point in the history
  • Loading branch information
palango committed Jul 17, 2024
1 parent 615a8f8 commit 6eb28d6
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions kliento/client/debug/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,14 @@
package debug

import (
"context"
"encoding/json"
"errors"
"math/big"

"github.com/celo-org/celo-blockchain/common"
"github.com/celo-org/celo-blockchain/common/hexutil"
"github.com/celo-org/celo-blockchain/eth/tracers"
)

var transferTracerTimeout = `50s`

var TransferTracer = `
// Geth Tracer that outputs cGLD transfers.
//
Expand Down Expand Up @@ -270,20 +266,3 @@ func (t *Transfer) UnmarshalJSON(input []byte) error {
}
return nil
}

// 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)
func (dc *DebugClient) TransactionTransfers(ctx context.Context, txhash common.Hash) ([]Transfer, error) {
tracerConfig := &tracers.TraceConfig{Timeout: &transferTracerTimeout, Tracer: &TransferTracer}
var response TransferTracerResponse

err := dc.TraceTransaction(ctx, &response, txhash, tracerConfig)
if err != nil {
return nil, err
}
return response.Transfers, nil
}

0 comments on commit 6eb28d6

Please sign in to comment.