Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
jochem-brouwer committed Sep 15, 2024
1 parent 92cbfe2 commit 5ea8ace
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions tests/prague/eip7702_set_code_tx/test_set_code_txs.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,9 @@ def test_set_code_to_tstore_reentry(
)


@pytest.mark.parametrize(
"call_opcode",
[
Op.CALL,
Op.STATICCALL,
],
@pytest.mark.with_all_call_opcodes(
selector=lambda call_opcode: call_opcode
not in [Op.DELEGATECALL, Op.CALLCODE, Op.STATICCALL, Op.EXTDELEGATECALL, Op.EXTSTATICCALL]
)
@pytest.mark.parametrize("call_eoa_first", [True, False])
def test_set_code_to_tstore_available_at_correct_address(
Expand All @@ -410,13 +407,8 @@ def test_set_code_to_tstore_available_at_correct_address(
set_code_to_address = pre.deploy_contract(tstore_check_code)

def make_call(call_type: Op, call_eoa: bool) -> Bytecode:

call_target = auth_signer if call_eoa else set_code_to_address
if call_type == Op.STATICCALL:
return call_type(Op.GAS(), call_target, 0, 0, 0, 0)
else:
# call_type = Op.CALL
return call_type(Op.GAS(), call_target, 0, 0, 0, 0, 0)
return call_type(address=call_target)

chain_code = make_call(call_type=call_opcode, call_eoa=call_eoa_first) + make_call(
call_type=call_opcode, call_eoa=not call_eoa_first
Expand Down Expand Up @@ -1948,9 +1940,7 @@ def test_set_code_invalid_authorization_tuple(
nonce=(
1
if invalidity_reason == InvalidityReason.NONCE
else [0, 1]
if invalidity_reason == InvalidityReason.MULTIPLE_NONCE
else 0
else [0, 1] if invalidity_reason == InvalidityReason.MULTIPLE_NONCE else 0
),
chain_id=2 if invalidity_reason == InvalidityReason.CHAIN_ID else 0,
signer=auth_signer,
Expand Down

0 comments on commit 5ea8ace

Please sign in to comment.