Skip to content

Commit 4694c9a

Browse files
committed
refactor: clean up and formatting in fuzz targets
Signed-off-by: Ntege Daniel <danientege785@gmail.com>
1 parent c6cfcd6 commit 4694c9a

2 files changed

Lines changed: 0 additions & 11 deletions

File tree

.clusterfuzzlite/build.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
#!/bin/bash -eu
22

3-
# Install grpcio-tools first so generate_proto.py can compile the protobufs.
43
pip3 install grpcio-tools
54

6-
# Generate the protobuf Python bindings required by the SDK.
75
python3 generate_proto.py
86

9-
# Install the SDK and all runtime dependencies (uses current CFLAGS/CXXFLAGS so
10-
# any C extensions such as grpcio and cryptography are built with the right flags).
117
pip3 install .
128

13-
# Install Atheris (the Python fuzzing engine) and PyInstaller (used to produce
14-
# self-contained fuzzer executables that ClusterFuzzLite can run reliably).
159
pip3 install atheris pyinstaller
1610

17-
# Build every *_fuzzer.py target found in the .clusterfuzzlite directory.
1811
find "$SRC/hiero-sdk-python/.clusterfuzzlite" -name '*_fuzzer.py' -print0 | while IFS= read -r -d '' fuzzer; do
1912
fuzzer_basename=$(basename -s .py "$fuzzer")
2013
fuzzer_package="${fuzzer_basename}.pkg"

.clusterfuzzlite/contract_params_fuzzer.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ def TestOneInput(data: bytes) -> None:
1515
"""Feed arbitrary bytes into ContractFunctionParameters encoding paths."""
1616
fdp = atheris.FuzzedDataProvider(data)
1717
choice = fdp.ConsumeIntInRange(0, 9)
18-
1918
try:
2019
params = ContractFunctionParameters()
21-
2220
if choice == 0:
2321
params.add_bool(fdp.ConsumeBool())
2422
elif choice == 1:
@@ -45,9 +43,7 @@ def TestOneInput(data: bytes) -> None:
4543
else:
4644
count = fdp.ConsumeIntInRange(0, 8)
4745
params.add_bytes32_array([fdp.ConsumeBytes(32) for _ in range(count)])
48-
4946
params.to_bytes()
50-
5147
except Exception:
5248
pass
5349

0 commit comments

Comments
 (0)