diff --git a/tests/json-fixtures-over-rpc/test_rpc_fixtures.py b/tests/json-fixtures-over-rpc/test_rpc_fixtures.py index 99252cd260..84fd95971c 100644 --- a/tests/json-fixtures-over-rpc/test_rpc_fixtures.py +++ b/tests/json-fixtures-over-rpc/test_rpc_fixtures.py @@ -159,6 +159,10 @@ def pad32_dict_values(some_dict): } +def map_0x_to_0x0(value): + return '0x0' if value == '0x' else value + + RPC_STATE_NORMALIZERS = { 'balance': remove_leading_zeros, 'code': empty_to_0x, @@ -192,7 +196,7 @@ def pad32_dict_values(some_dict): 'nonce': remove_leading_zeros, 'gasLimit': remove_leading_zeros, 'gasPrice': remove_leading_zeros, - 'value': remove_leading_zeros, + 'value': compose(remove_leading_zeros, map_0x_to_0x0), 'data': empty_to_0x, 'to': compose( apply_formatter_if(is_address, to_checksum_address), @@ -314,7 +318,7 @@ async def validate_account_state(rpc, state, addr, at_block): at_block=at_block ) for key in state['storage']: - position = '0x0' if key == '0x' else key + position = map_0x_to_0x0(key) expected_storage = standardized_state['storage'][key] await assert_rpc_result( rpc,