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: add unit tests for crosschain evm hooks #1787

Merged
merged 21 commits into from
Mar 5, 2024
Merged

Conversation

kingpinXD
Copy link
Contributor

@kingpinXD kingpinXD commented Feb 21, 2024

Description

Add unit tests for EVM hooks.

Closes: #1759

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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

codecov bot commented Feb 23, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 39.80%. Comparing base (01526a5) to head (8e1c2f0).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1787      +/-   ##
===========================================
+ Coverage    38.41%   39.80%   +1.39%     
===========================================
  Files          206      206              
  Lines        12584    12586       +2     
===========================================
+ Hits          4834     5010     +176     
+ Misses        7362     7181     -181     
- Partials       388      395       +7     
Files Coverage Δ
x/crosschain/keeper/evm_hooks.go 85.78% <100.00%> (+77.06%) ⬆️
x/crosschain/keeper/gas_payment.go 79.56% <0.00%> (+3.22%) ⬆️

... and 2 files with indirect coverage changes

@lumtis
Copy link
Member

lumtis commented Feb 23, 2024

Looking good so far!
34534534

@lumtis
Copy link
Member

lumtis commented Feb 23, 2024

@kingpinXD this addresses this one right? #1759

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 good, some comment on the formatting

e2e/e2etests/test_bitcoin_withdraw.go Outdated Show resolved Hide resolved
e2e/e2etests/test_bitcoin_withdraw.go Outdated Show resolved Hide resolved
x/crosschain/keeper/evm_hooks.go Outdated Show resolved Hide resolved
x/crosschain/keeper/evm_hooks_test.go Show resolved Hide resolved
x/crosschain/keeper/evm_hooks_test.go Outdated Show resolved Hide resolved
x/crosschain/keeper/evm_hooks_test.go Outdated Show resolved Hide resolved
x/crosschain/keeper/evm_hooks_test.go Outdated Show resolved Hide resolved
x/crosschain/keeper/evm_hooks_test.go Show resolved Hide resolved
Copy link

!!!WARNING!!!
nosec detected in the following files: e2e/e2etests/e2etests.go

Be very careful about using #nosec in code. It can be a quick way to suppress security warnings and move forward with development, it should be employed with caution. Suppressing warnings with #nosec can hide potentially serious vulnerabilities. Only use #nosec when you're absolutely certain that the security issue is either a false positive or has been mitigated in another way.

Only suppress a single rule (or a specific set of rules) within a section of code, while continuing to scan for other problems. To do this, you can list the rule(s) to be suppressed within the #nosec annotation, e.g: /* #nosec G401 */ or //#nosec G201 G202 G203
Broad #nosec annotations should be avoided, as they can hide other vulnerabilities. The CI will block you from merging this PR until you remove #nosec annotations that do not target specific rules.

Pay extra attention to the way #nosec is being used in the files listed above.

@github-actions github-actions bot added the nosec label Feb 27, 2024
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 good to me outside of the test failure.

e2e/e2etests/test_bitcoin_withdraw_invalid.go Outdated Show resolved Hide resolved
Copy link
Contributor

@skosito skosito left a comment

Choose a reason for hiding this comment

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

looks good, just couple small comments

changelog.md Outdated Show resolved Hide resolved
e2e/e2etests/test_bitcoin_withdraw_invalid.go Outdated Show resolved Hide resolved
testutil/keeper/keeper.go Show resolved Hide resolved
@lumtis lumtis merged commit 4db8436 into develop Mar 5, 2024
21 checks passed
@lumtis lumtis deleted the process-logs-test branch March 5, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zetacore (crosschain) : unit tests for process logs
3 participants