Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erc7562 tracer geth pr fixes #50

Merged
merged 2 commits into from
Jan 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading