diff --git a/starship/charts/devnet/scripts/injective/create-validator.sh b/starship/charts/devnet/scripts/injective/create-validator.sh index a2872b65..5f70a75c 100644 --- a/starship/charts/devnet/scripts/injective/create-validator.sh +++ b/starship/charts/devnet/scripts/injective/create-validator.sh @@ -23,7 +23,7 @@ function cosmos-sdk-version-default() { $CHAIN_BIN tx staking create-validator \ --pubkey=$($CHAIN_BIN tendermint show-validator) \ --moniker $VAL_NAME \ - --amount 100000000000000000000inj \ + --amount 10000000000000000inj \ --chain-id $CHAIN_ID \ --from $VAL_NAME \ --commission-rate="0.10" \ diff --git a/starship/charts/devnet/templates/chains/cosmos/genesis.yaml b/starship/charts/devnet/templates/chains/cosmos/genesis.yaml index 636a9f84..78d424d6 100644 --- a/starship/charts/devnet/templates/chains/cosmos/genesis.yaml +++ b/starship/charts/devnet/templates/chains/cosmos/genesis.yaml @@ -283,7 +283,16 @@ spec: do var="FAUCET_CREDIT_AMOUNT_$(printf '%s\n' ${coin//[[:digit:]]/} | tr '[:lower:]' '[:upper:]')" amt="${coin//[!0-9]/}" - export $var=$((amt/10000)) + + if [ ${#amt} -gt 18 ]; then + creditAmt=$(echo $amt | sed -e "s/000000000$//") + feesAmt=$(echo $amt | sed -e "s/0000000000000$//") + else + creditAmt=$(echo $amt | sed -e "s/0000$//") + feesAmt=$(echo $amt | sed -e "s/000000$//") + fi + + export $var="$creditAmt" done export FAUCET_PATH_PATTERN="${HD_PATH:0:$((${#HD_PATH}-1))}a" @@ -336,11 +345,19 @@ spec: do amt="${coin//[!0-9]/}" denom="${coin//[0-9]/}" - creditAmt=$(echo ${coin//[!0-9]/} | sed -e "s/0000$//") + + # Calculate the order of magnitude + if [ ${#amt} -gt 18 ]; then + creditAmt=$(echo $amt | sed -e "s/000000000$//") + feesAmt=$(echo $amt | sed -e "s/000000000000$//") + else + creditAmt=$(echo $amt | sed -e "s/0000$//") + feesAmt=$(echo $amt | sed -e "s/000000$//") + fi + if [[ $CREDIT_COINS == "" ]] then CREDIT_COINS="$creditAmt$denom" - feesAmt=$(echo ${coin//[!0-9]/} | sed -e "s/0000000$//") FEES="$feesAmt$denom" else CREDIT_COINS="${CREDIT_COINS},$creditAmt$denom" diff --git a/starship/tests/e2e/configs/injective.yaml b/starship/tests/e2e/configs/injective.yaml index d6b1f58f..7feb51e5 100644 --- a/starship/tests/e2e/configs/injective.yaml +++ b/starship/tests/e2e/configs/injective.yaml @@ -6,6 +6,7 @@ chains: rest: 1313 rpc: 26653 exposer: 38083 + faucet: 8003 - id: cosmoshub-4 name: cosmoshub numValidators: 1