diff --git a/baseapp/abci.go b/baseapp/abci.go index 7e83e68fc012..d0fb4b6c0985 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -2,12 +2,12 @@ package baseapp import ( "context" + "errors" "fmt" "sort" "strings" "time" - "github.com/cockroachdb/errors" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1" "github.com/cosmos/gogoproto/proto" diff --git a/baseapp/abci_utils.go b/baseapp/abci_utils.go index c1fffef636eb..7c9aac3202a1 100644 --- a/baseapp/abci_utils.go +++ b/baseapp/abci_utils.go @@ -3,10 +3,10 @@ package baseapp import ( "bytes" "context" + "errors" "fmt" "slices" - "github.com/cockroachdb/errors" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1" cryptoenc "github.com/cometbft/cometbft/crypto/encoding" diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index ba0c43cfd1f3..719eff6a2476 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -2,13 +2,13 @@ package baseapp import ( "context" + "errors" "fmt" "math" "sort" "strconv" "sync" - "github.com/cockroachdb/errors" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1" "github.com/cometbft/cometbft/crypto/tmhash" diff --git a/client/cmd.go b/client/cmd.go index d4f0693d7e4a..3fc29ad62be7 100644 --- a/client/cmd.go +++ b/client/cmd.go @@ -3,11 +3,11 @@ package client import ( "context" "crypto/tls" + "errors" "fmt" "slices" "strings" - "github.com/cockroachdb/errors" "github.com/spf13/cobra" "github.com/spf13/pflag" "google.golang.org/grpc" diff --git a/client/query.go b/client/query.go index 9e8fd30db71f..a90f80e79fa4 100644 --- a/client/query.go +++ b/client/query.go @@ -2,10 +2,10 @@ package client import ( "context" + "errors" "fmt" "strings" - "github.com/cockroachdb/errors" abci "github.com/cometbft/cometbft/abci/types" rpcclient "github.com/cometbft/cometbft/rpc/client" "google.golang.org/grpc/codes" diff --git a/client/v2/autocli/flag/binary.go b/client/v2/autocli/flag/binary.go index a1a93179f290..fc954d763148 100644 --- a/client/v2/autocli/flag/binary.go +++ b/client/v2/autocli/flag/binary.go @@ -4,9 +4,9 @@ import ( "context" "encoding/base64" "encoding/hex" + "errors" "os" - "github.com/cockroachdb/errors" "google.golang.org/protobuf/reflect/protoreflect" ) diff --git a/client/v2/autocli/flag/map.go b/client/v2/autocli/flag/map.go index c2f512503dfa..f6b21f8a963a 100644 --- a/client/v2/autocli/flag/map.go +++ b/client/v2/autocli/flag/map.go @@ -2,10 +2,10 @@ package flag import ( "context" + "errors" "fmt" "strings" - "github.com/cockroachdb/errors" "github.com/spf13/pflag" "google.golang.org/protobuf/reflect/protoreflect" diff --git a/client/v2/autocli/flag/maps/generic.go b/client/v2/autocli/flag/maps/generic.go index 3d610bf9a062..1a734faf0bb7 100644 --- a/client/v2/autocli/flag/maps/generic.go +++ b/client/v2/autocli/flag/maps/generic.go @@ -1,9 +1,8 @@ package maps import ( + "fmt" "strings" - - "github.com/cockroachdb/errors" ) type genericMapValueOptions[K comparable, V any] struct { @@ -31,7 +30,7 @@ func (gm *genericMapValue[K, V]) Set(val string) error { for _, pair := range ss { kv := strings.SplitN(pair, "=", 2) if len(kv) != 2 { - return errors.Errorf("%s must be formatted as key=value", pair) + return fmt.Errorf("%s must be formatted as key=value", pair) } key, err := gm.Options.keyParser(kv[0]) if err != nil { diff --git a/client/v2/autocli/msg.go b/client/v2/autocli/msg.go index 797c4c417348..25e7bbfa3c6d 100644 --- a/client/v2/autocli/msg.go +++ b/client/v2/autocli/msg.go @@ -4,7 +4,6 @@ import ( "context" "fmt" - "github.com/cockroachdb/errors" gogoproto "github.com/cosmos/gogoproto/proto" "github.com/spf13/cobra" "google.golang.org/protobuf/proto" @@ -69,7 +68,7 @@ func (b *Builder) AddMsgServiceCommands(cmd *cobra.Command, cmdDescriptor *autoc descriptor, err := b.FileResolver.FindDescriptorByName(protoreflect.FullName(cmdDescriptor.Service)) if err != nil { - return errors.Errorf("can't find service %s: %v", cmdDescriptor.Service, err) + return fmt.Errorf("can't find service %s: %w", cmdDescriptor.Service, err) } service := descriptor.(protoreflect.ServiceDescriptor) methods := service.Methods() diff --git a/client/v2/autocli/query.go b/client/v2/autocli/query.go index ace56f459c90..161abd75867e 100644 --- a/client/v2/autocli/query.go +++ b/client/v2/autocli/query.go @@ -10,7 +10,7 @@ import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" "cosmossdk.io/math" "cosmossdk.io/x/tx/signing/aminojson" - "github.com/cockroachdb/errors" + "github.com/spf13/cobra" "google.golang.org/protobuf/reflect/protoreflect" @@ -62,7 +62,7 @@ func (b *Builder) AddQueryServiceCommands(cmd *cobra.Command, cmdDescriptor *aut descriptor, err := b.FileResolver.FindDescriptorByName(protoreflect.FullName(cmdDescriptor.Service)) if err != nil { - return errors.Errorf("can't find service %s: %v", cmdDescriptor.Service, err) + return fmt.Errorf("can't find service %s: %w", cmdDescriptor.Service, err) } service := descriptor.(protoreflect.ServiceDescriptor) diff --git a/client/v2/go.mod b/client/v2/go.mod index 1be5cc04ecf8..8a92728f702e 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -10,7 +10,7 @@ require ( cosmossdk.io/x/gov v0.0.0-20231113122742-912390d5fc4a cosmossdk.io/x/tx v0.13.3 github.com/chzyer/readline v1.5.1 // indirect - github.com/cockroachdb/errors v1.11.1 + github.com/cockroachdb/errors v1.11.1 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.51.0 github.com/manifoldco/promptui v0.9.0 // indirect diff --git a/depinject/check_type.go b/depinject/check_type.go index 5df053fd6ccc..41ba36c8ffd2 100644 --- a/depinject/check_type.go +++ b/depinject/check_type.go @@ -1,11 +1,11 @@ package depinject import ( + "fmt" "reflect" "strings" "unicode" - "github.com/cockroachdb/errors" "golang.org/x/exp/slices" ) @@ -21,12 +21,12 @@ func isExportedType(typ reflect.Type) error { pkgPath := typ.PkgPath() if name != "" && pkgPath != "" { if unicode.IsLower([]rune(name)[0]) { - return errors.Errorf("type must be exported: %s", typ) + return fmt.Errorf("type must be exported: %s", typ) } pkgParts := strings.Split(pkgPath, "/") if slices.Contains(pkgParts, "internal") { - return errors.Errorf("type must not come from an internal package: %s", typ) + return fmt.Errorf("type must not come from an internal package: %s", typ) } return nil diff --git a/depinject/config.go b/depinject/config.go index 947539c4b34f..8547fda40f8b 100644 --- a/depinject/config.go +++ b/depinject/config.go @@ -1,9 +1,10 @@ package depinject import ( + "errors" + "fmt" "reflect" - - "github.com/cockroachdb/errors" + "runtime" ) // Config is a functional configuration of a container. @@ -33,7 +34,7 @@ func Provide(providers ...interface{}) Config { func ProvideInModule(moduleName string, providers ...interface{}) Config { return containerConfig(func(ctr *container) error { if moduleName == "" { - return errors.Errorf("expected non-empty module name") + return errors.New("expected non-empty module name") } return provide(ctr, ctr.moduleKeyContext.createOrGetModuleKey(moduleName), providers) @@ -44,11 +45,11 @@ func provide(ctr *container, key *moduleKey, providers []interface{}) error { for _, c := range providers { rc, err := extractProviderDescriptor(c) if err != nil { - return errors.WithStack(err) + return fmt.Errorf("%w\n%s", err, getStackTrace()) } _, err = ctr.addNode(&rc, key) if err != nil { - return errors.WithStack(err) + return fmt.Errorf("%w\n%s", err, getStackTrace()) } } return nil @@ -80,7 +81,7 @@ func Invoke(invokers ...interface{}) Config { func InvokeInModule(moduleName string, invokers ...interface{}) Config { return containerConfig(func(ctr *container) error { if moduleName == "" { - return errors.Errorf("expected non-empty module name") + return errors.New("expected non-empty module name") } return invoke(ctr, ctr.moduleKeyContext.createOrGetModuleKey(moduleName), invokers) @@ -91,7 +92,7 @@ func invoke(ctr *container, key *moduleKey, invokers []interface{}) error { for _, c := range invokers { rc, err := extractInvokerDescriptor(c) if err != nil { - return errors.WithStack(err) + return fmt.Errorf("%w\n%s", err, getStackTrace()) } err = ctr.addInvoker(&rc, key) if err != nil { @@ -151,7 +152,7 @@ func Supply(values ...interface{}) Config { for _, v := range values { err := ctr.supply(reflect.ValueOf(v), loc) if err != nil { - return errors.WithStack(err) + return fmt.Errorf("%w\n%s", err, getStackTrace()) } } return nil @@ -162,7 +163,7 @@ func Supply(values ...interface{}) Config { // fail immediately. func Error(err error) Config { return containerConfig(func(*container) error { - return errors.WithStack(err) + return fmt.Errorf("%w\n%s", err, getStackTrace()) }) } @@ -172,7 +173,7 @@ func Configs(opts ...Config) Config { for _, opt := range opts { err := opt.apply(ctr) if err != nil { - return errors.WithStack(err) + return fmt.Errorf("%w\n%s", err, getStackTrace()) } } return nil @@ -186,3 +187,9 @@ func (c containerConfig) apply(ctr *container) error { } var _ Config = (*containerConfig)(nil) + +func getStackTrace() string { + var stack [4096]byte + n := runtime.Stack(stack[:], false) + return string(stack[:n]) +} diff --git a/depinject/container.go b/depinject/container.go index 7816f56abf42..67772acdbca2 100644 --- a/depinject/container.go +++ b/depinject/container.go @@ -6,8 +6,6 @@ import ( "fmt" "reflect" - "github.com/cockroachdb/errors" - "cosmossdk.io/depinject/internal/graphviz" ) @@ -63,7 +61,7 @@ func (c *container) call(provider *providerDescriptor, moduleKey *moduleKey) ([] markGraphNodeAsFailed(graphNode) if c.callerMap[loc] { - return nil, errors.Errorf("cyclic dependency: %s -> %s", loc.Name(), loc.Name()) + return nil, fmt.Errorf("cyclic dependency: %s -> %s", loc.Name(), loc.Name()) } c.callerMap[loc] = true @@ -87,7 +85,7 @@ func (c *container) call(provider *providerDescriptor, moduleKey *moduleKey) ([] out, err := provider.Fn(inVals) if err != nil { - return nil, errors.Wrapf(err, "error calling provider %s", loc) + return nil, fmt.Errorf("error calling provider %s: %w", loc, err) } markGraphNodeAsUsed(graphNode) @@ -296,7 +294,7 @@ func (c *container) addNode(provider *providerDescriptor, key *moduleKey) (inter } if hasOwnModuleKeyParam { - return nil, errors.Errorf("%T and %T must not be declared as dependencies on the same provided", + return nil, fmt.Errorf("%T and %T must not be declared as dependencies on the same provided", ModuleKey{}, OwnModuleKey{}) } @@ -317,7 +315,7 @@ func (c *container) addNode(provider *providerDescriptor, key *moduleKey) (inter existing, ok := c.resolverByType(typ) if ok { - return nil, errors.Errorf("duplicate provision of type %v by module-scoped provider %s\n\talready provided by %s", + return nil, fmt.Errorf("duplicate provision of type %v by module-scoped provider %s\n\talready provided by %s", typ, provider.Location, existing.describeLocation()) } @@ -378,7 +376,7 @@ func (c *container) resolve(in providerInput, moduleKey *moduleKey, caller Locat if in.Type == moduleKeyType { if moduleKey == nil { - return reflect.Value{}, errors.Errorf("trying to resolve %T for %s but not inside of any module's scope", moduleKey, caller) + return reflect.Value{}, fmt.Errorf("trying to resolve %T for %s but not inside of any module's scope", moduleKey, caller) } c.logf("Providing ModuleKey %s", moduleKey.name) markGraphNodeAsUsed(typeGraphNode) @@ -387,7 +385,7 @@ func (c *container) resolve(in providerInput, moduleKey *moduleKey, caller Locat if in.Type == ownModuleKeyType { if moduleKey == nil { - return reflect.Value{}, errors.Errorf("trying to resolve %T for %s but not inside of any module's scope", moduleKey, caller) + return reflect.Value{}, fmt.Errorf("trying to resolve %T for %s but not inside of any module's scope", moduleKey, caller) } c.logf("Providing OwnModuleKey %s", moduleKey.name) markGraphNodeAsUsed(typeGraphNode) @@ -406,7 +404,7 @@ func (c *container) resolve(in providerInput, moduleKey *moduleKey, caller Locat } markGraphNodeAsFailed(typeGraphNode) - return reflect.Value{}, errors.Errorf("can't resolve type %v for %s:\n%s", + return reflect.Value{}, fmt.Errorf("can't resolve type %v for %s:\n%s", fullyQualifiedTypeName(in.Type), caller, c.formatResolveStack()) } @@ -475,7 +473,7 @@ func (c *container) build(loc Location, outputs ...interface{}) error { sn, ok := node.(*simpleProvider) if !ok { - return errors.Errorf("cannot run module-scoped provider as an invoker") + return stderrors.New("cannot run module-scoped provider as an invoker") } c.logf("Building container") diff --git a/depinject/errors.go b/depinject/errors.go index ebef77d47e38..94b9956a0115 100644 --- a/depinject/errors.go +++ b/depinject/errors.go @@ -3,8 +3,6 @@ package depinject import ( "fmt" "reflect" - - "github.com/cockroachdb/errors" ) // ErrMultipleImplicitInterfaceBindings defines an error condition where an attempt was made to implicitly bind @@ -63,6 +61,6 @@ func (err ErrNoTypeForExplicitBindingFound) Error() string { } func duplicateDefinitionError(typ reflect.Type, duplicateLoc Location, existingLoc string) error { - return errors.Errorf("duplicate provision of type %v by %s\n\talready provided by %s", + return fmt.Errorf("duplicate provision of type %v by %s\n\talready provided by %s", typ, duplicateLoc, existingLoc) } diff --git a/depinject/go.mod b/depinject/go.mod index 9bff496d0d27..bc7c1502927c 100644 --- a/depinject/go.mod +++ b/depinject/go.mod @@ -4,7 +4,6 @@ go 1.20 require ( cosmossdk.io/api v0.7.5 - github.com/cockroachdb/errors v1.11.1 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb @@ -14,15 +13,9 @@ require ( ) require ( - 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/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.24.0 // indirect @@ -30,5 +23,6 @@ require ( golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/grpc v1.63.2 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/depinject/go.sum b/depinject/go.sum index 70a044e2810f..2e2254dccfe9 100644 --- a/depinject/go.sum +++ b/depinject/go.sum @@ -1,34 +1,21 @@ cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= cosmossdk.io/api v0.7.5/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.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= 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/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= @@ -36,41 +23,14 @@ 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.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -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-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.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= -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/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= golang.org/x/sys v0.19.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-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= @@ -79,6 +39,7 @@ google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFW google.golang.org/protobuf v1.34.1/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= diff --git a/depinject/group.go b/depinject/group.go index 43bbce7b396a..5ecb519f004c 100644 --- a/depinject/group.go +++ b/depinject/group.go @@ -4,8 +4,6 @@ import ( "fmt" "reflect" - "github.com/cockroachdb/errors" - "cosmossdk.io/depinject/internal/graphviz" ) @@ -85,7 +83,7 @@ func (g *sliceGroupResolver) resolve(c *container, _ *moduleKey, caller Location } func (g *groupResolver) resolve(_ *container, _ *moduleKey, _ Location) (reflect.Value, error) { - return reflect.Value{}, errors.Errorf("%v is an many-per-container type and cannot be used as an input value, instead use %v", g.typ, g.sliceType) + return reflect.Value{}, fmt.Errorf("%v is an many-per-container type and cannot be used as an input value, instead use %v", g.typ, g.sliceType) } func (g *groupResolver) addNode(n *simpleProvider, i int) error { diff --git a/depinject/one_per_module.go b/depinject/one_per_module.go index 69916434be3d..55d19a7d93f3 100644 --- a/depinject/one_per_module.go +++ b/depinject/one_per_module.go @@ -4,8 +4,6 @@ import ( "fmt" "reflect" - "github.com/cockroachdb/errors" - "cosmossdk.io/depinject/internal/graphviz" ) @@ -46,7 +44,7 @@ type mapOfOnePerModuleResolver struct { } func (o *onePerModuleResolver) resolve(_ *container, _ *moduleKey, _ Location) (reflect.Value, error) { - return reflect.Value{}, errors.Errorf("%v is a one-per-module type and thus can't be used as an input parameter, instead use %v", o.typ, o.mapType) + return reflect.Value{}, fmt.Errorf("%v is a one-per-module type and thus can't be used as an input parameter, instead use %v", o.typ, o.mapType) } func (o *onePerModuleResolver) describeLocation() string { @@ -72,7 +70,7 @@ func (o *mapOfOnePerModuleResolver) resolve(c *container, _ *moduleKey, caller L } idx := o.idxMap[key] if len(values) <= idx { - return reflect.Value{}, errors.Errorf("expected value of type %T at index %d", o.typ, idx) + return reflect.Value{}, fmt.Errorf("expected value of type %T at index %d", o.typ, idx) } value := values[idx] res.SetMapIndex(reflect.ValueOf(key.name), value) @@ -87,11 +85,11 @@ func (o *mapOfOnePerModuleResolver) resolve(c *container, _ *moduleKey, caller L func (o *onePerModuleResolver) addNode(n *simpleProvider, i int) error { if n.moduleKey == nil { - return errors.Errorf("cannot define a provider with one-per-module dependency %v which isn't provided in a module", o.typ) + return fmt.Errorf("cannot define a provider with one-per-module dependency %v which isn't provided in a module", o.typ) } if existing, ok := o.providers[n.moduleKey]; ok { - return errors.Errorf("duplicate provision for one-per-module type %v in module %s: %s\n\talready provided by %s", + return fmt.Errorf("duplicate provision for one-per-module type %v in module %s: %s\n\talready provided by %s", o.typ, n.moduleKey.name, n.provider.Location, existing.provider.Location) } @@ -102,7 +100,7 @@ func (o *onePerModuleResolver) addNode(n *simpleProvider, i int) error { } func (o *mapOfOnePerModuleResolver) addNode(s *simpleProvider, _ int) error { - return errors.Errorf("%v is a one-per-module type and thus %v can't be used as an output parameter in %s", o.typ, o.mapType, s.provider.Location) + return fmt.Errorf("%v is a one-per-module type and thus %v can't be used as an output parameter in %s", o.typ, o.mapType, s.provider.Location) } func (o onePerModuleResolver) typeGraphNode() *graphviz.Node { diff --git a/depinject/provider_desc.go b/depinject/provider_desc.go index dfbac5dabaf7..f17537ccb521 100644 --- a/depinject/provider_desc.go +++ b/depinject/provider_desc.go @@ -1,11 +1,11 @@ package depinject import ( + "fmt" "reflect" "strings" "unicode" - "github.com/cockroachdb/errors" "golang.org/x/exp/slices" ) @@ -65,32 +65,32 @@ func doExtractProviderDescriptor(ctr interface{}) (providerDescriptor, error) { val := reflect.ValueOf(ctr) typ := val.Type() if typ.Kind() != reflect.Func { - return providerDescriptor{}, errors.Errorf("expected a Func type, got %v", typ) + return providerDescriptor{}, fmt.Errorf("expected a Func type, got %v", typ) } loc := LocationFromPC(val.Pointer()).(*location) nameParts := strings.Split(loc.name, ".") if len(nameParts) == 0 { - return providerDescriptor{}, errors.Errorf("missing function name %s", loc) + return providerDescriptor{}, fmt.Errorf("missing function name %s", loc) } lastNamePart := nameParts[len(nameParts)-1] if unicode.IsLower([]rune(lastNamePart)[0]) { - return providerDescriptor{}, errors.Errorf("function must be exported: %s", loc) + return providerDescriptor{}, fmt.Errorf("function must be exported: %s", loc) } if strings.Contains(lastNamePart, "-") { - return providerDescriptor{}, errors.Errorf("function can't be used as a provider (it might be a bound instance method): %s", loc) + return providerDescriptor{}, fmt.Errorf("function can't be used as a provider (it might be a bound instance method): %s", loc) } pkgParts := strings.Split(loc.pkg, "/") if slices.Contains(pkgParts, "internal") { - return providerDescriptor{}, errors.Errorf("function must not be in an internal package: %s", loc) + return providerDescriptor{}, fmt.Errorf("function must not be in an internal package: %s", loc) } if typ.IsVariadic() { - return providerDescriptor{}, errors.Errorf("variadic function can't be used as a provider: %s", loc) + return providerDescriptor{}, fmt.Errorf("variadic function can't be used as a provider: %s", loc) } numIn := typ.NumIn() @@ -108,7 +108,7 @@ func doExtractProviderDescriptor(ctr interface{}) (providerDescriptor, error) { t := typ.Out(i) if t == errType { if i != numOut-1 { - return providerDescriptor{}, errors.Errorf("output error parameter is not last parameter in function %s", loc) + return providerDescriptor{}, fmt.Errorf("output error parameter is not last parameter in function %s", loc) } errIdx = i } else { diff --git a/depinject/struct_args.go b/depinject/struct_args.go index 565bee406c7d..16e4c7cc5a9c 100644 --- a/depinject/struct_args.go +++ b/depinject/struct_args.go @@ -3,8 +3,6 @@ package depinject import ( "fmt" "reflect" - - "github.com/cockroachdb/errors" ) // In can be embedded in another struct to inform the container that the @@ -121,7 +119,7 @@ func structArgsInTypes(typ reflect.Type) ([]providerInput, error) { if optTag == "true" { optional = true } else { - return nil, errors.Errorf("bad optional tag %q (should be \"true\") in %v", optTag, typ) + return nil, fmt.Errorf("bad optional tag %q (should be \"true\") in %v", optTag, typ) } } diff --git a/go.mod b/go.mod index 2590643809c0..76d1d5aece2c 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,6 @@ require ( cosmossdk.io/x/tx v0.13.3 github.com/99designs/keyring v1.2.2 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 - github.com/cockroachdb/errors v1.11.1 github.com/cometbft/cometbft v1.0.0-alpha.2.0.20240429102542-490e9bc3de65 github.com/cometbft/cometbft/api v1.0.0-alpha.2.0.20240429102542-490e9bc3de65 github.com/cosmos/btcutil v1.0.5 @@ -79,6 +78,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect diff --git a/runtime/v2/store.go b/runtime/v2/store.go index e0f7c66528d7..8abd825c0b1f 100644 --- a/runtime/v2/store.go +++ b/runtime/v2/store.go @@ -26,8 +26,6 @@ type Store interface { // state. Must error when the version does not exist. StateAt(version uint64) (store.ReaderMap, error) - WorkingHash(*store.Changeset) ([]byte, error) - Commit(changeset *store.Changeset) (store.Hash, error) // Query is a key/value query directly to the underlying database. This skips the appmanager diff --git a/simapp/gomod2nix.toml b/simapp/gomod2nix.toml index 382cf0813963..e9430f86933b 100644 --- a/simapp/gomod2nix.toml +++ b/simapp/gomod2nix.toml @@ -2,11 +2,11 @@ schema = 3 [mod] [mod."buf.build/gen/go/cometbft/cometbft/protocolbuffers/go"] - version = "v1.33.0-20240312114316-c0d3497e35d6.1" - hash = "sha256-Y+tNsJqQsdFGSVTDzV/CGLyqR6e2kDywu3bxH7XL0mk=" + version = "v1.34.0-20240312114316-c0d3497e35d6.1" + hash = "sha256-Uoo+Gfx/mnzKRoBvmTJC7oUKMrxOT20ibdY6ArGKHLQ=" [mod."buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go"] - version = "v1.33.0-20240130113600-88ef6483f90f.1" - hash = "sha256-MwiW5ycryMhDAX6LJtOzbZd+xW+VcqnLExIKfy2VMFY=" + version = "v1.34.0-20240130113600-88ef6483f90f.1" + hash = "sha256-EpsIiMf8GKK56FgjSS3tCZtVCz4apPcJiaqsbhtF3kM=" [mod."cloud.google.com/go"] version = "v0.112.2" hash = "sha256-Bk5MD40eefJlyUk96arLU/X1+EHItM7MjRPJtV0CU58=" @@ -132,8 +132,8 @@ schema = 3 version = "v1.4.12" hash = "sha256-e2tbfaZtzLijq+EMnNG9GWKDCG4sBj8wIVnn6/R26iM=" [mod."github.com/cosmos/iavl"] - version = "v1.1.2" - hash = "sha256-fhh5fN1BMDxbF4PobERMQdIb9vIrxaSl0tRXas0WKmc=" + version = "v1.1.4" + hash = "sha256-bBU5w5rEMvpCWSzFBIVvnMHnsy2+a+e1DPDkb4hNOwU=" [mod."github.com/cosmos/ics23/go"] version = "v0.10.0" hash = "sha256-KYEv727BO/ht63JO02xiKFGFAddg41Ve9l2vSSZZBq0=" @@ -273,8 +273,8 @@ schema = 3 version = "v1.7.4" hash = "sha256-GtJSwcS1WXLn9lFAuTRCseIQBXJOElAywEhTtYrsfbE=" [mod."github.com/hashicorp/go-hclog"] - version = "v1.6.2" - hash = "sha256-cGlKyuctpU6Jd+L1ybCoJrBwnBlHXks4CQYkTQMCxDU=" + version = "v1.6.3" + hash = "sha256-BK2s+SH1tQyUaXCH4kC0/jgqiSu638UFbwamfKjFOYg=" [mod."github.com/hashicorp/go-immutable-radix"] version = "v1.3.1" hash = "sha256-65+A2HiVfS/GV9G+6/TkXXjzXhI/V98e6RlJWjxy+mg=" @@ -387,8 +387,8 @@ schema = 3 version = "v1.1.0" hash = "sha256-U4IS0keJa4BSBSeEBqtIV1Zg6N4b0zFiKfzN9ua4pWQ=" [mod."github.com/pelletier/go-toml/v2"] - version = "v2.2.1" - hash = "sha256-gmQ4CTz/MI97D3pYqU7mpxqo8gBTDccQ1Cp0lAMmJUc=" + version = "v2.2.2" + hash = "sha256-ukxk1Cfm6cQW18g/aa19tLcUu5BnF7VmfAvrDHAOl6A=" [mod."github.com/petermattis/goid"] version = "v0.0.0-20240327183114-c42a807a84ba" hash = "sha256-f2enuVnb6nrQX0uBc3WYEK68TiLUp4Y1qisx84ElaFA=" @@ -399,8 +399,8 @@ schema = 3 version = "v1.0.1-0.20181226105442-5d4384ee4fb2" hash = "sha256-XA4Oj1gdmdV/F/+8kMI+DBxKPthZ768hbKsO3d9Gx90=" [mod."github.com/prometheus/client_golang"] - version = "v1.19.0" - hash = "sha256-YV8sxMPR+xorTUCriTfcFsaV2b7PZfPJDQmOgUYOZJo=" + version = "v1.19.1" + hash = "sha256-MSLsMDi89uQc7Pa2fhqeamyfPJpenGj3r+eB/UotK7w=" [mod."github.com/prometheus/client_model"] version = "v0.6.1" hash = "sha256-rIDyUzNfxRA934PIoySR0EhuBbZVRK/25Jlc/r8WODw=" @@ -511,17 +511,17 @@ schema = 3 version = "v1.11.0" hash = "sha256-Lb6rHHfR62Ozg2j2JZy3MKOMKdsfzd1IYTR57r3Mhp0=" [mod."golang.org/x/crypto"] - version = "v0.22.0" - hash = "sha256-2+u9nd32+Bi7EEv7QFc12CRTbfV7DApNv+yKIr7+lTw=" + version = "v0.23.0" + hash = "sha256-6hZjb/OazWFBef0C/aH63l49YQnzCh2vpIduzyfSSG8=" [mod."golang.org/x/exp"] - version = "v0.0.0-20240416160154-fe59bbe5cc7f" - hash = "sha256-168CD9hlLJaQ7stQk/ztlP3zgaWXUMbIHa38gAeRRs4=" + version = "v0.0.0-20240506185415-9bf2ced13842" + hash = "sha256-5JZE4OhePWHtObIT4RJOS+2zv265Io1yJkFeE8wHXY4=" [mod."golang.org/x/mod"] version = "v0.17.0" hash = "sha256-CLaPeF6uTFuRDv4oHwOQE6MCMvrzkUjWN3NuyywZjKU=" [mod."golang.org/x/net"] - version = "v0.24.0" - hash = "sha256-w1c21ljta5wNIyel9CSIn/crPzwOCRofNKhqmfs4aEQ=" + version = "v0.25.0" + hash = "sha256-IjFfXLYNj27WLF7vpkZ6mfFXBnp+7QER3OQ0RgjxN54=" [mod."golang.org/x/oauth2"] version = "v0.19.0" hash = "sha256-IYdkq8R8BXnwoBt/ZLAMJr0DkLZDMVkjeBJNQ/Z9Bes=" @@ -529,20 +529,20 @@ schema = 3 version = "v0.7.0" hash = "sha256-2ETllEu2GDWoOd/yMkOkLC2hWBpKzbVZ8LhjLu0d2A8=" [mod."golang.org/x/sys"] - version = "v0.19.0" - hash = "sha256-cmuL31TYLJmDm/fDnI2Sn0wB88cpdOHV1+urorsJWx4=" + version = "v0.20.0" + hash = "sha256-mowlaoG2k4n1c1rApWef5EMiXd3I77CsUi8jPh6pTYA=" [mod."golang.org/x/term"] - version = "v0.19.0" - hash = "sha256-wFwEMwhtsr0C4mqjxukjMM7lxJLYPvb7gAPO95xyhyg=" + version = "v0.20.0" + hash = "sha256-kU+OVJbYktTIn4ZTAdomsOjL069Vj45sdroEMRKaRDI=" [mod."golang.org/x/text"] - version = "v0.14.0" - hash = "sha256-yh3B0tom1RfzQBf1RNmfdNWF1PtiqxV41jW1GVS6JAg=" + version = "v0.15.0" + hash = "sha256-pBnj0AEkfkvZf+3bN7h6epCD2kurw59clDP7yWvxKlk=" [mod."golang.org/x/time"] version = "v0.5.0" hash = "sha256-W6RgwgdYTO3byIPOFxrP2IpAZdgaGowAaVfYby7AULU=" [mod."golang.org/x/tools"] - version = "v0.20.0" - hash = "sha256-g5T5FrNPO/cf2W1lc+/93FcFB3HftPjqI72FueD9Wt8=" + version = "v0.21.0" + hash = "sha256-TU0gAxUX410AYc/nMxxZiaqXeORih1cXbKh3sxKufVg=" [mod."google.golang.org/api"] version = "v0.175.0" hash = "sha256-0NVK3UxAm8Sp8mux2GHeD4rA97u37U7yuE9vDd+wJlg=" @@ -553,14 +553,14 @@ schema = 3 version = "v0.0.0-20240415180920-8c6c420018be" hash = "sha256-0Bc66Utj1rydwYngQxTQoTyg1Td2D+nIxukc0zz7XFc=" [mod."google.golang.org/genproto/googleapis/rpc"] - version = "v0.0.0-20240415180920-8c6c420018be" - hash = "sha256-P5SBku16dYnK4koUQxTeGwPxAAWH8rxbDm2pOzFLo/Q=" + version = "v0.0.0-20240509183442-62759503f434" + hash = "sha256-w2SGX12NeDO33wjxEpHi+OMcpp9SioPtdBuZKUIun+U=" [mod."google.golang.org/grpc"] version = "v1.63.2" hash = "sha256-RmtVjYLam97k7IHTHU7Gn16xNX+GvA9AiLKlQwOiZXU=" [mod."google.golang.org/protobuf"] - version = "v1.34.0" - hash = "sha256-0fqsqQTyOicm4+NiuAf2IaJhavMVJh50VhNcRmZPSus=" + version = "v1.34.1" + hash = "sha256-qnHqY6KLZiZDbTVTN6uzF4jedxROYlPCYHoiv6XI0sc=" [mod."gopkg.in/ini.v1"] version = "v1.67.0" hash = "sha256-V10ahGNGT+NLRdKUyRg1dos5RxLBXBk1xutcnquc/+4=" diff --git a/store/v2/go.mod b/store/v2/go.mod index 6f9f64b30e58..3b85d7fb8e87 100644 --- a/store/v2/go.mod +++ b/store/v2/go.mod @@ -6,7 +6,6 @@ require ( cosmossdk.io/core v0.12.0 cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.3.1 - github.com/cockroachdb/errors v1.11.1 github.com/cockroachdb/pebble v1.1.0 github.com/cometbft/cometbft v0.38.7 github.com/cosmos/gogoproto v1.4.12 @@ -27,6 +26,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect + 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/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect diff --git a/store/v2/root/store.go b/store/v2/root/store.go index a8e717fd5a64..b0db1ee21748 100644 --- a/store/v2/root/store.go +++ b/store/v2/root/store.go @@ -2,11 +2,11 @@ package root import ( "bytes" + "errors" "fmt" "sync" "time" - "github.com/cockroachdb/errors" "golang.org/x/sync/errgroup" coreheader "cosmossdk.io/core/header" diff --git a/tools/hubl/go.mod b/tools/hubl/go.mod index 94caf41c7aa4..d85a50913fe3 100644 --- a/tools/hubl/go.mod +++ b/tools/hubl/go.mod @@ -7,7 +7,6 @@ require ( cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240118210941-3897926e722e cosmossdk.io/core v0.11.0 cosmossdk.io/errors v1.0.1 - github.com/cockroachdb/errors v1.11.1 github.com/cosmos/cosmos-sdk v0.50.6 github.com/manifoldco/promptui v0.9.0 github.com/pelletier/go-toml/v2 v2.2.2 @@ -35,6 +34,7 @@ require ( github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect diff --git a/tools/hubl/internal/load.go b/tools/hubl/internal/load.go index 9b0069ff6cc5..e59954215e69 100644 --- a/tools/hubl/internal/load.go +++ b/tools/hubl/internal/load.go @@ -8,7 +8,6 @@ import ( "os" "path" - cockroachdberrors "github.com/cockroachdb/errors" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" @@ -183,7 +182,7 @@ func (c *ChainInfo) OpenClient() (*grpc.ClientConn, error) { return c.client, nil } - return nil, cockroachdberrors.Wrapf(res, "error loading gRPC client") + return nil, fmt.Errorf("error loading gRPC client: %w", res) } // getAddressPrefix returns the address prefix of the chain. @@ -195,7 +194,7 @@ func getAddressPrefix(ctx context.Context, conn grpc.ClientConnInterface) (strin } if resp == nil || resp.Bech32Prefix == "" { - return "", cockroachdberrors.New("bech32 account address prefix is not set") + return "", errors.New("bech32 account address prefix is not set") } return resp.Bech32Prefix, nil diff --git a/x/circuit/ante/circuit.go b/x/circuit/ante/circuit.go index ab1876242b28..9d3ea0a49f4b 100644 --- a/x/circuit/ante/circuit.go +++ b/x/circuit/ante/circuit.go @@ -2,8 +2,7 @@ package ante import ( "context" - - "github.com/cockroachdb/errors" + "errors" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/circuit/go.mod b/x/circuit/go.mod index cfda7a3a3f40..2b5f6baee9cd 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -11,7 +11,6 @@ require ( cosmossdk.io/log v1.3.1 cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 - github.com/cockroachdb/errors v1.11.1 github.com/cosmos/cosmos-sdk v0.51.0 github.com/cosmos/gogoproto v1.4.12 github.com/golang/protobuf v1.5.4 @@ -40,6 +39,7 @@ require ( github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect diff --git a/x/distribution/go.mod b/x/distribution/go.mod index 8637f0657051..83050bb44f8f 100644 --- a/x/distribution/go.mod +++ b/x/distribution/go.mod @@ -14,7 +14,6 @@ require ( cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 - github.com/cockroachdb/errors v1.11.1 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.51.0 github.com/cosmos/gogoproto v1.4.12 @@ -30,6 +29,8 @@ require ( gotest.tools/v3 v3.5.1 ) +require github.com/cockroachdb/errors v1.11.1 // indirect + require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.0-20240312114316-c0d3497e35d6.1 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.0-20240130113600-88ef6483f90f.1 // indirect diff --git a/x/distribution/keeper/keeper.go b/x/distribution/keeper/keeper.go index dfc90cdc4eef..58f141ca0e33 100644 --- a/x/distribution/keeper/keeper.go +++ b/x/distribution/keeper/keeper.go @@ -2,10 +2,9 @@ package keeper import ( "context" + "errors" "fmt" - "github.com/cockroachdb/errors" - "cosmossdk.io/collections" collcodec "cosmossdk.io/collections/codec" "cosmossdk.io/core/appmodule" diff --git a/x/slashing/go.mod b/x/slashing/go.mod index f7daf9c5fb2e..8e77adb512f8 100644 --- a/x/slashing/go.mod +++ b/x/slashing/go.mod @@ -14,7 +14,6 @@ require ( cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 github.com/bits-and-blooms/bitset v1.10.0 - github.com/cockroachdb/errors v1.11.1 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.51.0 github.com/cosmos/gogoproto v1.4.12 @@ -45,6 +44,7 @@ require ( github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect diff --git a/x/slashing/keeper/infractions.go b/x/slashing/keeper/infractions.go index f044210cb9cd..df190f43c5ab 100644 --- a/x/slashing/keeper/infractions.go +++ b/x/slashing/keeper/infractions.go @@ -4,8 +4,6 @@ import ( "context" "fmt" - "github.com/cockroachdb/errors" - st "cosmossdk.io/api/cosmos/staking/v1beta1" "cosmossdk.io/core/comet" "cosmossdk.io/core/event" @@ -76,7 +74,7 @@ func (k Keeper) HandleValidatorSignatureWithParams(ctx context.Context, params t // determine if the validator signed the previous block previous, err := k.GetMissedBlockBitmapValue(ctx, consAddr, index) if err != nil { - return errors.Wrap(err, "failed to get the validator's bitmap value") + return fmt.Errorf("failed to get the validator's bitmap value: %w", err) } modifiedSignInfo := false