cosmos-sdk/db/memdb/db_test.go
Jacob Gadikian b0e82f9640
chore: Db linting (#12141)
* mainly sdk.int to cosmossdk.io/math

* staking keys

* fumpt

* var-naming linter errors and a fumpt

* Update CHANGELOG.md

* Update .golangci.yml

* Update CHANGELOG.md

* Update test_helpers.go

* Update test_helpers.go

* fumpt and lint

* this lints the db module, and makes it easier to use.  It adds breaking name changes

* DBConnection -> Connection

* previous commit contained a merge error

* Update test_helpers.go

* Update test_helpers.go

* db renamings

* merge master

* changelog

* DBWriter -> Writer

* consistent multistore reciever

* standard recievers for multistore v2alpha1

* general cleanup of linting issues

* more linter fixes

* remove prealloc linter

* nolint the secp256k1 import

* nolint the secp256k1 package

* completenolint resulting in a diff that has only nolints
2022-06-08 19:02:01 +02:00

54 lines
1013 B
Go

package memdb
import (
"testing"
"github.com/cosmos/cosmos-sdk/db"
"github.com/cosmos/cosmos-sdk/db/dbtest"
)
func BenchmarkMemDBRangeScans1M(b *testing.B) {
dbm := NewDB()
defer dbm.Close()
dbtest.BenchmarkRangeScans(b, dbm.ReadWriter(), int64(1e6))
}
func BenchmarkMemDBRangeScans10M(b *testing.B) {
dbm := NewDB()
defer dbm.Close()
dbtest.BenchmarkRangeScans(b, dbm.ReadWriter(), int64(10e6))
}
func BenchmarkMemDBRandomReadsWrites(b *testing.B) {
dbm := NewDB()
defer dbm.Close()
dbtest.BenchmarkRandomReadsWrites(b, dbm.ReadWriter())
}
func load(t *testing.T, _ string) db.Connection {
return NewDB()
}
func TestGetSetHasDelete(t *testing.T) {
dbtest.DoTestGetSetHasDelete(t, load)
}
func TestIterators(t *testing.T) {
dbtest.DoTestIterators(t, load)
}
func TestVersioning(t *testing.T) {
dbtest.DoTestVersioning(t, load)
}
func TestRevert(t *testing.T) {
dbtest.DoTestRevert(t, load, false)
}
func TestTransactions(t *testing.T) {
dbtest.DoTestTransactions(t, load, false)
}