Skip to content

Commit

Permalink
add a unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
moodysalem committed Jun 19, 2024
1 parent b29f175 commit 3e2eb51
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/governor_test.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use starknet::account::{Call};
use starknet::{
get_contract_address, syscalls::deploy_syscall, ClassHash, contract_address_const,
ContractAddress, get_block_timestamp,
testing::{set_block_timestamp, set_contract_address, pop_log},
testing::{set_block_timestamp, set_contract_address, pop_log, set_version},
account::{AccountContractDispatcher, AccountContractDispatcherTrait}
};

Expand Down Expand Up @@ -1039,6 +1039,15 @@ fn test_governor_execute_fails_from_non_zero() {
AccountContractDispatcher { contract_address: governor.contract_address }.__execute__(array![]);
}

#[test]
#[should_panic(expected: ('Invalid TX version', 'ENTRYPOINT_FAILED'))]
fn test_governor_execute_fails_invalid_tx_version() {
let (_staker, _token, governor, _config) = setup();
set_version(0);
AccountContractDispatcher { contract_address: governor.contract_address }.__execute__(array![]);
}


#[test]
fn test_reconfigure_succeeds_self_call() {
let (staker, token, governor, config) = setup();
Expand Down

0 comments on commit 3e2eb51

Please sign in to comment.