swarm/storage/localstore: unexport modeSetRemove

This commit is contained in:
Janos Guljas 2018-12-19 14:24:14 +01:00
parent 80c269b50d
commit bca85efff9
3 changed files with 8 additions and 7 deletions

View file

@ -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)
}

View file

@ -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
@ -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

View file

@ -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()
@ -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)
}