Skip to content

Commit

Permalink
Update interfaces for modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
Taztingo committed Mar 21, 2024
1 parent b7646e0 commit 76be962
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 48 deletions.
1 change: 0 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,6 @@ func New(
icaModule,
)

// TODO[1760]: app-module: BasicModuleManager: Make sure that this setup has everything we need (it was just copied from the SDK).
// BasicModuleManager defines the module BasicManager is in charge of setting up basic,
// non-dependant module elements, such as codec registration and genesis verification.
// By default it is composed of all the module from the module manager.
Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/provenance-io/provenance
go 1.21

require (
cosmossdk.io/core v0.11.0
cosmossdk.io/errors v1.0.1
cosmossdk.io/log v1.3.1
cosmossdk.io/math v1.2.0
Expand Down Expand Up @@ -32,6 +33,7 @@ require (
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/hashicorp/go-metrics v0.5.2
github.com/rakyll/statik v0.1.7
github.com/regen-network/cosmos-proto v0.3.1 // TODO[1760]: Verify that this is still needed
github.com/rs/zerolog v1.32.0
github.com/spf13/cast v1.6.0
github.com/spf13/cobra v1.8.0
Expand All @@ -46,8 +48,6 @@ require (
gopkg.in/yaml.v2 v2.4.0
)

require github.com/regen-network/cosmos-proto v0.3.1

require (
cloud.google.com/go v0.110.10 // indirect
cloud.google.com/go/compute v1.23.3 // indirect
Expand All @@ -57,7 +57,6 @@ require (
cosmossdk.io/api v0.7.3 // indirect
cosmossdk.io/client/v2 v2.0.0-beta.1 // indirect
cosmossdk.io/collections v0.4.0 // indirect
cosmossdk.io/core v0.11.0 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
cosmossdk.io/x/circuit v0.1.0 // indirect
cosmossdk.io/x/nft v0.1.0 // indirect
Expand Down
10 changes: 6 additions & 4 deletions x/attribute/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"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand All @@ -28,10 +29,11 @@ import (
)

var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleSimulation = AppModule{}
// TODO[1760]: app-module: Add more assertions for the new types and clean up stuff no longer needed.
_ module.AppModuleBasic = (*AppModule)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)

_ appmodule.AppModule = (*AppModule)(nil)
_ appmodule.HasBeginBlocker = (*AppModule)(nil)
)

// AppModuleBasic contains non-dependent elements for the attribute module.
Expand Down
9 changes: 5 additions & 4 deletions x/exchange/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"math/rand"

"cosmossdk.io/core/appmodule"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"

Expand All @@ -25,10 +26,10 @@ import (
)

var (
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModule = AppModule{}
_ module.AppModuleSimulation = AppModule{}
// TODO[1760]: app-module: Add more assertions for the new types and clean up stuff no longer needed.
_ module.AppModuleBasic = (*AppModule)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)

_ appmodule.AppModule = (*AppModule)(nil)
)

type AppModuleBasic struct {
Expand Down
9 changes: 5 additions & 4 deletions x/hold/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"math/rand"

"cosmossdk.io/core/appmodule"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"

Expand All @@ -25,10 +26,10 @@ import (
)

var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleSimulation = AppModule{}
// TODO[1760]: app-module: Add more assertions for the new types and clean up stuff no longer needed.
_ module.AppModuleBasic = (*AppModule)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)

_ appmodule.AppModule = (*AppModule)(nil)
)

type AppModule struct {
Expand Down
8 changes: 5 additions & 3 deletions x/ibchooks/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"math/rand"

"cosmossdk.io/core/appmodule"
"github.com/gorilla/mux"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"
Expand All @@ -26,9 +27,10 @@ import (
)

var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
// TODO[1760]: app-module: Add more assertions for the new types and clean up stuff no longer needed.
_ module.AppModuleBasic = (*AppModule)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)

_ appmodule.AppModule = (*AppModule)(nil)
)

// AppModuleBasic defines the basic application module used by the ibchooks module.
Expand Down
9 changes: 5 additions & 4 deletions x/ibcratelimit/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"math/rand"

"cosmossdk.io/core/appmodule"
"github.com/gorilla/mux"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"
Expand All @@ -28,10 +29,10 @@ import (
)

var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleSimulation = AppModule{}
// TODO[1760]: app-module: Add more assertions for the new types and clean up stuff no longer needed.
_ module.AppModuleBasic = (*AppModule)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)

_ appmodule.AppModule = (*AppModule)(nil)
)

// AppModuleBasic defines the basic application module used by the ibcratelimit module.
Expand Down
9 changes: 6 additions & 3 deletions x/marker/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"
feegrantkeeper "cosmossdk.io/x/feegrant/keeper"

"github.com/cosmos/cosmos-sdk/client"
Expand All @@ -31,9 +32,11 @@ import (

// type check to ensure the interface is properly implemented
var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
// TODO[1760]: app-module: Add more assertions for the new types and clean up stuff no longer needed.
_ module.AppModuleBasic = (*AppModule)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)

_ appmodule.AppModule = (*AppModule)(nil)
_ appmodule.HasBeginBlocker = (*AppModule)(nil)
)

// AppModuleBasic contains non-dependent elements for the marker module.
Expand Down
8 changes: 5 additions & 3 deletions x/metadata/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"math/rand"

"cosmossdk.io/core/appmodule"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"

Expand Down Expand Up @@ -36,9 +37,10 @@ const StoreKey = types.StoreKey

// type check to ensure the interface is properly implemented
var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
// TODO[1760]: app-module: Add more assertions for the new types and clean up stuff no longer needed.
_ module.AppModuleBasic = (*AppModule)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)

_ appmodule.AppModule = (*AppModule)(nil)
)

// AppModuleBasic contains non-dependent elements for the metadata module.
Expand Down
9 changes: 5 additions & 4 deletions x/msgfees/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

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

"cosmossdk.io/core/appmodule"
cerrs "cosmossdk.io/errors"

sdkclient "github.com/cosmos/cosmos-sdk/client"
Expand All @@ -26,10 +27,10 @@ import (
)

var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleSimulation = AppModule{}
// TODO[1760]: app-module: Add more assertions for the new types and clean up stuff no longer needed.
_ module.AppModuleBasic = (*AppModule)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)

_ appmodule.AppModule = (*AppModule)(nil)
)

// AppModuleBasic defines the basic application module used by the msgfee module.
Expand Down
9 changes: 5 additions & 4 deletions x/name/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"math/rand"

"cosmossdk.io/core/appmodule"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"

Expand All @@ -28,10 +29,10 @@ import (

// type check to ensure the interface is properly implemented
var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleSimulation = AppModule{}
// TODO[1760]: app-module: Add more assertions for the new types and clean up stuff no longer needed.
_ module.AppModuleBasic = (*AppModule)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)

_ appmodule.AppModule = (*AppModule)(nil)
)

// AppModuleBasic contains non-dependent elements for the name module.
Expand Down
9 changes: 5 additions & 4 deletions x/oracle/module/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"
cerrs "cosmossdk.io/errors"

sdkclient "github.com/cosmos/cosmos-sdk/client"
Expand All @@ -30,10 +31,10 @@ import (
)

var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleSimulation = AppModule{}
// TODO[1760]: app-module: Add more assertions for the new types and clean up stuff no longer needed.
_ module.AppModuleBasic = (*AppModule)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)

_ appmodule.AppModule = (*AppModule)(nil)
)

// AppModuleBasic defines the basic application module used by the oracle module.
Expand Down
10 changes: 7 additions & 3 deletions x/reward/module/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"
cerrs "cosmossdk.io/errors"

sdkclient "github.com/cosmos/cosmos-sdk/client"
Expand All @@ -30,9 +31,12 @@ import (
)

var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
// TODO[1760]: app-module: Add more assertions for the new types and clean up stuff no longer needed.
_ module.AppModuleBasic = (*AppModule)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)

_ appmodule.AppModule = (*AppModule)(nil)
_ appmodule.HasBeginBlocker = (*AppModule)(nil)
_ appmodule.HasEndBlocker = (*AppModule)(nil)
)

// AppModuleBasic defines the basic application module used by the reward module.
Expand Down
11 changes: 7 additions & 4 deletions x/trigger/module/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"
cerrs "cosmossdk.io/errors"

sdkclient "github.com/cosmos/cosmos-sdk/client"
Expand All @@ -30,10 +31,12 @@ import (
)

var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleSimulation = AppModule{}
// TODO[1760]: app-module: Add more assertions for the new types and clean up stuff no longer needed.
_ module.AppModuleBasic = (*AppModule)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)

_ appmodule.AppModule = (*AppModule)(nil)
_ appmodule.HasBeginBlocker = (*AppModule)(nil)
_ appmodule.HasEndBlocker = (*AppModule)(nil)
)

// AppModuleBasic defines the basic application module used by the trigger module.
Expand Down

0 comments on commit 76be962

Please sign in to comment.