Skip to content

Commit 2ff14ef

Browse files
authored
Merge pull request #19 from davxy/master
update tests
2 parents a54b056 + 449f0bb commit 2ff14ef

File tree

944 files changed

+62728
-113500
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

944 files changed

+62728
-113500
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
matrix:
1818
validator:
1919
- codec
20+
- erasure
2021
- traces
2122
- stf/accumulate
2223
- stf/assurances

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
- [Codec](./codec/README.md)
66

7+
## Erasure Coding
8+
9+
- [Erasure Coding](./erasure/README.md)
10+
711
## State Transition Functions
812

913
We offer two types of test vectors:

codec/convert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def convert(spec_name):
5757
print(f"\n[Converting codec ({spec_name})]")
5858
spec.set_spec(spec_name)
5959
for filename in glob.glob(f"{spec_name}/*.bin"):
60-
print("Converting ", filename)
60+
print("* Converting ", filename)
6161
basename = os.path.splitext(os.path.basename(filename))[0]
6262
basename = re.sub(r'_\d+$', '', basename)
6363
class_type = dump_classes[basename]

erasure/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Erasure Coding Test Vectors

erasure/convert.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env python3
2+
3+
import os
4+
import sys
5+
from jam_types import Struct, ByteSequence
6+
from jam_types import class_name as n
7+
8+
script_dir = os.path.dirname(os.path.abspath(__file__))
9+
sys.path.append(os.path.abspath(os.path.join(script_dir, '../lib')))
10+
from bin_to_json import convert_group # noqa: E402
11+
12+
os.chdir(script_dir)
13+
14+
class ErasureTestVector(Struct):
15+
type_mapping = [
16+
("data", n(ByteSequence)),
17+
("shards", "Vec<ByteSequence>"),
18+
]
19+
20+
for spec_name in ["tiny", "full"]:
21+
convert_group("erasure", spec_name, ErasureTestVector)

erasure/full/ec-100.bin

3.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)