@@ -717,7 +717,7 @@ def test_revert_consumes_all_gas(
717717 "func" ,
718718 [pytest .param (f , id = f .name ) for f in ALL_FUNCTIONS ],
719719)
720- @pytest .mark .parametrize ("value" , [0 , 1 ])
720+ @pytest .mark .parametrize ("value" , [0 , 1 , 2 ** 128 ])
721721def test_call_with_value (
722722 blockchain_test : BlockchainTestFiller ,
723723 pre : Alloc ,
@@ -785,18 +785,24 @@ def test_call_with_value(
785785 expected_return_size = len (err )
786786 expected_mload = _mload_of (err )
787787
788+ post : dict = {
789+ contract_address : Account (
790+ storage = {
791+ slot_call_success : 1 if should_succeed else 0 ,
792+ slot_return_size : expected_return_size ,
793+ slot_return_value : expected_mload ,
794+ slot_code_worked : value_code_worked ,
795+ },
796+ balance = 0 if should_succeed else value ,
797+ ),
798+ STAKING_PRECOMPILE : Account (balance = value )
799+ if should_succeed and value > 0
800+ else None ,
801+ }
802+
788803 blockchain_test (
789804 pre = pre ,
790- post = {
791- contract_address : Account (
792- storage = {
793- slot_call_success : 1 if should_succeed else 0 ,
794- slot_return_size : expected_return_size ,
795- slot_return_value : expected_mload ,
796- slot_code_worked : value_code_worked ,
797- }
798- ),
799- },
805+ post = post ,
800806 blocks = [Block (txs = [tx ])],
801807 )
802808
0 commit comments