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

refactor: migrate x/evidence to mocks #12749

Merged
merged 20 commits into from
Aug 1, 2022

Conversation

JeancarloBarrios
Copy link
Contributor

@JeancarloBarrios JeancarloBarrios commented Jul 27, 2022

Description

Closes: #12501


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...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

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 ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@JeancarloBarrios JeancarloBarrios changed the title Jeancarlo barrios/migrate evidence to mocks Jeancarlobarrios/migrate evidence to mocks Jul 27, 2022
@JeancarloBarrios JeancarloBarrios changed the title Jeancarlobarrios/migrate evidence to mocks migrate evidence to mocks Jul 27, 2022
@JeancarloBarrios JeancarloBarrios changed the title migrate evidence to mocks refeactor: migrate x/evidence to mocks Aug 1, 2022
@JeancarloBarrios JeancarloBarrios changed the title refeactor: migrate x/evidence to mocks refactor: migrate x/evidence to mocks Aug 1, 2022
@JeancarloBarrios JeancarloBarrios marked this pull request as ready for review August 1, 2022 02:40
@JeancarloBarrios JeancarloBarrios requested a review from a team as a code owner August 1, 2022 02:40
@JeancarloBarrios JeancarloBarrios added A:automerge Automatically merge PR once all prerequisites pass. and removed A:automerge Automatically merge PR once all prerequisites pass. labels Aug 1, 2022
)

func (suite *KeeperTestSuite) TestHandleDoubleSign() {
type InfractionTestSuite struct {
suite.Suite
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not exactly sure, why use the mixing of mock test and integration test?
For example, why are you using simtestuitl instead of KeeperTestSuite?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because this seems to be more like an integration test, and logic is a bit critical to just mock, it felt more like I was testing mock expect than anything else. We discuss it a bit and for now we left it like that

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, we don't use

func (suite *KeeperTestSuite) populateValidators(ctx sdk.Context) {
anywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true sorry I missed that thanks!!!

@JeancarloBarrios JeancarloBarrios added the A:automerge Automatically merge PR once all prerequisites pass. label Aug 1, 2022
@codecov
Copy link

codecov bot commented Aug 1, 2022

Codecov Report

Merging #12749 (4d67983) into main (30c5f20) will decrease coverage by 0.10%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #12749      +/-   ##
==========================================
- Coverage   56.25%   56.15%   -0.11%     
==========================================
  Files         645      641       -4     
  Lines       54656    54559      -97     
==========================================
- Hits        30749    30638     -111     
- Misses      21429    21453      +24     
+ Partials     2478     2468      -10     
Impacted Files Coverage Δ
x/evidence/keeper/infraction.go 0.00% <0.00%> (-78.41%) ⬇️
x/evidence/keeper/msg_server.go 0.00% <0.00%> (-10.00%) ⬇️
x/evidence/keeper/keeper.go 84.88% <0.00%> (-2.33%) ⬇️
tx/textual/valuerenderer/valuerenderer.go
tx/textual/valuerenderer/int.go
tx/textual/valuerenderer/bytes.go
tx/textual/valuerenderer/dec.go
x/distribution/simulation/operations.go 90.42% <0.00%> (+9.57%) ⬆️

@mergify mergify bot merged commit cc5fe49 into main Aug 1, 2022
@mergify mergify bot deleted the JeancarloBarrios/migrate-evidence-to-mocks branch August 1, 2022 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. C:x/evidence Type: Build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

migrate evidence to use mocks
3 participants