Skip to content

Commit

Permalink
move prefix settings to appparams
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba committed Sep 2, 2022
1 parent 9cd92d1 commit 7109f84
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
8 changes: 1 addition & 7 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,6 @@ func init() {
}

DefaultNodeHome = filepath.Join(userHomeDir, fmt.Sprintf(".%s", appparams.Name))

// XXX: If other upstream or external application's depend on any of Umee's
// CLI or command functionality, then this would require us to move the
// SetAddressConfig call to somewhere external such as the root command
// constructor and anywhere else we contract the app.
SetAddressConfig()
}

func New(
Expand Down Expand Up @@ -331,7 +325,7 @@ func New(
app.GetSubspace(authtypes.ModuleName),
authtypes.ProtoBaseAccount,
maccPerms,
AccountAddressPrefix,
appparams.AccountAddressPrefix,
)
app.BankKeeper = bankkeeper.NewBaseKeeper(
appCodec,
Expand Down
14 changes: 14 additions & 0 deletions app/params/app_settings.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package params

import (
"log"

sdk "github.com/cosmos/cosmos-sdk/types"
)

Expand All @@ -24,3 +26,15 @@ var (
// MinMinGasPrice is the minimum value a validator can set for `minimum-gas-prices` his app.toml config
MinMinGasPrice = sdk.NewDecCoinFromDec(BondDenom, sdk.MustNewDecFromStr("0.05"))
)

func init() {
// XXX: If other upstream or external application's depend on any of Umee's
// CLI or command functionality, then this would require us to move the
// SetAddressConfig call to somewhere external such as the root command
// constructor and anywhere else we contract the app.
SetAddressConfig()

if AccountAddressPrefix != Name {
log.Fatal("AccountAddresPrefix must equal Name")
}
}
2 changes: 1 addition & 1 deletion app/prefix.go → app/params/prefix.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package app
package params

import (
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
4 changes: 2 additions & 2 deletions cmd/umeed/cmd/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/cosmos/cosmos-sdk/version"
"github.com/spf13/cobra"

umeeapp "github.com/umee-network/umee/v3/app"
appparams "github.com/umee-network/umee/v3/app/params"
)

const (
Expand Down Expand Up @@ -80,7 +80,7 @@ $ %s debug addr cosmos1e0jnq2sun3dzjh8p2xq95kk0expwmd7shwjpfg
},
}

cmd.Flags().String(flagBech32HRP, umeeapp.AccountAddressPrefix,
cmd.Flags().String(flagBech32HRP, appparams.AccountAddressPrefix,
"Input Bech32 HRP (use only when address input is a Bech32 address")
return cmd
}

0 comments on commit 7109f84

Please sign in to comment.