Skip to content

Conversation

@MohammadNassar1
Copy link
Collaborator

@MohammadNassar1 MohammadNassar1 commented Dec 29, 2025

Note

Introduces multi-collateral transfer support in flow tests and validates balances for non-base assets.

  • Add transfer_spot_request to infra.cairo and perps_tests_facade.cairo; refactor into _transfer_request that accepts an explicit asset_id
  • Update transfer path to branch on base collateral vs spot (get_position_collateral_balance vs get_position_asset_balance) and validate with validate_asset_balance for non-base assets; adjust events to use provided asset_id
  • New test test_spot_collateral_deposit_transfer_withdraw covering STRK spot asset deposit, partial transfer, and withdrawals with final balance assertions

Written by Cursor Bugbot for commit 21a7b1a. This will update automatically on new commits. Configure here.


This change is Reviewable

@MohammadNassar1 MohammadNassar1 self-assigned this Dec 29, 2025
@github-actions github-actions bot force-pushed the mohammad/multi-collateral/test-utils/transfer branch 2 times, most recently from f71a46b to d075e76 Compare December 30, 2025 15:48
@MohammadNassar1 MohammadNassar1 force-pushed the mohammad/multi-collateral/test-utils/transfer branch from d075e76 to e130279 Compare January 1, 2026 08:28
@github-actions github-actions bot force-pushed the mohammad/multi-collateral/test-utils/transfer branch 2 times, most recently from 9824ef8 to e2d572a Compare January 1, 2026 14:48
Copy link
Collaborator

@omri-ba-starkware omri-ba-starkware left a comment

Choose a reason for hiding this comment

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

@omri-ba-starkware reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ishay-starkware and @RoeeGross).


workspace/apps/perpetuals/contracts/src/tests/flow_tests/perps_tests_facade.cairo line 1151 at r1 (raw file):

                asset_id: self.collateral_id,
                :amount,
                caller: sender,

So in our tests the sender is always the one who calls the request and never the receiver?

Code quote:

caller: sender

@MohammadNassar1 MohammadNassar1 force-pushed the mohammad/multi-collateral/test-utils/transfer branch from e2d572a to 21a7b1a Compare January 5, 2026 15:44
Copy link
Collaborator Author

@MohammadNassar1 MohammadNassar1 left a comment

Choose a reason for hiding this comment

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

@MohammadNassar1 made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ishay-starkware and @RoeeGross).


workspace/apps/perpetuals/contracts/src/tests/flow_tests/perps_tests_facade.cairo line 1151 at r1 (raw file):

Previously, omri-ba-starkware wrote…

So in our tests the sender is always the one who calls the request and never the receiver?

Good point. I initialy copied the withdraw/deposit behavior, but in the transfer, the user only calls the function, so testing different callers isn’t necessary.
I renamed the internal function and clarified that it’s not meant to be called by the test.

Copy link
Collaborator

@omri-ba-starkware omri-ba-starkware left a comment

Choose a reason for hiding this comment

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

@omri-ba-starkware reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ishay-starkware and @RoeeGross).

@MohammadNassar1 MohammadNassar1 merged commit fcc684e into dev Jan 6, 2026
4 checks passed
@MohammadNassar1 MohammadNassar1 deleted the mohammad/multi-collateral/test-utils/transfer branch January 6, 2026 11:19
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.

3 participants