Skip to content

Commit

Permalink
fix: linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JeancarloBarrios committed Jul 30, 2024
1 parent fc0cdc2 commit 05e755e
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,8 @@ func (app *RegenApp) TxConfig() client.TxConfig {
}

// DefaultGenesis returns a default genesis from the registered AppModuleBasic's.
func (a *RegenApp) DefaultGenesis() map[string]json.RawMessage {
return ModuleBasics.DefaultGenesis(a.appCodec)
func (app *RegenApp) DefaultGenesis() map[string]json.RawMessage {
return ModuleBasics.DefaultGenesis(app.appCodec)
}

// GetKey returns the KVStoreKey for the provided store key.
Expand Down
4 changes: 2 additions & 2 deletions app/client/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ func addModuleInitFlags(startCmd *cobra.Command) {
func genesisCommand(encodingConfig testutil.TestEncodingConfig, cmds ...*cobra.Command) *cobra.Command {
cmd := genutilcli.GenesisCoreCommand(encodingConfig.TxConfig, app.ModuleBasics, app.DefaultNodeHome)

for _, sub_cmd := range cmds {
cmd.AddCommand(sub_cmd)
for _, subCmd := range cmds {
cmd.AddCommand(subCmd)
}
return cmd
}
Expand Down
2 changes: 1 addition & 1 deletion app/testsuite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (

"github.com/stretchr/testify/suite"

tmtypes "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/baseapp"
sdk "github.com/cosmos/cosmos-sdk/types"
tmtypes "github.com/cometbft/cometbft/proto/tendermint/types"

"github.com/regen-network/regen-ledger/v5/app"
)
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v5_0/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"

upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
abci "github.com/cometbft/cometbft/abci/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/regen-network/regen-ledger/v5/app/testsuite"
"github.com/regen-network/regen-ledger/x/ecocredit/v3"
Expand Down
2 changes: 1 addition & 1 deletion x/ecocredit/base/keeper/msg_create_class.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (k Keeper) CreateClass(goCtx context.Context, req *types.MsgCreateClass) (*

// only check and charge fee if required fee is set
if classFee.Fee != nil {
requiredFee := regentypes.CoinFromCosmosApiLegacy(classFee.Fee)
requiredFee := regentypes.CoinFromCosmosAPILegacy(classFee.Fee)

Check failure on line 40 in x/ecocredit/base/keeper/msg_create_class.go

View workflow job for this annotation

GitHub Actions / unit (app)

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 40 in x/ecocredit/base/keeper/msg_create_class.go

View workflow job for this annotation

GitHub Actions / determinism

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 40 in x/ecocredit/base/keeper/msg_create_class.go

View workflow job for this annotation

GitHub Actions / after-import

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 40 in x/ecocredit/base/keeper/msg_create_class.go

View workflow job for this annotation

GitHub Actions / import-export

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 40 in x/ecocredit/base/keeper/msg_create_class.go

View workflow job for this annotation

GitHub Actions / integration

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 40 in x/ecocredit/base/keeper/msg_create_class.go

View workflow job for this annotation

GitHub Actions / app

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 40 in x/ecocredit/base/keeper/msg_create_class.go

View workflow job for this annotation

GitHub Actions / build

undefined: regentypes.CoinFromCosmosAPILegacy

if req.Fee == nil {
return nil, sdkerrors.ErrInsufficientFee.Wrapf(
Expand Down
2 changes: 1 addition & 1 deletion x/ecocredit/base/keeper/msg_update_class_fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (k Keeper) UpdateClassFee(ctx context.Context, req *types.MsgUpdateClassFee

var classFee *sdkbase.Coin
if req.Fee != nil && req.Fee.IsPositive() {
classFee = regentypes.CoinToCosmosApiLegacy(*req.Fee)
classFee = regentypes.CoinToCosmosAPILegacy(*req.Fee)

Check failure on line 21 in x/ecocredit/base/keeper/msg_update_class_fee.go

View workflow job for this annotation

GitHub Actions / unit (app)

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 21 in x/ecocredit/base/keeper/msg_update_class_fee.go

View workflow job for this annotation

GitHub Actions / determinism

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 21 in x/ecocredit/base/keeper/msg_update_class_fee.go

View workflow job for this annotation

GitHub Actions / after-import

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 21 in x/ecocredit/base/keeper/msg_update_class_fee.go

View workflow job for this annotation

GitHub Actions / import-export

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 21 in x/ecocredit/base/keeper/msg_update_class_fee.go

View workflow job for this annotation

GitHub Actions / integration

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 21 in x/ecocredit/base/keeper/msg_update_class_fee.go

View workflow job for this annotation

GitHub Actions / app

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 21 in x/ecocredit/base/keeper/msg_update_class_fee.go

View workflow job for this annotation

GitHub Actions / build

undefined: regentypes.CoinToCosmosAPILegacy
}

if err := k.stateStore.ClassFeeTable().Save(ctx, &api.ClassFee{
Expand Down
2 changes: 1 addition & 1 deletion x/ecocredit/base/keeper/query_class_fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (k Keeper) ClassFee(ctx context.Context, _ *types.QueryClassFeeRequest) (*t

var fee sdk.Coin
if classFee.Fee != nil {
fee = regentypes.CoinFromCosmosApiLegacy(classFee.Fee)
fee = regentypes.CoinFromCosmosAPILegacy(classFee.Fee)

Check failure on line 22 in x/ecocredit/base/keeper/query_class_fee.go

View workflow job for this annotation

GitHub Actions / unit (app)

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 22 in x/ecocredit/base/keeper/query_class_fee.go

View workflow job for this annotation

GitHub Actions / determinism

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 22 in x/ecocredit/base/keeper/query_class_fee.go

View workflow job for this annotation

GitHub Actions / after-import

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 22 in x/ecocredit/base/keeper/query_class_fee.go

View workflow job for this annotation

GitHub Actions / import-export

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 22 in x/ecocredit/base/keeper/query_class_fee.go

View workflow job for this annotation

GitHub Actions / integration

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 22 in x/ecocredit/base/keeper/query_class_fee.go

View workflow job for this annotation

GitHub Actions / app

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 22 in x/ecocredit/base/keeper/query_class_fee.go

View workflow job for this annotation

GitHub Actions / build

undefined: regentypes.CoinFromCosmosAPILegacy
}

return &types.QueryClassFeeResponse{Fee: &fee}, nil
Expand Down
4 changes: 2 additions & 2 deletions x/ecocredit/base/keeper/query_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ func (k Keeper) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types
Params: &types.Params{
AllowedClassCreators: creators,
AllowlistEnabled: allowlistEnabled.Enabled,
CreditClassFee: sdk.Coins{regentypes.CoinFromCosmosApiLegacy(classFee.Fee)},
BasketFee: sdk.Coins{regentypes.CoinFromCosmosApiLegacy(basketFee.Fee)},
CreditClassFee: sdk.Coins{regentypes.CoinFromCosmosAPILegacy(classFee.Fee)},

Check failure on line 89 in x/ecocredit/base/keeper/query_params.go

View workflow job for this annotation

GitHub Actions / unit (app)

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 89 in x/ecocredit/base/keeper/query_params.go

View workflow job for this annotation

GitHub Actions / determinism

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 89 in x/ecocredit/base/keeper/query_params.go

View workflow job for this annotation

GitHub Actions / after-import

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 89 in x/ecocredit/base/keeper/query_params.go

View workflow job for this annotation

GitHub Actions / import-export

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 89 in x/ecocredit/base/keeper/query_params.go

View workflow job for this annotation

GitHub Actions / integration

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 89 in x/ecocredit/base/keeper/query_params.go

View workflow job for this annotation

GitHub Actions / app

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 89 in x/ecocredit/base/keeper/query_params.go

View workflow job for this annotation

GitHub Actions / build

undefined: regentypes.CoinFromCosmosAPILegacy
BasketFee: sdk.Coins{regentypes.CoinFromCosmosAPILegacy(basketFee.Fee)},

Check failure on line 90 in x/ecocredit/base/keeper/query_params.go

View workflow job for this annotation

GitHub Actions / unit (app)

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 90 in x/ecocredit/base/keeper/query_params.go

View workflow job for this annotation

GitHub Actions / determinism

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 90 in x/ecocredit/base/keeper/query_params.go

View workflow job for this annotation

GitHub Actions / after-import

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 90 in x/ecocredit/base/keeper/query_params.go

View workflow job for this annotation

GitHub Actions / import-export

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 90 in x/ecocredit/base/keeper/query_params.go

View workflow job for this annotation

GitHub Actions / integration

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 90 in x/ecocredit/base/keeper/query_params.go

View workflow job for this annotation

GitHub Actions / app

undefined: regentypes.CoinFromCosmosAPILegacy

Check failure on line 90 in x/ecocredit/base/keeper/query_params.go

View workflow job for this annotation

GitHub Actions / build

undefined: regentypes.CoinFromCosmosAPILegacy
AllowedDenoms: allowedDenoms,
AllowedBridgeChains: allowedBridgeChains,
},
Expand Down
2 changes: 1 addition & 1 deletion x/ecocredit/basket/keeper/msg_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (k Keeper) Create(ctx context.Context, msg *types.MsgCreate) (*types.MsgCre
// only check and charge fee if required fee is set
if basketFee.Fee != nil {

requiredFee := regentypes.CoinFromCosmosApiLegacy(basketFee.Fee)
requiredFee := regentypes.CoinFromCosmosAPILegacy(basketFee.Fee)
if msg.Fee == nil {
return nil, sdkerrors.ErrInsufficientFee.Wrapf(
"fee cannot be empty: must be %s", requiredFee,
Expand Down
2 changes: 1 addition & 1 deletion x/ecocredit/basket/keeper/msg_update_basket_fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (k Keeper) UpdateBasketFee(ctx context.Context, req *types.MsgUpdateBasketF

var basketFee *sdkbase.Coin
if req.Fee != nil && req.Fee.IsPositive() {
basketFee = regentypes.CoinToCosmosApiLegacy(*req.Fee)
basketFee = regentypes.CoinToCosmosAPILegacy(*req.Fee)
}

if err := k.stateStore.BasketFeeTable().Save(ctx, &api.BasketFee{
Expand Down
2 changes: 1 addition & 1 deletion x/ecocredit/basket/keeper/query_fees.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (k Keeper) BasketFee(ctx context.Context, _ *types.QueryBasketFeeRequest) (

var fee sdk.Coin
if basketFee.Fee != nil {
fee = regentypes.CoinFromCosmosApiLegacy(basketFee.Fee)
fee = regentypes.CoinFromCosmosAPILegacy(basketFee.Fee)
}

return &types.QueryBasketFeeResponse{Fee: &fee}, nil
Expand Down
4 changes: 2 additions & 2 deletions x/ecocredit/migrations/v3/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func MigrateState(sdkCtx sdk.Context, baseStore baseapi.StateStore, basketStore
}

// we assume there is one fee at the time of the upgrade
classFees := regentypes.CoinToCosmosApiLegacy(params.CreditClassFee[0])
classFees := regentypes.CoinToCosmosAPILegacy(params.CreditClassFee[0])

Check failure on line 24 in x/ecocredit/migrations/v3/state.go

View workflow job for this annotation

GitHub Actions / unit (app)

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 24 in x/ecocredit/migrations/v3/state.go

View workflow job for this annotation

GitHub Actions / determinism

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 24 in x/ecocredit/migrations/v3/state.go

View workflow job for this annotation

GitHub Actions / after-import

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 24 in x/ecocredit/migrations/v3/state.go

View workflow job for this annotation

GitHub Actions / import-export

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 24 in x/ecocredit/migrations/v3/state.go

View workflow job for this annotation

GitHub Actions / integration

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 24 in x/ecocredit/migrations/v3/state.go

View workflow job for this annotation

GitHub Actions / app

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 24 in x/ecocredit/migrations/v3/state.go

View workflow job for this annotation

GitHub Actions / build

undefined: regentypes.CoinToCosmosAPILegacy
if err := baseStore.ClassFeeTable().Save(sdkCtx, &baseapi.ClassFee{
Fee: classFees,
}); err != nil {
Expand Down Expand Up @@ -55,7 +55,7 @@ func MigrateState(sdkCtx sdk.Context, baseStore baseapi.StateStore, basketStore

// migrate basket params
// we assume there is one fee at the time of the upgrade
basketFees := regentypes.CoinToCosmosApiLegacy(params.BasketFee[0])
basketFees := regentypes.CoinToCosmosAPILegacy(params.BasketFee[0])

Check failure on line 58 in x/ecocredit/migrations/v3/state.go

View workflow job for this annotation

GitHub Actions / unit (app)

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 58 in x/ecocredit/migrations/v3/state.go

View workflow job for this annotation

GitHub Actions / determinism

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 58 in x/ecocredit/migrations/v3/state.go

View workflow job for this annotation

GitHub Actions / after-import

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 58 in x/ecocredit/migrations/v3/state.go

View workflow job for this annotation

GitHub Actions / import-export

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 58 in x/ecocredit/migrations/v3/state.go

View workflow job for this annotation

GitHub Actions / integration

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 58 in x/ecocredit/migrations/v3/state.go

View workflow job for this annotation

GitHub Actions / app

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 58 in x/ecocredit/migrations/v3/state.go

View workflow job for this annotation

GitHub Actions / build

undefined: regentypes.CoinToCosmosAPILegacy
if err := basketStore.BasketFeeTable().Save(sdkCtx, &basketapi.BasketFee{
Fee: basketFees,
}); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion x/ecocredit/server/testsuite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (s *IntegrationTestSuite) ecocreditGenesis() json.RawMessage {
s.Require().NoError(err)

err = bs.BasketFeeTable().Save(ormCtx, &basketApi.BasketFee{
Fee: regentypes.CoinToCosmosApiLegacy(s.basketFee),
Fee: regentypes.CoinToCosmosAPILegacy(s.basketFee),
})
s.Require().NoError(err)

Expand Down
2 changes: 1 addition & 1 deletion x/ecocredit/simulation/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func genGenesisState(ctx context.Context, simState *module.SimulationState, ss a

classFee := genCreditClassFee(r)
if err := ss.ClassFeeTable().Save(ctx, &api.ClassFee{
Fee: regentypes.CoinToCosmosApiLegacy(classFee),
Fee: regentypes.CoinToCosmosAPILegacy(classFee),

Check failure on line 225 in x/ecocredit/simulation/genesis.go

View workflow job for this annotation

GitHub Actions / unit (app)

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 225 in x/ecocredit/simulation/genesis.go

View workflow job for this annotation

GitHub Actions / determinism

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 225 in x/ecocredit/simulation/genesis.go

View workflow job for this annotation

GitHub Actions / after-import

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 225 in x/ecocredit/simulation/genesis.go

View workflow job for this annotation

GitHub Actions / import-export

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 225 in x/ecocredit/simulation/genesis.go

View workflow job for this annotation

GitHub Actions / integration

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 225 in x/ecocredit/simulation/genesis.go

View workflow job for this annotation

GitHub Actions / app

undefined: regentypes.CoinToCosmosAPILegacy

Check failure on line 225 in x/ecocredit/simulation/genesis.go

View workflow job for this annotation

GitHub Actions / build

undefined: regentypes.CoinToCosmosAPILegacy
}); err != nil {
return err
}
Expand Down

0 comments on commit 05e755e

Please sign in to comment.