From bdcb3837b173332dd1a2671554571b55e669872b Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Mon, 9 Jan 2023 15:55:52 +0000 Subject: [PATCH] dot/state: remove `newInMemoryGrandpaDatabase` --- dot/state/grandpa_test.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/dot/state/grandpa_test.go b/dot/state/grandpa_test.go index 652988e84ec..e35477b8068 100644 --- a/dot/state/grandpa_test.go +++ b/dot/state/grandpa_test.go @@ -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) @@ -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) @@ -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) @@ -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) @@ -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)