Skip to content

Commit

Permalink
wip: verbose mode
Browse files Browse the repository at this point in the history
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
  • Loading branch information
gfanton committed Dec 20, 2024
1 parent a9bde35 commit d3717e4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions gno.land/pkg/integration/fork_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func (m *MarshalableGenesisDoc) ToGenesisDoc() *bft.GenesisDoc {
}

type ForkConfig struct {
Verbose bool `json:"verbose"`
PrivValidator ed25519.PrivKeyEd25519 `json:"priv"`
DBDir string `json:"dbdir"`
RootDir string `json:"rootdir"`
Expand Down
13 changes: 7 additions & 6 deletions gno.land/pkg/integration/fork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/gnolang/gno/gnovm/pkg/gnoenv"
"github.com/gnolang/gno/tm2/pkg/bft/rpc/client"
"github.com/gnolang/gno/tm2/pkg/crypto/ed25519"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand All @@ -31,13 +32,13 @@ func TestForkGnoland(t *testing.T) {

cfg := TestingMinimalNodeConfig(gnoRootDir)

gnoenv.RootDir()
remoteAddr, cmd, err := ExecuteForkBinary(ctx, gnolandBin, &ForkConfig{
// PrivValidator: ed25519.GenPrivKey(),
DBDir: gnolandDBDir,
RootDir: gnoRootDir,
TMConfig: cfg.TMConfig,
Genesis: NewMarshalableGenesisDoc(cfg.Genesis),
Verbose: true,
PrivValidator: ed25519.GenPrivKey(),
DBDir: gnolandDBDir,
RootDir: gnoRootDir,
TMConfig: cfg.TMConfig,
Genesis: NewMarshalableGenesisDoc(cfg.Genesis),
})
require.NoError(t, err)

Expand Down
4 changes: 3 additions & 1 deletion gno.land/pkg/integration/forknode/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ func isAllZero(key [64]byte) bool {

func ForkableNode(cfg *integration.ForkConfig) error {
logger := slog.New(slog.NewTextHandler(io.Discard, nil))
// logger := slog.New(slog.NewTextHandler(os.Stdout, nil))
if cfg.Verbose {
logger = slog.New(slog.NewTextHandler(os.Stdout, nil))
}

var data db.DB
var err error
Expand Down

0 comments on commit d3717e4

Please sign in to comment.