Skip to content

Commit

Permalink
bump dependencies versions and fix linter warnings (#70)
Browse files Browse the repository at this point in the history
* update dependencies to latest

* fix linter errors

* update github CI

* make envoy e2e only tiggered manually
  • Loading branch information
larry0x authored Jun 8, 2023
1 parent 802f901 commit ebf7069
Show file tree
Hide file tree
Showing 13 changed files with 346 additions and 342 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: E2E

on: push
on: workflow_dispatch

jobs:
envoy:
Expand All @@ -19,7 +19,7 @@ jobs:
mv wasmd-${TAG} wasmd
- name: Setup Go-lang
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: '1.20'

Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: '1.20'

Expand All @@ -26,11 +26,9 @@ jobs:
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Lint
uses: golangci/[email protected]
with:
version: latest
- name: Run linter
run: make lint
4 changes: 2 additions & 2 deletions app/testing/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ func MakeRandomConsensusPubkeys(numPks int) []*codectypes.Any {
anys := []*codectypes.Any{}

for _, pk := range pks {
any, err := codectypes.NewAnyWithValue(pk)
pkAny, err := codectypes.NewAnyWithValue(pk)
if err != nil {
panic(err)
}

anys = append(anys, any)
anys = append(anys, pkAny)
}

return anys
Expand Down
2 changes: 1 addition & 1 deletion app/wasm/query_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
)

func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessage) ([]byte, error) {
func CustomQuerier(*QueryPlugin) func(ctx sdk.Context, request json.RawMessage) ([]byte, error) {
return func(ctx sdk.Context, request json.RawMessage) ([]byte, error) {
var marsQuery MarsQuery
if err := json.Unmarshal(request, &marsQuery); err != nil {
Expand Down
184 changes: 95 additions & 89 deletions go.mod

Large diffs are not rendered by default.

372 changes: 186 additions & 186 deletions go.sum

Large diffs are not rendered by default.

68 changes: 34 additions & 34 deletions x/envoy/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ func NewIBCModule(k keeper.Keeper) ibcporttypes.IBCModule {
}

func (im IBCModule) OnChanOpenInit(
ctx sdk.Context,
order ibcchanneltypes.Order,
connectionHops []string,
portID string,
channelID string,
chanCap *capabilitytypes.Capability,
counterparty ibcchanneltypes.Counterparty,
_ sdk.Context,
_ ibcchanneltypes.Order,
_ []string,
_ string,
_ string,
_ *capabilitytypes.Capability,
_ ibcchanneltypes.Counterparty,
version string,
) (string, error) {
// the module is supposed to validate the version string here.
Expand All @@ -46,14 +46,14 @@ func (im IBCModule) OnChanOpenInit(
}

func (im IBCModule) OnChanOpenTry(
ctx sdk.Context,
order ibcchanneltypes.Order,
connectionHops []string,
portID,
channelID string,
chanCap *capabilitytypes.Capability,
counterparty ibcchanneltypes.Counterparty,
counterpartyVersion string,
_ sdk.Context,
_ ibcchanneltypes.Order,
_ []string,
_,
_ string,
_ *capabilitytypes.Capability,
_ ibcchanneltypes.Counterparty,
_ string,
) (string, error) {
// ICA channel handshake cannot be initiated from the host chain.
// the controller middleware should have rejected this request.
Expand All @@ -63,46 +63,46 @@ func (im IBCModule) OnChanOpenTry(
}

func (im IBCModule) OnChanOpenAck(
ctx sdk.Context,
portID,
channelID string,
counterpartyChannelID string,
counterpartyVersion string,
_ sdk.Context,
_,
_ string,
_ string,
_ string,
) error {
// counterpartyVersion is already validated by the controller middleware.
// we assume it's valid and don't validate again here.
return nil
}

func (im IBCModule) OnChanOpenConfirm(
ctx sdk.Context,
portID,
channelID string,
_ sdk.Context,
_,
_ string,
) error {
// see the comment in OnChanOpenTry on why we panic here
panic("UNREACHABLE: envoy module OnChanOpenConfirm")
}

func (im IBCModule) OnChanCloseInit(
ctx sdk.Context,
portID,
channelID string,
_ sdk.Context,
_,
_ string,
) error {
return nil
}

func (im IBCModule) OnChanCloseConfirm(
ctx sdk.Context,
portID,
channelID string,
_ sdk.Context,
_,
_ string,
) error {
return nil
}

func (im IBCModule) OnRecvPacket(
ctx sdk.Context,
packet ibcchanneltypes.Packet,
relayer sdk.AccAddress,
_ sdk.Context,
_ ibcchanneltypes.Packet,
_ sdk.AccAddress,
) ibcexported.Acknowledgement {
// the ICA controller does not expect to receive any packet.
// the controller middleware should have rejected this request.
Expand All @@ -121,7 +121,7 @@ func (im IBCModule) OnAcknowledgementPacket(
ctx sdk.Context,
packet ibcchanneltypes.Packet,
acknowledgement []byte,
relayer sdk.AccAddress,
_ sdk.AccAddress,
) error {
logger := im.k.Logger(ctx)
logger.Info(
Expand Down Expand Up @@ -215,7 +215,7 @@ func handleProtoMsg[T proto.Message](bz []byte, tyName string) (string, error) {
func (im IBCModule) OnTimeoutPacket(
ctx sdk.Context,
packet ibcchanneltypes.Packet,
relayer sdk.AccAddress,
_ sdk.AccAddress,
) error {
im.k.Logger(ctx).Info(
"ICS-27 packet timed out",
Expand Down
4 changes: 2 additions & 2 deletions x/envoy/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
//
// NOTE: we call `GetModuleAccount` instead of `SetModuleAccount` because the
// "get" function automatically sets the module account if it doesn't exist.
func (k Keeper) InitGenesis(ctx sdk.Context, gs *types.GenesisState) {
func (k Keeper) InitGenesis(ctx sdk.Context, _ *types.GenesisState) {
// set module account
k.accountKeeper.GetModuleAccount(ctx, types.ModuleName)
}

// ExportGenesis returns a genesis state for a given context and keeper.
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState {
func (k Keeper) ExportGenesis(_ sdk.Context) *types.GenesisState {
return &types.GenesisState{}
}
2 changes: 1 addition & 1 deletion x/envoy/keeper/query_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (qs queryServer) Account(goCtx context.Context, req *types.QueryAccountRequ
return &types.QueryAccountResponse{Account: account}, nil
}

func (qs queryServer) Accounts(goCtx context.Context, req *types.QueryAccountsRequest) (*types.QueryAccountsResponse, error) {
func (qs queryServer) Accounts(goCtx context.Context, _ *types.QueryAccountsRequest) (*types.QueryAccountsResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

_, portID, err := qs.k.GetOwnerAndPortID()
Expand Down
12 changes: 6 additions & 6 deletions x/envoy/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
return cdc.MustMarshalJSON(types.DefaultGenesisState())
}

func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, cfg client.TxEncodingConfig, bz json.RawMessage) error {
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error {
var gs types.GenesisState
if err := cdc.UnmarshalJSON(bz, &gs); err != nil {
return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err)
Expand Down Expand Up @@ -85,7 +85,7 @@ func NewAppModule(keeper keeper.Keeper) AppModule {
return AppModule{AppModuleBasic{}, keeper}
}

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {
}

func (am AppModule) RegisterServices(cfg module.Configurator) {
Expand All @@ -97,10 +97,10 @@ func (AppModule) ConsensusVersion() uint64 {
return 1
}

func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) {
func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {
}

func (AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate {
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
return []abci.ValidatorUpdate{}
}

Expand Down Expand Up @@ -132,11 +132,11 @@ func (am AppModule) InitModule(ctx sdk.Context) {
//------------------------------------------------------------------------------

// deprecated
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
func (AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {
}

// deprecated
func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) {
func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {
}

// deprecated
Expand Down
10 changes: 5 additions & 5 deletions x/incentives/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
return cdc.MustMarshalJSON(types.DefaultGenesisState())
}

func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, cfg client.TxEncodingConfig, bz json.RawMessage) error {
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error {
var gs types.GenesisState
if err := cdc.UnmarshalJSON(bz, &gs); err != nil {
return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err)
Expand Down Expand Up @@ -85,7 +85,7 @@ func NewAppModule(keeper keeper.Keeper) AppModule {
return AppModule{AppModuleBasic{}, keeper}
}

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {
}

func (am AppModule) RegisterServices(cfg module.Configurator) {
Expand All @@ -101,7 +101,7 @@ func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) {
BeginBlocker(ctx, req, am.keeper)
}

func (AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate {
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
return []abci.ValidatorUpdate{}
}

Expand All @@ -124,11 +124,11 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw
//------------------------------------------------------------------------------

// deprecated
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
func (AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {
}

// deprecated
func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) {
func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {
}

// deprecated
Expand Down
4 changes: 2 additions & 2 deletions x/safety/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
//
// NOTE: we call `GetModuleAccount` instead of `SetModuleAccount` because the
// "get" function automatically sets the module account if it doesn't exist.
func (k Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState) {
func (k Keeper) InitGenesis(ctx sdk.Context, _ types.GenesisState) {
k.accountKeeper.GetModuleAccount(ctx, types.ModuleName)
}

// ExportGenesis returns a genesis state for a given context and keeper
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState {
func (k Keeper) ExportGenesis(_ sdk.Context) *types.GenesisState {
return &types.GenesisState{}
}
12 changes: 6 additions & 6 deletions x/safety/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
return cdc.MustMarshalJSON(types.DefaultGenesisState())
}

func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, cfg client.TxEncodingConfig, bz json.RawMessage) error {
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error {
var gs types.GenesisState
if err := cdc.UnmarshalJSON(bz, &gs); err != nil {
return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err)
Expand Down Expand Up @@ -85,7 +85,7 @@ func NewAppModule(keeper keeper.Keeper) AppModule {
return AppModule{AppModuleBasic{}, keeper}
}

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {
}

func (am AppModule) RegisterServices(cfg module.Configurator) {
Expand All @@ -97,10 +97,10 @@ func (AppModule) ConsensusVersion() uint64 {
return 1
}

func (AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) {
func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {
}

func (AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate {
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
return []abci.ValidatorUpdate{}
}

Expand All @@ -123,11 +123,11 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw
//------------------------------------------------------------------------------

// deprecated
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
func (AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {
}

// deprecated
func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) {
func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {
}

// deprecated
Expand Down

0 comments on commit ebf7069

Please sign in to comment.