Skip to content

Commit

Permalink
chore: fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Lockwarr committed Nov 11, 2024
1 parent c0fefbc commit 9f0f46d
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nolus-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.55.2
version: v1.61.0
# Optional: if set to true, then all caching functionality will be completely disabled,
# takes precedence over all other caching options.
skip-cache: true
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ go.sum: go.mod
.PHONY: lint

lint:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
golangci-lint run --verbose

###############################################################################
Expand Down
23 changes: 0 additions & 23 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (
"net/http"
"os"
"path/filepath"
"reflect"
"strings"

"github.com/spf13/cast"

Expand Down Expand Up @@ -60,7 +58,6 @@ import (

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
interchaintxstypes "github.com/Nolus-Protocol/nolus-core/x/interchaintxs/types"
)

const (
Expand Down Expand Up @@ -292,33 +289,13 @@ func New(
}
}

// for local instances - set storage param for the interchain txs module - IcaRegistrationFeeFirstCodeID
app.SetInterchainTxsLocalChain()

return app
}

func (app *App) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) {
return app.mm.PreBlock(ctx)
}

func (app *App) SetInterchainTxsLocalChain() {
// ChainID gets chainID from private fields of BaseApp
chainID := reflect.ValueOf(app.BaseApp).Elem().FieldByName("chainID").String()

// If chain is not at block 0 or it's not a local chain, we don't set the storage param
if app.LastBlockHeight() != 0 || !strings.Contains(chainID, "local") {
return
}
store := app.CommitMultiStore()
storeInterchaintxs := store.GetKVStore(app.AppKeepers.GetKey(interchaintxstypes.StoreKey))
// set an extremely high number for the first code id that will be taxed with fee for opening an ICA
// these bytes are equal to 1684300900 when parsed with sdk.BigEndianToUint64. It's a number that is unlikely to be reached as a code id
// if we decide to charge a fee for opening an ICA, we can set this to a lower number in the future
bytesIcaRegistrationFirstCode := []byte{0, 0, 0, 0, 100, 100, 100, 100}
storeInterchaintxs.Set(interchaintxstypes.ICARegistrationFeeFirstCodeID, bytesIcaRegistrationFirstCode)
}

func (app *App) setupUpgradeHandlers() {
for _, upgrade := range Upgrades {
app.UpgradeKeeper.SetUpgradeHandler(
Expand Down
1 change: 0 additions & 1 deletion wasmbinding/message_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ func (m *CustomMessenger) resubmitFailure(ctx sdk.Context, contractAddr sdk.AccA
}

err = m.ContractmanagerKeeper.ResubmitFailure(ctx, contractAddr, failure)

if err != nil {
ctx.Logger().Error("failed to resubmitFailure",
"from_address", contractAddr.String(),
Expand Down
7 changes: 1 addition & 6 deletions x/interchaintxs/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ const (
const (
// parameters key.
prefixParamsKey = iota + 1
// prefix of code id, starting from which we charge fee for ICA registration.
prefixICARegistrationFeeFirstCodeID = iota + 2
)

var (
ParamsKey = []byte{prefixParamsKey}
ICARegistrationFeeFirstCodeID = []byte{prefixICARegistrationFeeFirstCodeID}
)
var ParamsKey = []byte{prefixParamsKey}
2 changes: 1 addition & 1 deletion x/tax/keeper/custom_tx_fee_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (k Keeper) CustomTxFeeChecker(ctx sdk.Context, tx sdk.Tx) (sdk.Coins, int64
// Get Fee Param for select dex based on the feeCoins provided
feeParam, err := getFeeParamBasedOnDenom(k.GetParams(ctx).FeeParams, feeCoins)
if err != nil {
return nil, 0, errors.Wrapf(sdkerrors.ErrInvalidRequest, err.Error())
return nil, 0, errors.Wrapf(sdkerrors.ErrInvalidRequest, err.Error()) //nolint:govet
}

// get the oracle address
Expand Down
2 changes: 1 addition & 1 deletion x/tax/keeper/taxdecorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func deductTax(ctx sdk.Context, taxKeeper Keeper, bankKeeper types.BankKeeper, f
// Send tax from fee collector to the treasury smart contract address
err := bankKeeper.SendCoinsFromModuleToAccount(ctx, authtypes.FeeCollectorName, treasuryAddr, sdk.Coins{tax})
if err != nil {
return errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, err.Error())
return errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, err.Error()) //nolint:govet
}

return nil
Expand Down

0 comments on commit 9f0f46d

Please sign in to comment.