Skip to content

Conversation

NehharShah
Copy link
Contributor

No description provided.

@NehharShah NehharShah requested a review from ZackAttax January 31, 2025 22:25
Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.67%. Comparing base (31a5c93) to head (7d722fa).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #25      +/-   ##
==========================================
+ Coverage   97.35%   98.67%   +1.32%     
==========================================
  Files           5        5              
  Lines         378      378              
==========================================
+ Hits          368      373       +5     
+ Misses         10        5       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@ZackAttax ZackAttax left a comment

Choose a reason for hiding this comment

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

I don't think we need to expose these private functions for testing. Check out these docs
https://book.cairo-lang.org/ch10-02-test-organization.html

tests/lib.cairo Outdated
Comment on lines 972 to 985
#[test]
#[should_panic(expected: 'Token ITR is paused')]
fn test_make_transfer_when_paused_neither_minter() {
let (tokenized_bond, minter) = setup_contract_with_minter();
let from = address_with_tokens(tokenized_bond, minter);
let to = setup_receiver();
let transfer = setup_transfer(from, to, AMOUNT_TRANSFERRED());

start_cheat_caller_address(tokenized_bond.contract_address, OWNER());
tokenized_bond.pause_inter_transfer(TOKEN_ID());

start_cheat_caller_address(tokenized_bond.contract_address, from);
tokenized_bond.make_transfer(transfer);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

we already have this same test on 891

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh damn. I had reviewed that. I totally forgot about it. removing it now

Copy link
Contributor

@ZackAttax ZackAttax left a comment

Choose a reason for hiding this comment

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

Let's move these test under the other make_transfer test

Copy link
Contributor

@ZackAttax ZackAttax left a comment

Choose a reason for hiding this comment

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

Looks great!

@NehharShah NehharShah merged commit 5a84d07 into main Feb 5, 2025
5 checks passed
@NehharShah NehharShah deleted the feat/test-inter-transfer branch February 5, 2025 19:59
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