Skip to content

Commit

Permalink
feat: Check interface of all modules
Browse files Browse the repository at this point in the history
  • Loading branch information
dudong2 committed Jul 2, 2024
1 parent 925b909 commit ccda4ab
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 18 deletions.
8 changes: 7 additions & 1 deletion x/coinswap/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

abci "github.com/cometbft/cometbft/abci/types"

"cosmossdk.io/core/appmodule"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand All @@ -25,9 +26,14 @@ import (
)

var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleBasic = AppModule{}
_ module.AppModuleSimulation = AppModule{}
_ module.HasInvariants = AppModule{}
_ module.HasServices = AppModule{}
_ module.HasABCIGenesis = AppModule{}

_ appmodule.AppModule = AppModule{}
)

// AppModuleBasic defines the basic application module used by the coinswap module.
Expand Down
16 changes: 12 additions & 4 deletions x/csr/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,29 @@ import (
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"

"github.com/Canto-Network/Canto/v7/x/csr/client/cli"
"github.com/Canto-Network/Canto/v7/x/csr/keeper"
"github.com/Canto-Network/Canto/v7/x/csr/types"
"cosmossdk.io/core/appmodule"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"

"github.com/Canto-Network/Canto/v7/x/csr/client/cli"
"github.com/Canto-Network/Canto/v7/x/csr/keeper"
"github.com/Canto-Network/Canto/v7/x/csr/types"
)

var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleBasic = AppModule{}
_ module.HasInvariants = AppModule{}
_ module.HasServices = AppModule{}
_ module.HasABCIGenesis = AppModule{}

_ appmodule.AppModule = AppModule{}
_ appmodule.HasBeginBlocker = AppModule{}
)

// ----------------------------------------------------------------------------
Expand Down
12 changes: 10 additions & 2 deletions x/epochs/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

abci "github.com/cometbft/cometbft/abci/types"

"cosmossdk.io/core/appmodule"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand All @@ -26,8 +27,15 @@ import (
)

var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleBasic = AppModule{}
_ module.AppModuleSimulation = AppModule{}
_ module.HasInvariants = AppModule{}
_ module.HasServices = AppModule{}
_ module.HasABCIGenesis = AppModule{}

_ appmodule.AppModule = AppModule{}
_ appmodule.HasBeginBlocker = AppModule{}
)

// ----------------------------------------------------------------------------
Expand Down
13 changes: 10 additions & 3 deletions x/erc20/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import (
"fmt"
"math/rand"

"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"

"cosmossdk.io/core/appmodule"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
Expand All @@ -14,8 +18,6 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"

"github.com/Canto-Network/Canto/v7/x/erc20/client/cli"
"github.com/Canto-Network/Canto/v7/x/erc20/keeper"
Expand All @@ -24,9 +26,14 @@ import (

// type check to ensure the interface is properly implemented
var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleBasic = AppModule{}
_ module.AppModuleSimulation = AppModule{}
_ module.HasInvariants = AppModule{}
_ module.HasServices = AppModule{}
_ module.HasABCIGenesis = AppModule{}

_ appmodule.AppModule = AppModule{}
)

// app module Basics object
Expand Down
18 changes: 13 additions & 5 deletions x/govshuttle/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,28 @@ import (

abci "github.com/cometbft/cometbft/abci/types"

"github.com/Canto-Network/Canto/v7/x/govshuttle/client/cli"
"github.com/Canto-Network/Canto/v7/x/govshuttle/keeper"
"github.com/Canto-Network/Canto/v7/x/govshuttle/types"
"cosmossdk.io/core/appmodule"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"

"github.com/Canto-Network/Canto/v7/x/govshuttle/client/cli"
"github.com/Canto-Network/Canto/v7/x/govshuttle/keeper"
"github.com/Canto-Network/Canto/v7/x/govshuttle/types"
)

var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleBasic = AppModule{}
_ module.AppModuleSimulation = AppModule{}
_ module.HasInvariants = AppModule{}
_ module.HasServices = AppModule{}
_ module.HasABCIGenesis = AppModule{}

_ appmodule.AppModule = AppModule{}
)

// ----------------------------------------------------------------------------
Expand Down
13 changes: 10 additions & 3 deletions x/inflation/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import (
"fmt"
"math/rand"

"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"

"cosmossdk.io/core/appmodule"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
Expand All @@ -16,8 +20,6 @@ import (
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"

"github.com/Canto-Network/Canto/v7/x/inflation/client/cli"
"github.com/Canto-Network/Canto/v7/x/inflation/keeper"
Expand All @@ -26,9 +28,14 @@ import (

// type check to ensure the interface is properly implemented
var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleBasic = AppModule{}
_ module.AppModuleSimulation = AppModule{}
_ module.HasInvariants = AppModule{}
_ module.HasServices = AppModule{}
_ module.HasABCIGenesis = AppModule{}

_ appmodule.AppModule = AppModule{}
)

// app module Basics object
Expand Down

0 comments on commit ccda4ab

Please sign in to comment.