Skip to content

Commit

Permalink
add 0 check for link token v2
Browse files Browse the repository at this point in the history
  • Loading branch information
augustbleeds committed Dec 13, 2024
1 parent 313ec2a commit 40d4df5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions contracts/src/libraries/upgrades/utils.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

12 changes: 12 additions & 0 deletions contracts/src/tests/test_link_token.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,18 @@ fn test_set_minter_already() {
Minter::set_minter(ref state, minter);
}

#[test]
#[should_panic(expected: ('minter is 0',))]
fn test_set_minter_zero() {
let sender = setup();
let mut state = STATE();

let minter = contract_address_const::<111>();
LinkToken::constructor(ref state, 0, 0, 0, 0, Zeroable::zero(), minter, sender, 0);

Minter::set_minter(ref state, Zeroable::zero());
}

#[test]
fn test_set_minter_success() {
let sender = setup();
Expand Down

0 comments on commit 40d4df5

Please sign in to comment.