Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve naming inconsistencies and update configurations #11

Merged
merged 5 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ mytestnet
# Testing
coverage.txt
profile.out
screenlog.0
contract_tests/*
scripts/wasm/*.wasm

# Vagrant
.vagrant/
Expand All @@ -45,5 +48,4 @@ dependency-graph.png
*.aux
*.out
*.synctex.gz
contract_tests/*
scripts/wasm/*.wasm

8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM golang:1.21-alpine3.18 as builder
ARG LIBWASM_VERSION
ARG LIBWASM_CHECKSUM

RUN test -n "${LIBWASM_VERSION}"
RUN test -n "${LIBWASM_VERSION}" # TODO: seems to be empty on docker build
RUN test -n "${LIBWASM_CHECKSUM}"

RUN set -eux; apk add --no-cache git libusb-dev linux-headers gcc musl-dev make;
Expand All @@ -29,10 +29,10 @@ WORKDIR /go/modules/light-clients/08-wasm

RUN go mod download

RUN GOOS=linux GOARCH=amd64 go build -mod=readonly -tags "netgo ledger muslc" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=sim -X github.com/cosmos/cosmos-sdk/version.AppName=simd -X github.com/cosmos/cosmos-sdk/version.Version= -X github.com/cosmos/cosmos-sdk/version.Commit= -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo ledger muslc," -w -s -linkmode=external -extldflags "-Wl,-z,muldefs -static"' -trimpath -o /go/build/ ./...
RUN GOOS=linux GOARCH=amd64 go build -mod=readonly -tags "netgo ledger muslc" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=hyperia -X github.com/cosmos/cosmos-sdk/version.AppName=hyperiad -X github.com/cosmos/cosmos-sdk/version.Version= -X github.com/cosmos/cosmos-sdk/version.Commit= -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo ledger muslc," -w -s -linkmode=external -extldflags "-Wl,-z,muldefs -static"' -trimpath -o /go/build/ ./...

FROM alpine:3.18

COPY --from=builder /go/build/simd /bin/simd
COPY --from=builder /go/build/hyperiad /bin/hyperiad

ENTRYPOINT ["simd"]
ENTRYPOINT ["hyperiad"]
10 changes: 5 additions & 5 deletions app/ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (

func TestMempoolDecorator(t *testing.T) {
gasLimit := uint64(200000)
minGasPrice := sdk.NewDecCoinsFromCoins(sdk.NewInt64Coin("uhyperia", feemarkettypes.DefaultMinBaseGasPrice.TruncateInt64()))
minGasPrice := sdk.NewDecCoinsFromCoins(sdk.NewInt64Coin("uhype", feemarkettypes.DefaultMinBaseGasPrice.TruncateInt64()))
validFeeAmount := feemarkettypes.DefaultMinBaseGasPrice.MulInt64(int64(gasLimit))
validFee := sdk.NewCoins(sdk.NewCoin("uhyperia", validFeeAmount.TruncateInt()))
validFee := sdk.NewCoins(sdk.NewCoin("uhype", validFeeAmount.TruncateInt()))
validIbcFee := sdk.NewCoins(sdk.NewCoin("ibcfee", validFeeAmount.TruncateInt()))
// mockHostZoneConfig is used to mock the host zone config, with ibcfee as the ibc fee denom to be used as alternative fee
mockHostZoneConfig := types.HostChainFeeAbsConfig{
Expand Down Expand Up @@ -55,7 +55,7 @@ func TestMempoolDecorator(t *testing.T) {
err := suite.feeabsKeeper.SetHostZoneConfig(suite.ctx, mockHostZoneConfig)
require.NoError(t, err)
suite.feeabsKeeper.SetTwapRate(suite.ctx, "ibcfee", math.LegacyNewDec(1))
suite.stakingKeeper.EXPECT().BondDenom(gomock.Any()).Return("uhyperia", nil).AnyTimes()
suite.stakingKeeper.EXPECT().BondDenom(gomock.Any()).Return("uhype", nil).AnyTimes()
},
nil,
},
Expand All @@ -66,15 +66,15 @@ func TestMempoolDecorator(t *testing.T) {
err := suite.feeabsKeeper.SetHostZoneConfig(suite.ctx, mockHostZoneConfig)
require.NoError(t, err)
suite.feeabsKeeper.SetTwapRate(suite.ctx, "ibcfee", math.LegacyNewDec(1))
suite.stakingKeeper.EXPECT().BondDenom(gomock.Any()).Return("uhyperia", nil).AnyTimes()
suite.stakingKeeper.EXPECT().BondDenom(gomock.Any()).Return("uhype", nil).AnyTimes()
},
sdkerrors.ErrInsufficientFee,
},
{
"fee in unsupported denom, should fail",
sdk.NewCoins(sdk.NewCoin("unsupported", validFeeAmount.TruncateInt())),
func(suite *AnteTestSuite) {
suite.stakingKeeper.EXPECT().BondDenom(gomock.Any()).Return("uhyperia", nil).AnyTimes()
suite.stakingKeeper.EXPECT().BondDenom(gomock.Any()).Return("uhype", nil).AnyTimes()
},
ErrDenomNotRegistered("unsupported"),
},
Expand Down
2 changes: 1 addition & 1 deletion app/ante/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func SetupTestSuite(t *testing.T, isCheckTx bool) *AnteTestSuite {

// setup feemarket
feemarketParams := feemarkettypes.DefaultParams()
feemarketParams.FeeDenom = "uhyperia"
feemarketParams.FeeDenom = "uhype"
suite.feemarketKeeper = feemarketkeeper.NewKeeper(suite.encCfg.Codec, key, suite.accountKeeper, &DenomResolverImpl{
FeeabsKeeper: suite.feeabsKeeper,
StakingKeeper: suite.stakingKeeper,
Expand Down
33 changes: 26 additions & 7 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"io"
"os"
"path/filepath"
"reflect"
"sort"
"sync"

Expand Down Expand Up @@ -1064,20 +1065,38 @@
}

func (app *HyperiaApp) FinalizeBlock(req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error) {
// when skipping sdk 47 for sdk 50, the upgrade handler is called too late in BaseApp
// this is a hack to ensure that the migration is executed when needed and not panics
app.once.Do(func() {
ctx := app.NewUncachedContext(false, tmproto.Header{})
if _, err := app.ConsensusParamsKeeper.Params(ctx, &consensusparamtypes.QueryParamsRequest{}); err != nil {
// prevents panic: consensus key is nil: collections: not found: key 'no_key' of type github.com/cosmos/gogoproto/tendermint.types.ConsensusParams
// sdk 47:
// Migrate Tendermint consensus parameters from x/params module to a dedicated x/consensus module.
// see https://github.com/cosmos/cosmos-sdk/blob/v0.47.0/simapp/upgrades.go#L66
// when skipping sdk 47 for sdk 50, the upgrade handler is called too late in BaseApp
// this is a hack to ensure that the migration is executed when needed and not panics
// prevents panic: consensus key is nil: collections: not found: key 'no_key' of type github.com/cosmos/gogoproto/tendermint.types.ConsensusParams

// sdk 47:
// Migrate Tendermint consensus parameters from x/params module to a dedicated x/consensus module.
// see https://github.com/cosmos/cosmos-sdk/blob/v0.47.0/simapp/upgrades.go#L66

// Check if ConsensusParamsKeeper is initialized
if reflect.ValueOf(app.ConsensusParamsKeeper).IsZero() {
app.Logger().Error("ConsensusParamsKeeper is not initialized")
return
}

_, err := app.ConsensusParamsKeeper.Params(ctx, &consensusparamtypes.QueryParamsRequest{})
if err != nil {
app.Logger().Info("Attempting to migrate consensus parameters", "error", err)
baseAppLegacySS := app.GetSubspace(baseapp.Paramspace)
if baseAppLegacySS.Name() == "" {
app.Logger().Error("baseAppLegacySS is invalid")
return
}
err := baseapp.MigrateParams(sdk.UnwrapSDKContext(ctx), baseAppLegacySS, app.ConsensusParamsKeeper.ParamsStore)
if err != nil {
panic(err)
app.Logger().Error("Failed to migrate params", "error", err)
// TODO: Consider how to handle this error without panicking

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
elix1er marked this conversation as resolved.
Show resolved Hide resolved
return
}
app.Logger().Info("Successfully migrated consensus parameters")
}
})

Expand Down
28 changes: 15 additions & 13 deletions scripts/run-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ if [ "$CONTINUE" == "true" ]; then
fi

rm -rf mytestnet
pkill -9 eved
pkill -9 hyperiad

# check DENOM is set. If not, set to ueve
DENOM=${2:-ueve}
# check DENOM is set. If not, set to uhype
DENOM=${2:-uhype}

COMMISSION_RATE=0.01
COMMISSION_MAX_RATE=0.02
Expand All @@ -32,13 +32,13 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
fi
fi

# check BINARY is set. If not, build eved and set BINARY
# check BINARY is set. If not, build hyperiad and set BINARY
if [ -z "$BINARY" ]; then
make build
BINARY=build/eved
BINARY=build/hyperiad
fi

CHAIN_ID="evenetwork-1"
CHAIN_ID="local-hype"
KEYRING="test"
KEY="test0"

Expand All @@ -49,24 +49,27 @@ update_test_genesis () {
}

$BINARY init --chain-id $CHAIN_ID moniker --home $HOME_DIR

$BINARY keys add $KEY --keyring-backend $KEYRING --home $HOME_DIR
# Allocate genesis accounts (cosmos formatted addresses)
$BINARY genesis add-genesis-account $KEY "1000000000000000${DENOM}" --keyring-backend $KEYRING --home $HOME_DIR

update_test_genesis '.app_state["gov"]["voting_params"]["voting_period"]="600s"'
update_test_genesis '.app_state["mint"]["params"]["mint_denom"]="'$DENOM'"'
update_test_genesis '.app_state["gov"]["voting_params"]["voting_period"]="15s"'
update_test_genesis '.app_state["gov"]["deposit_params"]["min_deposit"]=[{"denom":"'$DENOM'","amount": "1000000"}]'
update_test_genesis '.app_state["gov"]["params"]["min_deposit"]=[{"denom":"'$DENOM'","amount": "1000000"}]'
update_test_genesis '.app_state["gov"]["params"]["expedited_min_deposit"]=[{"denom":"'$DENOM'","amount": "50000000"}]'
# update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_fee"]=[{"denom":"'$DENOM'","amount": "1000000"}]'
update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_fee"]=[]'
update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_gas_consume"]=2000000'
update_test_genesis '.app_state["feemarket"]["params"]["fee_denom"]="'$DENOM'"'
update_test_genesis '.app_state["mint"]["params"]["mint_denom"]="'$DENOM'"'
update_test_genesis '.app_state["crisis"]["constant_fee"]={"denom":"'$DENOM'","amount":"1000"}'
update_test_genesis '.app_state["staking"]["params"]["bond_denom"]="'$DENOM'"'

# enable rest server and swagger
$SED_BINARY -i '0,/enable = false/s//enable = true/' $HOME_DIR/config/app.toml
$SED_BINARY -i 's/swagger = false/swagger = true/' $HOME_DIR/config/app.toml
$SED_BINARY -i -e 's/enabled-unsafe-cors = false/enabled-unsafe-cors = true/g' $HOME_DIR/config/app.toml
$SED_BINARY -i 's/minimum-gas-prices = "0.25ueve"/minimum-gas-prices = "0.0eve"/' $HOME_DIR/config/app.toml


$SED_BINARY -i 's/minimum-gas-prices = "0.25uhype"/minimum-gas-prices = "0.0uhype"/' $HOME_DIR/config/app.toml
# Sign genesis transaction
$BINARY genesis gentx $KEY "1000000${DENOM}" --commission-rate=$COMMISSION_RATE --commission-max-rate=$COMMISSION_MAX_RATE --keyring-backend $KEYRING --chain-id $CHAIN_ID --home $HOME_DIR

Expand All @@ -76,4 +79,3 @@ $BINARY genesis collect-gentxs --home $HOME_DIR
# Run this to ensure everything worked and that the genesis file is setup correctly
$BINARY genesis validate-genesis --home $HOME_DIR
$BINARY start --home $HOME_DIR

22 changes: 11 additions & 11 deletions scripts/tests/alliance/delegate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
echo "#################################################"
echo ""

BINARY=eved
BINARY=hyperiad
CHAIN_DIR=$(pwd)/data

AMOUNT_TO_DELEGATE=10000000000
UWHALE_DENOM=uwhale
UHYPE_DENOM=uhype
VAL_WALLET_1=$($BINARY keys show val1 -a --keyring-backend test --home $CHAIN_DIR/test-1)
VAL_WALLET_2=$($BINARY keys show val2 -a --keyring-backend test --home $CHAIN_DIR/test-2)

echo "Sending tokens from validator wallet on test-1 to validator wallet on test-2"
IBC_TRANSFER=$($BINARY tx ibc-transfer transfer transfer channel-0 $VAL_WALLET_2 $AMOUNT_TO_DELEGATE$UWHALE_DENOM --chain-id test-1 --from $VAL_WALLET_1 --home $CHAIN_DIR/test-1 --fees 60000$UWHALE_DENOM --node tcp://localhost:16657 --keyring-backend test -y -o json | jq -r '.raw_log' )
IBC_TRANSFER=$($BINARY tx ibc-transfer transfer transfer channel-0 $VAL_WALLET_2 $AMOUNT_TO_DELEGATE$UHYPE_DENOM --chain-id test-1 --from $VAL_WALLET_1 --home $CHAIN_DIR/test-1 --fees 60000$UHYPE_DENOM --node tcp://localhost:16657 --keyring-backend test -y -o json | jq -r '.raw_log' )

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note test

Do not leave debug code in production

if [[ "$IBC_TRANSFER" == "failed to execute message"* ]]; then
echo "Error: IBC transfer failed, with error: $IBC_TRANSFER"
Expand All @@ -29,7 +29,7 @@
IBC_QUERY=$($BINARY q bank balances $VAL_WALLET_2 --chain-id test-2 --node tcp://localhost:26657 -o json)

echo $IBC_QUERY
if [ "$IBC_DENOM" != "$UWHALE_DENOM" ]; then
if [ "$IBC_DENOM" != "$UHYPE_DENOM" ]; then
ACCOUNT_BALANCE=$($BINARY q bank balances $VAL_WALLET_2 --chain-id test-2 --node tcp://localhost:26657 -o json | jq -r '.balances[0].amount')
fi
sleep 2
Expand All @@ -53,22 +53,22 @@
}
],
"metadata": "",
"deposit": "25000000000'$UWHALE_DENOM'",
"deposit": "25000000000'$UHYPE_DENOM'",
"title": "Create an Alliance!",
"summary": "Source Code Version https://github.com/terra-money/core"
}' > $CHAIN_DIR/create-alliance.json


echo "Creating an alliance with the denom $IBC_DENOM"

PROPOSAL_HEIGHT=$($BINARY tx gov submit-proposal $CHAIN_DIR/create-alliance.json --from=$VAL_WALLET_2 --home $CHAIN_DIR/test-2 --node tcp://localhost:26657 -o json --keyring-backend test --fees 600000$UWHALE_DENOM --gas 500000 -y -o json | jq -r '.height')
PROPOSAL_HEIGHT=$($BINARY tx gov submit-proposal $CHAIN_DIR/create-alliance.json --from=$VAL_WALLET_2 --home $CHAIN_DIR/test-2 --node tcp://localhost:26657 -o json --keyring-backend test --fees 600000$UHYPE_DENOM --gas 500000 -y -o json | jq -r '.height')

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note test

Do not leave debug code in production
sleep 3


PROPOSAL_ID=$($BINARY query gov proposals --home $CHAIN_DIR/test-2 --count-total --node tcp://localhost:26657 -o json --output json --chain-id=test-2 | jq .proposals[-1].id -r)


VOTE_RES=$($BINARY tx gov vote $PROPOSAL_ID yes --from=$VAL_WALLET_2 --home $CHAIN_DIR/test-2 --keyring-backend=test --fees 60000$UWHALE_DENOM --chain-id=test-2 --node tcp://localhost:26657 -o json -y)
VOTE_RES=$($BINARY tx gov vote $PROPOSAL_ID yes --from=$VAL_WALLET_2 --home $CHAIN_DIR/test-2 --keyring-backend=test --fees 60000$UHYPE_DENOM --chain-id=test-2 --node tcp://localhost:26657 -o json -y)

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note test

Do not leave debug code in production
echo "Vote res: $VOTE_RES"

ALLIANCE="null"
Expand All @@ -83,7 +83,7 @@

echo "Delegating $AMOUNT_TO_DELEGATE to the alliance $IBC_DENOM"
VAL_ADDR=$($BINARY query staking validators --output json | jq .validators[0].operator_address --raw-output)
DELEGATE_RES=$($BINARY tx alliance delegate $VAL_ADDR $AMOUNT_TO_DELEGATE$IBC_DENOM --from=node0 --from=$VAL_WALLET_2 --home $CHAIN_DIR/test-2 --keyring-backend=test --fees 600000$UWHALE_DENOM --gas 500000 --chain-id=test-2 -o json -y)
DELEGATE_RES=$($BINARY tx alliance delegate $VAL_ADDR $AMOUNT_TO_DELEGATE$IBC_DENOM --from=node0 --from=$VAL_WALLET_2 --home $CHAIN_DIR/test-2 --keyring-backend=test --fees 600000$UHYPE_DENOM --gas 500000 --chain-id=test-2 -o json -y)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unused variable.

The DELEGATE_RES variable is declared but not used in the script. Consider removing it to avoid confusion.

- DELEGATE_RES=$($BINARY tx alliance delegate $VAL_ADDR $AMOUNT_TO_DELEGATE$IBC_DENOM --from=node0 --from=$VAL_WALLET_2 --home $CHAIN_DIR/test-2 --keyring-backend=test  --fees 600000$UHYPE_DENOM --gas 500000 --chain-id=test-2 -o json -y)
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
DELEGATE_RES=$($BINARY tx alliance delegate $VAL_ADDR $AMOUNT_TO_DELEGATE$IBC_DENOM --from=node0 --from=$VAL_WALLET_2 --home $CHAIN_DIR/test-2 --keyring-backend=test --fees 600000$UHYPE_DENOM --gas 500000 --chain-id=test-2 -o json -y)
Tools
Shellcheck

[warning] 86-86: DELEGATE_RES appears unused. Verify use (or export if used externally).

(SC2034)

sleep 3
DELEGATIONS=$($BINARY query alliance delegation $VAL_WALLET_2 $VAL_ADDR $IBC_DENOM --chain-id test-2 --node tcp://localhost:26657 -o json | jq -r '.delegation.balance.amount')
if [[ "$DELEGATIONS" == "0" ]]; then
Expand All @@ -92,13 +92,13 @@
fi

echo "Query bank balance after alliance creation"
TOTAL_SUPPLY_BEFORE_ALLIANCE=$($BINARY query bank total --denom $UWHALE_DENOM --height $PROPOSAL_HEIGHT -o json | jq -r '.amount')
TOTAL_SUPPLY_AFTER_ALLIANCE=$($BINARY query bank total --denom $UWHALE_DENOM -o json | jq -r '.amount')
TOTAL_SUPPLY_BEFORE_ALLIANCE=$($BINARY query bank total --denom $UHYPE_DENOM --height $PROPOSAL_HEIGHT -o json | jq -r '.amount')
TOTAL_SUPPLY_AFTER_ALLIANCE=$($BINARY query bank total --denom $UHYPE_DENOM -o json | jq -r '.amount')
TOTAL_SUPPLY_INCREMENT=$(($TOTAL_SUPPLY_BEFORE_ALLIANCE - $TOTAL_SUPPLY_AFTER_ALLIANCE))


if [ "$TOTAL_SUPPLY_INCREMENT" -gt 100000 ] && [ "$TOTAL_SUPPLY_INCREMENT" -lt 1000000 ]; then
echo "Error: Something went wrong, total supply of $UWHALE_DENOM has increased out of range 100_000 between 1_000_000. current value $TOTAL_SUPPLY_INCREMENT"
echo "Error: Something went wrong, total supply of $UHYPE_DENOM has increased out of range 100_000 between 1_000_000. current value $TOTAL_SUPPLY_INCREMENT"
exit 1
fi

Expand Down
27 changes: 18 additions & 9 deletions scripts/tests/init-test-framework.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash

BINARY=eved
BINARY=./build/hyperiad
CHAIN_DIR=$(pwd)/data
CHAINID_1=test-1
CHAINID_2=test-2
CHAINID_1=hype-1
CHAINID_2=hype-2

### Custom genesis files
DENOM=uwhale
DENOM=uhype
GENESIS_1=$CHAIN_DIR/$CHAINID_1/config/genesis.json
TMP_GENESIS_1=$CHAIN_DIR/$CHAINID_1/config/genesis.json.tmp

Expand Down Expand Up @@ -38,7 +38,7 @@ GRPCWEB_2=9091
# Stop if it is already running
if pgrep -x "$BINARY" >/dev/null; then
echo "Terminating $BINARY..."
killall $BINARY
killall -9 $BINARY
fi

echo "Removing previous data..."
Expand Down Expand Up @@ -78,7 +78,6 @@ WALLET3_ADDR=$($BINARY keys show wallet3 --home $CHAIN_DIR/$CHAINID_1 --keyring-
WALLET4_ADDR=$($BINARY keys show wallet4 --home $CHAIN_DIR/$CHAINID_2 --keyring-backend test -a)
RLY1_ADDR=$($BINARY keys show rly1 --home $CHAIN_DIR/$CHAINID_1 --keyring-backend test -a)
RLY2_ADDR=$($BINARY keys show rly2 --home $CHAIN_DIR/$CHAINID_2 --keyring-backend test -a)

$BINARY genesis add-genesis-account $VAL1_ADDR "1000000000000${DENOM}" --home $CHAIN_DIR/$CHAINID_1
$BINARY genesis add-genesis-account $VAL2_ADDR "1000000000000${DENOM}" --home $CHAIN_DIR/$CHAINID_2
$BINARY genesis add-genesis-account $WALLET1_ADDR "1000000000000${DENOM}" --home $CHAIN_DIR/$CHAINID_1
Expand All @@ -89,8 +88,8 @@ $BINARY genesis add-genesis-account $RLY1_ADDR "1000000000000${DENOM}" --home $C
$BINARY genesis add-genesis-account $RLY2_ADDR "1000000000000${DENOM}" --home $CHAIN_DIR/$CHAINID_2

echo "Creating and collecting gentx..."
$BINARY genesis gentx val1 7000000000uwhale --home $CHAIN_DIR/$CHAINID_1 --chain-id $CHAINID_1 --keyring-backend test
$BINARY genesis gentx val2 7000000000uwhale --home $CHAIN_DIR/$CHAINID_2 --chain-id $CHAINID_2 --keyring-backend test
$BINARY genesis gentx val1 7000000000uhype --home $CHAIN_DIR/$CHAINID_1 --chain-id $CHAINID_1 --keyring-backend test
$BINARY genesis gentx val2 7000000000uhype --home $CHAIN_DIR/$CHAINID_2 --chain-id $CHAINID_2 --keyring-backend test
$BINARY genesis collect-gentxs --home $CHAIN_DIR/$CHAINID_1 &> /dev/null
$BINARY genesis collect-gentxs --home $CHAIN_DIR/$CHAINID_2 &> /dev/null

Expand Down Expand Up @@ -142,7 +141,17 @@ update_test_genesis ".app_state[\"gov\"][\"params\"][\"min_deposit\"][0][\"denom
update_test_genesis ".app_state[\"tokenfactory\"][\"params\"][\"denom_creation_fee\"][0][\"denom\"]=\"$DENOM\""
update_test_genesis ".app_state[\"feeburn\"][\"params\"][\"tx_fee_burn_percent\"]=\"50\""


update_test_genesis '.app_state["gov"]["voting_params"]["voting_period"]="15s"'
update_test_genesis '.app_state["gov"]["deposit_params"]["min_deposit"]=[{"denom":"'$DENOM'","amount": "1000000"}]'
update_test_genesis '.app_state["gov"]["params"]["min_deposit"]=[{"denom":"'$DENOM'","amount": "1000000"}]'
update_test_genesis '.app_state["gov"]["params"]["expedited_min_deposit"]=[{"denom":"'$DENOM'","amount": "50000000"}]'
# update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_fee"]=[{"denom":"'$DENOM'","amount": "1000000"}]'
update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_fee"]=[]'
update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_gas_consume"]=2000000'
update_test_genesis '.app_state["feemarket"]["params"]["fee_denom"]="'$DENOM'"'
update_test_genesis '.app_state["mint"]["params"]["mint_denom"]="'$DENOM'"'
update_test_genesis '.app_state["crisis"]["constant_fee"]={"denom":"'$DENOM'","amount":"1000"}'
update_test_genesis '.app_state["staking"]["params"]["bond_denom"]="'$DENOM'"'
# Starting the chain
echo "Starting $CHAINID_1 in $CHAIN_DIR..."
echo "Creating log file at $CHAIN_DIR/$CHAINID_1.log"
Expand Down
2 changes: 1 addition & 1 deletion scripts/wasm/get_contract.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

VERSION="v0.16.0"
VERSION="v2.0.0"
CONTRACTS="cw20_base"

for CONTRACT in $CONTRACTS; do
Expand Down
8 changes: 4 additions & 4 deletions scripts/wasm/gov_upload_code.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash
BINARY=build/eved
BINARY=build/hyperiad

CHAIN_ID=local-eve
CHAIN_ID=local-hype
VAL_KEY=test0
VOTER=
VAL=$($BINARY keys show -a $VAL_KEY --keyring-backend test)
CONTRACT=cw20_base
PROPOSAL=1
DENOM=${2:-"ueve"}
DENOM=${2:-"uhype"}
HOME=mytestnet

echo "submit wasm store proposal..."
Expand All @@ -17,7 +17,7 @@ if ! $BINARY tx wasm submit-proposal wasm-store scripts/wasm/$CONTRACT.wasm --ti
fi


echo "deposit ueve to proposal..."
echo "deposit uhype to proposal..."
sleep 5
# $BINARY query gov proposal $PROPOSAL
$BINARY tx gov deposit $PROPOSAL "40000000000000000000$DENOM" --from $VAL_KEY --keyring-backend test \
Expand Down
Loading
Loading