package ethdb_test import ( "context" "errors" "fmt" "io" "testing" "time" "github.com/ledgerwatch/turbo-geth/common" "github.com/ledgerwatch/turbo-geth/common/dbutils" "github.com/ledgerwatch/turbo-geth/ethdb" "github.com/ledgerwatch/turbo-geth/ethdb/remote" "github.com/ledgerwatch/turbo-geth/ethdb/remote/remotedbserver" "github.com/ledgerwatch/turbo-geth/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/test/bufconn" ) func TestManagedTx(t *testing.T) { writeDBs, readDBs, closeAll := setupDatabases() defer closeAll() bucketID := 0 bucket1 := dbutils.Buckets[bucketID] bucket2 := dbutils.Buckets[bucketID+1] ctx := context.Background() for _, db := range writeDBs { db := db if err := db.Update(ctx, func(tx ethdb.Tx) error { b := tx.Bucket(bucket1) b1 := tx.Bucket(bucket2) c := b.Cursor() c1 := b1.Cursor() require.NoError(t, c.Append([]byte{0}, []byte{1})) require.NoError(t, c1.Append([]byte{0}, []byte{1})) require.NoError(t, c.Append([]byte{0, 0, 0, 0, 0, 1}, []byte{1})) // prefixes of len=FromLen for DupSort test (other keys must be