@@ -67,73 +67,73 @@ template checkRes(res, body: untyped) =
67
67
68
68
template checkBytes48 (res: untyped ) =
69
69
checkRes (res):
70
- let bytes = KzgBytes48 .fromHex (n[" output" ])
70
+ let bytes = Bytes48 .fromHex (n[" output" ])
71
71
check bytes == res.get
72
72
73
73
template checkBool (res: untyped ) =
74
74
checkRes (res):
75
75
check n[" output" ].content == $ res.get
76
76
77
77
suite " yaml tests" :
78
- var ctx: KzgCtx
78
+ var ctx: KZGCtx
79
79
# We cannot run this in `setup` because that runs before _every_ test
80
80
# and we only want to run this once
81
81
#
82
82
# This should also remove order dependency between tests; ie if we ran setup in a test
83
- ctx = newKzgCtx ()
83
+ ctx = newKZGCtx ()
84
84
85
85
runTests (BLOB_TO_KZG_COMMITMENT_TESTS ):
86
86
let
87
- blob = KzgBlob .fromHex (n[" input" ][" blob" ])
87
+ blob = Blob .fromHex (n[" input" ][" blob" ])
88
88
res = ctx.blobToKZGCommitment (blob)
89
89
checkBytes48 (res)
90
90
91
91
92
92
runTests (COMPUTE_CELLS_TESTS ):
93
93
let
94
- blob = KzgBlob .fromHex (n[" input" ][" blob" ])
94
+ blob = Blob .fromHex (n[" input" ][" blob" ])
95
95
res = ctx.computeCells (blob)
96
96
97
97
checkRes (res):
98
- let cells = KzgCell .fromHexList (n[" output" ])
98
+ let cells = Cell .fromHexList (n[" output" ])
99
99
check cells == res.get
100
100
101
101
runTests (COMPUTE_CELLS_AND_KZG_PROOFS_TESTS ):
102
102
let
103
- blob = KzgBlob .fromHex (n[" input" ][" blob" ])
103
+ blob = Blob .fromHex (n[" input" ][" blob" ])
104
104
res = ctx.computeCellsAndProofs (blob)
105
105
106
106
checkRes (res):
107
- let cells = KzgCell .fromHexList (n[" output" ][0 ])
107
+ let cells = Cell .fromHexList (n[" output" ][0 ])
108
108
check cells == res.get.cells
109
- let proofs = KzgProof .fromHexList (n[" output" ][1 ])
109
+ let proofs = KZGProof .fromHexList (n[" output" ][1 ])
110
110
check proofs == res.get.proofs
111
111
112
112
runTests (VERIFY_CELL_KZG_PROOF_TESTS ):
113
113
let
114
- commitment = KzgCommitment .fromHex (n[" input" ][" commitment" ])
114
+ commitment = KZGCommitment .fromHex (n[" input" ][" commitment" ])
115
115
cellId = n[" input" ][" cell_id" ].content.parseInt ().uint64
116
- cell = KzgCell .fromHex (n[" input" ][" cell" ])
117
- proof = KzgProof .fromHex (n[" input" ][" proof" ])
116
+ cell = Cell .fromHex (n[" input" ][" cell" ])
117
+ proof = KZGProof .fromHex (n[" input" ][" proof" ])
118
118
res = ctx.verifyCellKZGProof (commitment, cellId, cell, proof)
119
119
checkBool (res)
120
120
121
121
runTests (VERIFY_CELL_KZG_PROOF_BATCH_TESTS ):
122
122
let
123
- rowCommitments = KzgCommitment .fromHexList (n[" input" ][" row_commitments" ])
123
+ rowCommitments = KZGCommitment .fromHexList (n[" input" ][" row_commitments" ])
124
124
rowIndices = uint64 .fromIntList (n[" input" ][" row_indices" ])
125
125
columnIndices = uint64 .fromIntList (n[" input" ][" column_indices" ])
126
- cells = KzgCell .fromHexList (n[" input" ][" cells" ])
127
- proofs = KzgProof .fromHexList (n[" input" ][" proofs" ])
126
+ cells = Cell .fromHexList (n[" input" ][" cells" ])
127
+ proofs = KZGProof .fromHexList (n[" input" ][" proofs" ])
128
128
res = ctx.verifyCellKZGProofBatch (rowCommitments, rowIndices, columnIndices, cells, proofs)
129
129
checkBool (res)
130
130
131
131
runTests (RECOVER_ALL_CELLS_TESTS ):
132
132
let
133
133
cellIds = uint64 .fromIntList (n[" input" ][" cell_ids" ])
134
- cells = KzgCell .fromHexList (n[" input" ][" cells" ])
134
+ cells = Cell .fromHexList (n[" input" ][" cells" ])
135
135
res = ctx.recoverCells (cellIds, cells)
136
136
137
137
checkRes (res):
138
- let recovered = KzgCell .fromHexList (n[" output" ])
138
+ let recovered = Cell .fromHexList (n[" output" ])
139
139
check recovered == res.get
0 commit comments