Skip to content

Commit

Permalink
Merge pull request #172 from decentrio/local-net
Browse files Browse the repository at this point in the history
fix: Local node
  • Loading branch information
facs95 authored Jul 17, 2024
2 parents e25ee5c + ec6a737 commit ba80c0e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions cmd/realio-networkd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ import (

cmdcfg "github.com/realiotech/realio-network/cmd/config"
"github.com/realiotech/realio-network/testutil/network"

multistakingtypes "github.com/realio-tech/multi-staking-module/x/multi-staking/types"
)

var (
Expand Down Expand Up @@ -400,11 +402,16 @@ func initGenFiles(
bankGenState.Balances = genBalances
appGenState[banktypes.ModuleName] = clientCtx.Codec.MustMarshalJSON(&bankGenState)

var stakingGenState stakingtypes.GenesisState
clientCtx.Codec.MustUnmarshalJSON(appGenState[stakingtypes.ModuleName], &stakingGenState)
var multiStakingGenState multistakingtypes.GenesisState
clientCtx.Codec.MustUnmarshalJSON(appGenState[multistakingtypes.ModuleName], &multiStakingGenState)

stakingGenState.Params.BondDenom = coinDenom
appGenState[stakingtypes.ModuleName] = clientCtx.Codec.MustMarshalJSON(&stakingGenState)
multiStakingGenState.MultiStakingCoinInfo = []multistakingtypes.MultiStakingCoinInfo{
{
Denom: "ario",
BondWeight: sdk.OneDec(),
},
}
appGenState[multistakingtypes.ModuleName] = clientCtx.Codec.MustMarshalJSON(&multiStakingGenState)

mintGenState := *minttypes.DefaultGenesisState()
clientCtx.Codec.MustUnmarshalJSON(appGenState[minttypes.ModuleName], &mintGenState)
Expand Down
2 changes: 1 addition & 1 deletion local_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if [[ $overwrite == "y" || $overwrite == "Y" ]]; then
realio-networkd init $MONIKER -o --chain-id $CHAINID --home "$HOMEDIR"

# Change parameter token denominations to ario
jq '.app_state["staking"]["params"]["bond_denom"]="ario,arst"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS"
jq '.app_state["multistaking"]["multi_staking_coin_info"]=[{"denom": "ario", "bond_weight": "1.000000000000000000"}, {"denom": "arst", "bond_weight": "1.000000000000000000"}]' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS"
jq '.app_state["mint"]["params"]["mint_denom"]="ario"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS"
jq '.app_state["crisis"]["constant_fee"]["denom"]="ario"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS"
jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="ario"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS"
Expand Down

0 comments on commit ba80c0e

Please sign in to comment.