Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Commit

Permalink
swarm/storage/localstore: unexport modeSetRemove
Browse files Browse the repository at this point in the history
  • Loading branch information
janos committed Dec 19, 2018
1 parent 80c269b commit bca85ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion swarm/storage/localstore/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func TestDB_gcIndex(t *testing.T) {
t.Run("remove one chunk", func(t *testing.T) {
i := 3

err := db.NewSetter(ModeSetRemove).Set(chunks[i].Address())
err := db.NewSetter(modeSetRemove).Set(chunks[i].Address())
if err != nil {
t.Fatal(err)
}
Expand Down
7 changes: 4 additions & 3 deletions swarm/storage/localstore/mode_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ const (
ModeSetAccess ModeSet = iota
// ModeSetSync: when push sync receipt is received
ModeSetSync
// ModeSetRemove: when GC-d
ModeSetRemove
// modeSetRemove: when GC-d
// unexported as no external packages should remove chunks from database
modeSetRemove
)

// Setter sets the state of a particular
Expand Down Expand Up @@ -147,7 +148,7 @@ func (db *DB) set(mode ModeSet, addr storage.Address) (err error) {
db.gcUncountedHashesIndex.PutInBatch(batch, item)
db.incGCSize(1)

case ModeSetRemove:
case modeSetRemove:
// delete from retrieve, pull, gc

// need to get access timestamp here as it is not
Expand Down
6 changes: 3 additions & 3 deletions swarm/storage/localstore/mode_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ func TestModeSetSync(t *testing.T) {
t.Run("gc size", newIndexGCSizeTest(db))
}

// TestModeSetRemoval validates ModeSetRemoval index values on the provided DB.
func TestModeSetRemoval(t *testing.T) {
// TestModeSetRemove validates ModeSetRemove index values on the provided DB.
func TestModeSetRemove(t *testing.T) {
db, cleanupFunc := newTestDB(t, nil)
defer cleanupFunc()

Expand All @@ -96,7 +96,7 @@ func TestModeSetRemoval(t *testing.T) {
t.Fatal(err)
}

err = db.NewSetter(ModeSetRemove).Set(chunk.Address())
err = db.NewSetter(modeSetRemove).Set(chunk.Address())
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit bca85ef

Please sign in to comment.