Skip to content

Commit

Permalink
fix: nolusd successfully starting without hermes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lockwarr committed Dec 22, 2023
1 parent 5c06064 commit dcc294c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/images/builder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN set -eux; apk add --no-cache ca-certificates build-base;

RUN apk add git

ARG WASMVM_VERSION="v1.2.3"
ARG WASMVM_VERSION="v1.3.0"
ARG WASMVM_LIB="libwasmvm_muslc.x86_64.a"
ARG WASMVM_BASE_URL="https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION"
ARG WASMVM_URL="$WASMVM_BASE_URL/$WASMVM_LIB"
Expand Down
2 changes: 1 addition & 1 deletion app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var maccPerms = map[string][]string{
// non-dependant module elements, such as codec registration
// and genesis verification.
var ModuleBasics = module.NewBasicManager(
genutil.AppModuleBasic{},
genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator),
auth.AppModuleBasic{},
bank.AppModuleBasic{},
capability.AppModuleBasic{},
Expand Down
19 changes: 19 additions & 0 deletions cmd/nolusd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
tmcfg "github.com/cometbft/cometbft/config"
tmcli "github.com/cometbft/cometbft/libs/cli"
"github.com/cometbft/cometbft/libs/log"
tmtypes "github.com/cometbft/cometbft/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/config"
Expand Down Expand Up @@ -351,6 +352,23 @@ func (a appCreator) newApp(
panic(err)
}

homePath, ok := appOpts.Get(flags.FlagHome).(string)
if !ok || homePath == "" {
logger.Error("application home not set, using DefaultNodeHome")
homePath = app.DefaultNodeHome
}

chainID := cast.ToString(appOpts.Get(flags.FlagChainID))
if chainID == "" {
// fallback to genesis chain-id
appGenesis, err := tmtypes.GenesisDocFromFile(filepath.Join(homePath, "config", "genesis.json"))
if err != nil {
panic(err)
}

chainID = appGenesis.ChainID
}

return app.New(
logger,
db,
Expand All @@ -373,6 +391,7 @@ func (a appCreator) newApp(
Interval: cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval)),
KeepRecent: cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent)),
}),
baseapp.SetChainID(chainID),
)
}

Expand Down
1 change: 1 addition & 0 deletions scripts/internal/genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ __set_token_denominations() {
| jq '.app_state["crisis"]["constant_fee"]["denom"]="'"$currency"'"' \
| jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="'"$currency"'"' \
| jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="'"$currency"'"' \
| jq '.app_state["gov"]["params"]["min_deposit"][0]["denom"]="'"$currency"'"' \
| jq '.app_state["tax"]["params"]["base_denom"]="'"$currency"'"' \
| jq '.app_state["mint"]["params"]["mint_denom"]="'"$currency"'"' > "$genesis_tmp_file"
mv "$genesis_tmp_file" "$genesis_file"
Expand Down
5 changes: 4 additions & 1 deletion wasmbinding/query_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@ type QueryPlugin struct {

// NewQueryPlugin returns a reference to a new QueryPlugin.
func NewQueryPlugin(icaControllerKeeper *icacontrollerkeeper.Keeper, icqKeeper *icqkeeper.Keeper, feeRefunderKeeper *feerefunderkeeper.Keeper) *QueryPlugin {
return &QueryPlugin{icaControllerKeeper: icaControllerKeeper, icqKeeper: icqKeeper, feeRefunderKeeper: feeRefunderKeeper}
return &QueryPlugin{
icaControllerKeeper: icaControllerKeeper,
icqKeeper: icqKeeper,
feeRefunderKeeper: feeRefunderKeeper}
}

0 comments on commit dcc294c

Please sign in to comment.