Skip to content

Commit

Permalink
fix: use new root with config
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 Nov 20, 2023
1 parent 3bd97b5 commit 3fbb115
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
11 changes: 1 addition & 10 deletions gno.land/cmd/gnokey/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,12 @@ import (
"fmt"
"os"

"github.com/gnolang/gno/gnovm/pkg/gnoenv"
"github.com/gnolang/gno/tm2/pkg/commands"
"github.com/gnolang/gno/tm2/pkg/crypto/keys/client"
)

func main() {
baseCfg := client.BaseOptions{
Home: gnoenv.HomeDir(),
Remote: "127.0.0.1:26657",
Quiet: false,
InsecurePasswordStdin: false,
Config: "",
}

cmd := client.NewRootCmdWithBaseConfig(commands.NewDefaultIO(), baseCfg)
cmd := client.NewRootCmd(commands.NewDefaultIO())

if err := cmd.ParseAndRun(context.Background(), os.Args[1:]); err != nil {
_, _ = fmt.Fprintf(os.Stderr, "%+v\n", err)
Expand Down
5 changes: 4 additions & 1 deletion tm2/pkg/crypto/keys/client/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package client
import (
"flag"

"github.com/gnolang/gno/gnovm/pkg/gnoenv"
"github.com/gnolang/gno/tm2/pkg/commands"

"github.com/peterbourgon/ff/v3"
Expand Down Expand Up @@ -52,11 +53,13 @@ func NewRootCmd(io commands.IO) *commands.Command {
}

func (c *baseCfg) RegisterFlags(fs *flag.FlagSet) {
var homedir = gnoenv.HomeDir()

Check warning on line 57 in tm2/pkg/crypto/keys/client/root.go

View check run for this annotation

Codecov / codecov/patch

tm2/pkg/crypto/keys/client/root.go#L56-L57

Added lines #L56 - L57 were not covered by tests
// Base options
fs.StringVar(
&c.Home,
"home",
c.Home,
homedir,

Check warning on line 62 in tm2/pkg/crypto/keys/client/root.go

View check run for this annotation

Codecov / codecov/patch

tm2/pkg/crypto/keys/client/root.go#L62

Added line #L62 was not covered by tests
"home directory",
)

Expand Down

0 comments on commit 3fbb115

Please sign in to comment.