1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- use exonum_merkledb :: {
16- access:: FromAccess , proof_list_index:: ProofListIndexIter , Fork , IndexAddress , ListProof ,
17- ObjectHash , ProofListIndex , Snapshot ,
15+ use exonum :: merkledb :: {
16+ access:: FromAccess , proof_list_index:: ProofListIndexIter , Fork , IndexAddress , ObjectHash ,
17+ ProofListIndex , Snapshot ,
1818} ;
19- use exonum_proto:: ProtobufConvert ;
2019use jni:: {
2120 objects:: { JClass , JObject , JString } ,
2221 sys:: { jboolean, jbyteArray, jint, jlong} ,
2322 JNIEnv ,
2423} ;
25- use protobuf:: Message ;
2624
2725use std:: { panic, ptr} ;
2826
2927use handle:: { self , Handle } ;
3028use storage:: db:: { Value , View , ViewRef } ;
3129use utils;
32- use JniResult ;
3330
3431type Index < T > = ProofListIndex < T , Value > ;
3532
@@ -260,7 +257,7 @@ pub extern "system" fn Java_com_exonum_binding_core_storage_indices_ProofListInd
260257 IndexType :: SnapshotIndex ( ref list) => list. get_proof ( index as u64 ) ,
261258 IndexType :: ForkIndex ( ref list) => list. get_proof ( index as u64 ) ,
262259 } ;
263- proof_to_bytes ( & env, proof)
260+ utils :: proto_to_java_bytes ( & env, proof)
264261 } ) ;
265262 utils:: unwrap_exc_or ( & env, res, ptr:: null_mut ( ) )
266263}
@@ -280,7 +277,7 @@ pub extern "system" fn Java_com_exonum_binding_core_storage_indices_ProofListInd
280277 IndexType :: SnapshotIndex ( ref list) => list. get_range_proof ( from as u64 ..to as u64 ) ,
281278 IndexType :: ForkIndex ( ref list) => list. get_range_proof ( from as u64 ..to as u64 ) ,
282279 } ;
283- proof_to_bytes ( & env, proof)
280+ utils :: proto_to_java_bytes ( & env, proof)
284281 } ) ;
285282 utils:: unwrap_exc_or ( & env, res, ptr:: null_mut ( ) )
286283}
@@ -410,8 +407,3 @@ pub extern "system" fn Java_com_exonum_binding_core_storage_indices_ProofListInd
410407) {
411408 handle:: drop_handle :: < ProofListIndexIter < Value > > ( & env, iter_handle) ;
412409}
413-
414- // Serializes `ListProof` into protobuf format and converts to the Java bytes array.
415- fn proof_to_bytes ( env : & JNIEnv , proof : ListProof < Value > ) -> JniResult < jbyteArray > {
416- env. byte_array_from_slice ( & proof. to_pb ( ) . write_to_bytes ( ) . unwrap ( ) )
417- }
0 commit comments