Fix more typos (#397)

This commit is contained in:
Dimitris Apostolou 2024-02-22 19:55:22 +02:00 committed by GitHub
parent 4f982ae1f9
commit 486b15b305
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 19 additions and 16 deletions

View File

@ -4,7 +4,7 @@ This directory contains Nim bindings for the c-kzg-4844 library.
## Requirements
This bindings support Nim compiler version 1.2, 1.4, 1.6, and devel.
These bindings support Nim compiler version 1.2, 1.4, 1.6, and devel.
You also need to install dependencies:
@ -14,7 +14,7 @@ nimble install stew
## Tests
Currently reference tests only support Nim compiler version 1.4, and 1.6 because of yaml library limitations.
Currently, reference tests only support Nim compiler version 1.4, and 1.6 because of yaml library limitations.
But other tests that are not using yaml can be run by Nim 1.2 - devel.
Dependencies:
@ -36,7 +36,7 @@ Or from c-kzg-4844 root folder:
nimble test
```
## How to use this bindings in your project
## How to use these bindings in your project
Install via nimble:

View File

@ -97,7 +97,7 @@ proc loadTrustedSetupFromString*(input: string): Result[KzgCtx, string] =
try:
let fieldElems = s.readLine().parseInt()
if fieldElems != FIELD_ELEMENTS_PER_BLOB:
return err("invalid field elemments per blob, expect $1, got $2" % [
return err("invalid field elements per blob, expect $1, got $2" % [
$FIELD_ELEMENTS_PER_BLOB, $fieldElems
])
let numG2 = s.readLine().parseInt()

View File

@ -40,6 +40,6 @@ exported by `node.js`. There is also a header-only `C++` implementation of the
There is mixed usage of the two in this library.
The addon was built to be
[context-aware](https://nodejs.github.io/node-addon-examples/special-topics/context-awareness/)
[context-aware](https://nodejs.github.io/node-addon-examples/special-topics/context-awareness/),
so it will be safe to run on a worker thread. Be sure not to use any
static/global variables as those are not thread safe.

View File

@ -66,7 +66,7 @@ publish: build bundle
@cd dist
@npm publish
# Run ref-tests in linux environment for cross-compatability check
# Run ref-tests in linux environment for cross-compatibility check
.PHONY: linux-test
linux-test: bundle
@# Docker cannot copy from outside this dir

View File

@ -26,8 +26,6 @@ export const FIELD_ELEMENTS_PER_BLOB: number;
*
* @param {string} filePath
*
* @return {KzgBindings}
*
* @throws {TypeError} - Non-String input
* @throws {Error} - For all other errors. See error message for more info
*/
@ -82,7 +80,12 @@ export function computeBlobKzgProof(blob: Blob, commitmentBytes: Bytes48): KZGPr
*
* @throws {TypeError} - For invalid arguments or failure of the native library
*/
export function verifyKzgProof(commitment: Bytes48, zBytes: Bytes32, yBytes: Bytes32, proof: Bytes48): boolean;
export function verifyKzgProof(
commitmentBytes: Bytes48,
zBytes: Bytes32,
yBytes: Bytes32,
proofBytes: Bytes48
): boolean;
/**
* Given a blob and its proof, verify that it corresponds to the provided
@ -96,20 +99,20 @@ export function verifyKzgProof(commitment: Bytes48, zBytes: Bytes32, yBytes: Byt
*
* @throws {TypeError} - For invalid arguments or failure of the native library
*/
export function verifyBlobKzgProof(blob: Blob, commitment: Bytes48, proof: Bytes48): boolean;
export function verifyBlobKzgProof(blob: Blob, commitmentBytes: Bytes48, proofBytes: Bytes48): boolean;
/**
* Given an array of blobs and their proofs, verify that they corresponds to their
* Given an array of blobs and their proofs, verify that they correspond to their
* provided commitment.
*
* Note: blobs[0] relates to commitmentBytes[0] and proofBytes[0]
*
* @param {Blob} blobs - An array of serialized blobs to verify
* @param {Bytes48} commitmentBytes - An array of serialized commitments to verify
* @param {Bytes48} proofBytes - An array of serialized KZG proofs for verification
* @param {Bytes48} commitmentsBytes - An array of serialized commitments to verify
* @param {Bytes48} proofsBytes - An array of serialized KZG proofs for verification
*
* @return {boolean} - true/false depending on batch validity
*
* @throws {TypeError} - For invalid arguments or failure of the native library
*/
export function verifyBlobKzgProofBatch(blobs: Blob[], commitments: Bytes48[], proofs: Bytes48[]): boolean;
export function verifyBlobKzgProofBatch(blobs: Blob[], commitmentsBytes: Bytes48[], proofsBytes: Bytes48[]): boolean;

View File

@ -8,7 +8,7 @@ const bindings = require("bindings")("kzg");
/**
* Converts JSON formatted trusted setup into the native format that
* the native library requires. Returns the absolute file path to the
* the native library requires. Returns the absolute file path to
* the formatted file. The path will be the same as the origin
* file but with a ".txt" extension.
*

View File

@ -132,7 +132,7 @@ fn make_bindings(header_path: &str, blst_headers_dir: &str, bindings_out_path: &
// if/when bindgen fixes this or allows us to choose our own representation
// for types. Using repr(C) is equivalent to repr(u*) for fieldless enums,
// so this should be safe to do. The alternative was to modify C_KZG_RET in
// C and we decided this was the lesser of two evils. There should be only
// C, and we decided this was the lesser of two evils. There should be only
// one instance where repr(C) isn't used: C_KZG_RET.
// See: https://github.com/rust-lang/rust-bindgen/issues/1907
#[cfg(feature = "generate-bindings")]