Skip to content

Commit

Permalink
chore: linting, godocs, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
damiannolan committed Apr 28, 2024
1 parent 5a72470 commit ed70ae2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
6 changes: 6 additions & 0 deletions modules/core/02-client/types/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package types
import (
"fmt"

"cosmossdk.io/depinject"
storetypes "cosmossdk.io/store/types"

"github.com/cosmos/ibc-go/v8/modules/core/exported"
Expand Down Expand Up @@ -65,12 +66,17 @@ func (rtr *Router) GetRoute(clientID string) (exported.LightClientModule, bool)
return rtr.routes[clientType], true
}

var _ depinject.OnePerModuleType = (*LightClientModuleWrapper)(nil)

// LightClientModuleWrapper is a wrapper struct used for depinject to register client modules on the router.
type LightClientModuleWrapper struct{ exported.LightClientModule }

// NewLightClientModuleWrapper creates and returns a new LightClientModuleWrapper used for depinject.
func NewLightClientModuleWrapper(clientModule exported.LightClientModule) LightClientModuleWrapper {
return LightClientModuleWrapper{
clientModule,
}
}

// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (LightClientModuleWrapper) IsOnePerModuleType() {}
9 changes: 1 addition & 8 deletions modules/light-clients/06-solomachine/depinject.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,14 @@ import (
"github.com/cosmos/cosmos-sdk/codec"

modulev1 "github.com/cosmos/ibc-go/api/ibc/lightclients/solomachine/module/v1"

clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
)

var (
_ depinject.OnePerModuleType = AppModule{}
_ depinject.OnePerModuleType = LightClientModule{}
)
var _ depinject.OnePerModuleType = AppModule{}

// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (AppModule) IsOnePerModuleType() {}

// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (LightClientModule) IsOnePerModuleType() {}

func init() {
appmodule.Register(
&modulev1.Module{},
Expand Down
9 changes: 1 addition & 8 deletions modules/light-clients/07-tendermint/depinject.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,14 @@ import (
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"

modulev1 "github.com/cosmos/ibc-go/api/ibc/lightclients/tendermint/module/v1"

clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
)

var (
_ depinject.OnePerModuleType = AppModule{}
_ depinject.OnePerModuleType = LightClientModule{}
)
var _ depinject.OnePerModuleType = AppModule{}

// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (AppModule) IsOnePerModuleType() {}

// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (LightClientModule) IsOnePerModuleType() {}

func init() {
appmodule.Register(
&modulev1.Module{},
Expand Down

0 comments on commit ed70ae2

Please sign in to comment.