Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Oct 12, 2024
1 parent 6e737e6 commit 9b6e888
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions store/v2/root/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"crypto/sha256"
"errors"
"fmt"
"io"
"sync"
"time"

Expand Down Expand Up @@ -34,7 +35,7 @@ type Store struct {
initialVersion uint64

// holds the db instance for closing it
db corestore.KVStoreWithBatch
dbCloser io.Closer

// stateStorage reflects the state storage backend
stateStorage store.VersionedDatabase
Expand Down Expand Up @@ -71,7 +72,7 @@ type Store struct {
//
// NOTE: The migration manager is optional and can be nil if no migration is required.
func New(
db corestore.KVStoreWithBatch,
dbCloser io.Closer,
logger corelog.Logger,
ss store.VersionedDatabase,
sc store.Committer,
Expand All @@ -80,7 +81,7 @@ func New(
m metrics.StoreMetrics,
) (store.RootStore, error) {
return &Store{
db: db,
dbCloser: dbCloser,
logger: logger,
initialVersion: 1,
stateStorage: ss,
Expand All @@ -97,7 +98,7 @@ func New(
func (s *Store) Close() (err error) {
err = errors.Join(err, s.stateStorage.Close())
err = errors.Join(err, s.stateCommitment.Close())
err = errors.Join(err, s.db.Close())
err = errors.Join(err, s.dbCloser.Close())

s.stateStorage = nil
s.stateCommitment = nil
Expand Down

0 comments on commit 9b6e888

Please sign in to comment.