Skip to content

Commit

Permalink
refactor: change min self delegation value
Browse files Browse the repository at this point in the history
  • Loading branch information
tuantran1702 committed Jan 23, 2024
1 parent 481e937 commit fc2df64
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/apptesting/test_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const (

var (
DefaultPowerReduction, _ = sdk.NewIntFromString("1000000000000000000")
MinSelfDelegation, _ = sdk.NewIntFromString("2000000000000000000000000")
MinSelfDelegation, _ = sdk.NewIntFromString("50000000000000000000000")
)

var (
Expand Down
2 changes: 1 addition & 1 deletion app/decorators/staking_mindelegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}

Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ 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 \
--chain-id=cudos-local-network \
--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" \
Expand Down
10 changes: 5 additions & 5 deletions scripts/run-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'"'
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/staking/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down

0 comments on commit fc2df64

Please sign in to comment.