Skip to content

Commit

Permalink
Erc7562 tracer geth pr fixes (#50)
Browse files Browse the repository at this point in the history
* Remove unused function, sorting imports

* Fixing uncaught error
  • Loading branch information
shahafn authored Jan 12, 2025
1 parent bd560da commit c99dbf1
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions eth/tracers/native/erc7562.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ package native
import (
"encoding/json"
"errors"
"math/big"
"runtime"
"runtime/debug"
"sync/atomic"

"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
Expand All @@ -29,10 +34,6 @@ import (
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/holiman/uint256"
"math/big"
"runtime"
"runtime/debug"
"sync/atomic"
)

//go:generate go run github.com/fjl/gencodec -type callFrameWithOpcodes -field-override callFrameWithOpcodesMarshaling -out gen_callframewithopcodes_json.go
Expand Down Expand Up @@ -181,15 +182,6 @@ type erc7562TracerConfig struct {
WithLog bool `json:"withLog"` // If true, erc7562 tracer will collect event logs
}

// Function to convert byte array to map[vm.OpCode]struct{}
func ConvertBytesToOpCodes(byteArray []byte) map[vm.OpCode]struct{} {
var opCodes map[vm.OpCode]struct{}
for _, b := range byteArray {
opCodes[vm.OpCode(b)] = struct{}{}
}
return opCodes
}

func getFullConfiguration(partial erc7562TracerConfig) erc7562TracerConfig {
config := partial

Expand Down Expand Up @@ -335,6 +327,9 @@ func (t *erc7562Tracer) GetResult() (json.RawMessage, error) {
}

callFrameJSON, err := json.Marshal(t.callstackWithOpcodes[0])
if err != nil {
return nil, err
}

// Unmarshal the generated JSON into a map
var resultMap map[string]interface{}
Expand Down

0 comments on commit c99dbf1

Please sign in to comment.