Skip to content

Commit

Permalink
Fix more typos (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
rex4539 committed Feb 22, 2024
1 parent 4f982ae commit 486b15b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 16 deletions.
6 changes: 3 additions & 3 deletions bindings/nim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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:
Expand All @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion bindings/nim/kzg.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion bindings/node.js/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion bindings/node.js/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 11 additions & 8 deletions bindings/node.js/lib/kzg.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
Expand All @@ -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;
2 changes: 1 addition & 1 deletion bindings/node.js/lib/kzg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down

0 comments on commit 486b15b

Please sign in to comment.