Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: simulate nested messages #20291
feat: simulate nested messages #20291
Changes from 10 commits
3ba1d99
cc1efda
9556fe5
9409167
267b4b4
c0b2318
acfa637
e9569ed
6d0e987
c6a8a61
f1544b2
6051619
c035d34
6260cfd
e5362a5
79ac6b4
38854b6
99a166b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: if you use a map[string]struct{} for the tests spec, you can avoid the name attribute and use the map key instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure whats the best place to define this 🤨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is a good practice to define the type where it is used. You can also consider making it private or inline it into the function where it is used. In this case there is the same interface in types called HasMsgs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm
HasMsgs
is pretty similar but doesn't return an error. I think it was designed with tx in mind.cosmos-sdk/types/tx_msg.go
Line 48 in 83c4b9b
Makes me wonder if we should update
HasMsgs
or stick with this 'duplicate'. If we opt for both interfaces, baseapp is not the ideal place forHasNestedMsgs
as it may be useful for ante handlers.@tac0turtle @julienrbrt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the possible error that would be returned here? feel like it wouldnt return an error and just be length of 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opted for that because current messages with nested messages within the SDK have defined that method:
cosmos-sdk/x/gov/types/v1/proposal.go
Lines 62 to 65 in e8222c8
cosmos-sdk/x/group/proposal.go
Lines 10 to 13 in b536d11
I guess we should standardise this and document it.
Check failure on line 1109 in baseapp/baseapp.go
GitHub Actions / dependency-review
Check failure on line 1109 in baseapp/baseapp.go
GitHub Actions / golangci-lint
Check failure on line 1109 in baseapp/baseapp.go
GitHub Actions / golangci-lint
Check failure on line 1109 in baseapp/baseapp.go
GitHub Actions / golangci-lint
Check failure on line 1109 in baseapp/baseapp.go
GitHub Actions / tests (03)
Check failure on line 1109 in baseapp/baseapp.go
GitHub Actions / tests (03)
Check failure on line 1109 in baseapp/baseapp.go
GitHub Actions / tests (00)
Check failure on line 1109 in baseapp/baseapp.go
GitHub Actions / tests (00)
Check failure on line 1109 in baseapp/baseapp.go
GitHub Actions / tests (00)
Check failure on line 1109 in baseapp/baseapp.go
GitHub Actions / tests (00)
Check failure on line 1109 in baseapp/baseapp.go
GitHub Actions / tests (01)
Check failure on line 1109 in baseapp/baseapp.go
GitHub Actions / tests (01)
Check failure on line 1109 in baseapp/baseapp.go
GitHub Actions / tests (02)
Check failure on line 1109 in baseapp/baseapp.go
GitHub Actions / tests (02)