-
Notifications
You must be signed in to change notification settings - Fork 4
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
reclaim testcases #7
Conversation
byteZorvin
commented
Aug 9, 2024
- This adds reclaim tests
token_bridge.contract_address, | ||
Event::DepostiCancelRequest(expected_deposit_cancel) | ||
), | ||
(token_bridge.contract_address, Event::DepositReclaimed(expected_deposit_reclaim)) |
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.
looks like some formatting issue, is there any formatter right now? i know there's the new exploration project which started but there's nothing else for now?
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 have the formatter setup on my local, and even there is github action that validates the formatting of the code on every pr check here
|
||
#[test] | ||
#[should_panic(expected: ('CANCELLATION_NOT_ALLOWED_YET',))] | ||
fn deposit_with_message_reclaim_delay_not_reached() { |
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.
let's also add this to the accept_deposit issue?
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.
Have added this to the issue #8
let (token_bridge, mut spy, messaging_mock) = deploy_token_bridge_with_messaging(); | ||
let usdc_address = deploy_erc20("usdc", "usdc"); | ||
let usdc = IERC20Dispatcher { contract_address: usdc_address }; | ||
|
||
enroll_token_and_settle(token_bridge, messaging_mock, usdc_address); | ||
|
||
usdc.approve(token_bridge.contract_address, 100); | ||
token_bridge.deposit(usdc_address, 100, snf::test_address()); |
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.
based on the deposit_ok PR, I think we can move this to a common function. but we can merge this one into deposit_ok first and then you can fix all things there?
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.
Yes makes sense, can be done in #6
* deactivate tc * send messages tc * change name * resolved comments * Update tests/withdrawal_limit_bridge_test.cairo Co-authored-by: Apoorv Sadana <[email protected]> --------- Co-authored-by: Apoorv Sadana <[email protected]>
* feat: initiliased testcases * admin function tests * fix: max total balance check * feat: block token test * disable limit test * feat: add failing tc for withdraw limit * fixed testcases after rebase * chore: added messaging mock * Update src/bridge/token_bridge.cairo Co-authored-by: Apoorv Sadana <[email protected]> * resolve comments * add reactivate and unblock * add reactivate and unblock * unblock tests * reactivate and unblock tests * resolved merge conflicts * restructure testcases * fix: visibility modifier * deposit tests * make them unit * make them unit * deposit flow tests * change to mock usdc address * improve: not needed to deploy usdc in while mock testing * unit testcases * add token actions restructure * migrate to latest foundry * restructure * deposit failing tc * test: happy withdraw test * chore: ran formatter * fix settlement of message * change deposit tests to use message_payloads * add assert * failing withdraw tc * cancel request * deposit with message cancels * Update tests/deposit_test.cairo Co-authored-by: Apoorv Sadana <[email protected]> * resolved comments * fix consume message * fix consume message check * reclaim testcases (#7) * reclaim testcases * consume message * add balance check * add events in actions * Unit tests (#9) * deactivate tc * send messages tc * change name * resolved comments * Update tests/withdrawal_limit_bridge_test.cairo Co-authored-by: Apoorv Sadana <[email protected]> --------- Co-authored-by: Apoorv Sadana <[email protected]> --------- Co-authored-by: Apoorv Sadana <[email protected]> * add setup functions --------- Co-authored-by: Apoorv Sadana <[email protected]>