func TestModePutRequest(t *testing.T) {
	t.Cleanup(setWithinRadiusFunc(func(_ *DB, _ shed.Item) bool { return false }))
	for _, tc := range multiChunkTestCases {
		t.Run(tc.name, func(t *testing.T) {
			db := newTestDB(t, nil)
			chunks := generateTestRandomChunks(tc.count)
			unreserveChunkBatch(t, db, 0, chunks...)
			var storeTimestamp int64
			t.Run("first put", func(t *testing.T) {
				wantTimestamp := time.Now().UTC().UnixNano()
				defer setNow(func() (t int64) {
					return wantTimestamp
				})()
				storeTimestamp = wantTimestamp
				_, err := db.Put(context.Background(), storage.ModePutRequest, chunks...)
				if err != nil {
					t.Fatal(err)
				}
				for _, ch := range chunks {
					newRetrieveIndexesTestWithAccess(db, ch, wantTimestamp, wantTimestamp)(t)
				}
				newItemsCountTest(db.gcIndex, tc.count)(t)
				newItemsCountTest(db.pullIndex, tc.count)(t)
				newItemsCountTest(db.postageIndexIndex, tc.count)(t)
				newIndexGCSizeTest(db)(t)
			})
			t.Run("second put", func(t *testing.T) {
				wantTimestamp := time.Now().UTC().UnixNano()
				defer setNow(func() (t int64) {
					return wantTimestamp
				})()
				_, err := db.Put(context.Background(), storage.ModePutRequest, chunks...)
				if err != nil {
					t.Fatal(err)
				}
				for _, ch := range chunks {
					newRetrieveIndexesTestWithAccess(db, ch, storeTimestamp, storeTimestamp)(t)
				}
				newItemsCountTest(db.gcIndex, tc.count)(t)
				newItemsCountTest(db.pullIndex, tc.count)(t)
				newItemsCountTest(db.postageIndexIndex, tc.count)(t)
				newIndexGCSizeTest(db)(t)
			})
		})
	}
}
TestModePutRequest validates ModePutRequest index values on the provided DB.
package localstore
import (
	"bytes"
	"context"
	"encoding/binary"
	"errors"
	"fmt"
	"sync"
	"testing"
	"time"
	"github.com/ethsana/sana/pkg/postage"
	postagetesting "github.com/ethsana/sana/pkg/postage/testing"
	"github.com/ethsana/sana/pkg/shed"
	"github.com/ethsana/sana/pkg/storage"
	"github.com/ethsana/sana/pkg/swarm"
	"github.com/syndtr/goleveldb/leveldb"
)
var putModes = []storage.ModePut{
	storage.ModePutRequest,
	storage.ModePutRequestPin,
	storage.ModePutSync,
	storage.ModePutUpload,
	storage.ModePutUploadPin,
	storage.ModePutRequestCache,
}