diff --git a/gnovm/pkg/repl/repl.go b/gnovm/pkg/repl/repl.go index 9f58d77ed91..4ec7aceaf71 100644 --- a/gnovm/pkg/repl/repl.go +++ b/gnovm/pkg/repl/repl.go @@ -122,14 +122,14 @@ func NewRepl(opts ...ReplOption) *Repl { r.stdout = &b r.stderr = &b - for _, o := range opts { - o(r) - } - r.storeFunc = func() gno.Store { return tests.TestStore("teststore", "", r.stdin, r.stdout, r.stderr, tests.ImportModeStdlibsOnly) } + for _, o := range opts { + o(r) + } + r.state = newState(r.stdout, r.storeFunc) br := bufio.NewReader(r.stdin) diff --git a/gnovm/pkg/repl/repl_test.go b/gnovm/pkg/repl/repl_test.go index 8f835709c7e..a299f217241 100644 --- a/gnovm/pkg/repl/repl_test.go +++ b/gnovm/pkg/repl/repl_test.go @@ -113,6 +113,11 @@ func TestReplOpts(t *testing.T) { require := require.New(t) r := NewRepl(WithStd(nil, nil, nil), WithStore(nil)) + require.Nil(r.storeFunc()) + require.Nil(r.stderr) + require.Nil(r.stdin) + require.Nil(r.stdout) + _, err := r.Process("import \"fmt\"") require.NoError(err) }