Skip to content

Commit

Permalink
Merge branch 'cosmos:main' into chore/accounts-codec
Browse files Browse the repository at this point in the history
  • Loading branch information
caseylove authored Jan 13, 2025
2 parents 1aafc8d + a1a4c9a commit a2bfdad
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 304 deletions.
2 changes: 2 additions & 0 deletions client/v2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

* [#23325](https://github.com/cosmos/cosmos-sdk/pull/23325) Remove `NewAppOptionsFromConfig` that isn't needed in normal wiring.

## [v2.10.0-beta.1](https://github.com/cosmos/cosmos-sdk/releases/tag/client/v2/v2.10.0-beta.1) - 2024-12-18

### Features
Expand Down
50 changes: 0 additions & 50 deletions client/v2/autocli/app.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package autocli

import (
"github.com/cosmos/gogoproto/proto"
"github.com/spf13/cobra"
"google.golang.org/protobuf/reflect/protoregistry"

Expand All @@ -10,12 +9,9 @@ import (
"cosmossdk.io/core/address"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/depinject"
"cosmossdk.io/log"
"cosmossdk.io/x/tx/signing"

sdkflags "github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
)

Expand Down Expand Up @@ -143,49 +139,3 @@ func (appOptions AppOptions) EnhanceRootCommandWithBuilder(rootCmd *cobra.Comman

return nil
}

// NewAppOptionsFromConfig returns AppOptions for an app based on the provided modulesConfig and moduleOptions.
// It returns an AppOptions instance usable for CLI parsing but not execution. For an execution usable AppOptions
// see ProvideAppOptions, which expects input to be filled by depinject.
func NewAppOptionsFromConfig(
modulesConfig depinject.Config,
moduleOptions map[string]*autocliv1.ModuleOptions,
) (AppOptions, error) {
interfaceRegistry, err := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{
ProtoFiles: proto.HybridResolver,
SigningOptions: signing.Options{
AddressCodec: nopAddressCodec{},
ValidatorAddressCodec: nopAddressCodec{},
},
})
if err != nil {
return AppOptions{}, err
}
cfg := struct {
depinject.In
Modules map[string]appmodule.AppModule
}{
Modules: nil,
}
err = depinject.Inject(depinject.Configs(
modulesConfig,
depinject.Supply(
log.NewNopLogger(),
)), &cfg)
if err != nil {
return AppOptions{}, err
}

return AppOptions{
Modules: cfg.Modules,
ModuleOptions: moduleOptions,
skipValidation: true,
Cdc: codec.NewProtoCodec(interfaceRegistry),
}, nil
}

type nopAddressCodec struct{}

func (nopAddressCodec) StringToBytes(_ string) ([]byte, error) { return nil, nil }

func (nopAddressCodec) BytesToString(_ []byte) (string, error) { return "", nil }
2 changes: 1 addition & 1 deletion client/v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ require (
cosmossdk.io/collections v1.0.0 // indirect
cosmossdk.io/core/testing v0.0.1 // indirect
cosmossdk.io/errors v1.0.1
cosmossdk.io/log v1.5.0
cosmossdk.io/log v1.5.0 // indirect
cosmossdk.io/math v1.5.0
cosmossdk.io/schema v1.0.0 // indirect
cosmossdk.io/store v1.10.0-rc.1 // indirect
Expand Down
34 changes: 3 additions & 31 deletions collections/protocodec/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module cosmossdk.io/collections/protocodec
go 1.23.2

require (
cosmossdk.io/collections v0.4.0
cosmossdk.io/collections v1.0.0
cosmossdk.io/core v1.0.0
github.com/cosmos/gogoproto v1.7.0
github.com/google/go-cmp v0.6.0
Expand All @@ -13,39 +13,11 @@ require (

require (
cosmossdk.io/schema v1.0.0 // indirect
github.com/DataDog/zstd v1.5.6 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0 // indirect
github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 // indirect
github.com/cockroachdb/pebble v1.1.2 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cosmos/cosmos-db v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/getsentry/sentry-go v0.30.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/linxGnu/grocksdb v1.9.7 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.61.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rogpeppe/go-internal v1.13.1 // indirect
github.com/spf13/cast v1.7.1 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
github.com/tidwall/btree v1.7.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit a2bfdad

Please sign in to comment.