From fc2df64971ff8517dc1885ee774d18f78923d15b Mon Sep 17 00:00:00 2001 From: Tuan Tran Date: Tue, 23 Jan 2024 10:18:08 +0700 Subject: [PATCH] refactor: change min self delegation value --- app/apptesting/test_suite.go | 2 +- app/decorators/staking_mindelegation.go | 2 +- readme.md | 4 ++-- scripts/run-node.sh | 10 +++++----- tests/integration/staking/keeper/msg_server_test.go | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/apptesting/test_suite.go b/app/apptesting/test_suite.go index 50d830b0..b3e60115 100644 --- a/app/apptesting/test_suite.go +++ b/app/apptesting/test_suite.go @@ -45,7 +45,7 @@ const ( var ( DefaultPowerReduction, _ = sdk.NewIntFromString("1000000000000000000") - MinSelfDelegation, _ = sdk.NewIntFromString("2000000000000000000000000") + MinSelfDelegation, _ = sdk.NewIntFromString("50000000000000000000000") ) var ( diff --git a/app/decorators/staking_mindelegation.go b/app/decorators/staking_mindelegation.go index 2bdbc6a2..bb9b6af0 100644 --- a/app/decorators/staking_mindelegation.go +++ b/app/decorators/staking_mindelegation.go @@ -9,7 +9,7 @@ import ( ) // Copied from https://github.com/CudoVentures/cosmos-sdk/blob/3816012a2d4ea5c9bbb3d8e6174d3b96ff91a039/x/staking/types/msg.go#L20 -const MinSelfDelegation = "2000000000000000000000000" +const MinSelfDelegation = "50000000000000000000000" type MinSelfDelegationDecorator struct{} diff --git a/readme.md b/readme.md index 7529806a..b1acad6a 100644 --- a/readme.md +++ b/readme.md @@ -127,7 +127,7 @@ This mnemonic could be imported into cudos blockchain in order to verify that re ## Create validator - cudos-noded tx staking create-validator --amount=2000000000000000000000000acudos \ + cudos-noded tx staking create-validator --amount=50000000000000000000000acudos \ --from=val-2 \ --pubkey=$(cudos-noded tendermint show-validator) \ --moniker=cudos-node-02 \ @@ -135,7 +135,7 @@ This mnemonic could be imported into cudos blockchain in order to verify that re --commission-rate="0.10" \ --commission-max-rate="0.20" \ --commission-max-change-rate="0.01" \ - --min-self-delegation="2000000000000000000000000" \ + --min-self-delegation="50000000000000000000000" \ --gas="auto" \ --gas-prices="5000000000000acudos" \ --gas-adjustment="1.80" \ diff --git a/scripts/run-node.sh b/scripts/run-node.sh index 0d6013fe..db4475f0 100644 --- a/scripts/run-node.sh +++ b/scripts/run-node.sh @@ -18,7 +18,7 @@ DENOM=${2:-"acudos"} COMMISSION_RATE=0.01 COMMISSION_MAX_RATE=0.02 -MIN_SELF_DELEGATION=2000000000000000000000000 +MIN_SELF_DELEGATION=50000000000000000000000 SED_BINARY=sed # check if this is OS X if [[ "$OSTYPE" == "darwin"* ]]; then @@ -62,9 +62,9 @@ TEST1_ADDRESS=$($BINARY keys show $KEY1 -a --keyring-backend $KEYRING --home $HO TEST2_ADDRESS=$($BINARY keys show $KEY2 -a --keyring-backend $KEYRING --home $HOME_DIR) # Allocate genesis accounts (cosmos formatted addresses) -$BINARY add-genesis-account $TEST0_ADDRESS "2000000000000000000000000000${DENOM}" --home $HOME_DIR -$BINARY add-genesis-account $TEST1_ADDRESS "2000000000000000000000000000${DENOM}" --home $HOME_DIR -$BINARY add-genesis-account $TEST2_ADDRESS "2000000000000000000000000000${DENOM}" --home $HOME_DIR +$BINARY add-genesis-account $TEST0_ADDRESS "50000000000000000000000000${DENOM}" --home $HOME_DIR +$BINARY add-genesis-account $TEST1_ADDRESS "50000000000000000000000000${DENOM}" --home $HOME_DIR +$BINARY add-genesis-account $TEST2_ADDRESS "50000000000000000000000000${DENOM}" --home $HOME_DIR update_test_genesis '.app_state["gov"]["voting_params"]["voting_period"]="50s"' update_test_genesis '.app_state["mint"]["params"]["mint_denom"]="'$DENOM'"' @@ -84,7 +84,7 @@ $SED_BINARY -i 's/swagger = false/swagger = true/' $HOME_DIR/config/app.toml # Sign genesis transaction # TEST0 is the validator -$BINARY gentx $KEY "20000000000000000000000000${DENOM}" "0x4838B106FCe9647Bdf1E7877BF73cE8B0BAD5f97" $TEST0_ADDRESS --commission-rate=$COMMISSION_RATE --min-self-delegation=$MIN_SELF_DELEGATION --commission-max-rate=$COMMISSION_MAX_RATE --keyring-backend $KEYRING --chain-id $CHAIN_ID --home $HOME_DIR +$BINARY gentx $KEY "500000000000000000000000${DENOM}" "0x4838B106FCe9647Bdf1E7877BF73cE8B0BAD5f97" $TEST0_ADDRESS --commission-rate=$COMMISSION_RATE --min-self-delegation=$MIN_SELF_DELEGATION --commission-max-rate=$COMMISSION_MAX_RATE --keyring-backend $KEYRING --chain-id $CHAIN_ID --home $HOME_DIR # Collect genesis tx $BINARY collect-gentxs --home $HOME_DIR diff --git a/tests/integration/staking/keeper/msg_server_test.go b/tests/integration/staking/keeper/msg_server_test.go index e860bcd6..b4475f1e 100644 --- a/tests/integration/staking/keeper/msg_server_test.go +++ b/tests/integration/staking/keeper/msg_server_test.go @@ -128,7 +128,7 @@ func (suite *AnteTestSuite) CreateValidator(tokens sdk.Int, accNum uint64) (cryp func (suite *AnteTestSuite) Test_CreateValidator() { // Construct transaction - MinSelfDelegation, _ := sdk.NewIntFromString("2000000000000000000000000") + MinSelfDelegation, _ := sdk.NewIntFromString("50000000000000000000000") suite.SetupTest() // setup suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder() suite.txBuilder.SetGasLimit(400_000_000) @@ -150,7 +150,7 @@ func (suite *AnteTestSuite) Test_CreateValidator() { // and also err when trying to create validator with insufficient min self delegation func (suite *AnteTestSuite) TestAnte_CreateValidator_SeqNumber() { - MinSelfDelegation, _ := sdk.NewIntFromString("2000000000000000000000000") + MinSelfDelegation, _ := sdk.NewIntFromString("50000000000000000000000") suite.SetupTest() // setup suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder()