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

x/auth/ante: Migrate tests to use the new client.TxConfig #6661

Merged
merged 61 commits into from
Jul 20, 2020

Conversation

amaury1093
Copy link
Contributor

@amaury1093 amaury1093 commented Jul 9, 2020

Description

ref: #6213

Some seemingly unrelated stuff got bundled in this PR, after comments:

  • Refactored x/auth/ante tests:
    • remove StdTx,StdFee... in favor of TxBuilder
    • created a AnteTestSuite to factorize some code, tests use this suite when it makes sense
    • use test tables, improve readability
  • move codec/testdata to testutil/testdata
  • Rename TxGenerator to TxConfig
  • Add SignWithPrivKey so that you can either sign with a crypto.PrivKey or a TxFactory's keybase

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

@aaronc aaronc mentioned this pull request Jul 9, 2020
27 tasks
@codecov
Copy link

codecov bot commented Jul 9, 2020

Codecov Report

Merging #6661 into master will decrease coverage by 0.01%.
The diff coverage is 64.36%.

@@            Coverage Diff             @@
##           master    #6661      +/-   ##
==========================================
- Coverage   60.27%   60.26%   -0.01%     
==========================================
  Files         513      512       -1     
  Lines       31510    31492      -18     
==========================================
- Hits        18993    18979      -14     
+ Misses      11070    11065       -5     
- Partials     1447     1448       +1     

x/auth/types/test_utils.go Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Jul 10, 2020

This pull request introduces 1 alert when merging 1f79c24 into 59cd065 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

@lgtm-com
Copy link

lgtm-com bot commented Jul 10, 2020

This pull request introduces 1 alert when merging 5dec3f8 into 59cd065 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

@amaury1093 amaury1093 marked this pull request as draft July 15, 2020 16:22
@amaury1093 amaury1093 changed the title x/auth/ante: Migrate tests to use the new client.TxGenerator x/auth/ante: Migrate tests to use the new client.TxConfig Jul 16, 2020
client/tx/tx.go Show resolved Hide resolved
client/tx/tx.go Show resolved Hide resolved
@amaury1093 amaury1093 marked this pull request as ready for review July 16, 2020 13:41
client/tx/tx.go Show resolved Hide resolved
@amaury1093
Copy link
Contributor Author

Done, reverted 👍

@fedekunze fedekunze merged commit 5c0e3b4 into master Jul 20, 2020
@fedekunze fedekunze deleted the am-6213-xauthante branch July 20, 2020 12:30
chengwenxi pushed a commit to irisnet/cosmos-sdk that referenced this pull request Jul 22, 2020
* WIP: using encoding config

* Make it compile, test fails

* test should be okay

* Make tests pass

* Add comments

* Convert more tests

* Make TestAnteHandlerSigErrors work

* Make first 2 tests pass

* TestAnteHandlerAccountNumbers

* Use table tests

* Remove print

* Use test table

* TestAnteHandlerSigErrors

* TestAnteHandlerAccountNumbers

* TestAnteHandlerAccountNumbers

* Refactor TestAccount

* Refactor getSignBytes

* TestAnteHandlerAccountNumbersAtBlockHeightZero

* TestAnteHandlerSequences

* TestAnteHandlerFees

* TestAnteHandlerMultiSigner

* TestAnteHandlerBadSignBytes

* TestAnteHandlerSetPubKey

* TestAnteHandlerSigLimitExceeded

* TestCustomSignatureVerificationGasConsumer

* TestAnteHandlerReCheck

* Make all tests pass

* Refactor a little bit more

* Fee test

* SetupTest

* All tests pass

* Refactor to RunTestCase

* Don't use StdFee

* Revert some little stuff

* Finish up last couple of test cases

* Less verbose

* s/TxGenerator/TxConfig

* Add comments

* Indent

* Move KeyTestPubAddr to testdata

* Move testdata to /testutil

* Revert to use signature: nil step in signing

* Add comments

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
* WIP: using encoding config

* Make it compile, test fails

* test should be okay

* Make tests pass

* Add comments

* Convert more tests

* Make TestAnteHandlerSigErrors work

* Make first 2 tests pass

* TestAnteHandlerAccountNumbers

* Use table tests

* Remove print

* Use test table

* TestAnteHandlerSigErrors

* TestAnteHandlerAccountNumbers

* TestAnteHandlerAccountNumbers

* Refactor TestAccount

* Refactor getSignBytes

* TestAnteHandlerAccountNumbersAtBlockHeightZero

* TestAnteHandlerSequences

* TestAnteHandlerFees

* TestAnteHandlerMultiSigner

* TestAnteHandlerBadSignBytes

* TestAnteHandlerSetPubKey

* TestAnteHandlerSigLimitExceeded

* TestCustomSignatureVerificationGasConsumer

* TestAnteHandlerReCheck

* Make all tests pass

* Refactor a little bit more

* Fee test

* SetupTest

* All tests pass

* Refactor to RunTestCase

* Don't use StdFee

* Revert some little stuff

* Finish up last couple of test cases

* Less verbose

* s/TxGenerator/TxConfig

* Add comments

* Indent

* Move KeyTestPubAddr to testdata

* Move testdata to /testutil

* Revert to use signature: nil step in signing

* Add comments

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
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.

4 participants