Skip to content

Commit

Permalink
dot/state: remove newInMemoryGrandpaDatabase
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Jan 9, 2023
1 parent db9cdc9 commit 6a92ccf
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions dot/state/grandpa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,8 @@ var (
}
)

func newInMemoryGrandpaDatabase(t *testing.T) chaindb.Database {
db := newInMemoryDB(t)
return chaindb.NewTable(db, grandpaPrefix)
}

func TestNewGrandpaStateFromGenesis(t *testing.T) {
db := newInMemoryGrandpaDatabase(t)
db := newInMemoryDB(t)
gs, err := NewGrandpaStateFromGenesis(db, nil, testAuths)
require.NoError(t, err)

Expand All @@ -52,7 +47,7 @@ func TestNewGrandpaStateFromGenesis(t *testing.T) {
}

func TestGrandpaState_SetNextChange(t *testing.T) {
db := newInMemoryGrandpaDatabase(t)
db := newInMemoryDB(t)
gs, err := NewGrandpaStateFromGenesis(db, nil, testAuths)
require.NoError(t, err)

Expand All @@ -69,7 +64,7 @@ func TestGrandpaState_SetNextChange(t *testing.T) {
}

func TestGrandpaState_IncrementSetID(t *testing.T) {
db := newInMemoryGrandpaDatabase(t)
db := newInMemoryDB(t)
gs, err := NewGrandpaStateFromGenesis(db, nil, testAuths)
require.NoError(t, err)

Expand All @@ -79,7 +74,7 @@ func TestGrandpaState_IncrementSetID(t *testing.T) {
}

func TestGrandpaState_GetSetIDByBlockNumber(t *testing.T) {
db := newInMemoryGrandpaDatabase(t)
db := newInMemoryDB(t)
gs, err := NewGrandpaStateFromGenesis(db, nil, testAuths)
require.NoError(t, err)

Expand Down Expand Up @@ -112,7 +107,7 @@ func TestGrandpaState_GetSetIDByBlockNumber(t *testing.T) {
}

func TestGrandpaState_LatestRound(t *testing.T) {
grandpaDatabase := newInMemoryGrandpaDatabase(t)
grandpaDatabase := newInMemoryDB(t)
gs, err := NewGrandpaStateFromGenesis(grandpaDatabase, nil, testAuths)
require.NoError(t, err)

Expand Down

0 comments on commit 6a92ccf

Please sign in to comment.