From 1612b13339cab9d151a1d427f19f1c1c662fb143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sojka?= Date: Thu, 23 May 2024 11:34:36 +0000 Subject: [PATCH] Fix vesting tests with snforge v0.23 --- tests/vesting.cairo | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/vesting.cairo b/tests/vesting.cairo index 02d4741d..d8a243f0 100644 --- a/tests/vesting.cairo +++ b/tests/vesting.cairo @@ -8,25 +8,26 @@ use snforge_std::{ BlockId, declare, ContractClassTrait, ContractClass, start_prank, start_warp, CheatTarget }; -use governance::vesting::{IVestingDispatcher, IVestingDispatcherTrait, IVesting}; +use konoha::vesting::{IVestingDispatcher, IVestingDispatcherTrait, IVesting}; use openzeppelin::token::erc20::interface::{IERC20Dispatcher, IERC20DispatcherTrait}; // returns gov addr, token addr fn test_setup() -> (ContractAddress, ContractAddress) { - let new_gov_contract: ContractClass = declare('Governance'); - let new_token_contract: ContractClass = declare('MyToken'); + let new_gov_contract: ContractClass = declare("Governance") + .expect('unable to declare Governance'); + let new_token_contract: ContractClass = declare("MyToken").expect('unable to declare MyToken'); let new_gov_addr: ContractAddress = 0x001405ab78ab6ec90fba09e6116f373cda53b0ba557789a4578d8c1ec374ba0f .try_into() .unwrap(); let mut token_constructor = ArrayTrait::new(); token_constructor.append(new_gov_addr.into()); // Owner - let token_address = new_token_contract + let (token_address, _) = new_token_contract .deploy(@token_constructor) .expect('unable to deploy token'); let mut gov_constructor: Array = ArrayTrait::new(); gov_constructor.append(token_address.into()); - let gov_address = new_gov_contract + let (gov_address, _) = new_gov_contract .deploy_at(@gov_constructor, new_gov_addr) .expect('unable to deploy gov'); @@ -36,7 +37,7 @@ fn test_setup() -> (ContractAddress, ContractAddress) { #[test] #[should_panic(expected: ('not self-call',))] fn test_unauthorized_add_vesting_schedule() { - let (gov_address, token_address) = test_setup(); + let (gov_address, _) = test_setup(); let gov_vesting = IVestingDispatcher { contract_address: gov_address }; @@ -48,7 +49,7 @@ fn test_unauthorized_add_vesting_schedule() { #[test] #[should_panic(expected: ('not yet eligible',))] fn test_unauthorized_vest_early() { - let (gov_address, token_address) = test_setup(); + let (gov_address, _) = test_setup(); let gov_vesting = IVestingDispatcher { contract_address: gov_address }; @@ -65,7 +66,7 @@ fn test_unauthorized_vest_early() { #[test] #[should_panic(expected: ('nothing to vest',))] fn test_vest_twice() { - let (gov_address, token_address) = test_setup(); + let (gov_address, _) = test_setup(); let gov_vesting = IVestingDispatcher { contract_address: gov_address };