@@ -50,12 +50,12 @@ proc runBlobToKzgCommitmentTest(suiteName, suitePath, path: string) =
5050 if blob.isNone:
5151 check output.kind == JNull
5252 else :
53- let commitment = blobToKzgCommitment (KzgBlob (bytes: blob.get) )
53+ let commitment = blobToKzgCommitment (blob.get)
5454 check:
5555 if commitment.isErr:
5656 output.kind == JNull
5757 else :
58- commitment.get ().bytes == fromHex [48 ](output.getStr).get
58+ commitment.get == fromHex [48 ](output.getStr).get
5959
6060proc runVerifyKzgProofTest (suiteName, suitePath, path: string ) =
6161 let relativePathComponent = path.relativeTestPathComponent (suitePath)
@@ -75,10 +75,7 @@ proc runVerifyKzgProofTest(suiteName, suitePath, path: string) =
7575 if commitment.isNone or z.isNone or y.isNone or proof.isNone:
7676 check output.kind == JNull
7777 else :
78- let v = verifyProof (
79- KzgCommitment (bytes: commitment.get),
80- KzgBytes32 (bytes: z.get), KzgBytes32 (bytes: y.get),
81- KzgBytes48 (bytes: proof.get))
78+ let v = verifyProof (commitment.get, z.get, y.get, proof.get)
8279 check:
8380 if v.isErr:
8481 output.kind == JNull
@@ -103,10 +100,7 @@ proc runVerifyBlobKzgProofTest(suiteName, suitePath, path: string) =
103100 if blob.isNone or commitment.isNone or proof.isNone:
104101 check output.kind == JNull
105102 else :
106- let v = verifyBlobKzgProof (
107- KzgBlob (bytes: blob.get),
108- KzgBytes48 (bytes: commitment.get),
109- KzgBytes48 (bytes: proof.get))
103+ let v = verifyBlobKzgProof (blob.get, commitment.get, proof.get)
110104 check:
111105 if v.isErr:
112106 output.kind == JNull
@@ -133,9 +127,7 @@ proc runVerifyBlobKzgProofBatchTest(suiteName, suitePath, path: string) =
133127 check output.kind == JNull
134128 else :
135129 let v = verifyBlobKzgProofBatch (
136- blobs.mapIt (KzgBlob (bytes: it.get)),
137- commitments.mapIt (KzgCommitment (bytes: it.get)),
138- proofs.mapIt (KzgProof (bytes: it.get)))
130+ blobs.mapIt (it.get), commitments.mapIt (it.get), proofs.mapIt (it.get))
139131 check:
140132 if v.isErr:
141133 output.kind == JNull
@@ -158,17 +150,16 @@ proc runComputeKzgProofTest(suiteName, suitePath, path: string) =
158150 if blob.isNone or z.isNone:
159151 check output.kind == JNull
160152 else :
161- let p = computeKzgProof (
162- KzgBlob (bytes: blob.get), KzgBytes32 (bytes: z.get))
153+ let p = computeKzgProof (blob.get, z.get)
163154 if p.isErr:
164155 check output.kind == JNull
165156 else :
166157 let
167158 proof = fromHex [48 ](output[0 ].getStr)
168159 y = fromHex [32 ](output[1 ].getStr)
169160 check:
170- p.get.proof.bytes == proof.get
171- p.get.y.bytes == y.get
161+ p.get.proof == proof.get
162+ p.get.y == y.get
172163
173164proc runComputeBlobKzgProofTest (suiteName, suitePath, path: string ) =
174165 let relativePathComponent = path.relativeTestPathComponent (suitePath)
@@ -186,12 +177,11 @@ proc runComputeBlobKzgProofTest(suiteName, suitePath, path: string) =
186177 if blob.isNone or commitment.isNone:
187178 check output.kind == JNull
188179 else :
189- let p = computeBlobKzgProof (
190- KzgBlob (bytes: blob.get), KzgBytes48 (bytes: commitment.get))
180+ let p = computeBlobKzgProof (blob.get, commitment.get)
191181 if p.isErr:
192182 check output.kind == JNull
193183 else :
194- check p.get.bytes == fromHex [48 ](output.getStr).get
184+ check p.get == fromHex [48 ](output.getStr).get
195185
196186from std/ algorithm import sorted
197187
@@ -237,4 +227,4 @@ suite suiteName:
237227 for kind, path in walkDir (testsDir, relative = true , checkDir = true ):
238228 runComputeBlobKzgProofTest (suiteName, testsDir, testsDir / path)
239229
240- doAssert Kzg .freeTrustedSetup ().isOk
230+ doAssert Kzg .freeTrustedSetup ().isOk
0 commit comments