From 5d717fafa219210e94a5728b5493ccfcd0621f9e Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Mon, 16 Sep 2024 09:21:40 +0000 Subject: [PATCH] test: lint --- l1infotreesync/processor.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/l1infotreesync/processor.go b/l1infotreesync/processor.go index 13807db8..c76d7aac 100644 --- a/l1infotreesync/processor.go +++ b/l1infotreesync/processor.go @@ -245,14 +245,17 @@ func (p *processor) ProcessBlock(ctx context.Context, b sync.Block) error { var initialL1InfoIndex uint32 var l1InfoLeavesAdded uint32 lastIndex, err := p.getLastIndex(tx) - if errors.Is(err, ErrNotFound) { + + switch { + case errors.Is(err, ErrNotFound): initialL1InfoIndex = 0 err = nil - } else if err != nil { + case err != nil: return fmt.Errorf("err: %w", err) - } else { + default: initialL1InfoIndex = lastIndex + 1 } + for _, e := range b.Events { event, ok := e.(Event) if !ok {