From cc6c29fa32b26c876c3375ef4ff4959580994ae8 Mon Sep 17 00:00:00 2001 From: Petr Hanzl <84449820+petr-hanzl@users.noreply.github.com> Date: Mon, 20 May 2024 10:27:47 +0200 Subject: [PATCH] Correctly return error. (#77) --- db/destroyed_account_db.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/db/destroyed_account_db.go b/db/destroyed_account_db.go index fdb00ea..cc389f6 100644 --- a/db/destroyed_account_db.go +++ b/db/destroyed_account_db.go @@ -2,10 +2,8 @@ package db import ( "encoding/binary" - "errors" "fmt" - "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/opt" "github.com/Fantom-foundation/Substate/types" @@ -56,7 +54,10 @@ func (db *DestroyedAccountDB) SetDestroyedAccounts(block uint64, tx int, des []t func (db *DestroyedAccountDB) GetDestroyedAccounts(block uint64, tx int) ([]types.Address, []types.Address, error) { data, err := db.backend.Get(encodeDestroyedAccountKey(block, tx)) - if err != nil && !errors.Is(err, leveldb.ErrNotFound) { + if data == nil { + return nil, nil, nil + } + if err != nil { return nil, nil, err } list, err := DecodeAddressList(data)