Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode for syscall + fix default value #101

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading