Skip to content

Commit

Permalink
fixed parsing rollappID parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsitrin committed Jun 28, 2023
1 parent e22c252 commit b6b2032
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const (
flagSLGasLimit = "dymint.settlement_config.gas_limit"
flagSLGasPrices = "dymint.settlement_config.gas_prices"
flagSLGasFees = "dymint.settlement_config.gas_fees"
flagRollappID = "dymint.settlement_config.rollapp_id"
)

// NodeConfig stores Dymint node configuration.
Expand Down Expand Up @@ -132,6 +133,7 @@ func AddNodeFlags(cmd *cobra.Command) {
cmd.Flags().String(flagSLGasFees, def.SettlementConfig.GasFees, "Settlement Layer gas fees")
cmd.Flags().String(flagSLGasPrices, def.SettlementConfig.GasPrices, "Settlement Layer gas prices")
cmd.Flags().Uint64(flagSLGasLimit, def.SettlementConfig.GasLimit, "Settlement Layer batch submit gas limit")
cmd.Flags().String(flagRollappID, def.SettlementConfig.RollappID, "The chainID of the rollapp")
}

func BindDymintFlags(cmd *cobra.Command, v *viper.Viper) error {
Expand Down Expand Up @@ -186,6 +188,9 @@ func BindDymintFlags(cmd *cobra.Command, v *viper.Viper) error {
if err := v.BindPFlag("gas_limit", cmd.Flags().Lookup(flagSLGasLimit)); err != nil {
return err
}
if err := v.BindPFlag("rollapp_id", cmd.Flags().Lookup(flagRollappID)); err != nil {
return err
}

return nil
}
3 changes: 2 additions & 1 deletion settlement/dymension/dymension.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strconv"
"time"

"cosmossdk.io/errors"
"github.com/avast/retry-go"
"github.com/cosmos/cosmos-sdk/codec"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand Down Expand Up @@ -287,7 +288,7 @@ func (d *HubClient) GetBatchAtIndex(rollappID string, index uint64) (*settlement
func (d *HubClient) GetSequencers(rollappID string) ([]*types.Sequencer, error) {
sequencers, err := d.sequencerQueryClient.SequencersByRollapp(d.ctx, &sequencertypes.QueryGetSequencersByRollappRequest{RollappId: d.config.RollappID})
if err != nil {
return nil, settlement.ErrNoSequencerForRollapp
return nil, errors.Wrapf(settlement.ErrNoSequencerForRollapp, "rollappID: %s", rollappID)
}
sequencersList := []*types.Sequencer{}
for _, sequencer := range sequencers.SequencerInfoList {
Expand Down

0 comments on commit b6b2032

Please sign in to comment.