From 09bf986e3b502ac3194b0b0f71a5a202b018143f Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 6 Mar 2023 18:04:31 +0100 Subject: [PATCH 1/2] chore: remove unnecessary condition --- store/iavl/store.go | 6 +----- store/rootmulti/store.go | 4 ---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/store/iavl/store.go b/store/iavl/store.go index 2bd523194f7f..09ff361bdac0 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -281,11 +281,7 @@ func (st *Store) Export(version int64) (*iavl.Exporter, error) { if !ok || tree == nil { return nil, fmt.Errorf("iavl export failed: unable to fetch tree for version %v", version) } - export, err := tree.Export() - if err != nil { - return nil, err - } - return export, nil + return tree.Export() } // Import imports an IAVL tree at the given version, returning an iavl.Importer for importing. diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index da45c99f064a..20e72d9d7c37 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -779,10 +779,6 @@ func (rs *Store) Snapshot(height uint64, protoWriter protoio.Writer) error { for _, store := range stores { rs.logger.Debug("starting snapshot", "store", store.name, "height", height) exporter, err := store.Export(int64(height)) - if exporter == nil { - rs.logger.Error("snapshot failed; exporter is nil", "store", store.name) - return err - } if err != nil { rs.logger.Error("snapshot failed; exporter error", "store", store.name, "err", err) return err From 604fa9ed0aa30453555cb913c786b6e911131259 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 6 Mar 2023 18:07:42 +0100 Subject: [PATCH 2/2] standardize casing --- store/rootmulti/store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 20e72d9d7c37..b87bcd219015 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -803,7 +803,7 @@ func (rs *Store) Snapshot(height uint64, protoWriter protoio.Writer) error { for { node, err := exporter.Next() if err == iavltree.ErrorExportDone { - rs.logger.Debug("Snapshot Done", "store", store.name, "nodeCount", nodeCount) + rs.logger.Debug("snapshot Done", "store", store.name, "nodeCount", nodeCount) nodeCount = 0 break } else if err != nil {