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

[Bank Refactor]: Remove SetBalances usage from the code and tests #8509

Merged

Conversation

fdymylja
Copy link
Contributor

@fdymylja fdymylja commented Feb 4, 2021

Description

closes: #XXXX


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

@codecov
Copy link

codecov bot commented Feb 4, 2021

Codecov Report

Merging #8509 (8494b9e) into jonathan-frojdi/refactor-bank (c4bd11c) will decrease coverage by 0.06%.
The diff coverage is 0.00%.

Impacted file tree graph

@@                        Coverage Diff                        @@
##           jonathan-frojdi/refactor-bank    #8509      +/-   ##
=================================================================
- Coverage                          61.47%   61.41%   -0.07%     
=================================================================
  Files                                651      630      -21     
  Lines                              37286    36438     -848     
=================================================================
- Hits                               22923    22377     -546     
+ Misses                             11962    11711     -251     
+ Partials                            2401     2350      -51     
Impacted Files Coverage Δ
simapp/test_helpers.go 0.49% <0.00%> (-0.01%) ⬇️
x/distribution/keeper/genesis.go 9.32% <0.00%> (ø)
x/evidence/types/evidence.go 67.74% <0.00%> (-19.76%) ⬇️
x/bank/types/key.go 33.33% <0.00%> (-16.67%) ⬇️
x/bank/keeper/send.go 72.17% <0.00%> (-10.71%) ⬇️
x/staking/types/keys.go 44.89% <0.00%> (-3.18%) ⬇️
x/bank/keeper/keeper.go 72.50% <0.00%> (-2.50%) ⬇️
x/bank/types/msgs.go 53.04% <0.00%> (-0.87%) ⬇️
x/bank/client/cli/query.go 68.37% <0.00%> (-0.54%) ⬇️
x/gov/client/cli/query.go 69.14% <0.00%> (-0.43%) ⬇️
... and 51 more


// FundAccount is a utility function that funds an account by minting and sending the coins to the address
// TODO(fdymylja): instead of using the mint module account, which has the permission of minting, create a "faucet" account
func FundAccount(app *SimApp, ctx sdk.Context, addr sdk.AccAddress, amount sdk.Coins) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Excellent

@fdymylja fdymylja marked this pull request as ready for review February 10, 2021 15:47
@fdymylja fdymylja merged commit f6718d8 into jonathan-frojdi/refactor-bank Feb 10, 2021
@fdymylja fdymylja deleted the frojdi/refactor-bank-remove-setbalance branch February 10, 2021 15:47
mergify bot pushed a commit that referenced this pull request Feb 17, 2021
* temp commit

* setbalance now is internal

* remove set balances in genesis

* feedback test commit

* update tests

* fix: genesis panic message

* fix not bonded pool

* fix(staking): genesis test

* fix(simapp): rollback state fix change

* fix(staking): genesis large val set test

* [Bank Refactor] Frojdi jonathan/remove setsupply (#8491)

* init supply in a different way

* remove external usage of set supply

* change(staking): replace SetSupply with MintCoins in tests

* change(evidence): replace SetSupply with MintCoins in tests

* change(crisis): remove SetSupply in tests

* change(bank): remove set supply from genesis tests

* change(bank): remove set supply from keeper tests

* change(bank): remove remaining set supply usage from keeper tests

* change(bank): remove set supply usage from grpc query and querier tests

* change(bank): remove SetSupply from keeper interface

Co-authored-by: Frojdi Dymylja <[email protected]>

* remove setbalances from genesis in gov

* remove keyring

* add init genesis state

* change(staking): make genesis checks coherent and add tests

* remove setbalances on distribution

* fix(staking): genesis tests

* [Bank Refactor]: Remove SetBalances usage from the code and tests (#8509)

* change(distribution): remove SetBalances usage from keeper tests

* add(simapp): FundAccount utility function

* chore(staking): use FundAccount in keeper tests

* change(staking): remove usage of SetBalance in allocation tests

* change(staking): remove usage of SetBalance in delegation tests

* change(staking): remove usage of SetBalance in proposal handler tests

* change(staking): remove usage of SetBalances in grpc query tests

* change(staking): remove usage of SetBalances in operations tests

* change(distribution): remove usage of SetBalances in genesis

* change(authz): remove usage of SetBalances keeper and operations test

* fix(authz): TestKeeperFees failing test

* change(slashing): remove SetBalances from expected BankKeeper

* change(slashing): remove usage of SetBalances in tests

* change(distribution): remove SetBalances from expected BankKeeper

* change(genutil): remove usage of SetBalances from tests

* change(gov): remove SetBalances from expected BankKeeper

* change(gov): remove usage of SetBalances from tests

* change(staking): remove usage of SetBalances from slash tests

* change(staking): remove SetBalances from expected BankKeeper

* change(staking): remove usage of SetBalances from delegation tests

* change(staking): remove usage of SetBalances from operations tests

* change(staking): remove usage of SetBalances from validator tests

* change(bank): remove usage of SetBalances from app tests

* change(bank): remove usage of SetBalances from bench tests

* change(bank): remove usage of SetBalances from querier tests

* change(bank): remove usage of SetBalances from grpc query tests

* change(bank): remove usage of SetBalances from operations tests

* change(bank): partially remove usage of SetBalances from keeper tests

* change(bank): finalize removal of usage of SetBalances from keeper tests

* change(auth): remove usage of SetBalances from verify tests

* change(auth): partially remove usage of SetBalances from tests

* [Bank refactor]: finalize removal of setbalances from auth (#8527)

* add tests with is check tx

* temp commit

* fix test

* fix other test and remove setbalances

* change(auth): remove usage of SetBalances is vesting tests

Co-authored-by: Jonathan Gimeno <[email protected]>

* change(types): remove usage of SetBalances in queries

* fix(types): pagination tests

* [Bank refactor] fix pagination tests (#8550)

* fix tests

* lint

* change(bank): remove SetBalances from keeper public API

Co-authored-by: Jonathan Gimeno <[email protected]>
Co-authored-by: SaReN <[email protected]>

* change(bank): remove SubtractCoins from keeper public API

* change(ibc/transfer): remove AddCoins from relay tests

* change(bank): remove AddCoins from public keeper API

* fix imports

* remove set balances

* fix fee test

* remove set balances

* fix(staking): remove dependency on minter authorization for staking pools

* chore: update CHANGELOG.md

* update: x/distribution/keeper/keeper_test.go

Co-authored-by: Robert Zaremba <[email protected]>

* Update simapp/test_helpers.go

Co-authored-by: Robert Zaremba <[email protected]>

* Update x/staking/genesis_test.go

Co-authored-by: Robert Zaremba <[email protected]>

* fix(simapp): FundAccount amount variable name

* fix some PR issues

Co-authored-by: Frojdi Dymylja <[email protected]>
Co-authored-by: Frojdi Dymylja <[email protected]>
Co-authored-by: SaReN <[email protected]>
Co-authored-by: Alessio Treglia <[email protected]>
Co-authored-by: Robert Zaremba <[email protected]>
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
* temp commit

* setbalance now is internal

* remove set balances in genesis

* feedback test commit

* update tests

* fix: genesis panic message

* fix not bonded pool

* fix(staking): genesis test

* fix(simapp): rollback state fix change

* fix(staking): genesis large val set test

* [Bank Refactor] Frojdi jonathan/remove setsupply (cosmos#8491)

* init supply in a different way

* remove external usage of set supply

* change(staking): replace SetSupply with MintCoins in tests

* change(evidence): replace SetSupply with MintCoins in tests

* change(crisis): remove SetSupply in tests

* change(bank): remove set supply from genesis tests

* change(bank): remove set supply from keeper tests

* change(bank): remove remaining set supply usage from keeper tests

* change(bank): remove set supply usage from grpc query and querier tests

* change(bank): remove SetSupply from keeper interface

Co-authored-by: Frojdi Dymylja <[email protected]>

* remove setbalances from genesis in gov

* remove keyring

* add init genesis state

* change(staking): make genesis checks coherent and add tests

* remove setbalances on distribution

* fix(staking): genesis tests

* [Bank Refactor]: Remove SetBalances usage from the code and tests (cosmos#8509)

* change(distribution): remove SetBalances usage from keeper tests

* add(simapp): FundAccount utility function

* chore(staking): use FundAccount in keeper tests

* change(staking): remove usage of SetBalance in allocation tests

* change(staking): remove usage of SetBalance in delegation tests

* change(staking): remove usage of SetBalance in proposal handler tests

* change(staking): remove usage of SetBalances in grpc query tests

* change(staking): remove usage of SetBalances in operations tests

* change(distribution): remove usage of SetBalances in genesis

* change(authz): remove usage of SetBalances keeper and operations test

* fix(authz): TestKeeperFees failing test

* change(slashing): remove SetBalances from expected BankKeeper

* change(slashing): remove usage of SetBalances in tests

* change(distribution): remove SetBalances from expected BankKeeper

* change(genutil): remove usage of SetBalances from tests

* change(gov): remove SetBalances from expected BankKeeper

* change(gov): remove usage of SetBalances from tests

* change(staking): remove usage of SetBalances from slash tests

* change(staking): remove SetBalances from expected BankKeeper

* change(staking): remove usage of SetBalances from delegation tests

* change(staking): remove usage of SetBalances from operations tests

* change(staking): remove usage of SetBalances from validator tests

* change(bank): remove usage of SetBalances from app tests

* change(bank): remove usage of SetBalances from bench tests

* change(bank): remove usage of SetBalances from querier tests

* change(bank): remove usage of SetBalances from grpc query tests

* change(bank): remove usage of SetBalances from operations tests

* change(bank): partially remove usage of SetBalances from keeper tests

* change(bank): finalize removal of usage of SetBalances from keeper tests

* change(auth): remove usage of SetBalances from verify tests

* change(auth): partially remove usage of SetBalances from tests

* [Bank refactor]: finalize removal of setbalances from auth (cosmos#8527)

* add tests with is check tx

* temp commit

* fix test

* fix other test and remove setbalances

* change(auth): remove usage of SetBalances is vesting tests

Co-authored-by: Jonathan Gimeno <[email protected]>

* change(types): remove usage of SetBalances in queries

* fix(types): pagination tests

* [Bank refactor] fix pagination tests (cosmos#8550)

* fix tests

* lint

* change(bank): remove SetBalances from keeper public API

Co-authored-by: Jonathan Gimeno <[email protected]>
Co-authored-by: SaReN <[email protected]>

* change(bank): remove SubtractCoins from keeper public API

* change(ibc/transfer): remove AddCoins from relay tests

* change(bank): remove AddCoins from public keeper API

* fix imports

* remove set balances

* fix fee test

* remove set balances

* fix(staking): remove dependency on minter authorization for staking pools

* chore: update CHANGELOG.md

* update: x/distribution/keeper/keeper_test.go

Co-authored-by: Robert Zaremba <[email protected]>

* Update simapp/test_helpers.go

Co-authored-by: Robert Zaremba <[email protected]>

* Update x/staking/genesis_test.go

Co-authored-by: Robert Zaremba <[email protected]>

* fix(simapp): FundAccount amount variable name

* fix some PR issues

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

Successfully merging this pull request may close these issues.

3 participants