refactor(core)!: cleanup dependency graph (#18866)

Co-authored-by: Likhita Polavarapu <78951027+likhita-809@users.noreply.github.com>
This commit is contained in:
Marko 2024-01-09 16:14:36 +01:00 committed by GitHub
parent f431a5039c
commit bde7eb1a4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
99 changed files with 432 additions and 476 deletions

View File

@ -38,6 +38,7 @@ COPY x/auth/go.mod x/auth/go.sum ./x/auth/
COPY x/authz/go.mod x/authz/go.sum ./x/authz/
COPY x/bank/go.mod x/bank/go.sum ./x/bank/
COPY x/mint/go.mod x/mint/go.sum ./x/mint/
COPY depinject/go.mod depinject/go.sum ./depinject/
RUN go mod download
# Add source files

View File

@ -116,6 +116,10 @@ Refer to SimApp `root_v2.go` and `root.go` for an example with an app v2 and a l
#### `**all**`
##### Dependency Injection
Previously `cosmossdk.io/core` held functions `Invoke`, `Provide` and `Register` were moved to `cosmossdk.io/depinject/appmodule`. All modules using dependency injection must update their imports.
##### Genesis Interface
All genesis interfaces have been migrated to take context.Context instead of sdk.Context.

View File

@ -21,8 +21,8 @@ import (
runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1"
appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"
"cosmossdk.io/core/address"
"cosmossdk.io/core/appconfig"
"cosmossdk.io/depinject"
"cosmossdk.io/depinject/appconfig"
errorsmod "cosmossdk.io/errors"
"cosmossdk.io/math"
storetypes "cosmossdk.io/store/types"

View File

@ -168,6 +168,7 @@ require (
replace github.com/cosmos/cosmos-sdk => ./../../
replace (
cosmossdk.io/depinject => ./../../depinject
cosmossdk.io/x/auth => ./../../x/auth
cosmossdk.io/x/bank => ./../../x/bank
cosmossdk.io/x/distribution => ./../../x/distribution

View File

@ -6,8 +6,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -9,6 +9,7 @@ COPY api/go.mod api/go.sum /work/api/
COPY core/go.mod core/go.sum /work/core/
COPY collections/go.mod collections/go.sum /work/collections/
COPY store/go.mod store/go.sum /work/store/
COPY store/go.mod store/go.sum /work/depinject/
COPY x/tx/go.mod x/tx/go.sum /work/x/tx/
COPY x/protocolpool/go.mod x/protocolpool/go.sum /work/x/protocolpool/
COPY x/gov/go.mod x/gov/go.sum /work/x/gov/

View File

@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [#18857](https://github.com/cosmos/cosmos-sdk/pull/18857) Moved `FormatCoins` to `x/tx`.
* [#18861](httpes://github.com/cosmos/cosmos-sdk/pull/18861) Moved `coin.ParseCoin` to `client/v2/internal`.
* [#18866](https://github.com/cosmos/cosmos-sdk/pull/18866) All items related to depinject have been moved to `cosmossdk.io/depinject` (`Provide`, `Invoke`, `Register`)
## [v0.12.0](https://github.com/cosmos/cosmos-sdk/releases/tag/core%2Fv0.11.0)

View File

@ -1,232 +1,8 @@
# Wiring up app modules for use with appconfig
# Appmodule
The `appconfig` framework allows Cosmos SDK modules to be composed declaratively using a configuration file without
requiring the app developer to understand the details of inter-module dependencies.
<!-- TODO add more docs here with https://github.com/cosmos/cosmos-sdk/issues/17207 -->
## 1. Create a module config protobuf message
This package defines what is needed for an module to be used in the Cosmos SDK.
The first step in creating a module that works with `appconfig`, is to create a protobuf message for the module configuration. The best practices for defining the module configuration message are:
* Use a dedicated protobuf package for the module configuration message instead of placing it in the API protobuf package. For example, the module configuration for bank would go in `cosmos.bank.module.v1` instead of just `cosmos.bank.v1`. This decouples the state machine version from the API version.
* The module configuration message is usually called simply `Module`, ex. `cosmos.bank.module.v1.Module`.
* Create a new protobuf package and configuration message for each state machine breaking version of the module, ex. `cosmos.bank.module.v2.Module`, etc.
The module configuration message should include any parameters which should be initialized at application startup. For example, the auth module needs to know the bech32 prefix of the app and the permissions of module accounts.
In the future, it may be possible to update the app config through a governance proposal at runtime.
All module configuration messages should define a module descriptor, using the `cosmos.app.v1alpha1.module` message option.
Here is an example module configuration message for the `auth` module:
```protobuf
package cosmos.auth.module.v1;
import "cosmos/app/v1alpha1/module.proto";
message Module {
option (cosmos.app.v1alpha1.module) = {
go_import: "cosmossdk.io/x/auth"
};
string bech32_prefix = 1;
repeated ModuleAccountPermission module_account_permissions = 2;
}
```
## 2. Register module depinject providers and invokers
Once we have a module config object, we need to register depinject providers and invokers for the module using the `cosmossdk.io/core/appmodule` package.
At the most basic level, we must define an `init` function in the package listed as the `go_import` in the module descriptor. This `init` function must call `appmodule.Register` with an empty instance of the config object and some options for initializing the module, ex:
```go
func init() {
appmodule.Register(&modulev1.Module{},
// options
)
}
```
### `depinject` Provider and Invoker Basics
A `depinject` "provider" is a function which takes dependencies from other modules as inputs and returns outputs for
other modules to use as dependencies. A `depinject` "invoker" is function which takes optional dependencies as inputs,
returns no outputs, and is run at the end of initializing the dependency graph. Providers are much more common than
invokers and should be the preferred method of wiring up modules when possible. Providers and invokers can be registered
for modules by using `appmodule.Provide` and `appmodule.Invoke` to create options which get passed
to `appmodule.Register` in the module `init` function, ex:
```go
func init() {
appmodule.Register(&modulev1.Module{},
appmodule.Provide(provideSomething, provideSomethingElse),
appmodule.Invoke(invokeSomething),
)
}
```
### `depinject` Types
`depinject` constructor functions support these classes of input and output parameter types:
* regular golang types (with special treatment of interface types as input parameters)
* structs with `depinject.In` and `depinject.Out` embedded
* `depinject.OnePerModuleType`s
* `depinject.ManyPerContainerType`s
* `depinject.ModuleKey` (which can only be defined as an input type)
* `error` (which gets special treatment as an output type)
#### Regular Golang Types
Regular golang types (besides the special cases described above) can be provided as both input and output parameters
to providers and invokers. For `depinject` to match an output parameter of one provider to an input parameter of
another, there must be an exact match for the type unless the input parameter is an input type. For instance, if
a provider defines a dependency on `Foo` and some module provides `*Foo`, these two types will not match and there
will be an error.
#### Interface Input Types
When interfaces are used as input parameters to providers and invokers, `depinject` will search the container for
all types that implement this interface. If there is an unambiguously matching type, then this type will be used
to satisfy that interface. If there is a conflict between two types matching the interface, the app developer
can use `golang_bindings` options in their app config in order to resolve the conflict.
#### Structs with embedded `depinject.In` and `depinject.Out`
Structs that have `depinject.In` or `depinject.Out` as an embedded field are treated specially by `depinject`, where
all of these structs fields are treated as input or output parameters, respectively. These structs allow custom options
to be defined using struct field tags. Currently, the only supported custom option is `optional:"true"` which marks
a field as optional.
#### `depinject.OnePerModuleType`s
Any type which implements the `depinject.OnePerModuleType` interface can be provided at most once by every module.
These types can be collected as an input parameter to some provider or invoker by defining an input parameter which
is a map of module names as strings to this parameter type. For example if `Foo` is a `OnePerModuleType`, then
`map[string]Foo` can be declared as an input parameter by some provider (which obviously cannot provide an instance of
`Foo` itself because that would cause a circular dependency).
`OnePerModuleType`s should be used whenever different modules may provide the type *and* there is a need to provide
an ordering of these types based on the module name. Generally, in blockchains there is always a need for deterministic
orderings so using module names to provide that ordering is generally a good strategy for this use case. Ordering based
on module names can either be done implicitly by sorting the module names or explicitly as a parameter in the module
configuration object.
#### `depinject.ManyPerContainerType`s
`ManyPerContainerType`s can be provided by as many providers in as many modules as the user would like. If a type `Bar`
is a `ManyPerContainerType`, a provider may define an output parameter of `Bar` or `[]Bar` to provide `Bar` instances
to the container. A provider may define an input parameter of `[]Bar` to get all of the `Bar` instances in the
container (such a provider may not also return `Bar` as that would cause a circular dependency). The ordering of `Bar`
instances in the `[]Bar` input type should be assumed to be deterministic.
`ManyPerContainerType`s should be used only when 1) ordering is unimportant or 2) the ordering can be defined by
some parameter on the type. For instance, if `Bar` had a field `Name string`, that is supposed to be unique in the
container then that could be used to provide an ordering. An example of a type that could work as a
`ManyPerContainerType` in this way is a wrapper around `*cobra.Command`, ex.
`type QueryCommand struct {*cobra.Command}`. This could be used to collect all the query commands in an app and then
cobra would take care of ordering. If this type of ordering is not available, a `OnePerModuleType` is probably a better
bet.
#### Module-scoped Providers/`depinject.ModuleKey` as an input
If `depinject.ModuleKey` is used as input parameter for a provider, the provider function will be treated as a
"module-scoped provider" which means that the provider function will be called exactly once every time
one of its outputs is needed by a module so that the provider can provide a unique instance of the dependency to
each module.
Module-scoped dependencies should be used to provide dependencies which are private and unique to each module. Examples
of these are store keys and param subspaces.
#### `error` as an output parameter
`error` can be used as the last output parameter on any provider or invoker. If a provider or invoker with an `error`
parameter returns a non-nil value for `error`, `depinject` will fail and propagate this error up to the caller.
### Provider Invocation Details
Providers are called lazily as they are needed and will be invoked at most once (except for "module-scoped providers"
described above) if and only if at least one of their outputs is needed somewhere in the dependency graph. Providers
will only get called if all of their non-optional inputs can successfully be resolved by some other module, otherwise an
error will occur. Modules should proactively mark dependencies as `optional` if the module can still be successfully
built without this dependency.
### Invoker Invocation Details
Invokers are called at the end of container initialization after all providers that were needed to build the graph
were called. All the dependencies of invokers are automatically marked as optional so invokers should `nil` check
every input parameter. Invokers may cause additional providers to get run if they have a dependency that wasn't built
yet. But if a dependency to an invoker cannot be provided for some reason, the invoker will still get called but with
`nil` for that input. This allows invokers to still work with the lazy invocation model of providers which only
builds things which are actually necessary as a dependency for some module or the caller.
Invokers should generally be used sparingly to perform some initialization logic which can't be done in the initial
provider, usually because of a circular dependency, and which may be optional.
### Best practices
* make dependencies `optional` whenever possible!
* interface types should be used whenever possible to avoid tight couplings between two modules.
* `OnePerModuleType`s should be used when there is something occurs at most once per module and the module name is a
convenient way for providing a deterministic order.
* `ManyPerContainerType`s should be used only when there is an obvious way to create an ordering from the types or
when ordering *really* doesn't matter (which is rare).
* module-scoped providers should be used for private, module-scoped dependencies
* use different providers for unrelated or loosely components or to resolve circular dependencies (see below)
* use invokers sparingly and always `nil`-check the inputs.
### Resolving Circular Dependencies
Circular dependencies are inevitable to crop up and there are ways to avoid them. While `depinject` cannot handle
circular dependency graphs of providers, many of the above tools are designed to enable satisfying circular dependencies
between modules.
One of the key tactics for resolving circular dependencies is to use different providers and/or invokers to allow a
circular dependency between components. For example, say the slashing keeper depends on the keeper module but the
staking keeper also depends on the staking module indirectly (in the form of "staking hooks"). The slashing module
can declare a dependency directly on the staking keeper (using an interface to avoid actually importing the staking
keeper package). It can also provide an instance of the slashing keeper wrapped as staking hooks in a `OnePerModuleType`
we'll call `StakingHooksWrapper`. Now, if the staking module directly depended on the staking hooks wrappers
(`map[string]StakingHooksWrapper`) we would have a circular dependency graph and `depinject` would fail. To fix this,
the staking module can define an invoker which depends on `map[string]StakingHooksWrapper` and the staking keeper
(which was provided by the staking module already in a separate provided). In this way `depinject` will be able to
satisfy this dependency graph which allows staking and slashing to depend on each other in this order:
* provide staking keeper -> slashing keeper
* provide slashing keeper wrapped as `StakingHooksWrapper`
* get `map[string]StakingHooksWrapper` and the staking keeper and wire them together
## 3. Testing and Debugging The Module
In order to test and debug the module configuration, we need to build an app config, generally defined in a YAML file.
This configuration should be passed first to `appconfig.LoadYAML` to get an `depinject.Config` instance.Then the
`depinject.Config` can be passed to `depinject.Inject` and we can try to resolve dependencies in the app config.
Alternatively, the `depinject.Config` can be created via [pure Go code](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_config.go).
Ex:
```go
//go:embed app.yaml
var appConfig []byte
var AppConfig = appconfig.LoadYAML(appConfig)
func TestModule(t *testing.T) {
var keeper Keeper
assert.NilError(t, depinject.Inject(AppConfig, &keeper))
}
```
### Debugging `depinject` Graphs
Whenever there is an error in a `depinject` graph, by default `depinject` will dump a bunch of logging output to the
console, print the error message, and save the dependency graph in [GraphViz](https://graphviz.org) DOT format to
the file `debug_container.dot`. Inspecting the GraphViz output by converting it to an SVG and viewing it in a web
browser or using some other GraphViz tool is *highly recommended*.
If `depinject` does not return an error but there is still some weird issue wiring up modules, inspecting the GraphViz
and logging output is still *highly recommended* and can be done using `depinject.InjectDebug` with the debug option
`depinject.Debug`.
App developers should attempt to familiarize themselves with the GraphViz graph of their app to see which modules
depend on which other modules.
If you are looking at integrating Dependency injection into your module please see [depinject appmodule documentation](../../depinject/appmodule/README.md)

View File

@ -4,8 +4,6 @@ import (
"context"
"google.golang.org/grpc"
"cosmossdk.io/depinject"
)
// AppModule is a tag interface for app module implementations to use as a basis
@ -13,8 +11,6 @@ import (
// type that all valid app modules should provide so that they can be identified
// by other modules (usually via depinject) as app modules.
type AppModule interface {
depinject.OnePerModuleType
// IsAppModule is a dummy method to tag a struct as implementing an AppModule.
IsAppModule()
}

View File

@ -3,34 +3,22 @@ module cosmossdk.io/core
go 1.20
require (
cosmossdk.io/api v0.7.2
cosmossdk.io/depinject v1.0.0-alpha.4
github.com/cosmos/cosmos-proto v1.0.0-beta.3
github.com/stretchr/testify v1.8.4
google.golang.org/grpc v1.60.1
google.golang.org/protobuf v1.32.0
gotest.tools/v3 v3.5.1
sigs.k8s.io/yaml v1.4.0
)
require (
github.com/cockroachdb/errors v1.11.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/getsentry/sentry-go v0.23.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

View File

@ -1,40 +1,20 @@
cosmossdk.io/api v0.7.2 h1:BO3i5fvKMKvfaUiMkCznxViuBEfyWA/k6w2eAF6q1C4=
cosmossdk.io/api v0.7.2/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8=
github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw=
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE=
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs=
github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30=
github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o=
github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE=
github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY=
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
@ -42,43 +22,15 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c h1:jHkCUWkseRf+W+edG5hMzr/Uh1xkDREY4caybAq4dpY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0=
google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU=
google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
@ -87,9 +39,6 @@ google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=

View File

@ -1,32 +0,0 @@
package intermodule
import (
"context"
"google.golang.org/grpc"
)
// Client is an inter-module client as specified in ADR-033. It
// allows one module to send msg's and queries to other modules provided
// that the request is valid and can be properly authenticated.
type Client interface {
grpc.ClientConnInterface
// InvokerByMethod resolves an invoker for the provided method or returns an error.
InvokerByMethod(method string) (Invoker, error)
// InvokerByRequest resolves an invoker for the provided request type or returns an error.
// This only works for Msg's as they are routed based on type name in transactions already.
// For queries use InvokerByMethod instead.
InvokerByRequest(request any) (Invoker, error)
// DerivedClient returns an inter-module client for the ADR-028 derived
// module address for the provided key.
DerivedClient(key []byte) Client
// Address is the ADR-028 address of this client against which messages will be authenticated.
Address() []byte
}
// Invoker is an inter-module invoker that has already been resolved to a specific method route.
type Invoker func(ctx context.Context, request any, opts ...grpc.CallOption) (res any, err error)

View File

@ -13,8 +13,8 @@ import (
"sigs.k8s.io/yaml"
appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"
"cosmossdk.io/core/internal"
"cosmossdk.io/depinject"
internal "cosmossdk.io/depinject/internal/appconfig"
)
// LoadJSON loads an app config in JSON format.

View File

@ -10,11 +10,11 @@ import (
"gotest.tools/v3/assert"
"cosmossdk.io/core/appconfig"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/internal"
"cosmossdk.io/core/internal/testpb"
"cosmossdk.io/depinject"
"cosmossdk.io/depinject/appconfig"
"cosmossdk.io/depinject/appmodule"
internal "cosmossdk.io/depinject/internal/appconfig"
"cosmossdk.io/depinject/internal/appconfig/testpb"
)
func expectContainerErrorContains(t *testing.T, option depinject.Config, contains string) {

View File

@ -0,0 +1,232 @@
# Wiring up app modules for use with appconfig
The `appconfig` framework allows Cosmos SDK modules to be composed declaratively using a configuration file without
requiring the app developer to understand the details of inter-module dependencies.
## 1. Create a module config protobuf message
The first step in creating a module that works with `appconfig`, is to create a protobuf message for the module configuration. The best practices for defining the module configuration message are:
* Use a dedicated protobuf package for the module configuration message instead of placing it in the API protobuf package. For example, the module configuration for bank would go in `cosmos.bank.module.v1` instead of just `cosmos.bank.v1`. This decouples the state machine version from the API version.
* The module configuration message is usually called simply `Module`, ex. `cosmos.bank.module.v1.Module`.
* Create a new protobuf package and configuration message for each state machine breaking version of the module, ex. `cosmos.bank.module.v2.Module`, etc.
The module configuration message should include any parameters which should be initialized at application startup. For example, the auth module needs to know the bech32 prefix of the app and the permissions of module accounts.
In the future, it may be possible to update the app config through a governance proposal at runtime.
All module configuration messages should define a module descriptor, using the `cosmos.app.v1alpha1.module` message option.
Here is an example module configuration message for the `auth` module:
```protobuf
package cosmos.auth.module.v1;
import "cosmos/app/v1alpha1/module.proto";
message Module {
option (cosmos.app.v1alpha1.module) = {
go_import: "cosmossdk.io/x/auth"
};
string bech32_prefix = 1;
repeated ModuleAccountPermission module_account_permissions = 2;
}
```
## 2. Register module depinject providers and invokers
Once we have a module config object, we need to register depinject providers and invokers for the module using the `cosmossdk.io/core/appmodule` package.
At the most basic level, we must define an `init` function in the package listed as the `go_import` in the module descriptor. This `init` function must call `appmodule.Register` with an empty instance of the config object and some options for initializing the module, ex:
```go
func init() {
appmodule.Register(&modulev1.Module{},
// options
)
}
```
### `depinject` Provider and Invoker Basics
A `depinject` "provider" is a function which takes dependencies from other modules as inputs and returns outputs for
other modules to use as dependencies. A `depinject` "invoker" is function which takes optional dependencies as inputs,
returns no outputs, and is run at the end of initializing the dependency graph. Providers are much more common than
invokers and should be the preferred method of wiring up modules when possible. Providers and invokers can be registered
for modules by using `appmodule.Provide` and `appmodule.Invoke` to create options which get passed
to `appmodule.Register` in the module `init` function, ex:
```go
func init() {
appmodule.Register(&modulev1.Module{},
appmodule.Provide(provideSomething, provideSomethingElse),
appmodule.Invoke(invokeSomething),
)
}
```
### `depinject` Types
`depinject` constructor functions support these classes of input and output parameter types:
* regular golang types (with special treatment of interface types as input parameters)
* structs with `depinject.In` and `depinject.Out` embedded
* `depinject.OnePerModuleType`s
* `depinject.ManyPerContainerType`s
* `depinject.ModuleKey` (which can only be defined as an input type)
* `error` (which gets special treatment as an output type)
#### Regular Golang Types
Regular golang types (besides the special cases described above) can be provided as both input and output parameters
to providers and invokers. For `depinject` to match an output parameter of one provider to an input parameter of
another, there must be an exact match for the type unless the input parameter is an input type. For instance, if
a provider defines a dependency on `Foo` and some module provides `*Foo`, these two types will not match and there
will be an error.
#### Interface Input Types
When interfaces are used as input parameters to providers and invokers, `depinject` will search the container for
all types that implement this interface. If there is an unambiguously matching type, then this type will be used
to satisfy that interface. If there is a conflict between two types matching the interface, the app developer
can use `golang_bindings` options in their app config in order to resolve the conflict.
#### Structs with embedded `depinject.In` and `depinject.Out`
Structs that have `depinject.In` or `depinject.Out` as an embedded field are treated specially by `depinject`, where
all of these structs fields are treated as input or output parameters, respectively. These structs allow custom options
to be defined using struct field tags. Currently, the only supported custom option is `optional:"true"` which marks
a field as optional.
#### `depinject.OnePerModuleType`s
Any type which implements the `depinject.OnePerModuleType` interface can be provided at most once by every module.
These types can be collected as an input parameter to some provider or invoker by defining an input parameter which
is a map of module names as strings to this parameter type. For example if `Foo` is a `OnePerModuleType`, then
`map[string]Foo` can be declared as an input parameter by some provider (which obviously cannot provide an instance of
`Foo` itself because that would cause a circular dependency).
`OnePerModuleType`s should be used whenever different modules may provide the type *and* there is a need to provide
an ordering of these types based on the module name. Generally, in blockchains there is always a need for deterministic
orderings so using module names to provide that ordering is generally a good strategy for this use case. Ordering based
on module names can either be done implicitly by sorting the module names or explicitly as a parameter in the module
configuration object.
#### `depinject.ManyPerContainerType`s
`ManyPerContainerType`s can be provided by as many providers in as many modules as the user would like. If a type `Bar`
is a `ManyPerContainerType`, a provider may define an output parameter of `Bar` or `[]Bar` to provide `Bar` instances
to the container. A provider may define an input parameter of `[]Bar` to get all of the `Bar` instances in the
container (such a provider may not also return `Bar` as that would cause a circular dependency). The ordering of `Bar`
instances in the `[]Bar` input type should be assumed to be deterministic.
`ManyPerContainerType`s should be used only when 1) ordering is unimportant or 2) the ordering can be defined by
some parameter on the type. For instance, if `Bar` had a field `Name string`, that is supposed to be unique in the
container then that could be used to provide an ordering. An example of a type that could work as a
`ManyPerContainerType` in this way is a wrapper around `*cobra.Command`, ex.
`type QueryCommand struct {*cobra.Command}`. This could be used to collect all the query commands in an app and then
cobra would take care of ordering. If this type of ordering is not available, a `OnePerModuleType` is probably a better
bet.
#### Module-scoped Providers/`depinject.ModuleKey` as an input
If `depinject.ModuleKey` is used as input parameter for a provider, the provider function will be treated as a
"module-scoped provider" which means that the provider function will be called exactly once every time
one of its outputs is needed by a module so that the provider can provide a unique instance of the dependency to
each module.
Module-scoped dependencies should be used to provide dependencies which are private and unique to each module. Examples
of these are store keys and param subspaces.
#### `error` as an output parameter
`error` can be used as the last output parameter on any provider or invoker. If a provider or invoker with an `error`
parameter returns a non-nil value for `error`, `depinject` will fail and propagate this error up to the caller.
### Provider Invocation Details
Providers are called lazily as they are needed and will be invoked at most once (except for "module-scoped providers"
described above) if and only if at least one of their outputs is needed somewhere in the dependency graph. Providers
will only get called if all of their non-optional inputs can successfully be resolved by some other module, otherwise an
error will occur. Modules should proactively mark dependencies as `optional` if the module can still be successfully
built without this dependency.
### Invoker Invocation Details
Invokers are called at the end of container initialization after all providers that were needed to build the graph
were called. All the dependencies of invokers are automatically marked as optional so invokers should `nil` check
every input parameter. Invokers may cause additional providers to get run if they have a dependency that wasn't built
yet. But if a dependency to an invoker cannot be provided for some reason, the invoker will still get called but with
`nil` for that input. This allows invokers to still work with the lazy invocation model of providers which only
builds things which are actually necessary as a dependency for some module or the caller.
Invokers should generally be used sparingly to perform some initialization logic which can't be done in the initial
provider, usually because of a circular dependency, and which may be optional.
### Best practices
* make dependencies `optional` whenever possible!
* interface types should be used whenever possible to avoid tight couplings between two modules.
* `OnePerModuleType`s should be used when there is something occurs at most once per module and the module name is a
convenient way for providing a deterministic order.
* `ManyPerContainerType`s should be used only when there is an obvious way to create an ordering from the types or
when ordering *really* doesn't matter (which is rare).
* module-scoped providers should be used for private, module-scoped dependencies
* use different providers for unrelated or loosely components or to resolve circular dependencies (see below)
* use invokers sparingly and always `nil`-check the inputs.
### Resolving Circular Dependencies
Circular dependencies are inevitable to crop up and there are ways to avoid them. While `depinject` cannot handle
circular dependency graphs of providers, many of the above tools are designed to enable satisfying circular dependencies
between modules.
One of the key tactics for resolving circular dependencies is to use different providers and/or invokers to allow a
circular dependency between components. For example, say the slashing keeper depends on the keeper module but the
staking keeper also depends on the staking module indirectly (in the form of "staking hooks"). The slashing module
can declare a dependency directly on the staking keeper (using an interface to avoid actually importing the staking
keeper package). It can also provide an instance of the slashing keeper wrapped as staking hooks in a `OnePerModuleType`
we'll call `StakingHooksWrapper`. Now, if the staking module directly depended on the staking hooks wrappers
(`map[string]StakingHooksWrapper`) we would have a circular dependency graph and `depinject` would fail. To fix this,
the staking module can define an invoker which depends on `map[string]StakingHooksWrapper` and the staking keeper
(which was provided by the staking module already in a separate provided). In this way `depinject` will be able to
satisfy this dependency graph which allows staking and slashing to depend on each other in this order:
* provide staking keeper -> slashing keeper
* provide slashing keeper wrapped as `StakingHooksWrapper`
* get `map[string]StakingHooksWrapper` and the staking keeper and wire them together
## 3. Testing and Debugging The Module
In order to test and debug the module configuration, we need to build an app config, generally defined in a YAML file.
This configuration should be passed first to `appconfig.LoadYAML` to get an `depinject.Config` instance.Then the
`depinject.Config` can be passed to `depinject.Inject` and we can try to resolve dependencies in the app config.
Alternatively, the `depinject.Config` can be created via [pure Go code](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_config.go).
Ex:
```go
//go:embed app.yaml
var appConfig []byte
var AppConfig = appconfig.LoadYAML(appConfig)
func TestModule(t *testing.T) {
var keeper Keeper
assert.NilError(t, depinject.Inject(AppConfig, &keeper))
}
```
### Debugging `depinject` Graphs
Whenever there is an error in a `depinject` graph, by default `depinject` will dump a bunch of logging output to the
console, print the error message, and save the dependency graph in [GraphViz](https://graphviz.org) DOT format to
the file `debug_container.dot`. Inspecting the GraphViz output by converting it to an SVG and viewing it in a web
browser or using some other GraphViz tool is *highly recommended*.
If `depinject` does not return an error but there is still some weird issue wiring up modules, inspecting the GraphViz
and logging output is still *highly recommended* and can be done using `depinject.InjectDebug` with the debug option
`depinject.Debug`.
App developers should attempt to familiarize themselves with the GraphViz graph of their app to see which modules
depend on which other modules.

View File

@ -1,7 +1,7 @@
package appmodule
import (
"cosmossdk.io/core/internal"
internal "cosmossdk.io/depinject/internal/appconfig"
)
// Option is a functional option for implementing modules.

View File

@ -5,7 +5,7 @@ import (
"google.golang.org/protobuf/proto"
"cosmossdk.io/core/internal"
internal "cosmossdk.io/depinject/internal/appconfig"
)
// Register registers a module with the global module registry. The provided

View File

@ -3,10 +3,14 @@ module cosmossdk.io/depinject
go 1.20
require (
cosmossdk.io/api v0.7.2
github.com/cockroachdb/errors v1.11.1
github.com/cosmos/cosmos-proto v1.0.0-beta.3
github.com/stretchr/testify v1.8.4
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e
golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb
google.golang.org/protobuf v1.31.0
gotest.tools/v3 v3.5.1
sigs.k8s.io/yaml v1.4.0
)
require (
@ -15,13 +19,17 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/getsentry/sentry-go v0.23.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c // indirect
google.golang.org/grpc v1.58.3 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

View File

@ -1,9 +1,13 @@
cosmossdk.io/api v0.7.2 h1:BO3i5fvKMKvfaUiMkCznxViuBEfyWA/k6w2eAF6q1C4=
cosmossdk.io/api v0.7.2/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38=
github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8=
github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw=
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE=
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs=
github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30=
github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o=
github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -12,6 +16,11 @@ github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
@ -36,14 +45,16 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb h1:mIKbk8weKhSeLH2GmUTrvx8CjkyJmnU1wFmg59CUjFA=
golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@ -64,9 +75,19 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c h1:jHkCUWkseRf+W+edG5hMzr/Uh1xkDREY4caybAq4dpY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0=
google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ=
google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=

View File

@ -104,18 +104,28 @@ All methods, structs and their fields must be public for `depinject`.
5. Create a function named `ProvideModule` (as called in 1.) and use the inputs for instantiating the module outputs.
```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/group/module/module.go#L220-L235
```
```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/group/module/module.go#L220-L235
```
The `ProvideModule` function should return an instance of `cosmossdk.io/core/appmodule.AppModule` which implements
one or more app module extension interfaces for initializing the module.
Following is the complete app wiring configuration for `group`:
```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/group/module/module.go#L194-L235
```
6. All modules must implement `depinject.OnePerModuleType` interface. This is used in order to tell the dependency injection framework that the module can only be instantiated once.
```go reference
https://github.com/cosmos/cosmos-sdk/blob/f4bdec3433373cc4950f4680743e969495763fbb/x/group/module/module.go#L64-L65
```
The `ProvideModule` function should return an instance of `cosmossdk.io/core/appmodule.AppModule` which implements
one or more app module extension interfaces for initializing the module.
Following is the complete app wiring configuration for `group`:
```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/group/module/module.go#L194-L235
```
The module is now ready to be used with `depinject` by a chain developer.

1
go.mod
View File

@ -178,6 +178,7 @@ require (
// )
// TODO remove after all modules have their own go.mods
replace (
cosmossdk.io/depinject => ./depinject
cosmossdk.io/x/auth => ./x/auth
cosmossdk.io/x/bank => ./x/bank
cosmossdk.io/x/distribution => ./x/distribution

2
go.sum
View File

@ -6,8 +6,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -68,3 +68,5 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
replace cosmossdk.io/depinject => ../depinject

View File

@ -2,8 +2,6 @@ cosmossdk.io/api v0.7.2 h1:BO3i5fvKMKvfaUiMkCznxViuBEfyWA/k6w2eAF6q1C4=
cosmossdk.io/api v0.7.2/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38=
cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo=
cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ=

View File

@ -16,11 +16,11 @@ import (
appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"
ormmodulev1alpha1 "cosmossdk.io/api/cosmos/orm/module/v1alpha1"
ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1"
"cosmossdk.io/core/appconfig"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/genesis"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
"cosmossdk.io/depinject/appconfig"
am "cosmossdk.io/depinject/appmodule"
_ "cosmossdk.io/orm" // required for ORM module registration
"cosmossdk.io/orm/internal/testkv"
"cosmossdk.io/orm/internal/testpb"
@ -36,8 +36,8 @@ import (
func init() {
// this registers the test module with the module registry
appmodule.Register(&testpb.Module{},
appmodule.Provide(NewKeeper),
am.Register(&testpb.Module{},
am.Provide(NewKeeper),
)
}

View File

@ -10,16 +10,16 @@ import (
appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"
modulev1alpha1 "cosmossdk.io/api/cosmos/orm/module/v1alpha1"
ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
"cosmossdk.io/orm/model/ormdb"
"cosmossdk.io/orm/model/ormtable"
)
func init() {
appmodule.Register(&modulev1alpha1.Module{},
appmodule.Provide(ProvideModuleDB),
am.Register(&modulev1alpha1.Module{},
am.Provide(ProvideModuleDB),
)
}

View File

@ -76,8 +76,8 @@ func (a *App) RegisterModules(modules ...module.AppModule) error {
appModule.RegisterInterfaces(a.interfaceRegistry)
appModule.RegisterLegacyAminoCodec(a.amino)
if module, ok := appModule.(module.HasServices); ok {
module.RegisterServices(a.configurator)
if mod, ok := appModule.(module.HasServices); ok {
mod.RegisterServices(a.configurator)
} else if module, ok := appModule.(appmodule.HasServices); ok {
if err := module.RegisterServices(a.configurator); err != nil {
return err

View File

@ -18,6 +18,7 @@ import (
"cosmossdk.io/core/genesis"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
"cosmossdk.io/log"
storetypes "cosmossdk.io/store/types"
"cosmossdk.io/x/tx/signing"
@ -58,8 +59,8 @@ type BaseAppOption func(*baseapp.BaseApp)
func (b BaseAppOption) IsManyPerContainerType() {}
func init() {
appmodule.Register(&runtimev1alpha1.Module{},
appmodule.Provide(
am.Register(&runtimev1alpha1.Module{},
am.Provide(
ProvideApp,
ProvideInterfaceRegistry,
ProvideKVStoreKey,
@ -74,7 +75,7 @@ func init() {
ProvideAppVersionModifier,
ProvideAddressCodec,
),
appmodule.Invoke(SetupAppBuilder),
am.Invoke(SetupAppBuilder),
)
}

View File

@ -26,8 +26,8 @@ import (
txconfigv1 "cosmossdk.io/api/cosmos/tx/config/v1"
upgrademodulev1 "cosmossdk.io/api/cosmos/upgrade/module/v1"
vestingmodulev1 "cosmossdk.io/api/cosmos/vesting/module/v1"
"cosmossdk.io/core/appconfig"
"cosmossdk.io/depinject"
"cosmossdk.io/depinject/appconfig"
_ "cosmossdk.io/x/auth/tx/config" // import for side-effects
authtypes "cosmossdk.io/x/auth/types"
_ "cosmossdk.io/x/auth/vesting" // import for side-effects

View File

@ -230,6 +230,7 @@ require (
replace (
cosmossdk.io/api => ../api
cosmossdk.io/client/v2 => ../client/v2
cosmossdk.io/depinject => ../depinject
cosmossdk.io/tools/confix => ../tools/confix
cosmossdk.io/x/accounts => ../x/accounts
cosmossdk.io/x/auth => ../x/auth

View File

@ -188,8 +188,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -22,9 +22,6 @@ schema = 3
[mod."cosmossdk.io/core"]
version = "v0.12.1-0.20231114100755-569e3ff6a0d7"
hash = "sha256-I74lq2kZ9hOcvOU4uJZ8LhSoQ0RbgCvAvSXj1xI0iII="
[mod."cosmossdk.io/depinject"]
version = "v1.0.0-alpha.4"
hash = "sha256-xpLH0K6ivQznFrLw2hmhWIIyYgqjstV47OhTEj/c1oQ="
[mod."cosmossdk.io/errors"]
version = "v1.0.0"
hash = "sha256-ZD1fhIefk3qkt9I4+ed9NBmBqTDvym9cXWmgFBh5qu0="

View File

@ -222,6 +222,7 @@ require (
replace (
cosmossdk.io/api => ../api
cosmossdk.io/client/v2 => ../client/v2
cosmossdk.io/depinject => ../depinject
cosmossdk.io/x/accounts => ../x/accounts
cosmossdk.io/x/auth => ../x/auth
cosmossdk.io/x/authz => ../x/authz

View File

@ -188,8 +188,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -14,6 +14,7 @@ replace (
replace (
cosmossdk.io/api => ../../../api
cosmossdk.io/client/v2 => ../../../client/v2
cosmossdk.io/depinject => ../../../depinject
cosmossdk.io/simapp => ../../../simapp
cosmossdk.io/x/accounts => ../../../x/accounts
cosmossdk.io/x/auth => ../../../x/auth

View File

@ -188,8 +188,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -23,8 +23,8 @@ import (
stakingmodulev1 "cosmossdk.io/api/cosmos/staking/module/v1"
txconfigv1 "cosmossdk.io/api/cosmos/tx/config/v1"
vestingmodulev1 "cosmossdk.io/api/cosmos/vesting/module/v1"
"cosmossdk.io/core/appconfig"
"cosmossdk.io/depinject"
"cosmossdk.io/depinject/appconfig"
"github.com/cosmos/cosmos-sdk/testutil"
)

View File

@ -160,6 +160,7 @@ replace github.com/cosmos/cosmos-sdk => ../../.
replace (
cosmossdk.io/api => ../../api
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/distribution => ../distribution

View File

@ -4,8 +4,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -166,6 +166,7 @@ replace github.com/cosmos/cosmos-sdk => ../../.
// TODO remove post spinning out all modules
replace (
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/distribution => ../distribution
cosmossdk.io/x/mint => ../mint

View File

@ -6,8 +6,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -12,6 +12,7 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
"cosmossdk.io/x/auth/keeper"
"cosmossdk.io/x/auth/simulation"
"cosmossdk.io/x/auth/types"
@ -35,6 +36,7 @@ var (
_ module.AppModuleSimulation = AppModule{}
_ module.HasGenesis = AppModule{}
_ module.HasServices = AppModule{}
_ depinject.OnePerModuleType = AppModule{}
_ appmodule.AppModule = AppModule{}
)
@ -173,8 +175,8 @@ func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.Weighte
//
func init() {
appmodule.Register(&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Register(&modulev1.Module{},
am.Provide(ProvideModule),
)
}

View File

@ -11,8 +11,8 @@ import (
bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1"
txconfigv1 "cosmossdk.io/api/cosmos/tx/config/v1"
"cosmossdk.io/core/address"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/depinject"
"cosmossdk.io/depinject/appmodule"
"cosmossdk.io/x/auth/ante"
"cosmossdk.io/x/auth/posthandler"
"cosmossdk.io/x/auth/tx"

View File

@ -11,6 +11,7 @@ import (
modulev1 "cosmossdk.io/api/cosmos/vesting/module/v1"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
"cosmossdk.io/x/auth/keeper"
"cosmossdk.io/x/auth/vesting/client/cli"
"cosmossdk.io/x/auth/vesting/types"
@ -25,8 +26,7 @@ var (
_ module.AppModuleBasic = AppModule{}
_ module.HasGenesis = AppModule{}
_ appmodule.AppModule = AppModule{}
_ appmodule.HasServices = AppModule{}
_ appmodule.AppModule = AppModule{}
)
// AppModuleBasic defines the basic application module used by the sub-vesting
@ -114,8 +114,8 @@ func (AppModule) ConsensusVersion() uint64 { return 1 }
//
func init() {
appmodule.Register(&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Register(&modulev1.Module{},
am.Provide(ProvideModule),
)
}

View File

@ -172,6 +172,7 @@ replace github.com/cosmos/cosmos-sdk => ../../.
// TODO remove post spinning out all modules
replace (
cosmossdk.io/api => ../../api
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/distribution => ../distribution

View File

@ -4,8 +4,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -12,6 +12,7 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
"cosmossdk.io/errors"
"cosmossdk.io/x/authz"
"cosmossdk.io/x/authz/client/cli"
@ -31,6 +32,7 @@ var (
_ module.AppModuleSimulation = AppModule{}
_ module.HasGenesis = AppModule{}
_ module.HasServices = AppModule{}
_ depinject.OnePerModuleType = AppModule{}
_ appmodule.AppModule = AppModule{}
_ appmodule.HasBeginBlocker = AppModule{}
@ -147,9 +149,9 @@ func (am AppModule) BeginBlock(ctx context.Context) error {
}
func init() {
appmodule.Register(
am.Register(
&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Provide(ProvideModule),
)
}

View File

@ -165,6 +165,7 @@ replace github.com/cosmos/cosmos-sdk => ../../.
// TODO remove post spinning out all modules
replace (
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/distribution => ../distribution
cosmossdk.io/x/mint => ../mint

View File

@ -6,8 +6,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -13,6 +13,7 @@ import (
"cosmossdk.io/core/appmodule"
corestore "cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
"cosmossdk.io/log"
authtypes "cosmossdk.io/x/auth/types"
"cosmossdk.io/x/bank/client/cli"
@ -38,6 +39,7 @@ var (
_ module.HasGenesis = AppModule{}
_ module.HasServices = AppModule{}
_ module.HasInvariants = AppModule{}
_ depinject.OnePerModuleType = AppModule{}
_ appmodule.AppModule = AppModule{}
)
@ -187,8 +189,8 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp
// App Wiring Setup
func init() {
appmodule.Register(&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Register(&modulev1.Module{},
am.Provide(ProvideModule),
)
}

View File

@ -165,6 +165,7 @@ require (
replace github.com/cosmos/cosmos-sdk => ../../.
replace (
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/distribution => ../distribution

View File

@ -6,8 +6,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -13,6 +13,7 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
authtypes "cosmossdk.io/x/auth/types"
"cosmossdk.io/x/circuit/keeper"
"cosmossdk.io/x/circuit/types"
@ -126,9 +127,9 @@ func (am AppModule) ExportGenesis(ctx context.Context, cdc codec.JSONCodec) json
}
func init() {
appmodule.Register(
am.Register(
&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Provide(ProvideModule),
)
}

View File

@ -11,6 +11,7 @@ import (
"cosmossdk.io/core/event"
storetypes "cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
authtypes "cosmossdk.io/x/auth/types"
"github.com/cosmos/cosmos-sdk/baseapp"
@ -29,8 +30,7 @@ const ConsensusVersion = 1
var (
_ module.AppModuleBasic = AppModule{}
_ appmodule.AppModule = AppModule{}
_ appmodule.HasServices = AppModule{}
_ appmodule.AppModule = AppModule{}
)
// AppModuleBasic defines the basic application module used by the consensus module.
@ -90,9 +90,9 @@ func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule {
func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion }
func init() {
appmodule.Register(
am.Register(
&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Provide(ProvideModule),
)
}

View File

@ -9,6 +9,7 @@ import (
"cosmossdk.io/core/event"
storetypes "cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
@ -21,8 +22,7 @@ import (
var (
_ module.AppModuleBasic = AppModule{}
_ appmodule.AppModule = AppModule{}
_ appmodule.HasServices = AppModule{}
_ appmodule.AppModule = AppModule{}
)
// AppModuleBasic defines the basic application module used by the consensus module.
@ -74,9 +74,9 @@ func NewAppModule(keeper keeper.Keeper) AppModule {
func (AppModule) ConsensusVersion() uint64 { return 1 }
func init() {
appmodule.Register(
am.Register(
&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Provide(ProvideModule),
)
}

View File

@ -15,6 +15,7 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
authtypes "cosmossdk.io/x/auth/types"
"github.com/cosmos/cosmos-sdk/client"
@ -163,9 +164,9 @@ func (am AppModule) EndBlock(ctx context.Context) error {
// App Wiring Setup
func init() {
appmodule.Register(
am.Register(
&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Provide(ProvideModule),
)
}

View File

@ -167,6 +167,7 @@ require (
replace github.com/cosmos/cosmos-sdk => ../../.
replace (
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/mint => ../mint

View File

@ -6,8 +6,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -12,6 +12,7 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
authtypes "cosmossdk.io/x/auth/types"
"cosmossdk.io/x/distribution/client/cli"
"cosmossdk.io/x/distribution/keeper"
@ -36,6 +37,7 @@ var (
_ module.HasGenesis = AppModule{}
_ module.HasServices = AppModule{}
_ module.HasInvariants = AppModule{}
_ depinject.OnePerModuleType = AppModule{}
_ appmodule.AppModule = AppModule{}
_ appmodule.HasBeginBlocker = AppModule{}
@ -199,8 +201,8 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp
//
func init() {
appmodule.Register(&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Register(&modulev1.Module{},
am.Provide(ProvideModule),
)
}

View File

@ -167,6 +167,7 @@ require (
replace github.com/cosmos/cosmos-sdk => ../../.
replace (
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/distribution => ../distribution

View File

@ -6,8 +6,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -14,6 +14,7 @@ import (
"cosmossdk.io/core/appmodule"
store "cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
eviclient "cosmossdk.io/x/evidence/client"
"cosmossdk.io/x/evidence/client/cli"
"cosmossdk.io/x/evidence/keeper"
@ -33,7 +34,6 @@ var (
_ module.HasGenesis = AppModule{}
_ appmodule.AppModule = AppModule{}
_ appmodule.HasServices = AppModule{}
_ appmodule.HasBeginBlocker = AppModule{}
)
@ -180,8 +180,8 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp
//
func init() {
appmodule.Register(&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Register(&modulev1.Module{},
am.Provide(ProvideModule),
)
}

View File

@ -169,6 +169,7 @@ require (
replace github.com/cosmos/cosmos-sdk => ../../.
replace (
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/distribution => ../distribution

View File

@ -6,8 +6,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -12,6 +12,7 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
"cosmossdk.io/errors"
"cosmossdk.io/x/feegrant"
"cosmossdk.io/x/feegrant/client/cli"
@ -30,6 +31,7 @@ var (
_ module.AppModuleSimulation = AppModule{}
_ module.HasServices = AppModule{}
_ module.HasGenesis = AppModule{}
_ depinject.OnePerModuleType = AppModule{}
_ appmodule.AppModule = AppModule{}
_ appmodule.HasEndBlocker = AppModule{}
@ -163,8 +165,8 @@ func (am AppModule) EndBlock(ctx context.Context) error {
}
func init() {
appmodule.Register(&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Register(&modulev1.Module{},
am.Provide(ProvideModule),
)
}

View File

@ -12,6 +12,7 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/genesis"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
@ -120,8 +121,8 @@ func (am AppModule) ExportGenesis(_ context.Context, cdc codec.JSONCodec) json.R
func (AppModule) ConsensusVersion() uint64 { return 1 }
func init() {
appmodule.Register(&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Register(&modulev1.Module{},
am.Provide(ProvideModule),
)
}

View File

@ -169,6 +169,7 @@ replace github.com/cosmos/cosmos-sdk => ../../.
replace (
cosmossdk.io/api => ../../api
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/distribution => ../distribution

View File

@ -4,8 +4,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -17,6 +17,7 @@ import (
"cosmossdk.io/core/appmodule"
store "cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
authtypes "cosmossdk.io/x/auth/types"
govclient "cosmossdk.io/x/gov/client"
"cosmossdk.io/x/gov/client/cli"
@ -151,10 +152,10 @@ func (am AppModule) IsOnePerModuleType() {}
func (am AppModule) IsAppModule() {}
func init() {
appmodule.Register(
am.Register(
&modulev1.Module{},
appmodule.Invoke(InvokeAddRoutes, InvokeSetHooks),
appmodule.Provide(ProvideModule))
am.Invoke(InvokeAddRoutes, InvokeSetHooks),
am.Provide(ProvideModule))
}
type ModuleInputs struct {

View File

@ -172,6 +172,7 @@ replace github.com/cosmos/cosmos-sdk => ../../
replace (
cosmossdk.io/api => ../../api
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/authz => ../authz
cosmossdk.io/x/bank => ../bank

View File

@ -4,8 +4,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -12,6 +12,7 @@ import (
"cosmossdk.io/core/address"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
store "cosmossdk.io/store/types"
"cosmossdk.io/x/group"
"cosmossdk.io/x/group/client/cli"
@ -36,6 +37,7 @@ var (
_ module.HasGenesis = AppModule{}
_ module.HasServices = AppModule{}
_ module.HasInvariants = AppModule{}
_ depinject.OnePerModuleType = AppModule{}
_ appmodule.AppModule = AppModule{}
_ appmodule.HasEndBlocker = AppModule{}
@ -180,9 +182,9 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp
//
func init() {
appmodule.Register(
am.Register(
&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Provide(ProvideModule),
)
}

View File

@ -166,6 +166,7 @@ replace github.com/cosmos/cosmos-sdk => ../../.
// TODO remove post spinning out all modules
replace (
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/distribution => ../distribution

View File

@ -6,8 +6,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -11,6 +11,7 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
authtypes "cosmossdk.io/x/auth/types"
"cosmossdk.io/x/mint/keeper"
"cosmossdk.io/x/mint/simulation"
@ -31,6 +32,7 @@ var (
_ module.AppModuleSimulation = AppModule{}
_ module.HasGenesis = AppModule{}
_ module.HasServices = AppModule{}
_ depinject.OnePerModuleType = AppModule{}
_ appmodule.AppModule = AppModule{}
_ appmodule.HasBeginBlocker = AppModule{}
@ -181,8 +183,8 @@ func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.Weighte
//
func init() {
appmodule.Register(&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Register(&modulev1.Module{},
am.Provide(ProvideModule),
)
}

View File

@ -166,6 +166,7 @@ require (
replace github.com/cosmos/cosmos-sdk => ../../.
replace (
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/distribution => ../distribution

View File

@ -6,8 +6,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -12,6 +12,7 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
"cosmossdk.io/errors"
"cosmossdk.io/x/nft"
"cosmossdk.io/x/nft/keeper"
@ -29,8 +30,7 @@ var (
_ module.AppModuleSimulation = AppModule{}
_ module.HasGenesis = AppModule{}
_ appmodule.AppModule = AppModule{}
_ appmodule.HasServices = AppModule{}
_ appmodule.AppModule = AppModule{}
)
// AppModuleBasic defines the basic application module used by the nft module.
@ -156,8 +156,8 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp
//
func init() {
appmodule.Register(&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Register(&modulev1.Module{},
am.Provide(ProvideModule),
)
}

View File

@ -166,6 +166,7 @@ require (
replace github.com/cosmos/cosmos-sdk => ../..
replace (
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/distribution => ../distribution

View File

@ -6,8 +6,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -8,6 +8,7 @@ import (
modulev1 "cosmossdk.io/api/cosmos/params/module/v1"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
store "cosmossdk.io/store/types"
govv1beta1 "cosmossdk.io/x/gov/types/v1beta1"
"cosmossdk.io/x/params/keeper"
@ -25,6 +26,7 @@ var (
_ module.AppModuleBasic = AppModule{}
_ module.AppModuleSimulation = AppModule{}
_ module.HasServices = AppModule{}
_ depinject.OnePerModuleType = AppModule{}
_ appmodule.AppModule = AppModule{}
)
@ -102,8 +104,8 @@ func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion }
//
func init() {
appmodule.Register(&modulev1.Module{},
appmodule.Provide(
am.Register(&modulev1.Module{},
am.Provide(
ProvideModule,
ProvideSubspace,
))

View File

@ -167,6 +167,7 @@ require (
replace github.com/cosmos/cosmos-sdk => ../../.
replace (
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/distribution => ../distribution

View File

@ -6,8 +6,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -9,6 +9,7 @@ import (
"cosmossdk.io/core/appmodule"
storetypes "cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
authtypes "cosmossdk.io/x/auth/types"
"cosmossdk.io/x/protocolpool/keeper"
"cosmossdk.io/x/protocolpool/simulation"
@ -97,9 +98,9 @@ func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion }
//
func init() {
appmodule.Register(
am.Register(
&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Provide(ProvideModule),
)
}

View File

@ -170,6 +170,7 @@ replace github.com/cosmos/cosmos-sdk => ../../.
// TODO remove post spinning out all modules
replace (
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/distribution => ../distribution

View File

@ -6,8 +6,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -11,6 +11,7 @@ import (
"cosmossdk.io/core/appmodule"
store "cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
authtypes "cosmossdk.io/x/auth/types"
"cosmossdk.io/x/slashing/keeper"
"cosmossdk.io/x/slashing/simulation"
@ -187,9 +188,9 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp
//
func init() {
appmodule.Register(
am.Register(
&modulev1.Module{},
appmodule.Provide(ProvideModule),
am.Provide(ProvideModule),
)
}

View File

@ -170,6 +170,7 @@ replace github.com/cosmos/cosmos-sdk => ../../.
// TODO remove post spinning out all modules
replace (
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/distribution => ../distribution

View File

@ -6,8 +6,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -15,6 +15,7 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
authtypes "cosmossdk.io/x/auth/types"
"cosmossdk.io/x/staking/client/cli"
"cosmossdk.io/x/staking/keeper"
@ -41,6 +42,7 @@ var (
_ module.HasInvariants = AppModule{}
_ module.HasABCIGenesis = AppModule{}
_ module.HasABCIEndBlock = AppModule{}
_ depinject.OnePerModuleType = AppModule{}
_ appmodule.AppModule = AppModule{}
_ appmodule.HasBeginBlocker = AppModule{}
@ -180,10 +182,10 @@ func (am AppModule) EndBlock(ctx context.Context) ([]abci.ValidatorUpdate, error
}
func init() {
appmodule.Register(
am.Register(
&modulev1.Module{},
appmodule.Provide(ProvideModule),
appmodule.Invoke(InvokeSetStakingHooks),
am.Provide(ProvideModule),
am.Invoke(InvokeSetStakingHooks),
)
}

View File

@ -196,6 +196,7 @@ replace github.com/cosmos/cosmos-sdk => ../../.
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
replace (
cosmossdk.io/depinject => ../../depinject
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/distribution => ../distribution

View File

@ -190,8 +190,6 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 h1:hOzi4yo2Fc7h3mod+xX4m4QA4+Uq+PkFRjY/yalZ0B8=
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7/go.mod h1:3v0JJNNd8ye0cOvJ+wUUvE7Ke0d2qxnNIDcXd5mziHk=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=

View File

@ -14,6 +14,7 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
am "cosmossdk.io/depinject/appmodule"
authtypes "cosmossdk.io/x/auth/types"
"cosmossdk.io/x/upgrade/client/cli"
"cosmossdk.io/x/upgrade/keeper"
@ -165,9 +166,9 @@ func (am AppModule) PreBlock(ctx context.Context) (appmodule.ResponsePreBlock, e
//
func init() {
appmodule.Register(&modulev1.Module{},
appmodule.Provide(ProvideModule),
appmodule.Invoke(PopulateVersionMap),
am.Register(&modulev1.Module{},
am.Provide(ProvideModule),
am.Invoke(PopulateVersionMap),
)
}