Skip to content

Commit

Permalink
eth/tracers/internal/tracetest,eth/tracers/native: (lint) remove unus…
Browse files Browse the repository at this point in the history
…ed fields

Date: 2024-08-19 11:15:07-06:00
Signed-off-by: meows <[email protected]>
  • Loading branch information
meowsbits committed Aug 19, 2024
1 parent 9661f0d commit 36c82ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 deletions.
19 changes: 0 additions & 19 deletions eth/tracers/internal/tracetest/state_diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"math/big"
"os"
"path/filepath"
"reflect"
"strings"
"testing"

Expand Down Expand Up @@ -192,21 +191,3 @@ func testStateDiffTracer(tracerName string, dirPath string, t *testing.T) {
})
}
}

// jsonEqual is similar to reflect.DeepEqual, but does a 'bounce' via json prior to
// comparison
func jsonEqualStateDiff(x, y interface{}) bool {
xTrace := new(map[common.Address]*stateDiffAccount)
yTrace := new(map[common.Address]*stateDiffAccount)
if xj, err := json.Marshal(x); err == nil {
json.Unmarshal(xj, xTrace)
} else {
return false
}
if yj, err := json.Marshal(y); err == nil {
json.Unmarshal(yj, yTrace)
} else {
return false
}
return reflect.DeepEqual(xTrace, yTrace)
}
15 changes: 2 additions & 13 deletions eth/tracers/native/state_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ import (

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/tracing"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/eth/tracers"
)

Expand All @@ -44,8 +42,6 @@ const (

type stateDiff = map[common.Address]*stateDiffAccount
type stateDiffAccount struct {
marker *stateDiffMarker `json:"-"`
err error `json:"-"`
Balance interface{} `json:"balance"`
Nonce interface{} `json:"nonce"`
Code interface{} `json:"code"`
Expand Down Expand Up @@ -76,15 +72,8 @@ type stateDiffTracer struct {
tracer *prestateTracer
ctx *tracers.Context // Holds tracer context data

env *vm.EVM
stateDiff stateDiff
initialState *state.StateDB
create bool
to common.Address
accountsToRemove []common.Address
changedStorageKeys map[common.Address]map[common.Hash]bool
interrupt uint32 // Atomic flag to signal execution interruption
reason error // Textual reason for the interruption
stateDiff stateDiff
reason error // Textual reason for the interruption
}

func (t *stateDiffTracer) CaptureTxStart(gasLimit uint64) {}
Expand Down

0 comments on commit 36c82ce

Please sign in to comment.