Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
matrix:
validator:
- codec
- traces
- stf/accumulate
- stf/assurances
- stf/authorizations
Expand Down
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,3 @@ specific subsystem.
Validation scripts are included to verify the JSON files against the expected
ASN.1 syntax provided with the test vectors. These scripts currently rely on my
[asn1tools](https://github.com/davxy/asn1tools) fork.

## Binary To JSON

The repository binary test vector files can be converted to their JSON
equivalents for easier inspection and debugging. Use the provided conversion
script to transform binary files into human-readable JSON format:

```bash
./scripts/convert-all.sh
```

This conversion script requires the [jam-types](https://github.com/davxy/jam-types)
Python library to be installed.
8 changes: 3 additions & 5 deletions lib/bin_to_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,13 @@ def decode(self):
return decoded


def convert_to_json(filename, subsystem_type, spec_name = None):
if spec_name in ("tiny", "full"):
spec.set_spec(spec_name)
print("* Converting:", filename)
def convert_to_json(filename, subsystem_type):
with open(filename, 'rb') as file:
blob = file.read()
scale_bytes = ScaleBytes(blob)
dump = subsystem_type(data=scale_bytes)
decoded = dump.decode()
json_filename = str(filename).replace('.bin', '.json')
json_filename = filename.replace('.bin', '.json')
with open(json_filename, 'w') as json_file:
json.dump(decoded, json_file, indent=4)
json_file.write('\n')
Expand All @@ -50,4 +47,5 @@ def convert_group(group_name, spec_name, subsystem_type):
spec.set_spec(spec_name)
print(f"\n[Converting {group_name} ({spec_name})]")
for file in glob.glob(f"{spec_name}/*.bin"):
print("* Converting:", file)
convert_to_json(file, subsystem_type)
31 changes: 13 additions & 18 deletions lib/validate_asn1.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,30 +76,24 @@ def path_to_type_name(path):
return name


def validate(schema, json_file, root_type = None, json_tweaks_callback = None):
def validate(schema, json_file, json_tweaks_callback=None):
"""Validate a JSON file against an ASN.1 schema.

The root type for decoding is determined as follows:
- If the schema contains "TestCase", use that type
- Otherwise, derive the type from the filename (e.g., "my_type.json" → "MyType")

Args:
schema: Compiled ASN.1 schema
json_file: Path to JSON file to validate
root_type_name: Optional schema type name to be used to parse the json_file
json_tweaks_callback: Optional callback to modify JSON before validation

If the `root_type_name` arg is None or is not present in the schema, then the root
type for decoding is determined as follows:
- If the schema contains "TestCase", use that type
- Otherwise, derive the type from the filename (e.g., "my_type.json" → "MyType")

"""
print("* Validating:", json_file)

# Determine root type used for decoding
if root_type is None:
if "TestCase" in schema.types:
root_type = "TestCase"
else:
# Auto-detect root type from filename
root_type = path_to_type_name(json_file)
if "TestCase" in schema.types:
root_type = "TestCase"
else:
# Auto-detect root type from filename
root_type = path_to_type_name(json_file)

# Read and prepare JSON
with open(json_file, "rb") as f:
Expand Down Expand Up @@ -127,7 +121,7 @@ def validate_group(group_name, group_schema, spec_name, json_tweaks_callback=Non
Args:
group_name: Name of the validation group (for display)
group_schema: ASN.1 schema file name (or None for base schema only)
spec_name: Specification name ("tiny", "full")
spec_name: Specification name ("tiny", "full", or "data")
json_tweaks_callback: Optional callback to modify JSON before validation
"""
print(f"\n[Validating {group_name} ({spec_name})]")
Expand All @@ -140,4 +134,5 @@ def validate_group(group_name, group_schema, spec_name, json_tweaks_callback=Non
# Compile schema and validate all JSON files
schema = asn1tools.compile_files(schema_files, codec="jer")
for json_file in glob.glob(f"{spec_name}/*.json"):
validate(schema, json_file, None, json_tweaks_callback)
print("* Validating:", json_file)
validate(schema, json_file, json_tweaks_callback)
24 changes: 0 additions & 24 deletions scripts/convert-all.sh

This file was deleted.

24 changes: 0 additions & 24 deletions scripts/validate-all.sh

This file was deleted.

Binary file modified stf/accumulate/full/accumulate_ready_queued_reports-1.bin
Binary file not shown.
40 changes: 20 additions & 20 deletions stf/accumulate/full/accumulate_ready_queued_reports-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_and_unlock_chain-1.bin
Binary file not shown.
28 changes: 14 additions & 14 deletions stf/accumulate/full/enqueue_and_unlock_chain-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_and_unlock_chain-2.bin
Binary file not shown.
36 changes: 18 additions & 18 deletions stf/accumulate/full/enqueue_and_unlock_chain-2.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_and_unlock_chain-3.bin
Binary file not shown.
42 changes: 21 additions & 21 deletions stf/accumulate/full/enqueue_and_unlock_chain-3.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_and_unlock_chain-4.bin
Binary file not shown.
34 changes: 17 additions & 17 deletions stf/accumulate/full/enqueue_and_unlock_chain-4.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_and_unlock_chain_wraps-1.bin
Binary file not shown.
42 changes: 21 additions & 21 deletions stf/accumulate/full/enqueue_and_unlock_chain_wraps-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_and_unlock_chain_wraps-2.bin
Binary file not shown.
48 changes: 24 additions & 24 deletions stf/accumulate/full/enqueue_and_unlock_chain_wraps-2.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_and_unlock_chain_wraps-3.bin
Binary file not shown.
54 changes: 27 additions & 27 deletions stf/accumulate/full/enqueue_and_unlock_chain_wraps-3.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_and_unlock_chain_wraps-4.bin
Binary file not shown.
54 changes: 27 additions & 27 deletions stf/accumulate/full/enqueue_and_unlock_chain_wraps-4.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_and_unlock_chain_wraps-5.bin
Binary file not shown.
40 changes: 20 additions & 20 deletions stf/accumulate/full/enqueue_and_unlock_chain_wraps-5.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_and_unlock_simple-1.bin
Binary file not shown.
24 changes: 12 additions & 12 deletions stf/accumulate/full/enqueue_and_unlock_simple-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_and_unlock_simple-2.bin
Binary file not shown.
26 changes: 13 additions & 13 deletions stf/accumulate/full/enqueue_and_unlock_simple-2.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_and_unlock_with_sr_lookup-1.bin
Binary file not shown.
24 changes: 12 additions & 12 deletions stf/accumulate/full/enqueue_and_unlock_with_sr_lookup-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_and_unlock_with_sr_lookup-2.bin
Binary file not shown.
26 changes: 13 additions & 13 deletions stf/accumulate/full/enqueue_and_unlock_with_sr_lookup-2.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_self_referential-1.bin
Binary file not shown.
24 changes: 12 additions & 12 deletions stf/accumulate/full/enqueue_self_referential-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_self_referential-2.bin
Binary file not shown.
32 changes: 16 additions & 16 deletions stf/accumulate/full/enqueue_self_referential-2.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_self_referential-3.bin
Binary file not shown.
40 changes: 20 additions & 20 deletions stf/accumulate/full/enqueue_self_referential-3.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/enqueue_self_referential-4.bin
Binary file not shown.
44 changes: 22 additions & 22 deletions stf/accumulate/full/enqueue_self_referential-4.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/no_available_reports-1.bin
Binary file not shown.
20 changes: 10 additions & 10 deletions stf/accumulate/full/no_available_reports-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/process_one_immediate_report-1.bin
Binary file not shown.
24 changes: 12 additions & 12 deletions stf/accumulate/full/process_one_immediate_report-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/queues_are_shifted-1.bin
Binary file not shown.
84 changes: 42 additions & 42 deletions stf/accumulate/full/queues_are_shifted-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/queues_are_shifted-2.bin
Binary file not shown.
82 changes: 41 additions & 41 deletions stf/accumulate/full/queues_are_shifted-2.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/ready_queue_editing-1.bin
Binary file not shown.
28 changes: 14 additions & 14 deletions stf/accumulate/full/ready_queue_editing-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/ready_queue_editing-2.bin
Binary file not shown.
36 changes: 18 additions & 18 deletions stf/accumulate/full/ready_queue_editing-2.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/ready_queue_editing-3.bin
Binary file not shown.
34 changes: 17 additions & 17 deletions stf/accumulate/full/ready_queue_editing-3.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/full/same_code_different_services-1.bin
Binary file not shown.
38 changes: 19 additions & 19 deletions stf/accumulate/full/same_code_different_services-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/accumulate_ready_queued_reports-1.bin
Binary file not shown.
40 changes: 20 additions & 20 deletions stf/accumulate/tiny/accumulate_ready_queued_reports-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_and_unlock_chain-1.bin
Binary file not shown.
28 changes: 14 additions & 14 deletions stf/accumulate/tiny/enqueue_and_unlock_chain-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_and_unlock_chain-2.bin
Binary file not shown.
36 changes: 18 additions & 18 deletions stf/accumulate/tiny/enqueue_and_unlock_chain-2.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_and_unlock_chain-3.bin
Binary file not shown.
42 changes: 21 additions & 21 deletions stf/accumulate/tiny/enqueue_and_unlock_chain-3.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_and_unlock_chain-4.bin
Binary file not shown.
34 changes: 17 additions & 17 deletions stf/accumulate/tiny/enqueue_and_unlock_chain-4.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_and_unlock_chain_wraps-1.bin
Binary file not shown.
42 changes: 21 additions & 21 deletions stf/accumulate/tiny/enqueue_and_unlock_chain_wraps-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_and_unlock_chain_wraps-2.bin
Binary file not shown.
48 changes: 24 additions & 24 deletions stf/accumulate/tiny/enqueue_and_unlock_chain_wraps-2.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_and_unlock_chain_wraps-3.bin
Binary file not shown.
54 changes: 27 additions & 27 deletions stf/accumulate/tiny/enqueue_and_unlock_chain_wraps-3.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_and_unlock_chain_wraps-4.bin
Binary file not shown.
54 changes: 27 additions & 27 deletions stf/accumulate/tiny/enqueue_and_unlock_chain_wraps-4.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_and_unlock_chain_wraps-5.bin
Binary file not shown.
40 changes: 20 additions & 20 deletions stf/accumulate/tiny/enqueue_and_unlock_chain_wraps-5.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_and_unlock_simple-1.bin
Binary file not shown.
24 changes: 12 additions & 12 deletions stf/accumulate/tiny/enqueue_and_unlock_simple-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_and_unlock_simple-2.bin
Binary file not shown.
26 changes: 13 additions & 13 deletions stf/accumulate/tiny/enqueue_and_unlock_simple-2.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_and_unlock_with_sr_lookup-1.bin
Binary file not shown.
24 changes: 12 additions & 12 deletions stf/accumulate/tiny/enqueue_and_unlock_with_sr_lookup-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_and_unlock_with_sr_lookup-2.bin
Binary file not shown.
26 changes: 13 additions & 13 deletions stf/accumulate/tiny/enqueue_and_unlock_with_sr_lookup-2.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_self_referential-1.bin
Binary file not shown.
24 changes: 12 additions & 12 deletions stf/accumulate/tiny/enqueue_self_referential-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_self_referential-2.bin
Binary file not shown.
32 changes: 16 additions & 16 deletions stf/accumulate/tiny/enqueue_self_referential-2.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_self_referential-3.bin
Binary file not shown.
40 changes: 20 additions & 20 deletions stf/accumulate/tiny/enqueue_self_referential-3.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/enqueue_self_referential-4.bin
Binary file not shown.
44 changes: 22 additions & 22 deletions stf/accumulate/tiny/enqueue_self_referential-4.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/no_available_reports-1.bin
Binary file not shown.
20 changes: 10 additions & 10 deletions stf/accumulate/tiny/no_available_reports-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/process_one_immediate_report-1.bin
Binary file not shown.
24 changes: 12 additions & 12 deletions stf/accumulate/tiny/process_one_immediate_report-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/queues_are_shifted-1.bin
Binary file not shown.
70 changes: 35 additions & 35 deletions stf/accumulate/tiny/queues_are_shifted-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/queues_are_shifted-2.bin
Binary file not shown.
54 changes: 27 additions & 27 deletions stf/accumulate/tiny/queues_are_shifted-2.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/ready_queue_editing-1.bin
Binary file not shown.
28 changes: 14 additions & 14 deletions stf/accumulate/tiny/ready_queue_editing-1.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/ready_queue_editing-2.bin
Binary file not shown.
36 changes: 18 additions & 18 deletions stf/accumulate/tiny/ready_queue_editing-2.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/ready_queue_editing-3.bin
Binary file not shown.
34 changes: 17 additions & 17 deletions stf/accumulate/tiny/ready_queue_editing-3.json

Large diffs are not rendered by default.

Binary file modified stf/accumulate/tiny/same_code_different_services-1.bin
Binary file not shown.
38 changes: 19 additions & 19 deletions stf/accumulate/tiny/same_code_different_services-1.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions stf/history/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ the input `accumulate_root`.

## Vectors

- [progress_blocks_history-1](tiny/progress_blocks_history-1.json) 🟢
- [progress_blocks_history-1](data/progress_blocks_history-1.json) 🟢
- Empty history queue.
- [progress_blocks_history-2](tiny/progress_blocks_history-2.json) 🟢
- [progress_blocks_history-2](data/progress_blocks_history-2.json) 🟢
- Not empty nor full history queue.
- [progress_blocks_history-3](tiny/progress_blocks_history-3.json) 🟢
- [progress_blocks_history-3](data/progress_blocks_history-3.json) 🟢
- Fill the history queue.
- [progress_blocks_history-4](tiny/progress_blocks_history-4.json) 🟢
- [progress_blocks_history-4](data/progress_blocks_history-4.json) 🟢
- Shift the history queue.
3 changes: 1 addition & 2 deletions stf/history/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@

os.chdir(script_dir)

for spec in ["tiny", "full"]:
convert_group("history", spec, HistoryTestVector)
convert_group("history", "data", HistoryTestVector)
Binary file removed stf/history/tiny/progress_blocks_history-1.bin
Binary file not shown.
44 changes: 0 additions & 44 deletions stf/history/tiny/progress_blocks_history-1.json

This file was deleted.

Binary file removed stf/history/tiny/progress_blocks_history-2.bin
Binary file not shown.
76 changes: 0 additions & 76 deletions stf/history/tiny/progress_blocks_history-2.json

This file was deleted.

Binary file removed stf/history/tiny/progress_blocks_history-3.bin
Binary file not shown.
Loading