Skip to content

Commit

Permalink
feat: adds logger for evmhelper
Browse files Browse the repository at this point in the history
  • Loading branch information
ckartik committed Jul 5, 2024
1 parent d4f6b58 commit a7ee85d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions oracle/pkg/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func NewNode(opts *Options) (*Node, error) {
monitor := txmonitor.New(
owner,
settlementClient,
txmonitor.NewEVMHelper(settlementClient.Client()),
txmonitor.NewEVMHelperWithLogger(settlementClient.Client(), nd.logger),
st,
nd.logger.With("component", "tx_monitor"),
1024,
Expand Down Expand Up @@ -238,7 +238,7 @@ func NewNode(opts *Options) (*Node, error) {
st,
evtMgr,
oracleTransactorSession,
txmonitor.NewEVMHelper(l1Client.Client()),
txmonitor.NewEVMHelperWithLogger(l1Client.Client(), nd.logger),
)
if err != nil {
nd.logger.Error("failed to instantiate updater", "error", err)
Expand Down
7 changes: 4 additions & 3 deletions x/contracts/txmonitor/eth_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package txmonitor
import (
"context"
"log"
"log/slog"
"time"

"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -78,11 +79,11 @@ type BatchReceiptGetter interface {

type evmHelper struct {
client *rpc.Client
logger *slog.Logger
}

// NewEVMHelper creates a new EVMHelper instance.
func NewEVMHelper(client *rpc.Client) *evmHelper {
return &evmHelper{client}
func NewEVMHelperWithLogger(client *rpc.Client, logger *slog.Logger) *evmHelper {
return &evmHelper{client, logger}
}

// TraceTransaction implements Debugger.TraceTransaction interface.
Expand Down

0 comments on commit a7ee85d

Please sign in to comment.