Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
Normalize transaction value in fixture tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cburgdorf committed Dec 18, 2019
1 parent ed9b214 commit 552895a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/json-fixtures-over-rpc/test_rpc_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 552895a

Please sign in to comment.