Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouop0 committed Jan 7, 2025
1 parent 38bfe90 commit cde207f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions handler/logFilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package handler

import (
"context"
"github.com/spf13/cast"
"math/big"
"strings"

"github.com/spf13/cast"

"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
Expand Down Expand Up @@ -46,7 +47,7 @@ func LogFilter(ctx *svc.ServiceContext, block schema.SyncBlock, addresses []comm
return LogsToEvents(ctx, logs, block.ID)
}

func LogsToEvents(ctx *svc.ServiceContext, logs []types.Log, syncBlockId int64) ([]*schema.SyncEvent, error) {
func LogsToEvents(ctx *svc.ServiceContext, logs []types.Log, syncBlockID int64) ([]*schema.SyncEvent, error) {
var events []*schema.SyncEvent

Check failure on line 51 in handler/logFilter.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

Consider pre-allocating `events` (prealloc)
blockTimes := make(map[int64]int64)
sendMessageEvent := &event.SendMessage{}
Expand Down Expand Up @@ -78,7 +79,7 @@ func LogsToEvents(ctx *svc.ServiceContext, logs []types.Log, syncBlockId int64)
payloadMsgBytes := payloadBytes(&vlog)
evt := &schema.SyncEvent{
Blockchain: ctx.Config.Blockchain,
SyncBlockID: syncBlockId,
SyncBlockID: syncBlockID,
BlockTime: blockTime,
BlockNumber: cast.ToInt64(vlog.BlockNumber),
BlockHash: vlog.BlockHash.Hex(),
Expand Down
1 change: 0 additions & 1 deletion handler/syncBlock.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ func SyncBlock(ctx *svc.ServiceContext) {

ctx.SyncedBlockNumber = block.Number()
ctx.SyncedBlockHash = common.HexToHash(block.Hash())

}
}

Expand Down

0 comments on commit cde207f

Please sign in to comment.