Skip to content

Commit

Permalink
accounts,cmd/utils: fixup merge issues; lint and cli lib v2 syntax
Browse files Browse the repository at this point in the history
Date: 2022-08-15 05:38:36-07:00
Signed-off-by: meows <b5c6@protonmail.com>
  • Loading branch information
meowsbits committed Aug 15, 2022
1 parent 35052a8 commit ffb1ea3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion accounts/hd_cg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func TestHDPathParsing_CG(t *testing.T) {

func testHDPathParsing(coinType uint32) func(t *testing.T) {
return func(t *testing.T) {

// Set the coin type to the one we're testing.
// This assigns the default derivations and iterator to the coin type.
SetCoinTypeConfiguration(coinType)
Expand Down
6 changes: 2 additions & 4 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,6 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {

// We handle configuration of HD paths only if --usb is set to a truthy value.
if cfg.USB {

// Flag --usb.pathid allows configuration for arbitrary SLIP-0044 values.
if ctx.IsSet(USBPathIDFlag.Name) {
pathID := ctx.Uint64(USBPathIDFlag.Name)
Expand All @@ -1574,13 +1573,12 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
}
accounts.SetCoinTypeConfiguration(uint32(pathID))
log.Info("Using custom HD derivation path", "pathid", uint32(pathID), "basepath", accounts.DefaultBaseDerivationPath)

} else {
// Set default hd path based on --chain configuration flags, if any.

// Set default derivation path to a testnet value if we're configuring for a testnet.
for _, f := range TestnetFlags {
if ctx.IsSet(f.GetName()) && ctx.Bool(f.GetName()) {
name := f.Names()[0] // This won't overflow because the flags always have a Name, because they are defined as --name.
if ctx.IsSet(name) && ctx.Bool(name) {
accounts.SetCoinTypeConfiguration(accounts.BIP0044CoinTypeTestnet)
log.Info("Using testnet HD derivation path", "basepath", accounts.DefaultBaseDerivationPath)
break
Expand Down

0 comments on commit ffb1ea3

Please sign in to comment.