Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename depinject imports to cosmossdk.io/depinject #12479

Merged
merged 3 commits into from
Jul 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/appconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"

"github.com/cosmos/cosmos-sdk/depinject"
"cosmossdk.io/depinject"

"cosmossdk.io/core/internal"
)
Expand Down
2 changes: 1 addition & 1 deletion core/appconfig/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"cosmossdk.io/core/internal"
"cosmossdk.io/core/internal/testpb"
_ "cosmossdk.io/core/internal/testpb"
"github.com/cosmos/cosmos-sdk/depinject"
"cosmossdk.io/depinject"
)

func expectContainerErrorContains(t *testing.T, option depinject.Config, contains string) {
Expand Down
2 changes: 1 addition & 1 deletion core/appmodule/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package appmodule

import (
"cosmossdk.io/core/internal"
"github.com/cosmos/cosmos-sdk/depinject"
"cosmossdk.io/depinject"
)

// Option is a functional option for implementing modules.
Expand Down
4 changes: 2 additions & 2 deletions core/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.18
require (
cosmossdk.io/api v0.1.0-alpha8
github.com/cosmos/cosmos-proto v1.0.0-alpha7
github.com/cosmos/cosmos-sdk/depinject v1.0.0-alpha.4
cosmossdk.io/depinject v1.0.0-alpha.4
google.golang.org/protobuf v1.28.0
gotest.tools/v3 v3.2.0
sigs.k8s.io/yaml v1.3.0
Expand All @@ -28,5 +28,5 @@ require (

replace (
cosmossdk.io/api => ../api
github.com/cosmos/cosmos-sdk/depinject => ../depinject
cosmossdk.io/depinject => ../depinject
)
2 changes: 1 addition & 1 deletion core/internal/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"

"github.com/cosmos/cosmos-sdk/depinject"
"cosmossdk.io/depinject"
)

// ModuleRegistry is the registry of module initializers indexed by their golang
Expand Down
2 changes: 1 addition & 1 deletion core/internal/testpb/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sort"

"cosmossdk.io/core/appmodule"
"github.com/cosmos/cosmos-sdk/depinject"
"cosmossdk.io/depinject"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions depinject/binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/regen-network/gocuke"
"github.com/stretchr/testify/assert"

"github.com/cosmos/cosmos-sdk/depinject"
"cosmossdk.io/depinject"
)

func TestBindInterface(t *testing.T) {
Expand Down Expand Up @@ -120,7 +120,7 @@ func (s *bindingSuite) ThereIsNoError() {
}

func fullTypeName(typeName string) string {
return fmt.Sprintf("github.com/cosmos/cosmos-sdk/depinject_test/depinject_test.%s", typeName)
return fmt.Sprintf("cosmossdk.io/depinject_test/depinject_test.%s", typeName)
}

func (s *bindingSuite) ThereIsAGlobalBindingForA(preferredType string, interfaceType string) {
Expand Down
8 changes: 4 additions & 4 deletions depinject/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func invoke(ctr *container, key *moduleKey, invokers []interface{}) error {
// instance when an interface of type Duck is requested as an input.
//
// BindInterface(
// "github.com/cosmos/cosmos-sdk/depinject_test/depinject_test.Duck",
// "github.com/cosmos/cosmos-sdk/depinject_test/depinject_test.Canvasback")
// "cosmossdk.io/depinject_test/depinject_test.Duck",
// "cosmossdk.io/depinject_test/depinject_test.Canvasback")
func BindInterface(inTypeName string, outTypeName string) Config {
return containerConfig(func(ctr *container) error {
return bindInterface(ctr, inTypeName, outTypeName, "")
Expand All @@ -107,8 +107,8 @@ func BindInterface(inTypeName string, outTypeName string) Config {
//
// BindInterfaceInModule(
// "moduleFoo",
// "github.com/cosmos/cosmos-sdk/depinject_test/depinject_test.Duck",
// "github.com/cosmos/cosmos-sdk/depinject_test/depinject_test.Canvasback")
// "cosmossdk.io/depinject_test/depinject_test.Duck",
// "cosmossdk.io/depinject_test/depinject_test.Canvasback")
func BindInterfaceInModule(moduleName string, inTypeName string, outTypeName string) Config {
return containerConfig(func(ctr *container) error {
return bindInterface(ctr, inTypeName, outTypeName, moduleName)
Expand Down
2 changes: 1 addition & 1 deletion depinject/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/pkg/errors"

"github.com/cosmos/cosmos-sdk/depinject/internal/graphviz"
"cosmossdk.io/depinject/internal/graphviz"
)

type container struct {
Expand Down
2 changes: 1 addition & 1 deletion depinject/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/require"
"gotest.tools/v3/golden"

"github.com/cosmos/cosmos-sdk/depinject"
"cosmossdk.io/depinject"
)

type KVStoreKey struct {
Expand Down
2 changes: 1 addition & 1 deletion depinject/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"path/filepath"
"reflect"

"github.com/cosmos/cosmos-sdk/depinject/internal/graphviz"
"cosmossdk.io/depinject/internal/graphviz"
)

// DebugOption is a functional option for running a container that controls
Expand Down
2 changes: 1 addition & 1 deletion depinject/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/cosmos/cosmos-sdk/depinject
module cosmossdk.io/depinject

go 1.18

Expand Down
2 changes: 1 addition & 1 deletion depinject/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/pkg/errors"

"github.com/cosmos/cosmos-sdk/depinject/internal/graphviz"
"cosmossdk.io/depinject/internal/graphviz"
)

// ManyPerContainerType marks a type which automatically gets grouped together. For an ManyPerContainerType T,
Expand Down
2 changes: 1 addition & 1 deletion depinject/internal/graphviz/attrs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"github.com/cosmos/cosmos-sdk/depinject/internal/util"
"cosmossdk.io/depinject/internal/util"
)

// Attributes represents a graphviz attributes map.
Expand Down
2 changes: 1 addition & 1 deletion depinject/internal/graphviz/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"io"

"github.com/cosmos/cosmos-sdk/depinject/internal/util"
"cosmossdk.io/depinject/internal/util"
)

// Graph represents a graphviz digraph.
Expand Down
2 changes: 1 addition & 1 deletion depinject/invoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/regen-network/gocuke"
"gotest.tools/v3/assert"

"github.com/cosmos/cosmos-sdk/depinject"
"cosmossdk.io/depinject"
)

func TestInvoke(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion depinject/module_dep.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package depinject
import (
"reflect"

"github.com/cosmos/cosmos-sdk/depinject/internal/graphviz"
"cosmossdk.io/depinject/internal/graphviz"
)

type moduleDepProvider struct {
Expand Down
2 changes: 1 addition & 1 deletion depinject/one_per_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/pkg/errors"

"github.com/cosmos/cosmos-sdk/depinject/internal/graphviz"
"cosmossdk.io/depinject/internal/graphviz"
)

// OnePerModuleType marks a type which
Expand Down
2 changes: 1 addition & 1 deletion depinject/provider_desc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/cosmos/cosmos-sdk/depinject"
"cosmossdk.io/depinject"
)

type StructIn struct {
Expand Down
2 changes: 1 addition & 1 deletion depinject/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package depinject
import (
"reflect"

"github.com/cosmos/cosmos-sdk/depinject/internal/graphviz"
"cosmossdk.io/depinject/internal/graphviz"
)

type resolver interface {
Expand Down
2 changes: 1 addition & 1 deletion depinject/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package depinject
import (
"reflect"

"github.com/cosmos/cosmos-sdk/depinject/internal/graphviz"
"cosmossdk.io/depinject/internal/graphviz"
)

type simpleProvider struct {
Expand Down
2 changes: 1 addition & 1 deletion depinject/supply.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package depinject
import (
"reflect"

"github.com/cosmos/cosmos-sdk/depinject/internal/graphviz"
"cosmossdk.io/depinject/internal/graphviz"
)

type supplyResolver struct {
Expand Down
56 changes: 28 additions & 28 deletions depinject/testdata/example.dot
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
digraph "" {
subgraph "cluster_a" {
graph [fontsize="12.0", label="Module: a", penwidth="0.5", style="rounded"];
"github.com/cosmos/cosmos-sdk/depinject_test.ModuleA.Provide"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"];
"cosmossdk.io/depinject_test.ModuleA.Provide"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"];
}

subgraph "cluster_b" {
graph [fontsize="12.0", label="Module: b", penwidth="0.5", style="rounded"];
"github.com/cosmos/cosmos-sdk/depinject_test.ModuleB.Provide"[color="black", fontcolor="black", penwidth="1.5", shape="box"];
"cosmossdk.io/depinject_test.ModuleB.Provide"[color="black", fontcolor="black", penwidth="1.5", shape="box"];
}

subgraph "cluster_runtime" {
graph [fontsize="12.0", label="Module: runtime", penwidth="0.5", style="rounded"];
"github.com/cosmos/cosmos-sdk/depinject_test.ProvideKVStoreKey"[color="black", fontcolor="black", penwidth="1.5", shape="box"];
"cosmossdk.io/depinject_test.ProvideKVStoreKey"[color="black", fontcolor="black", penwidth="1.5", shape="box"];
}

"[]github.com/cosmos/cosmos-sdk/depinject_test.Command"[color="lightgrey", comment="many-per-container", fontcolor="dimgrey", penwidth="0.5"];
"github.com/cosmos/cosmos-sdk/depinject.ModuleKey"[color="black", fontcolor="black", penwidth="1.5"];
"github.com/cosmos/cosmos-sdk/depinject.OwnModuleKey"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"];
"github.com/cosmos/cosmos-sdk/depinject_test.KVStoreKey"[color="black", fontcolor="black", penwidth="1.5"];
"github.com/cosmos/cosmos-sdk/depinject_test.KeeperA"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"];
"github.com/cosmos/cosmos-sdk/depinject_test.KeeperB"[color="black", fontcolor="black", penwidth="1.5"];
"github.com/cosmos/cosmos-sdk/depinject_test.MsgClientA"[color="black", fontcolor="black", penwidth="1.5"];
"github.com/cosmos/cosmos-sdk/depinject_test.ProvideMsgClientA"[color="black", fontcolor="black", penwidth="1.5", shape="box"];
"github.com/cosmos/cosmos-sdk/depinject_test.TestGraphAndLogOutput"[color="black", fontcolor="black", penwidth="1.5", shape="hexagon"];
"map[string]github.com/cosmos/cosmos-sdk/depinject_test.Handler"[color="lightgrey", comment="one-per-module", fontcolor="dimgrey", penwidth="0.5"];
"github.com/cosmos/cosmos-sdk/depinject.ModuleKey" -> "github.com/cosmos/cosmos-sdk/depinject_test.ProvideMsgClientA";
"github.com/cosmos/cosmos-sdk/depinject_test.ProvideMsgClientA" -> "github.com/cosmos/cosmos-sdk/depinject_test.MsgClientA";
"github.com/cosmos/cosmos-sdk/depinject.ModuleKey" -> "github.com/cosmos/cosmos-sdk/depinject_test.ProvideKVStoreKey";
"github.com/cosmos/cosmos-sdk/depinject_test.ProvideKVStoreKey" -> "github.com/cosmos/cosmos-sdk/depinject_test.KVStoreKey";
"github.com/cosmos/cosmos-sdk/depinject_test.KVStoreKey" -> "github.com/cosmos/cosmos-sdk/depinject_test.ModuleA.Provide";
"github.com/cosmos/cosmos-sdk/depinject.OwnModuleKey" -> "github.com/cosmos/cosmos-sdk/depinject_test.ModuleA.Provide";
"github.com/cosmos/cosmos-sdk/depinject_test.ModuleA.Provide" -> "github.com/cosmos/cosmos-sdk/depinject_test.KeeperA";
"github.com/cosmos/cosmos-sdk/depinject_test.ModuleA.Provide" -> "map[string]github.com/cosmos/cosmos-sdk/depinject_test.Handler";
"github.com/cosmos/cosmos-sdk/depinject_test.ModuleA.Provide" -> "[]github.com/cosmos/cosmos-sdk/depinject_test.Command";
"github.com/cosmos/cosmos-sdk/depinject_test.KVStoreKey" -> "github.com/cosmos/cosmos-sdk/depinject_test.ModuleB.Provide";
"github.com/cosmos/cosmos-sdk/depinject_test.MsgClientA" -> "github.com/cosmos/cosmos-sdk/depinject_test.ModuleB.Provide";
"github.com/cosmos/cosmos-sdk/depinject_test.ModuleB.Provide" -> "github.com/cosmos/cosmos-sdk/depinject_test.KeeperB";
"github.com/cosmos/cosmos-sdk/depinject_test.ModuleB.Provide" -> "[]github.com/cosmos/cosmos-sdk/depinject_test.Command";
"github.com/cosmos/cosmos-sdk/depinject_test.ModuleB.Provide" -> "map[string]github.com/cosmos/cosmos-sdk/depinject_test.Handler";
"github.com/cosmos/cosmos-sdk/depinject_test.KeeperB" -> "github.com/cosmos/cosmos-sdk/depinject_test.TestGraphAndLogOutput";
"[]cosmossdk.io/depinject_test.Command"[color="lightgrey", comment="many-per-container", fontcolor="dimgrey", penwidth="0.5"];
"cosmossdk.io/depinject.ModuleKey"[color="black", fontcolor="black", penwidth="1.5"];
"cosmossdk.io/depinject.OwnModuleKey"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"];
"cosmossdk.io/depinject_test.KVStoreKey"[color="black", fontcolor="black", penwidth="1.5"];
"cosmossdk.io/depinject_test.KeeperA"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"];
"cosmossdk.io/depinject_test.KeeperB"[color="black", fontcolor="black", penwidth="1.5"];
"cosmossdk.io/depinject_test.MsgClientA"[color="black", fontcolor="black", penwidth="1.5"];
"cosmossdk.io/depinject_test.ProvideMsgClientA"[color="black", fontcolor="black", penwidth="1.5", shape="box"];
"cosmossdk.io/depinject_test.TestGraphAndLogOutput"[color="black", fontcolor="black", penwidth="1.5", shape="hexagon"];
"map[string]cosmossdk.io/depinject_test.Handler"[color="lightgrey", comment="one-per-module", fontcolor="dimgrey", penwidth="0.5"];
"cosmossdk.io/depinject.ModuleKey" -> "cosmossdk.io/depinject_test.ProvideMsgClientA";
"cosmossdk.io/depinject_test.ProvideMsgClientA" -> "cosmossdk.io/depinject_test.MsgClientA";
"cosmossdk.io/depinject.ModuleKey" -> "cosmossdk.io/depinject_test.ProvideKVStoreKey";
"cosmossdk.io/depinject_test.ProvideKVStoreKey" -> "cosmossdk.io/depinject_test.KVStoreKey";
"cosmossdk.io/depinject_test.KVStoreKey" -> "cosmossdk.io/depinject_test.ModuleA.Provide";
"cosmossdk.io/depinject.OwnModuleKey" -> "cosmossdk.io/depinject_test.ModuleA.Provide";
"cosmossdk.io/depinject_test.ModuleA.Provide" -> "cosmossdk.io/depinject_test.KeeperA";
"cosmossdk.io/depinject_test.ModuleA.Provide" -> "map[string]cosmossdk.io/depinject_test.Handler";
"cosmossdk.io/depinject_test.ModuleA.Provide" -> "[]cosmossdk.io/depinject_test.Command";
"cosmossdk.io/depinject_test.KVStoreKey" -> "cosmossdk.io/depinject_test.ModuleB.Provide";
"cosmossdk.io/depinject_test.MsgClientA" -> "cosmossdk.io/depinject_test.ModuleB.Provide";
"cosmossdk.io/depinject_test.ModuleB.Provide" -> "cosmossdk.io/depinject_test.KeeperB";
"cosmossdk.io/depinject_test.ModuleB.Provide" -> "[]cosmossdk.io/depinject_test.Command";
"cosmossdk.io/depinject_test.ModuleB.Provide" -> "map[string]cosmossdk.io/depinject_test.Handler";
"cosmossdk.io/depinject_test.KeeperB" -> "cosmossdk.io/depinject_test.TestGraphAndLogOutput";
}

Loading