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(x/ecocredit): add bridge integration tests #1297

Merged
merged 8 commits into from
Jul 25, 2022

Conversation

ryanchristo
Copy link
Member

@ryanchristo ryanchristo commented Jul 23, 2022

Description

This pull request adds integration tests for bridging credits from polygon to regen and then back to polygon. This pull request also removes the unused contract field from MsgBridge as we are now using the stored contract in BatchContract when credits are bridged using MsgBridgeReceive (this field should have been removed when adding batch contract mapping).


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)

@codecov
Copy link

codecov bot commented Jul 23, 2022

Codecov Report

Merging #1297 (f747469) into master (3ab976e) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1297      +/-   ##
==========================================
+ Coverage   77.48%   77.50%   +0.01%     
==========================================
  Files         220      221       +1     
  Lines       16130    16160      +30     
==========================================
+ Hits        12499    12524      +25     
- Misses       2612     2621       +9     
+ Partials     1019     1015       -4     
Flag Coverage Δ
experimental-codecov 77.56% <100.00%> (-0.04%) ⬇️
stable-codecov 77.27% <100.00%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
types/module/server/testutil.go 93.47% <100.00%> (+0.14%) ⬆️
x/ecocredit/server/tests/utils.go 100.00% <100.00%> (ø)
types/ormstore/store.go 35.83% <0.00%> (-3.91%) ⬇️
x/ecocredit/core/msg_bridge_receive.go 94.44% <0.00%> (+3.70%) ⬆️
x/ecocredit/core/msg_bridge.go 88.88% <0.00%> (+7.40%) ⬆️
x/ecocredit/server/genesis.go 54.83% <0.00%> (+9.67%) ⬆️

Comment on lines -465 to -466
// recipient is the address of the contract handling the bridged credits.
string contract = 4;
Copy link
Member Author

Choose a reason for hiding this comment

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

The logic for this was already removed as we are now using batch contract mapping to check if credits can be bridged back to the source chain. If a batch contract mapping exists, the stored contract is used. It looks like I forgot to remove this field or I accidentally added it back in with a merge.

@ryanchristo ryanchristo added the backport/v4.0.x backport to release/v4.0.x branch label Jul 24, 2022
@ryanchristo ryanchristo marked this pull request as ready for review July 25, 2022 04:51
Copy link
Contributor

@technicallyty technicallyty left a comment

Choose a reason for hiding this comment

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

great work!

@ryanchristo ryanchristo merged commit 1785310 into master Jul 25, 2022
@ryanchristo ryanchristo deleted the ryan/bridge-integration-tests branch July 25, 2022 18:06
mergify bot pushed a commit that referenced this pull request Jul 25, 2022
* test(x/ecocredit): add bridge integration tests

* add expect project properties

* add bridge receive event check

* add steps and testing reverse direction

* use different address for recipient

* use iteration to generate keys

* expect error in code block

(cherry picked from commit 1785310)
ryanchristo added a commit that referenced this pull request Jul 25, 2022
* test(x/ecocredit): add bridge integration tests (#1297)

* test(x/ecocredit): add bridge integration tests

* add expect project properties

* add bridge receive event check

* add steps and testing reverse direction

* use different address for recipient

* use iteration to generate keys

* expect error in code block

(cherry picked from commit 1785310)

* make tidy

Co-authored-by: Ryan Christoffersen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v4.0.x backport to release/v4.0.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants