Skip to content

Commit

Permalink
refactor: use struct instead of pointer to avoid panic
Browse files Browse the repository at this point in the history
  • Loading branch information
renlulu committed Sep 5, 2024
1 parent eb15e20 commit 11fb347
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion services/bls_aggregation/blsagg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ func TestIntegrationBlsAgg(t *testing.T) {
avsClients.AvsRegistryChainSubscriber,
avsClients.AvsRegistryChainReader,
nil,
&operatorsinfo.Opts{},
operatorsinfo.Opts{},
logger,
)
avsRegistryService := avsregistry.NewAvsRegistryServiceChainCaller(
Expand Down
8 changes: 4 additions & 4 deletions services/operatorsinfo/operatorsinfo_inmemory.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func NewOperatorsInfoServiceInMemory(
avsRegistrySubscriber avsRegistrySubscriber,
avsRegistryReader avsRegistryReader,
logFilterQueryBlockRange *big.Int,
opts *Opts,
opts Opts,
logger logging.Logger,
) *OperatorsInfoServiceInMemory {
queryC := make(chan query)
Expand Down Expand Up @@ -127,7 +127,7 @@ func (ops *OperatorsInfoServiceInMemory) startServiceInGoroutine(
ctx context.Context,
queryC <-chan query,
wg *sync.WaitGroup,
opts *Opts,
opts Opts,
) {
go func() {

Expand Down Expand Up @@ -284,7 +284,7 @@ func (ops *OperatorsInfoServiceInMemory) startServiceInGoroutine(

func (ops *OperatorsInfoServiceInMemory) queryPastRegisteredOperatorEventsAndFillDb(
ctx context.Context,
opts *Opts,
opts Opts,
) error {
// Querying with nil startBlock and stopBlock will return all events. It doesn't matter if we query some events that
// we will receive again in the websocket,
Expand Down Expand Up @@ -338,7 +338,7 @@ func (ops *OperatorsInfoServiceInMemory) queryPastRegisteredOperatorEventsAndFil
// we print each socket info on a separate line because slog for some reason doesn't pass map keys via their
// LogValue() function, so operatorId (of custom type Bytes32) prints as a byte array instead of its hex
// representation from LogValue()
// passing the Bytes32 directly to an slog log statements does call LogValue() and prints the hex representation
// passing the Bytes32 directly to a slog log statements does call LogValue() and prints the hex representation
ops.logger.Debug(
"operator socket returned from registration events query",
"operatorId",
Expand Down
2 changes: 1 addition & 1 deletion services/operatorsinfo/operatorsinfo_inmemory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func TestGetOperatorInfo(t *testing.T) {
mockAvsRegistrySubscriber,
mockAvsReader,
nil,
&Opts{},
Opts{},
logger,
)
time.Sleep(
Expand Down

0 comments on commit 11fb347

Please sign in to comment.