func RunTests(t *testing.T, db DB, tests []TestCase) bool {
	for _, tc := range tests {
		tc := tc
		ok := t.Run(tc.Name, func(t *testing.T) {
			tc.Run(t, db)
		})
		if !ok {
			return false
		}
	}
	err := db.Close()
	require.NoError(t, err)
	return t.Run("closing twice errors", func(t *testing.T) {
		testCloseTwice(t, db)
	})
}
RunTests runs the specified tests against a DB instance. Note that the db is
closed at the end of the tests (independtly of whether they succeeded or
not) so the DB instance is not usable after this returns.

Returns true if no tests failed.
package backenddb
import (
	"context"
	"errors"
	"fmt"
	"math/rand"
	"testing"
	"time"
	"github.com/decred/dcrd/chaincfg/chainhash"
	"github.com/decred/dcrd/dcrutil/v3"
	"github.com/decred/dcrd/wire"
	"github.com/stretchr/testify/require"
)
const defaultTimeout = time.Second * 30
type TestCase struct {
	Name string
	Run func(t *testing.T, db DB)
}
func TestCases() []TestCase {
	return []TestCase{
		{Name: "propagates context", Run: testPropagatesContext},
		{Name: "update wtx writeable", Run: testUpdateWriteTx},
		{Name: "error rollsback update", Run: testErrorRollsbackUpdate},
		{Name: "stores balances", Run: testStoresBalances},
		{Name: "processed block hash", Run: testProcessedBlockHash},
		{Name: "rollback tip", Run: testRollbackTip},
		{Name: "multiple rollback", Run: testMultipleRollback},
		{Name: "account utxos", Run: testAccountUtxos},
	}
}