-
Notifications
You must be signed in to change notification settings - Fork 16
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
Adding tests for Crosschain_Base and PP_Connext_Crosschain - DRAFT #694
base: feature/crosschain-paymentProcessor
Are you sure you want to change the base?
Adding tests for Crosschain_Base and PP_Connext_Crosschain - DRAFT #694
Conversation
238a99e
to
2b4b9c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didnt have time to go through this fully, but this should give you enough material to work on.
test/modules/paymentProcessor/bridging/abstracts/PP_Connext_Crosschain_v1_Test.t.sol
Outdated
Show resolved
Hide resolved
test/modules/paymentProcessor/bridging/abstracts/PP_Connext_Crosschain_v1_Test.t.sol
Outdated
Show resolved
Hide resolved
test/modules/paymentProcessor/bridging/abstracts/PP_Connext_Crosschain_v1_Test.t.sol
Outdated
Show resolved
Hide resolved
test/modules/paymentProcessor/bridging/abstracts/PP_Connext_Crosschain_v1_Test.t.sol
Outdated
Show resolved
Hide resolved
test/modules/paymentProcessor/bridging/abstracts/PP_Connext_Crosschain_v1_Test.t.sol
Outdated
Show resolved
Hide resolved
test/modules/paymentProcessor/bridging/abstracts/PP_Connext_Crosschain_v1_Test.t.sol
Outdated
Show resolved
Hide resolved
test/modules/paymentProcessor/bridging/abstracts/PP_Connext_Crosschain_v1_Test.t.sol
Outdated
Show resolved
Hide resolved
test/modules/paymentProcessor/bridging/abstracts/PP_Connext_Crosschain_v1_Test.t.sol
Outdated
Show resolved
Hide resolved
test/modules/paymentProcessor/bridging/abstracts/PP_Connext_Crosschain_v1_Test.t.sol
Outdated
Show resolved
Hide resolved
1d6c23d
to
4aa8384
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think looks good in general. I do have a bit of a harder time reviewing the tests as we are starting right away with the implementation and not the base contracts first. This means I need to check back and forth with the underlying contracts.
Additionally there are different formatting related things concerning the written gherkin as well as the functions names. I'm wondering if it might make sense to merge the other PR, update this one and then maybe have a peer-programming session to do some quick clean up? Lmk what you think
test/modules/paymentProcessor/bridging/abstracts/CrossChainBase_v1.t.sol
Outdated
Show resolved
Hide resolved
test/modules/paymentProcessor/bridging/abstracts/CrossChainBase_v1.t.sol
Outdated
Show resolved
Hide resolved
test/modules/paymentProcessor/bridging/abstracts/CrossChainBase_v1.t.sol
Outdated
Show resolved
Hide resolved
test/modules/paymentProcessor/bridging/abstracts/PP_Connext_Crosschain_v1_Test.t.sol
Outdated
Show resolved
Hide resolved
│ ├── When processing through Connext bridge | ||
│ │ ├── Then it should emit PaymentProcessed event | ||
│ │ ├── Then it should transfer tokens correctly | ||
│ │ └── Then it should create Connext intent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can we check that an intent has been created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, in our mock we're changing the status of the intent to ADDED but we should be verifying that in the test.
// Set intent status to ADDED and emit the event
status[_intentId] = IntentStatus.ADDED;
```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think processPayments will need to return the intentID, at least for the tests, this will allow us to check if the status has been changed in the mock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leeftk this is a general comment for testing the intentID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this as we discussed, there's now a mapping in the payment process that stores the payment -> receive -> bridge data. We're now getting that value from the payment processor, and then checking that the status in the mock contract for that intentID has flipped to added. Please take a look at this to see if it follow what we discuss on the call, any feedback is welcome.
test/modules/paymentProcessor/bridging/abstracts/PP_Connext_Crosschain_v1_Test.t.sol
Outdated
Show resolved
Hide resolved
test/modules/paymentProcessor/bridging/abstracts/PP_Connext_Crosschain_v1_Test.t.sol
Outdated
Show resolved
Hide resolved
test/modules/paymentProcessor/bridging/abstracts/PP_Connext_Crosschain_v1_Test.t.sol
Outdated
Show resolved
Hide resolved
I didn't understand this comment do you mean that the CrossChainBase isn't tested or something else? Sorry Im not following, however we might have added the tests after your initial review and so that's why you didn't see them but they are there now. |
add more notes
code compile issue solved
comment our bridge test
8eb89d9
to
197a65a
Compare
Quick update here
There is a core issue I couldn't wrap my head around, seems like in cancel payments I need to update amountPaid for the client however when I do Im getting an overflow/underflow issue. I believe the issue is from this For this review I'd love the focus to be on the added functionality however as you review if you find anything else that's wrong and doesn't meet the standard please add that here and I'll make those changes. Thanks again and looking forward to the feedback. |
@Zitzak notes for my review
|
Pull Request Note
Overview
This pull request introduces significant updates to the
PP_Connext_Crosschain_v1_Test
contract and related modules. The changes primarily focus on enhancing the cross-chain functionality, fixing compilation issues, and adding comprehensive unit tests to ensure the reliability of the new implementations.Key Changes
PP_Connext_Crosschain
contract.processPayments
function, including edge cases for insufficient balances and payment ID checks.Notable Commit
======= First half of these commits were already reviewed =======
======= These are the new changes after the last PR =======
Future Work
Focus Areas