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(depinject): Add gogo support for depinject #20403

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

hieuvubk
Copy link
Collaborator

@hieuvubk hieuvubk commented May 15, 2024

Description

Closes: #20134


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • Gen app config & module config as gogo types
  • Add a depinject.Compose version that support gogo
  • Add tests

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • New Features

    • Introduced support for a new version of the app configuration (appv2), alongside the existing appv1alpha1.
    • Added configuration schema for a Cosmos SDK ABCI app, defining modules and explicit interface to implementation type bindings.
    • Added ModuleDescriptor message to describe app modules and their migration information.
  • Refactor

    • Updated LoadJSON and Compose functions to support both appv1alpha1 and appv2 configurations.
    • Adjusted module processing, bindings, and provider handling based on the app config version.
  • Chores

    • Removed dependency on google.golang.org/protobuf/proto and added github.com/cosmos/gogoproto/proto.

Copy link
Contributor

coderabbitai bot commented May 15, 2024

Important

Review skipped

Review was skipped due to path filters

Files ignored due to path filters (2)
  • runtime/v2/go.mod is excluded by !**/*.mod
  • runtime/v2/go.sum is excluded by !**/*.sum

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes introduce support for gogo protobuf in the Cosmos SDK's dependency injection (depinject) system, allowing users to avoid generating Pulsar types. This involves adding new methods for type URLs and Golang bindings in ModuleConfig, supporting multiple app config versions, and adjusting protobuf dependencies and configurations.

Changes

File(s) Change Summary
api/cosmos/app/v1alpha1/types.go, api/cosmos/app/v2/types.go Added methods to retrieve type URLs and Golang bindings from ModuleConfig.
depinject/appconfig/config.go Introduced support for appv2 alongside appv1alpha1 in LoadJSON and Compose functions, handling module configs.
depinject/appconfig/module.go, depinject/internal/appconfig/registry.go Changed protobuf dependencies from google.golang.org/protobuf/proto to github.com/cosmos/gogoproto/proto.
depinject/internal/appconfig/buf.gen.gogo.yaml Added configuration settings for versioning, package management, and plugin specifications related to gocosmos.
depinject/internal/appconfig/testpb/test_gogo.proto Introduced protobuf message definitions for various test modules with specific import options.
proto/cosmos/app/v2/config.proto, proto/cosmos/app/v2/module.proto Defined configuration schema for Cosmos SDK ABCI app and described app modules including Golang bindings.
scripts/protocgen.sh Removed /api/cosmos/app/v2 folder as version 2 does not support Pulsar.

Assessment against linked issues

Objective (Issue #20134) Addressed Explanation
Add gogo support to depinject
Allow users to avoid generating Pulsar types
Reduce complexity of code for users

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@julienrbrt
Copy link
Member

Referencing this, as it is important too: #20389 (comment)

@julienrbrt julienrbrt changed the title Add gogo support for depinject feat(depinject): Add gogo support for depinject May 16, 2024
@hieuvubk hieuvubk marked this pull request as ready for review May 27, 2024 13:12
@hieuvubk hieuvubk requested a review from a team as a code owner May 27, 2024 13:12
Copy link
Contributor

@hieuvubk your pull request is missing a changelog!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 190b20c and 8dc47f6.
Files ignored due to path filters (5)
  • api/cosmos/app/v2/config.pb.go is excluded by !**/*.pb.go
  • api/cosmos/app/v2/module.pb.go is excluded by !**/*.pb.go
  • depinject/go.mod is excluded by !**/*.mod
  • depinject/go.sum is excluded by !**/*.sum
  • depinject/internal/appconfig/testpb/test.pb.go is excluded by !**/*.pb.go
Files selected for processing (6)
  • api/cosmos/app/v1alpha1/types.go (1 hunks)
  • api/cosmos/app/v2/types.go (1 hunks)
  • depinject/appconfig/config.go (3 hunks)
  • depinject/appconfig/config_test.go (2 hunks)
  • depinject/appconfig/module.go (1 hunks)
  • depinject/internal/appconfig/registry.go (2 hunks)
Additional Context Used
Path-based Instructions (6)
api/cosmos/app/v2/types.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

api/cosmos/app/v1alpha1/types.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

depinject/internal/appconfig/registry.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

depinject/appconfig/module.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

depinject/appconfig/config.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

depinject/appconfig/config_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

Additional comments not posted (9)
api/cosmos/app/v2/types.go (2)

5-14: The implementation of GetTypeUrl method correctly handles nil checks for both the ModuleConfig and its Config field, providing appropriate error messages. This is a good practice for robust error handling.


16-28: The method GetGolangBindingsStrings effectively extracts interface types and their implementations from GolangBindings. Using slices with pre-allocated lengths based on the input slice ensures efficient memory usage.

api/cosmos/app/v1alpha1/types.go (2)

5-14: The GetTypeUrl method is implemented consistently with the v2 version, including comprehensive nil handling and clear error messaging. This consistency across versions helps in maintaining a uniform interface.


16-28: Similar to the v2 implementation, GetGolangBindingsStrings is well-implemented with efficient memory management and clear structure in handling the bindings. Consistency in method implementations across versions is beneficial.

depinject/internal/appconfig/registry.go (1)

35-50: The logic to handle both v1 and v2 protobuf messages using protoadapt is a clever use of the adapter pattern to ensure compatibility across different versions of protobuf messages. However, ensure that the error handling is robust enough to manage potential issues during the type assertions and conversions.

#!/bin/bash
# Description: Verify robust error handling for type assertions in registry.go.

# Test: Search for error handling related to type assertions. Expect: Proper error checks after type assertions.
rg --type go 'if _, ok := .*\.(.*); !ok {' ./depinject/internal/appconfig/registry.go
depinject/appconfig/module.go (1)

7-7: Switching the import to github.com/cosmos/gogoproto/proto aligns with the PR's goal to support gogo protobufs. This change should be reflected across all files that interact with protobufs to maintain consistency.

depinject/appconfig/config.go (2)

20-40: The updated LoadJSON function now supports both v1alpha1 and v2 configurations using respective unmarshalers. This dual support enhances the flexibility of the configuration loading but ensure that the error paths are thoroughly tested to handle any inconsistencies between the two versions.

#!/bin/bash
# Description: Verify thorough testing of error paths in LoadJSON function.

# Test: Search for test cases covering error paths in LoadJSON. Expect: Comprehensive test cases in config_test.go.
rg --type go 'LoadJSON' ./depinject/appconfig/config_test.go

63-190: The Compose function has been significantly refactored to handle different versions of configurations and their modules. The use of interfaces and type assertions is appropriate, but it's crucial to ensure that all edge cases and error conditions are covered in unit tests, especially for the new branching logic introduced.

#!/bin/bash
# Description: Verify coverage of edge cases in Compose function.

# Test: Search for test cases covering new logic in Compose. Expect: Specific tests for branching logic.
rg --type go 'Compose' ./depinject/appconfig/config_test.go
depinject/appconfig/config_test.go (1)

124-221: The new test TestComposeGogoTypes is crucial for verifying the integration of gogo types. It's well-structured to simulate various scenarios and error conditions. Ensure that these tests are comprehensive enough to cover all new logic introduced in the Compose function.

fullName := descriptor.FullName()
if _, ok := res[fullName]; ok {
return nil, fmt.Errorf("duplicate module registration for %s", fullName)
}

modDesc := proto.GetExtension(descriptor.Options(), appv1alpha1.E_Module).(*appv1alpha1.ModuleDescriptor)
modDesc := protov2.GetExtension(descriptor.Options(), appv1alpha1.E_Module).(*appv1alpha1.ModuleDescriptor)
Copy link
Contributor

Choose a reason for hiding this comment

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

The use of GetExtension to fetch module descriptors is correctly implemented. However, consider adding null checks after retrieving the extension to prevent potential nil pointer dereferences.

- modDesc := protov2.GetExtension(descriptor.Options(), appv1alpha1.E_Module).(*appv1alpha1.ModuleDescriptor)
+ modDesc, ok := protov2.GetExtension(descriptor.Options(), appv1alpha1.E_Module).(*appv1alpha1.ModuleDescriptor)
+ if !ok {
+     return nil, fmt.Errorf("failed to get module descriptor for %s", fullName)
+ }

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
modDesc := protov2.GetExtension(descriptor.Options(), appv1alpha1.E_Module).(*appv1alpha1.ModuleDescriptor)
modDesc, ok := protov2.GetExtension(descriptor.Options(), appv1alpha1.E_Module).(*appv1alpha1.ModuleDescriptor)
if !ok {
return nil, fmt.Errorf("failed to get module descriptor for %s", fullName)
}

@kocubinski kocubinski self-assigned this May 28, 2024
Copy link
Member

@kocubinski kocubinski left a comment

Choose a reason for hiding this comment

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

Great start!
Looking for some clarification on code gen and design decision to use an interface.

Copy link
Member

Choose a reason for hiding this comment

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

What command was run to generate these files? There must be counterparty protofiles in proto/cosmos/app/v2 which I don't see in this PR. Could you explain a bit on why a v2 API is needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Its for appconfig.Compose since rn it just supports appv1alpha1 types.
Also, regened module & config to api/cosmos/app/v2 with some changes in gen script cause we just want v2 as gogo types I think

# remove /api/cosmos/app/v2 folder since v2 not support pulsar
 rm -rf $home/api/cosmos/app/v2/*.pulsar.go

Copy link
Member

Choose a reason for hiding this comment

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

This usage of interface implementation seems overly complex, can't we just type switch in depinject. We don't need support for n variations of generated proto types.

@@ -121,11 +121,122 @@ modules:
expectContainerErrorContains(t, opt, "module should have ModuleDescriptor.go_import specified")
}

func TestComposeGogoTypes(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

How is this test different from TestCompose? It looks like a lot of repeated code, maybe just include the new test cases which test the new code path, i.e. yamls like

    "@type": type.googleapis.com/testpb.TestGogoUnregisteredModule

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah its quite same, cause Compose take v1 msg or v2 as input so I separate tests for each case

depinject/internal/appconfig/testpb/test.pb.go Outdated Show resolved Hide resolved
@github-actions github-actions bot added the C:orm label Jun 3, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Outside diff range and nitpick comments (1)
scripts/protocgen.sh (1)

Line range hint 19-19: Ensure proper quoting to prevent globbing and word splitting.

- find ./ -name "*.proto" -exec clang-format -i {} \;
+ find ./ -name "*.proto" -exec clang-format -i "{}" \;

- if [ -d "../cosmos" -a "$dir" != "./proto" ]; then
+ if [ -d "../cosmos" ] && [ "$dir" != "./proto" ]; then

- rm -rf $home/api/cosmos/app/v2/*.pulsar.go
+ rm -rf "$home/api/cosmos/app/v2"/*.pulsar.go

- if grep -q "option go_package" "$file" && grep -H -o -c 'option go_package.*cosmossdk.io/api' "$file" | grep -q ':0$'; then
+ if grep -q "option go_package" "$file" && grep -H -o -c 'option go_package.*cosmossdk.io/api' "$file" | grep -q ':0$'; then

- cp -r ../cosmossdk.io/* $home
+ cp -r ../cosmossdk.io/* "$home"

- cp -r ../github.com/cosmos/cosmos-sdk/* $home
+ cp -r ../github.com/cosmos/cosmos-sdk/* "$home"

- rm -rf github.com
+ rm -rf "github.com"

Also applies to: 25-25, 29-29, 40-40, 46-46, 51-51, 56-56

Tools
Shellcheck

[warning] 24-24: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.


[info] 25-25: Double quote to prevent globbing and word splitting.


[info] 29-29: Double quote to prevent globbing and word splitting.

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8dc47f6 and fb8ffb8.

Files ignored due to path filters (9)
  • api/cosmos/app/v2/config.pb.go is excluded by !**/*.pb.go
  • api/cosmos/app/v2/module.pb.go is excluded by !**/*.pb.go
  • api/go.mod is excluded by !**/*.mod
  • api/go.sum is excluded by !**/*.sum
  • depinject/go.mod is excluded by !**/*.mod
  • depinject/go.sum is excluded by !**/*.sum
  • depinject/internal/appconfig/testpb/test_gogo.pb.go is excluded by !**/*.pb.go
  • orm/go.mod is excluded by !**/*.mod
  • orm/go.sum is excluded by !**/*.sum
Files selected for processing (9)
  • depinject/appconfig/config.go (4 hunks)
  • depinject/appconfig/config_test.go (2 hunks)
  • depinject/appconfig/module.go (1 hunks)
  • depinject/internal/appconfig/buf.gen.gogo.yaml (1 hunks)
  • depinject/internal/appconfig/registry.go (2 hunks)
  • depinject/internal/appconfig/testpb/test_gogo.proto (1 hunks)
  • proto/cosmos/app/v2/config.proto (1 hunks)
  • proto/cosmos/app/v2/module.proto (1 hunks)
  • scripts/protocgen.sh (1 hunks)
Additional context used
Path-based instructions (4)
depinject/internal/appconfig/registry.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

depinject/appconfig/module.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

depinject/appconfig/config.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

depinject/appconfig/config_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

Shellcheck
scripts/protocgen.sh

[info] 19-19: Double quote to prevent globbing and word splitting.


[warning] 24-24: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.


[info] 25-25: Double quote to prevent globbing and word splitting.


[info] 29-29: Double quote to prevent globbing and word splitting.


[warning] 35-35: For loops over find output are fragile. Use find -exec or a while read loop.


[info] 40-40: Double quote to prevent globbing and word splitting.


[warning] 45-45: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.


[info] 46-46: Double quote to prevent globbing and word splitting.


[warning] 50-50: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.


[info] 51-51: Double quote to prevent globbing and word splitting.


[info] 56-56: Double quote to prevent globbing and word splitting.

golangci-lint
depinject/internal/appconfig/registry.go

6-6: File is not gci-ed with --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order


12-12: File is not gci-ed with --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order


40-40: S1040: type assertion to the same type: initializer.ConfigProtoMessage already has type proto.Message

depinject/appconfig/module.go

8-8: use of internal package cosmossdk.io/depinject/internal/appconfig not allowed

depinject/appconfig/config.go

21-21: use of internal package cosmossdk.io/depinject/internal/appconfig not allowed

depinject/appconfig/config_test.go

15-15: use of internal package cosmossdk.io/depinject/internal/appconfig not allowed

Additional comments not posted (15)
depinject/internal/appconfig/buf.gen.gogo.yaml (1)

1-11: Configuration settings for gogo support are correctly specified.

depinject/internal/appconfig/testpb/test_gogo.proto (1)

1-38: All protobuf message definitions are correctly configured with go_import options.

depinject/internal/appconfig/registry.go (1)

50-50: Consider adding null checks after retrieving the extension to prevent potential nil pointer dereferences.

proto/cosmos/app/v2/config.proto (1)

1-57: The new protobuf definitions for Config and ModuleConfig are correctly implemented to support the new functionality.

proto/cosmos/app/v2/module.proto (3)

21-41: Added ModuleDescriptor message to describe app modules, including import paths and migration capabilities.


43-83: Introduced PackageReference message to manage protobuf package versions used by modules.


86-93: Added MigrateFromInfo message to handle module version migrations.

depinject/appconfig/config.go (6)

8-10: Added imports for gogoproto to support the new gogo functionality.


19-19: Imported appv2 to handle version 2 of app configurations.


28-37: Updated LoadJSON to handle both appv1alpha1 and appv2 configurations using gogo's JSON parsing.


61-65: Defined ModuleConfigI interface to standardize module configuration interactions.


69-196: Refactored Compose to support dynamic module configuration and binding based on the provided app configuration version.


210-213: Simplified GetProtoV1MsgNameFromAnyTypeUrl to extract message names from URLs.

depinject/appconfig/config_test.go (2)

38-38: Added a test case to handle unknown message types in YAML configurations.


124-221: Updated TestComposeGogoTypes to include tests for the new gogo types and error handling.

Comment on lines +7 to +12
protov2 "google.golang.org/protobuf/proto"
"google.golang.org/protobuf/protoadapt"
"google.golang.org/protobuf/reflect/protoreflect"

appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"
"github.com/cosmos/gogoproto/proto"
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure imports are grouped correctly according to the Golang style guide.

import (
	"fmt"
	"reflect"
	protov2 "google.golang.org/protobuf/proto"
	"google.golang.org/protobuf/protoadapt"
	"google.golang.org/protobuf/reflect/protoreflect"
	appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"
	"github.com/cosmos/gogoproto/proto"
)

Committable suggestion was skipped due low confidence.

Tools
golangci-lint

12-12: File is not gci-ed with --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order

if ok {
descriptor = v2Msg.ProtoReflect().Descriptor()
} else {
v1Msg, _ := initializer.ConfigProtoMessage.(proto.Message)
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove unnecessary type assertion, as it is redundant.

- v1Msg, _ := initializer.ConfigProtoMessage.(proto.Message)
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
v1Msg, _ := initializer.ConfigProtoMessage.(proto.Message)
Tools
golangci-lint

40-40: S1040: type assertion to the same type: initializer.ConfigProtoMessage already has type proto.Message

@@ -3,7 +3,7 @@ package appconfig
import (
"reflect"

"google.golang.org/protobuf/proto"
"github.com/cosmos/gogoproto/proto"
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid using internal packages in public API implementations to ensure proper encapsulation and package independence.

- import internal "cosmossdk.io/depinject/internal/appconfig"

Committable suggestion was skipped due low confidence.

} else {
config := init.ConfigProtoMessage.(proto.Message)

anyCfg := &gogotypes.Any{
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cast from gogoproto/types/any.Any to gogoproto/types.Any then UnmarshalAny.
This codes can be replaced by

codectypes.NewInterfaceRegistry().UnpackAny()

but will make dependencies bigger as cosmos-sdk import

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: depinject with gogo
3 participants