Skip to content

Commit

Permalink
cleanup sdkmodule.go and wasm_hook.go
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat committed Mar 6, 2024
1 parent 013d35d commit 76b1242
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions modules/ibc-hooks/sdkmodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,20 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw
}

// BeginBlock returns the begin blocker for the ibc-hooks module.
func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {
func (am AppModule) BeginBlock(ctx sdk.Context) {
}

// EndBlock returns the end blocker for the ibc-hooks module. It returns no validator
// updates.
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
func (AppModule) EndBlock(_ sdk.Context) []abci.ValidatorUpdate {
return []abci.ValidatorUpdate{}
}

// ConsensusVersion implements AppModule/ConsensusVersion.
func (AppModule) ConsensusVersion() uint64 { return 1 }

// Add this method to implement the module.AppModule interface
func (AppModule) IsAppModule() {}

// IsOnePerModuleType ensures AppModule implements the module.AppModule interface.
func (AppModule) IsOnePerModuleType() {}
2 changes: 1 addition & 1 deletion modules/ibc-hooks/tests/unit/mocks/isc4_middleware_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package mocks

import (
sdk "github.com/cosmos/cosmos-sdk/types"
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"

capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types"
"github.com/cosmos/ibc-go/v8/modules/core/exported"
Expand Down
3 changes: 2 additions & 1 deletion modules/ibc-hooks/wasm_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"

sdkmath "cosmossdk.io/math"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/cosmos/ibc-apps/modules/ibc-hooks/v8/keeper"

Check failure on line 10 in modules/ibc-hooks/wasm_hook.go

View workflow job for this annotation

GitHub Actions / Linter

could not import github.com/cosmos/ibc-apps/modules/ibc-hooks/v8/keeper (-: # github.com/cosmos/ibc-apps/modules/ibc-hooks/v8/keeper
Expand Down Expand Up @@ -92,7 +93,7 @@ func (h WasmHooks) OnRecvPacketOverride(im IBCMiddleware, ctx sdk.Context, packe
return ack
}

amount, ok := sdk.NewIntFromString(data.GetAmount())
amount, ok := sdkmath.NewIntFromString(data.GetAmount())
if !ok {
// This should never happen, as it should've been caught in the underlaying call to OnRecvPacket,
// but returning here for completeness
Expand Down

0 comments on commit 76b1242

Please sign in to comment.