Skip to content

Commit

Permalink
fix: remove unnecessary tx version check
Browse files Browse the repository at this point in the history
  • Loading branch information
obatirou committed Nov 29, 2024
1 parent 306d391 commit 8d18dd7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
6 changes: 0 additions & 6 deletions cairo_zero/kakarot/accounts/account_contract.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ from starkware.cairo.common.math import assert_le, assert_not_zero, assert_le_fe
from starkware.cairo.common.math_cmp import is_nn
from starkware.cairo.common.uint256 import Uint256
from starkware.starknet.common.syscalls import (
get_tx_info,
get_caller_address,
get_block_timestamp,
call_contract,
Expand Down Expand Up @@ -109,11 +108,6 @@ func execute_from_outside{
with_attr error_message("EOA: multicall not supported") {
assert call_array_len = 1;
}
let (tx_info) = get_tx_info();
let version = tx_info.version;
with_attr error_message("Deprecated tx version: 0") {
assert_le(1, version);
}

// EOA validation
let (bytecode_len) = Account_bytecode_len.read();
Expand Down
19 changes: 0 additions & 19 deletions cairo_zero/tests/src/kakarot/accounts/test_account_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,25 +579,6 @@ def test_should_raise_when_call_array_has_more_than_one_call(self, cairo_run):
signature=[],
)

@patch.dict(SyscallHandler.tx_info, {"version": 0})
def test_should_raise_when_tx_version_is_zero(self, cairo_run):
with cairo_error(message="Deprecated tx version: 0"):
cairo_run(
"test__execute_from_outside_entrypoint",
outside_execution={
"caller": SyscallHandler.caller_address,
"nonce": 0,
"execute_after": 0,
"execute_before": SyscallHandler.block_timestamp + 1,
},
call_array=[
{"to": 0, "selector": 0, "data_offset": 0, "data_len": 0},
],
calldata=[],
calldata_len=0,
signature=[],
)

@SyscallHandler.patch("Account_bytecode_len", 1)
def test_should_raise_when_eoa_has_code(self, cairo_run):
with cairo_error(message="EOAs cannot have code"):
Expand Down

0 comments on commit 8d18dd7

Please sign in to comment.