diff --git a/kevm-pyk/src/kevm_pyk/gst_to_kore.py b/kevm-pyk/src/kevm_pyk/gst_to_kore.py index 01ee590267..5c63e1a28c 100644 --- a/kevm-pyk/src/kevm_pyk/gst_to_kore.py +++ b/kevm-pyk/src/kevm_pyk/gst_to_kore.py @@ -28,41 +28,64 @@ SORT_MODE: Final = SortApp('SortMode') SORT_ETHEREUM_SIMULATION: Final = SortApp('SortEthereumSimulation') -GST_DISCARD_KEYS: Final = [ - '//', - '_info', - 'callcreates', - 'sealEngine', - 'transactionSequence', - 'chainname', - 'expectException', - 'lastblockhash', -] -GST_LOAD_KEYS: Final = ['env', 'pre', 'rlp', 'network', 'genesisRLP'] -GST_EXEC_KEYS: Final = ['exec', 'blocks'] -GST_POST_KEYS: Final = ['post', 'postState', 'postStateHash'] -GST_ALL_POST_KEYS: Final = GST_POST_KEYS + ['expect', 'export'] -GST_CHECK_KEYS: Final = GST_ALL_POST_KEYS + [ - 'logs', - 'out', - 'gas', - 'blockHeader', - 'transactions', - 'uncleHeaders', - 'genesisBlockHeader', - 'withdrawals', - 'blocknumber', -] +_GST_DISCARD_KEYS: Final = frozenset( + [ + '//', + '_info', + 'callcreates', + 'sealEngine', + 'transactionSequence', + 'chainname', + 'expectException', + 'lastblockhash', + ] +) +_GST_LOAD_KEYS: Final = frozenset( + [ + 'env', + 'pre', + 'rlp', + 'network', + 'genesisRLP', + ] +) +_GST_EXEC_KEYS: Final = frozenset( + [ + 'exec', + 'blocks', + ] +) +_GST_POST_KEYS: Final = frozenset( + [ + 'post', + 'postState', + 'postStateHash', + ] +) +_GST_ALL_POST_KEYS: Final = _GST_POST_KEYS.union(['expect', 'export']) +_GST_CHECK_KEYS: Final = _GST_ALL_POST_KEYS.union( + [ + 'logs', + 'out', + 'gas', + 'blockHeader', + 'transactions', + 'uncleHeaders', + 'genesisBlockHeader', + 'withdrawals', + 'blocknumber', + ] +) def filter_gst_keys(gst_data: dict) -> dict: """Filters the discarded keys out of a single GeneralStateTest. :param gst_data: A single test from a GST file structured as {"test_name": {test_fields}, ... }. - :returns: The gst_data object after filtering out GST_DISCARD_KEYS. + :returns: The gst_data object after filtering out _GST_DISCARD_KEYS. """ return { - test_name: {k: v for k, v in test_data.items() if k not in GST_DISCARD_KEYS} + test_name: {k: v for k, v in test_data.items() if k not in _GST_DISCARD_KEYS} for test_name, test_data in gst_data.items() }