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

reclaim testcases #7

Merged
merged 6 commits into from
Aug 13, 2024
Merged

reclaim testcases #7

merged 6 commits into from
Aug 13, 2024

Conversation

byteZorvin
Copy link
Member

  • This adds reclaim tests

Comment on lines +78 to +81
token_bridge.contract_address,
Event::DepostiCancelRequest(expected_deposit_cancel)
),
(token_bridge.contract_address, Event::DepositReclaimed(expected_deposit_reclaim))
Copy link
Contributor

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?

Copy link
Member Author

@byteZorvin byteZorvin Aug 10, 2024

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() {
Copy link
Contributor

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?

Copy link
Member Author

@byteZorvin byteZorvin Aug 13, 2024

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

Comment on lines +37 to +44
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());
Copy link
Contributor

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?

Copy link
Member Author

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]>
@apoorvsadana apoorvsadana merged commit 5beb4ce into deposit-testcases Aug 13, 2024
2 checks passed
apoorvsadana added a commit that referenced this pull request Aug 13, 2024
* 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]>
@byteZorvin byteZorvin deleted the reclaim-tests branch August 13, 2024 09:35
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.

2 participants