diff --git a/src/governor.cairo b/src/governor.cairo index e4c131e..5b40006 100644 --- a/src/governor.cairo +++ b/src/governor.cairo @@ -463,7 +463,11 @@ pub mod Governor { fn __execute__(ref self: ContractState, mut calls: Array) -> Array> { assert(get_caller_address().is_zero(), 'Invalid caller'); let tx_version = get_tx_info().unbox().version.into(); - assert(tx_version == 1 || tx_version == 3, 'Invalid TX version'); + assert( + tx_version == 0x100000000000000000000000000000001 + || tx_version == 0x100000000000000000000000000000003, + 'Invalid TX version' + ); let mut results: Array> = array![]; while let Option::Some(call) = calls.pop_front() { results.append(call.execute()); diff --git a/src/governor_test.cairo b/src/governor_test.cairo index c2fd591..1e5d9ef 100644 --- a/src/governor_test.cairo +++ b/src/governor_test.cairo @@ -1041,12 +1041,26 @@ fn test_governor_execute_fails_from_non_zero() { #[test] #[should_panic(expected: ('Invalid TX version', 'ENTRYPOINT_FAILED'))] -fn test_governor_execute_fails_invalid_tx_version() { +fn test_governor_execute_fails_tx_version_0() { let (_staker, _token, governor, _config) = setup(); set_version(0); AccountContractDispatcher { contract_address: governor.contract_address }.__execute__(array![]); } +#[test] +#[should_panic(expected: ('Invalid TX version', 'ENTRYPOINT_FAILED'))] +fn test_governor_execute_fails_tx_version_1() { + let (_staker, _token, governor, _config) = setup(); + set_version(1); + AccountContractDispatcher { contract_address: governor.contract_address }.__execute__(array![]); +} + +#[test] +fn test_governor_execute_succeeds_version_simulate() { + let (_staker, _token, governor, _config) = setup(); + set_version(0x100000000000000000000000000000001); + AccountContractDispatcher { contract_address: governor.contract_address }.__execute__(array![]); +} #[test] fn test_reconfigure_succeeds_self_call() {