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

feat: start app wiring with runtime and x/params modules #11924

Merged
merged 25 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
994 changes: 994 additions & 0 deletions api/cosmos/app/runtime/v1alpha1/module.pulsar.go

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions baseapp/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,8 @@ func (app *BaseApp) SetStreamingService(s StreamingService) {
// BaseApp will pass BeginBlock, DeliverTx, and EndBlock requests and responses to the streaming services to update their ABCI context
app.abciListeners = append(app.abciListeners, s)
}

// SetTxDecoder sets the TxDecoder if it wasn't provided in the BaseApp constructor.
func (app *BaseApp) SetTxDecoder(txDecoder sdk.TxDecoder) {
app.txDecoder = txDecoder
}
10 changes: 5 additions & 5 deletions core/appconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
)

// LoadJSON loads an app config in JSON format.
func LoadJSON(bz []byte) container.Option {
func LoadJSON(bz []byte) container.Config {
config := &appv1alpha1.Config{}
err := protojson.Unmarshal(bz, config)
if err != nil {
Expand All @@ -31,7 +31,7 @@ func LoadJSON(bz []byte) container.Option {
}

// LoadYAML loads an app config in YAML format.
func LoadYAML(bz []byte) container.Option {
func LoadYAML(bz []byte) container.Config {
j, err := yaml.YAMLToJSON(bz)
if err != nil {
return container.Error(err)
Expand All @@ -42,8 +42,8 @@ func LoadYAML(bz []byte) container.Option {

// Compose composes a v1alpha1 app config into a container option by resolving
// the required modules and composing their options.
func Compose(appConfig *appv1alpha1.Config) container.Option {
opts := []container.Option{
func Compose(appConfig *appv1alpha1.Config) container.Config {
opts := []container.Config{
container.Supply(appConfig),
}

Expand Down Expand Up @@ -99,7 +99,7 @@ func Compose(appConfig *appv1alpha1.Config) container.Option {
}
}

return container.Options(opts...)
return container.Configs(opts...)
}

func dumpRegisteredModules(modules map[protoreflect.FullName]*internal.ModuleInitializer) string {
Expand Down
2 changes: 1 addition & 1 deletion core/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.18
require (
github.com/cosmos/cosmos-proto v1.0.0-alpha7
github.com/cosmos/cosmos-sdk/api v0.1.0
github.com/cosmos/cosmos-sdk/container v1.0.0-alpha.3
github.com/cosmos/cosmos-sdk/container 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 Down
7 changes: 7 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module github.com/cosmos/cosmos-sdk

require (
cosmossdk.io/api v0.1.0-alpha8
cosmossdk.io/core v0.0.0
cosmossdk.io/errors v1.0.0-beta.6
cosmossdk.io/math v1.0.0-beta.2
github.com/99designs/keyring v1.1.6
Expand Down Expand Up @@ -61,6 +62,8 @@ require (
sigs.k8s.io/yaml v1.3.0
)

require github.com/cosmos/cosmos-sdk/container v1.0.0-alpha.4

require (
cloud.google.com/go v0.100.2 // indirect
cloud.google.com/go/compute v1.5.0 // indirect
Expand All @@ -74,6 +77,7 @@ require (
github.com/cenkalti/backoff/v4 v4.1.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cosmos/cosmos-sdk/api v0.1.0 // indirect
github.com/cosmos/ledger-go v0.9.2 // indirect
github.com/creachadair/taskgroup v0.3.2 // indirect
github.com/danieljoos/wincred v1.0.2 // indirect
Expand Down Expand Up @@ -135,6 +139,7 @@ require (
github.com/zondax/hid v0.9.1-0.20220302062450-5552068d2266 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/exp v0.0.0-20220428152302-39d4317da171 // indirect
golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
Expand All @@ -151,6 +156,8 @@ require (
)

replace (
cosmossdk.io/api => ./api
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this PR we can tag and remove this

Copy link
Member

@julienrbrt julienrbrt Jun 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How often should we tag a new version then? (as this has not yet been done)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As often as we need to, but with alpha tags only for now

cosmossdk.io/core => ./core
github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76
github.com/cosmos/cosmos-sdk/db => ./db

Expand Down
Loading