test_blake2_precompile_delegatecall()
Documentation for tests/istanbul/eip152_blake2/test_blake2_delegatecall.py::test_blake2_precompile_delegatecall@ffe48572.
Generate fixtures for these test cases for Bogota with:
fill -v tests/istanbul/eip152_blake2/test_blake2_delegatecall.py::test_blake2_precompile_delegatecall --fork Bogota
Test delegatecall consumes specified gas for the Blake2B precompile when it
exists.
Source code in tests/istanbul/eip152_blake2/test_blake2_delegatecall.py
| @pytest.mark.valid_from("ConstantinopleFix")
def test_blake2_precompile_delegatecall(
state_test: StateTestFiller, pre: Alloc, fork: Fork
) -> None:
"""
Test delegatecall consumes specified gas for the Blake2B precompile when it
exists.
"""
account = pre.deploy_contract(
Op.SSTORE(
0,
Op.DELEGATECALL(
gas=1,
address=Spec.BLAKE2_PRECOMPILE_ADDRESS,
),
)
+ Op.STOP,
storage={0: 0xDEADBEEF},
)
tx = Transaction(to=account, sender=pre.fund_eoa())
# If precompile exists, DELEGATECALL will fail, otherwise DELEGATECALL will
# succeed
post = {
account: Account(
storage={
0: "0x00" if fork >= Istanbul else "0x01",
}
)
}
state_test(pre=pre, post=post, tx=tx)
|
Parametrized Test Cases
This test generates 1 parametrized test case across 11 forks.