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

SDK Core Audit - simapp updates #9315

Merged
merged 8 commits into from
May 17, 2021
Merged

SDK Core Audit - simapp updates #9315

merged 8 commits into from
May 17, 2021

Conversation

blushi
Copy link
Contributor

@blushi blushi commented May 12, 2021

Description

ref: #9218


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@@ -443,12 +444,12 @@ func (ao EmptyAppOptions) Get(o string) interface{} {
//
// TODO: Instead of using the mint module account, which has the
// permission of minting, create a "faucet" account. (@fdymylja)
func FundAccount(app *SimApp, ctx sdk.Context, addr sdk.AccAddress, amounts sdk.Coins) error {
if err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, amounts); err != nil {
func FundAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, amounts sdk.Coins) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressing leftover comments from #8473 cc/ @robert-zaremba

Copy link
Collaborator

Choose a reason for hiding this comment

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

My main desire was to move this function away from the simapp package. This functions is used in tests.
#8473 (review)

Copy link
Contributor Author

@blushi blushi May 17, 2021

Choose a reason for hiding this comment

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

@robert-zaremba makes sense, to testutil for instance?

Copy link
Contributor

Choose a reason for hiding this comment

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

x/bank/client/testutil could also be a candidate, even though FundAccount is not really a client util.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has received enough approvals, so let's tackle #9315 (comment) as part of a separate issue: #9346

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, we could put it to testutil. So, as you prefer, we can do it here , or in other PR.

Address: authtypes.NewModuleAddress(stakingtypes.NotBondedPoolName).String(),
Coins: sdk.NewCoins(notBondedCoins),
})
stakingAddr := authtypes.NewModuleAddress(stakingtypes.NotBondedPoolName).String()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@codecov
Copy link

codecov bot commented May 12, 2021

Codecov Report

Merging #9315 (da4aad6) into master (321aed8) will decrease coverage by 0.00%.
The diff coverage is 12.50%.

❗ Current head da4aad6 differs from pull request most recent head b5a95bd. Consider uploading reports for the commit b5a95bd to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9315      +/-   ##
==========================================
- Coverage   60.39%   60.38%   -0.01%     
==========================================
  Files         587      587              
  Lines       36914    36920       +6     
==========================================
  Hits        22294    22294              
- Misses      12645    12651       +6     
  Partials     1975     1975              
Impacted Files Coverage Δ
simapp/state.go 0.00% <0.00%> (ø)
simapp/test_helpers.go 0.48% <0.00%> (ø)
simapp/app.go 83.09% <100.00%> (ø)
types/address.go 64.75% <0.00%> (ø)
types/address/hash.go 100.00% <0.00%> (ø)
types/query/pagination.go 80.00% <0.00%> (ø)

@blushi blushi marked this pull request as ready for review May 12, 2021 16:29
Copy link
Collaborator

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

Approving - it's an improvement. But it doesn't solve the main concern: #8473 (review)

@robert-zaremba
Copy link
Collaborator

@blushi , are you planning to solve #8473 (review) here as well?
If not, then let's create another issue.

@blushi
Copy link
Contributor Author

blushi commented May 17, 2021

@blushi , are you planning to solve #8473 (review) here as well?
If not, then let's create another issue.

I can move it as part of this PR I guess, once we have agreed on #9315 (comment)

Copy link
Contributor

@atheeshp atheeshp left a comment

Choose a reason for hiding this comment

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

LGTM

@blushi blushi added the A:automerge Automatically merge PR once all prerequisites pass. label May 17, 2021
@robert-zaremba
Copy link
Collaborator

@blushi , are you planning to solve #8473 (review) here as well?
If not, then let's create another issue.

I can move it as part of this PR I guess, once we have agreed on #9315 (comment)

It would be great, otherwise we can put it as a checklist item in #9346

@mergify mergify bot merged commit 9d05048 into master May 17, 2021
@mergify mergify bot deleted the marie/9218-simapp-audit branch May 17, 2021 15:42
roysc pushed a commit to vulcanize/cosmos-sdk that referenced this pull request Jun 23, 2021
* Make package imports consistent

* Update comment

* Update FundAccount/FundModuleAccount

* Fix bench test

Co-authored-by: atheeshp <[email protected]>
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
* Make package imports consistent

* Update comment

* Update FundAccount/FundModuleAccount

* Fix bench test

Co-authored-by: atheeshp <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants