Skip to content

Commit

Permalink
Fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
mjain-jump committed Jul 3, 2024
1 parent 8b52106 commit b1090c8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions src/test_suite/fuzz_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/test_suite/instr/prune_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/test_suite/test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
4 changes: 2 additions & 2 deletions src/test_suite/txn/prune_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b1090c8

Please sign in to comment.