From cde207fd4f5375b6d26cd2527976dc6392826bea Mon Sep 17 00:00:00 2001 From: zhouop0 <11733741+zhouop0@users.noreply.github.com> Date: Tue, 7 Jan 2025 19:19:16 +0800 Subject: [PATCH] format --- handler/logFilter.go | 7 ++++--- handler/syncBlock.go | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/handler/logFilter.go b/handler/logFilter.go index 76cf33e..ef23e48 100644 --- a/handler/logFilter.go +++ b/handler/logFilter.go @@ -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" @@ -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 blockTimes := make(map[int64]int64) sendMessageEvent := &event.SendMessage{} @@ -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(), diff --git a/handler/syncBlock.go b/handler/syncBlock.go index a9f4fe0..1dc5ce4 100644 --- a/handler/syncBlock.go +++ b/handler/syncBlock.go @@ -77,7 +77,6 @@ func SyncBlock(ctx *svc.ServiceContext) { ctx.SyncedBlockNumber = block.Number() ctx.SyncedBlockHash = common.HexToHash(block.Hash()) - } }