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

test: improve fungible module coverage #1762

Merged
merged 12 commits into from
Feb 19, 2024

Conversation

skosito
Copy link
Contributor

@skosito skosito commented Feb 15, 2024

Description

Increases the coverage of mentioned parts of fungible module. Adds some generic helper methods for mocking evm client. I think there is a bit more room to move some testing code around (for example deploySystemContract) and probably it's better to mock happy paths too. Here I basically had to introduce more evm client mocking because it is hard to mimic real world evmCall reverts (and no need to in unit tests, we can mock that external dependency).

Relates to: #1742 . It is part 1 of adding more coverage, will add missing tests for system_contract.go in follow up PR.

Type of change

Tests

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Checklist:

  • I have added unit tests that prove my fix feature works

Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

Looks great!

x/fungible/keeper/evm_test.go Show resolved Hide resolved
x/fungible/keeper/gas_price.go Outdated Show resolved Hide resolved
@skosito skosito requested a review from lumtis February 16, 2024 11:36
Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

Great job!
The coverage looks good to me. We're integrating code coverage so will check the global coverage afterward.

@lumtis lumtis merged commit e72da59 into develop Feb 19, 2024
13 checks passed
@lumtis lumtis deleted the chore-improve-fungible-module-coverage branch February 19, 2024 14:32
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.

None yet

3 participants