Skip to content

Commit

Permalink
Revert "fix: register uom as DefaultBondDenom (#195)" (#221)
Browse files Browse the repository at this point in the history
This reverts commit 1596ac0.
  • Loading branch information
mantrachain-support authored Nov 8, 2024
1 parent e3fe297 commit 3eaa0f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 29 deletions.
10 changes: 10 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,16 @@ type App struct {
configurator module.Configurator
}

func init() {
sdk.SetCoinDenomRegex(MantraCoinDenomRegex)
}

// MantraCoinDenomRegex returns the mantra regex string
// this is used to override the default sdk coin denom regex
func MantraCoinDenomRegex() string {
return `[a-zA-Z][a-zA-Z0-9/:._-]{1,127}`
}

// New returns a reference to an initialized App.
func New(
logger log.Logger,
Expand Down
29 changes: 0 additions & 29 deletions app/params/config.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
package params

import (
"cosmossdk.io/math"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)

const (
HumanCoinUnit = "om"
BaseCoinUnit = "uom"
OmExponent = 6

DefaultBondDenom = BaseCoinUnit
)

var (
Bech32Prefix = "mantra"
// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key.
Expand All @@ -29,27 +20,7 @@ var (
)

func init() {
sdk.SetCoinDenomRegex(MantraCoinDenomRegex)
SetAddressPrefixes()
RegisterDenoms()
}

// MantraCoinDenomRegex returns the mantra regex string
// this is used to override the default sdk coin denom regex
func MantraCoinDenomRegex() string {
return `[a-zA-Z][a-zA-Z0-9/:._-]{1,127}`
}

// RegisterDenoms registers token denoms.
func RegisterDenoms() {
err := sdk.RegisterDenom(HumanCoinUnit, math.LegacyOneDec())
if err != nil {
panic(err)
}
err = sdk.RegisterDenom(BaseCoinUnit, math.LegacyNewDecWithPrec(1, OmExponent))
if err != nil {
panic(err)
}
}

// SetAddressPrefixes builds the Config with Bech32 addressPrefix and publKeyPrefix for accounts, validators, and consensus nodes and verifies that addreeses have correct format.
Expand Down

0 comments on commit 3eaa0f3

Please sign in to comment.