Small cleanups (#202)

This commit is contained in:
Stefan Bratanov 2023-03-10 17:32:13 +00:00 committed by GitHub
parent da83e45e9c
commit 9b91f3b832
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 11 deletions

2
.gitignore vendored
View File

@ -10,8 +10,6 @@ analysis-report/
*.s *.s
*.a *.a
*.out *.out
inc/blst.h*
inc/blst_aux.h*
.vscode/ .vscode/
.idea/ .idea/
*bindings/*/*.so *bindings/*/*.so

View File

@ -17,13 +17,14 @@ java {
dependencies { dependencies {
def junitVersion = "5.9.2" def junitVersion = "5.9.2"
def jacksonVersion = "2.14.2"
testImplementation("org.junit.jupiter:junit-jupiter:${junitVersion}") testImplementation("org.junit.jupiter:junit-jupiter:${junitVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-params:${junitVersion}") testImplementation("org.junit.jupiter:junit-jupiter-params:${junitVersion}")
testFixturesImplementation("org.apache.tuweni:tuweni-units:2.3.1") testFixturesImplementation("org.apache.tuweni:tuweni-units:2.3.1")
testFixturesImplementation("com.fasterxml.jackson.core:jackson-databind:2.14.2") testFixturesImplementation("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
testFixturesImplementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.2") testFixturesImplementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${jacksonVersion}")
} }
spotless { spotless {

View File

@ -230,21 +230,21 @@ JNIEXPORT jobject JNICALL Java_ethereum_ckzg4844_CKZG4844JNI_computeKzgProof(JNI
return NULL; return NULL;
} }
jclass tupleClass = (*env)->FindClass(env, "ethereum/ckzg4844/Tuple"); jclass tuple_class = (*env)->FindClass(env, "ethereum/ckzg4844/Tuple");
if (tupleClass == NULL) if (tuple_class == NULL)
{ {
throw_exception(env, "Failed to find Tuple class."); throw_exception(env, "Failed to find Tuple class.");
return NULL; return NULL;
} }
jmethodID tupleConstructor = (*env)->GetMethodID(env, tupleClass, "<init>", "([B[B)V"); jmethodID tuple_constructor = (*env)->GetMethodID(env, tuple_class, "<init>", "([B[B)V");
if (tupleConstructor == NULL) if (tuple_constructor == NULL)
{ {
throw_exception(env, "Failed to find Tuple constructor."); throw_exception(env, "Failed to find Tuple constructor.");
return NULL; return NULL;
} }
jobject tuple = (*env)->NewObject(env, tupleClass, tupleConstructor, proof, y); jobject tuple = (*env)->NewObject(env, tuple_class, tuple_constructor, proof, y);
if (tuple == NULL) if (tuple == NULL)
{ {
throw_exception(env, "Failed to instantiate new Tuple."); throw_exception(env, "Failed to instantiate new Tuple.");

View File

@ -1,8 +1,8 @@
package ethereum.ckzg4844; package ethereum.ckzg4844;
public class Tuple { public class Tuple {
private byte[] first; private final byte[] first;
private byte[] second; private final byte[] second;
public Tuple(byte[] first, byte[] second) { public Tuple(byte[] first, byte[] second) {
this.first = first; this.first = first;

4
inc/.gitignore vendored
View File

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore