Skip to content

Commit

Permalink
Add homedir
Browse files Browse the repository at this point in the history
  • Loading branch information
yzang2019 committed Aug 14, 2024
1 parent 90bbe0b commit 7272ab6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ss/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ss
import (
"fmt"
"os"
"path/filepath"
"testing"

"github.com/cosmos/iavl"
Expand All @@ -14,13 +15,14 @@ import (

func TestNewStateStore(t *testing.T) {
tempDir := os.TempDir()
homeDir := filepath.Join(tempDir, "seidb")
ssConfig := config.StateStoreConfig{
DedicatedChangelog: true,
Backend: string(PebbleDBBackend),
AsyncWriteBuffer: 50,
KeepRecent: 500,
}
stateStore, err := NewStateStore(logger.NewNopLogger(), tempDir, ssConfig)
stateStore, err := NewStateStore(logger.NewNopLogger(), homeDir, ssConfig)
require.NoError(t, err)
for i := 1; i < 20; i++ {
var changesets []*proto.NamedChangeSet
Expand All @@ -45,7 +47,7 @@ func TestNewStateStore(t *testing.T) {
require.NoError(t, err)

// Reopen a new state store
stateStore, err = NewStateStore(logger.NewNopLogger(), tempDir, ssConfig)
stateStore, err = NewStateStore(logger.NewNopLogger(), homeDir, ssConfig)
require.NoError(t, err)

// Make sure key and values can be found
Expand Down

0 comments on commit 7272ab6

Please sign in to comment.