From 3eaa0f3b73868603e319aaadcedebf35289a46d4 Mon Sep 17 00:00:00 2001 From: Mantrachain Development Support Date: Fri, 8 Nov 2024 13:41:06 +0900 Subject: [PATCH] Revert "fix: register uom as DefaultBondDenom (#195)" (#221) This reverts commit 1596ac0b56de7c22c31abd358cfe77627ae43bfa. --- app/app.go | 10 ++++++++++ app/params/config.go | 29 ----------------------------- 2 files changed, 10 insertions(+), 29 deletions(-) diff --git a/app/app.go b/app/app.go index eed6fe02..9feecfcc 100644 --- a/app/app.go +++ b/app/app.go @@ -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, diff --git a/app/params/config.go b/app/params/config.go index 5daa33eb..08e89f19 100644 --- a/app/params/config.go +++ b/app/params/config.go @@ -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. @@ -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.