Skip to content

Commit

Permalink
chore: Only use c-eth-kzg in java crate (#182)
Browse files Browse the repository at this point in the history
* re-export rust-eth-kzg error

* use re-exported Error

* remove TODO

* remove rust-eth-kzg dep
  • Loading branch information
kevaundray authored Aug 14, 2024
1 parent 407b1be commit 0d26de1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bindings/c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub use rust_eth_kzg::constants::{
BYTES_PER_BLOB, BYTES_PER_CELL, BYTES_PER_COMMITMENT, BYTES_PER_FIELD_ELEMENT,
CELLS_PER_EXT_BLOB, FIELD_ELEMENTS_PER_BLOB,
};
use rust_eth_kzg::Error;
pub use rust_eth_kzg::Error;

/*
* Note: All methods in this file have been prefixed with `eth_kzg`.
Expand Down
1 change: 0 additions & 1 deletion bindings/java/rust_code/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ repository = { workspace = true }

[dependencies]
jni = "^0.21.1"
rust_eth_kzg = { workspace = true }
hex = { workspace = true }
c_eth_kzg = { workspace = true }

Expand Down
2 changes: 1 addition & 1 deletion bindings/java/rust_code/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rust_eth_kzg::Error as KZGError;
use c_eth_kzg::Error as KZGError;

#[derive(Debug)]
pub enum Error {
Expand Down
5 changes: 1 addition & 4 deletions bindings/java/rust_code/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use c_eth_kzg::DASContext;
use jni::objects::JObjectArray;
use jni::objects::{JByteArray, JClass, JLongArray, JObject, JValue};
use jni::objects::{JByteArray, JClass, JLongArray, JObject, JObjectArray, JValue};
use jni::sys::{jboolean, jlong};
use jni::JNIEnv;

Expand All @@ -12,7 +11,6 @@ pub extern "system" fn Java_ethereum_cryptography_LibEthKZG_DASContextNew(
_env: JNIEnv,
_class: JClass,
) -> jlong {
// TODO: Switch to using the Rust DASContext object
c_eth_kzg::eth_kzg_das_context_new() as jlong
}

Expand All @@ -22,7 +20,6 @@ pub extern "system" fn Java_ethereum_cryptography_LibEthKZG_DASContextDestroy(
_class: JClass,
ctx_ptr: jlong,
) {
// TODO: Switch to using the Rust DASContext object
c_eth_kzg::eth_kzg_das_context_free(ctx_ptr as *mut DASContext);
}

Expand Down

0 comments on commit 0d26de1

Please sign in to comment.