diff --git a/src/test_suite/fuzz_interface.py b/src/test_suite/fuzz_interface.py index 0e29745..7eac292 100644 --- a/src/test_suite/fuzz_interface.py +++ b/src/test_suite/fuzz_interface.py @@ -27,8 +27,10 @@ def generic_effects_prune( - ctx: ContextType, effects: dict[str, EffectsType] -) -> dict[str, EffectsType]: + ctx: str | None, effects: dict[str, str | None] +) -> dict[str, str | None] | None: + if ctx is None: + return None return effects @@ -52,7 +54,7 @@ class HarnessCtx: ignore_fields_for_consensus: list[str] = field(default_factory=list) diff_effect_fn: Callable[[EffectsType, EffectsType], bool] = generic_effects_diff prune_effects_fn: Callable[ - [ContextType, dict[str, EffectsType]], dict[str, EffectsType] + [str | None, dict[str, str | None]], dict[str, str | None] | None ] = generic_effects_prune context_human_encode_fn: Callable[[ContextType], None] = generic_human_encode context_human_decode_fn: Callable[[ContextType], None] = generic_human_decode diff --git a/src/test_suite/instr/prune_utils.py b/src/test_suite/instr/prune_utils.py index fec58dc..5e9cb43 100644 --- a/src/test_suite/instr/prune_utils.py +++ b/src/test_suite/instr/prune_utils.py @@ -5,14 +5,14 @@ def prune_execution_result( - serialized_context: str, + serialized_context: str | None, targets_to_serialized_effects: dict[str, str | None], ) -> dict[str, str | None] | None: """ Prune execution result to only include actually modified accounts. Args: - - serialized_context (str): Serialized instruction context. + - serialized_context (str | None): Serialized instruction context. - targets_to_serialized_effects (dict[str, str | None]): Dictionary of target library names and serialized instruction effects. Returns: diff --git a/src/test_suite/test_suite.py b/src/test_suite/test_suite.py index a3eadf2..7740525 100644 --- a/src/test_suite/test_suite.py +++ b/src/test_suite/test_suite.py @@ -23,10 +23,10 @@ import tqdm from test_suite.fuzz_context import * -globals.harness_ctx = InstrHarness +# globals.harness_ctx = InstrHarness # globals.harness_ctx = SyscallHarness # globals.harness_ctx = ValidateVM -# globals.harness_ctx = TxnHarness +globals.harness_ctx = TxnHarness app = typer.Typer( help="Validate instruction effects from clients using instruction context Protobuf messages." diff --git a/src/test_suite/txn/prune_utils.py b/src/test_suite/txn/prune_utils.py index e1c206f..e6fac94 100644 --- a/src/test_suite/txn/prune_utils.py +++ b/src/test_suite/txn/prune_utils.py @@ -4,14 +4,14 @@ def prune_execution_result( - serialized_context: str, + serialized_context: str | None, targets_to_serialized_effects: dict[str, str | None], ) -> dict[str, str | None] | None: """ Prune execution result to only include actually modified accounts. Args: - - serialized_context (str): Serialized context. + - serialized_context (str | None): Serialized context. - targets_to_serialized_effects (dict[str, str | None]): Dictionary of target library names and serialized effects. Returns: