Skip to content

Commit

Permalink
Merge pull request #101 from firedancer-io/mjain/feature
Browse files Browse the repository at this point in the history
Encode for syscall + fix default value
  • Loading branch information
mjain-jump authored Nov 13, 2024
2 parents b407fa6 + 1b1ef7a commit 74b6a83
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ $ solana-test-suite run-tests [OPTIONS]
* `-v, --verbose`: Verbose output: log failed test cases
* `-c, --consensus-mode`: Only fail on consensus failures. One such effect is to normalize error codes when comparing results
* `-f, --failures-only`: Only log failed test cases
* `-sf, --save-failures`: Saves failed test cases to results directory [default: True]
* `-sf, --save-failures`: Saves failed test cases to results directory
* `-ss, --save-successes`: Saves successful test cases to results directory
* `-l, --log-level INTEGER`: FD logging level [default: 5]
* `--help`: Show this message and exit.
1 change: 1 addition & 0 deletions src/test_suite/fuzz_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
SyscallHarness = HarnessCtx(
fuzz_fn_name="sol_compat_vm_syscall_execute_v1",
fixture_desc=vm_pb.SyscallFixture.DESCRIPTOR,
context_human_encode_fn=syscall_codec.encode_input,
effects_human_encode_fn=syscall_codec.encode_output,
)

Expand Down
9 changes: 9 additions & 0 deletions src/test_suite/syscall/codec_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import base64
import test_suite.invoke_pb2 as invoke_pb
import test_suite.vm_pb2 as vm_pb
from test_suite.fuzz_interface import encode_hex_compact
from test_suite.instr.codec_utils import encode_input as instr_encode_input


def encode_input(input: vm_pb.SyscallContext):
instr_ctx = invoke_pb.InstrContext()
instr_ctx.CopyFrom(input.instr_ctx)
instr_encode_input(instr_ctx)
input.instr_ctx.CopyFrom(instr_ctx)


def encode_output(effects: vm_pb.SyscallEffects):
Expand Down
2 changes: 1 addition & 1 deletion src/test_suite/test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def run_tests(
help="Only log failed test cases",
),
save_failures: bool = typer.Option(
True,
False,
"--save-failures",
"-sf",
help="Saves failed test cases to results directory",
Expand Down

0 comments on commit 74b6a83

Please sign in to comment.