diff --git a/app/params/config.go b/app/params/config.go index 4fc14f08..77c8747d 100644 --- a/app/params/config.go +++ b/app/params/config.go @@ -10,9 +10,11 @@ import ( ) const ( - CoinUnit = "photon" + CoinUnit = "lnt" + BaseCoinUnit = "alnt" + LntExponent = 18 - DefaultBondDenom = CoinUnit + DefaultBondDenom = BaseCoinUnit // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address. Bech32PrefixAccAddr = "laconic" @@ -41,6 +43,11 @@ func RegisterDenoms() { if err != nil { panic(err) } + + err = sdk.RegisterDenom(BaseCoinUnit, math.LegacyNewDecWithPrec(1, LntExponent)) + if err != nil { + panic(err) + } } func SetAddressPrefixes() { diff --git a/cmd/laconicd/cmd/root.go b/cmd/laconicd/cmd/root.go index b4847145..3fdb0341 100644 --- a/cmd/laconicd/cmd/root.go +++ b/cmd/laconicd/cmd/root.go @@ -98,7 +98,7 @@ func NewRootCmd() *cobra.Command { // overwrite the minimum gas price from the app configuration srvCfg := serverconfig.DefaultConfig() - srvCfg.MinGasPrices = "0photon" + srvCfg.MinGasPrices = "0alnt" // overwrite the block timeout cmtCfg := cmtcfg.DefaultConfig() diff --git a/scripts/init.sh b/scripts/init.sh index 190e3fd3..402b5d39 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -27,7 +27,7 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then laconicd keys add $KEY --keyring-backend $KEYRING # Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer) - laconicd init $MONIKER --chain-id $CHAINID --default-denom photon + laconicd init $MONIKER --chain-id $CHAINID --default-denom alnt update_genesis() { jq "$1" $HOME/.laconicd/config/genesis.json > $HOME/.laconicd/config/tmp_genesis.json && @@ -70,7 +70,7 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then else sed -i 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml fi - + # Run this to allow requests from any origin sed -i 's/cors_allowed_origins.*$/cors_allowed_origins = ["*"]/' $HOME/.laconicd/config/config.toml @@ -86,10 +86,12 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then fi # Allocate genesis accounts (cosmos formatted addresses) - laconicd genesis add-genesis-account $KEY 100000000000000000000000000photon --keyring-backend $KEYRING + # 10^30 alnt | 10^12 lnt + laconicd genesis add-genesis-account $KEY 1000000000000000000000000000000alnt --keyring-backend $KEYRING # Sign genesis transaction - laconicd genesis gentx $KEY 1000000000000000000000photon --keyring-backend $KEYRING --chain-id $CHAINID + # 10^24 alnt | 10^6 lnt + laconicd genesis gentx $KEY 1000000000000000000000000alnt --keyring-backend $KEYRING --chain-id $CHAINID # Collect genesis tx laconicd genesis collect-gentxs @@ -104,7 +106,7 @@ fi laconicd start \ --pruning=nothing \ --log_level $LOGLEVEL \ - --minimum-gas-prices=0.0001photon \ + --minimum-gas-prices=1alnt \ --api.enable \ --rpc.laddr="tcp://0.0.0.0:26657" \ --gql-server --gql-playground diff --git a/tests/integration/auction/keeper/query_server_test.go b/tests/integration/auction/keeper/query_server_test.go index a81fa5bd..2ed1ec27 100644 --- a/tests/integration/auction/keeper/query_server_test.go +++ b/tests/integration/auction/keeper/query_server_test.go @@ -324,7 +324,7 @@ func (kts *KeeperTestSuite) createAuctionAndCommitBid(commitBid bool) (*types.Au } // Create funded account(s) - accounts := simtestutil.AddTestAddrs(kts.BankKeeper, integrationTest.BondDenomProvider{}, ctx, accCount, math.NewInt(100)) + accounts := simtestutil.AddTestAddrs(kts.BankKeeper, integrationTest.BondDenomProvider{}, ctx, accCount, math.NewInt(1000000)) params, err := k.GetParams(ctx) if err != nil { diff --git a/tests/integration/registry/keeper/common_test.go b/tests/integration/registry/keeper/common_test.go index 17ec795e..095e0b49 100644 --- a/tests/integration/registry/keeper/common_test.go +++ b/tests/integration/registry/keeper/common_test.go @@ -49,7 +49,7 @@ func (kts *KeeperTestSuite) createBond() (*bondTypes.Bond, error) { ctx := kts.SdkCtx // Create a funded account - kts.accounts = simtestutil.AddTestAddrs(kts.BankKeeper, integrationTest.BondDenomProvider{}, ctx, 1, math.NewInt(100000000000)) + kts.accounts = simtestutil.AddTestAddrs(kts.BankKeeper, integrationTest.BondDenomProvider{}, ctx, 1, math.NewInt(1000000000000)) bond, err := kts.BondKeeper.CreateBond(ctx, kts.accounts[0], sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1000000000)))) if err != nil { diff --git a/x/auction/params.go b/x/auction/params.go index 0dd99480..766d01b7 100644 --- a/x/auction/params.go +++ b/x/auction/params.go @@ -13,9 +13,10 @@ import ( var ( DefaultCommitsDuration = 5 * time.Minute DefaultRevealsDuration = 5 * time.Minute - DefaultCommitFee = sdk.Coin{Amount: sdkmath.NewInt(10), Denom: sdk.DefaultBondDenom} - DefaultRevealFee = sdk.Coin{Amount: sdkmath.NewInt(10), Denom: sdk.DefaultBondDenom} - DefaultMinimumBid = sdk.Coin{Amount: sdkmath.NewInt(1000), Denom: sdk.DefaultBondDenom} + + DefaultCommitFee = sdkmath.NewInt(1000) // 10^3 alnt + DefaultRevealFee = sdkmath.NewInt(1000) // 10^3 alnt + DefaultMinimumBid = sdkmath.NewInt(1000000) // 10^6 alnt ) func NewParams(commitsDuration time.Duration, revealsDuration time.Duration, commitFee sdk.Coin, revealFee sdk.Coin, minimumBid sdk.Coin) Params { @@ -33,9 +34,9 @@ func DefaultParams() Params { return Params{ CommitsDuration: DefaultCommitsDuration, RevealsDuration: DefaultRevealsDuration, - CommitFee: DefaultCommitFee, - RevealFee: DefaultRevealFee, - MinimumBid: DefaultMinimumBid, + CommitFee: sdk.NewCoin(sdk.DefaultBondDenom, DefaultCommitFee), + RevealFee: sdk.NewCoin(sdk.DefaultBondDenom, DefaultRevealFee), + MinimumBid: sdk.NewCoin(sdk.DefaultBondDenom, DefaultMinimumBid), } } diff --git a/x/bond/params.go b/x/bond/params.go index e836ae2c..12901561 100644 --- a/x/bond/params.go +++ b/x/bond/params.go @@ -9,7 +9,7 @@ import ( ) // DefaultMaxBondAmountTokens are the default parameter values. -var DefaultMaxBondAmountTokens = sdkmath.NewInt(100000000000) +var DefaultMaxBondAmountTokens = sdkmath.NewInt(1000000000000) // 10^12 alnt func NewParams(maxBondAmount sdk.Coin) Params { return Params{MaxBondAmount: maxBondAmount} diff --git a/x/registry/params.go b/x/registry/params.go index b98fe820..31c8700d 100644 --- a/x/registry/params.go +++ b/x/registry/params.go @@ -11,21 +11,21 @@ import ( // Default parameter values. var ( // DefaultRecordRent is the default record rent for 1 time period (see expiry time). - DefaultRecordRent = sdkmath.NewInt(1000000) + DefaultRecordRent = sdkmath.NewInt(1000000) // 10^6 alnt // DefaultRecordExpiryTime is the default record expiry time (1 year). DefaultRecordExpiryTime = time.Hour * 24 * 365 - DefaultAuthorityRent = sdkmath.NewInt(1000000) + DefaultAuthorityRent = sdkmath.NewInt(1000000) // 10^6 alnt DefaultAuthorityExpiryTime = time.Hour * 24 * 365 DefaultAuthorityGracePeriod = time.Hour * 24 * 2 DefaultAuthorityAuctionEnabled = false DefaultCommitsDuration = time.Hour * 24 DefaultRevealsDuration = time.Hour * 24 - DefaultCommitFee = sdkmath.NewInt(1000000) - DefaultRevealFee = sdkmath.NewInt(1000000) - DefaultMinimumBid = sdkmath.NewInt(5000000) + DefaultCommitFee = sdkmath.NewInt(1000000) // 10^6 alnt + DefaultRevealFee = sdkmath.NewInt(1000000) // 10^6 alnt + DefaultMinimumBid = sdkmath.NewInt(5000000) // 5 * 10^6 alnt ) // NewParams creates a new Params instance