From 40d4df53afad72810206eb8f5fcc537562561488 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Fri, 13 Dec 2024 15:50:57 -0500 Subject: [PATCH] add 0 check for link token v2 --- contracts/src/libraries/upgrades/utils.cairo | 1 + contracts/src/tests/test_link_token.cairo | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/contracts/src/libraries/upgrades/utils.cairo b/contracts/src/libraries/upgrades/utils.cairo index e69de29bb..8b1378917 100644 --- a/contracts/src/libraries/upgrades/utils.cairo +++ b/contracts/src/libraries/upgrades/utils.cairo @@ -0,0 +1 @@ + diff --git a/contracts/src/tests/test_link_token.cairo b/contracts/src/tests/test_link_token.cairo index 418230c92..e03f5d7f6 100644 --- a/contracts/src/tests/test_link_token.cairo +++ b/contracts/src/tests/test_link_token.cairo @@ -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();