Update token denom and add a separate staking token
Some checks failed
SDK Tests / sdk_tests_nameservice_expiry (pull_request) Failing after 44s
SDK Tests / sdk_tests (pull_request) Failing after 45s
Integration Tests / test-integration (pull_request) Failing after 59s
Unit Tests / test-unit (pull_request) Successful in 49s
SDK Tests / sdk_tests_authority_auctions (pull_request) Failing after 9m3s
E2E Tests / test-e2e (pull_request) Successful in 1m43s
Some checks failed
SDK Tests / sdk_tests_nameservice_expiry (pull_request) Failing after 44s
SDK Tests / sdk_tests (pull_request) Failing after 45s
Integration Tests / test-integration (pull_request) Failing after 59s
Unit Tests / test-unit (pull_request) Successful in 49s
SDK Tests / sdk_tests_authority_auctions (pull_request) Failing after 9m3s
E2E Tests / test-e2e (pull_request) Successful in 1m43s
This commit is contained in:
parent
c14f1d3b00
commit
cbbc96421c
@ -10,11 +10,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
CoinUnit = "lnt"
|
CoinUnit = "lps"
|
||||||
BaseCoinUnit = "alnt"
|
BaseCoinUnit = "alps"
|
||||||
LntExponent = 18
|
LpsExponent = 18
|
||||||
|
|
||||||
DefaultBondDenom = BaseCoinUnit
|
LstakeCoinUnit = "lstake"
|
||||||
|
DefaultBondDenom = LstakeCoinUnit
|
||||||
|
|
||||||
// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address.
|
// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address.
|
||||||
Bech32PrefixAccAddr = "laconic"
|
Bech32PrefixAccAddr = "laconic"
|
||||||
@ -43,8 +44,7 @@ func RegisterDenoms() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
err = sdk.RegisterDenom(BaseCoinUnit, math.LegacyNewDecWithPrec(1, LpsExponent))
|
||||||
err = sdk.RegisterDenom(BaseCoinUnit, math.LegacyNewDecWithPrec(1, LntExponent))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@ import (
|
|||||||
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
||||||
"github.com/cosmos/cosmos-sdk/server"
|
"github.com/cosmos/cosmos-sdk/server"
|
||||||
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
|
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
||||||
"github.com/cosmos/cosmos-sdk/types/module"
|
"github.com/cosmos/cosmos-sdk/types/module"
|
||||||
"github.com/cosmos/cosmos-sdk/types/tx/signing"
|
"github.com/cosmos/cosmos-sdk/types/tx/signing"
|
||||||
"github.com/cosmos/cosmos-sdk/x/auth/tx"
|
"github.com/cosmos/cosmos-sdk/x/auth/tx"
|
||||||
@ -29,6 +28,7 @@ import (
|
|||||||
"github.com/cosmos/cosmos-sdk/x/auth/types"
|
"github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||||
|
|
||||||
"git.vdb.to/cerc-io/laconicd/app"
|
"git.vdb.to/cerc-io/laconicd/app"
|
||||||
|
"git.vdb.to/cerc-io/laconicd/app/params"
|
||||||
"git.vdb.to/cerc-io/laconicd/gql"
|
"git.vdb.to/cerc-io/laconicd/gql"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ func NewRootCmd() *cobra.Command {
|
|||||||
|
|
||||||
// overwrite the minimum gas price from the app configuration
|
// overwrite the minimum gas price from the app configuration
|
||||||
srvCfg := serverconfig.DefaultConfig()
|
srvCfg := serverconfig.DefaultConfig()
|
||||||
srvCfg.MinGasPrices = fmt.Sprintf("0%s", sdk.DefaultBondDenom)
|
srvCfg.MinGasPrices = fmt.Sprintf("0%s", params.BaseCoinUnit)
|
||||||
|
|
||||||
// overwrite the block timeout
|
// overwrite the block timeout
|
||||||
cmtCfg := cmtcfg.DefaultConfig()
|
cmtCfg := cmtcfg.DefaultConfig()
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
KEY="alice"
|
KEY="alice"
|
||||||
CHAINID=${CHAINID:-"laconic_9000-1"}
|
CHAINID=${CHAINID:-"laconic_9000-1"}
|
||||||
MONIKER=${MONIKER:-"localtestnet"}
|
MONIKER=${MONIKER:-"localtestnet"}
|
||||||
KEYRING=${KEYRING:-"test"}
|
KEYRING=${KEYRING:-"test"}
|
||||||
DENOM=${DENOM:-"alnt"}
|
DENOM=${DENOM:-"alps"}
|
||||||
STAKING_AMOUNT=${STAKING_AMOUNT:-"1000000000000000"}
|
BALANCE=${BALANCE:-"1000000000000000000000000000000"} # 10^32 alps | 10^12 lps
|
||||||
|
STAKING_DENOM=${STAKING_DENOM:-"lstake"}
|
||||||
|
STAKING_AMOUNT=${STAKING_AMOUNT:-"1000000000000000"} # 10^15 lstake
|
||||||
MIN_GAS_PRICE=${MIN_GAS_PRICE:-"0.001"}
|
MIN_GAS_PRICE=${MIN_GAS_PRICE:-"0.001"}
|
||||||
LOGLEVEL=${LOGLEVEL:-"info"}
|
LOGLEVEL=${LOGLEVEL:-"info"}
|
||||||
|
|
||||||
@ -94,6 +98,11 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data" ]; then
|
|||||||
# Set gas limit in genesis
|
# Set gas limit in genesis
|
||||||
update_genesis '.consensus["params"]["block"]["max_gas"]="10000000"'
|
update_genesis '.consensus["params"]["block"]["max_gas"]="10000000"'
|
||||||
|
|
||||||
|
# Disable bank transfers for the staking token (lstake)
|
||||||
|
update_genesis ".app_state[\"bank\"][\"send_enabled\"] += [{\"denom\": \"$STAKING_DENOM\", \"enabled\": false}]"
|
||||||
|
|
||||||
|
update_genesis ".app_state[\"staking\"][\"params\"][\"bond_denom\"]=\"$STAKING_DENOM\""
|
||||||
|
|
||||||
# disable produce empty block
|
# disable produce empty block
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
sed -i '' 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml
|
sed -i '' 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml
|
||||||
@ -116,12 +125,10 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Allocate genesis accounts (cosmos formatted addresses)
|
# Allocate genesis accounts (cosmos formatted addresses)
|
||||||
# 10^30 alnt | 10^12 lnt
|
laconicd genesis add-genesis-account $KEY $BALANCE$DENOM,$STAKING_AMOUNT$STAKING_DENOM --keyring-backend $KEYRING
|
||||||
laconicd genesis add-genesis-account $KEY 1000000000000000000000000000000$DENOM --keyring-backend $KEYRING
|
|
||||||
|
|
||||||
# Sign genesis transaction
|
# Sign genesis transaction
|
||||||
# 10^15 alnt
|
laconicd genesis gentx $KEY $STAKING_AMOUNT$STAKING_DENOM --keyring-backend $KEYRING --chain-id $CHAINID
|
||||||
laconicd genesis gentx $KEY $STAKING_AMOUNT$DENOM --keyring-backend $KEYRING --chain-id $CHAINID
|
|
||||||
|
|
||||||
# Collect genesis tx
|
# Collect genesis tx
|
||||||
laconicd genesis collect-gentxs
|
laconicd genesis collect-gentxs
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
fmt "fmt"
|
fmt "fmt"
|
||||||
|
|
||||||
sdkmath "cosmossdk.io/math"
|
sdkmath "cosmossdk.io/math"
|
||||||
|
"git.vdb.to/cerc-io/laconicd/app/params"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -17,7 +18,7 @@ func NewParams(maxBondAmount sdk.Coin) Params {
|
|||||||
|
|
||||||
// DefaultParams returns default module parameters
|
// DefaultParams returns default module parameters
|
||||||
func DefaultParams() Params {
|
func DefaultParams() Params {
|
||||||
return NewParams(sdk.NewCoin(sdk.DefaultBondDenom, DefaultMaxBondAmountTokens))
|
return NewParams(sdk.NewCoin(params.BaseCoinUnit, DefaultMaxBondAmountTokens))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate checks that the parameters have valid values
|
// Validate checks that the parameters have valid values
|
||||||
|
@ -15,6 +15,7 @@ import (
|
|||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||||
|
|
||||||
|
"git.vdb.to/cerc-io/laconicd/app/params"
|
||||||
auctiontypes "git.vdb.to/cerc-io/laconicd/x/auction"
|
auctiontypes "git.vdb.to/cerc-io/laconicd/x/auction"
|
||||||
registrytypes "git.vdb.to/cerc-io/laconicd/x/registry"
|
registrytypes "git.vdb.to/cerc-io/laconicd/x/registry"
|
||||||
"git.vdb.to/cerc-io/laconicd/x/registry/helpers"
|
"git.vdb.to/cerc-io/laconicd/x/registry/helpers"
|
||||||
@ -295,7 +296,7 @@ func (k Keeper) createAuthority(ctx sdk.Context, name string, owner string, isRo
|
|||||||
moduleParams.AuthorityAuctionCommitFee,
|
moduleParams.AuthorityAuctionCommitFee,
|
||||||
moduleParams.AuthorityAuctionRevealFee,
|
moduleParams.AuthorityAuctionRevealFee,
|
||||||
moduleParams.AuthorityAuctionMinimumBid,
|
moduleParams.AuthorityAuctionMinimumBid,
|
||||||
sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(0)),
|
sdk.NewCoin(params.BaseCoinUnit, math.NewInt(0)),
|
||||||
0,
|
0,
|
||||||
ownerAddress,
|
ownerAddress,
|
||||||
)
|
)
|
||||||
|
@ -6,6 +6,8 @@ import (
|
|||||||
|
|
||||||
sdkmath "cosmossdk.io/math"
|
sdkmath "cosmossdk.io/math"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
|
||||||
|
"git.vdb.to/cerc-io/laconicd/app/params"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Default parameter values.
|
// Default parameter values.
|
||||||
@ -60,13 +62,13 @@ func NewParams(
|
|||||||
// DefaultParams returns a default set of parameters.
|
// DefaultParams returns a default set of parameters.
|
||||||
func DefaultParams() Params {
|
func DefaultParams() Params {
|
||||||
return NewParams(
|
return NewParams(
|
||||||
sdk.NewCoin(sdk.DefaultBondDenom, DefaultRecordRent), DefaultRecordExpiryTime,
|
sdk.NewCoin(params.BaseCoinUnit, DefaultRecordRent), DefaultRecordExpiryTime,
|
||||||
sdk.NewCoin(sdk.DefaultBondDenom, DefaultAuthorityRent),
|
sdk.NewCoin(params.BaseCoinUnit, DefaultAuthorityRent),
|
||||||
DefaultAuthorityExpiryTime, DefaultAuthorityGracePeriod, DefaultAuthorityAuctionEnabled, DefaultCommitsDuration,
|
DefaultAuthorityExpiryTime, DefaultAuthorityGracePeriod, DefaultAuthorityAuctionEnabled, DefaultCommitsDuration,
|
||||||
DefaultRevealsDuration,
|
DefaultRevealsDuration,
|
||||||
sdk.NewCoin(sdk.DefaultBondDenom, DefaultCommitFee),
|
sdk.NewCoin(params.BaseCoinUnit, DefaultCommitFee),
|
||||||
sdk.NewCoin(sdk.DefaultBondDenom, DefaultRevealFee),
|
sdk.NewCoin(params.BaseCoinUnit, DefaultRevealFee),
|
||||||
sdk.NewCoin(sdk.DefaultBondDenom, DefaultMinimumBid),
|
sdk.NewCoin(params.BaseCoinUnit, DefaultMinimumBid),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user