Switch to v0.4 Zcash Rust crates

This commit is contained in:
Jack Grigg 2020-09-22 15:43:42 +01:00
parent 6c39534bf4
commit 11895dd282
3 changed files with 554 additions and 309 deletions

604
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -22,6 +22,10 @@ log-panics = "2.0.0"
#protobuf = { version = "2", optional = true }
tls-api = { version = "0.1", optional = true }
tls-api-rustls = { version = "0.1", optional = true }
zcash_client_backend = "0.4"
zcash_client_sqlite = "0.2"
zcash_primitives = "0.4"
zcash_proofs = "0.4"
#### Temporary additions: ####################################
base58 = "0.1.0"
@ -34,36 +38,10 @@ secp256k1 = "0.17.2"
##############################################################
[dependencies.ff]
git = "https://github.com/zcash/librustzcash.git"
rev = "18b1ce7401184e86031e6d7ddefa7c8d36929296"
[dependencies.pairing]
git = "https://github.com/zcash/librustzcash.git"
rev = "18b1ce7401184e86031e6d7ddefa7c8d36929296"
[dependencies.zcash_client_backend]
git = "https://github.com/zcash/librustzcash.git"
rev = "18b1ce7401184e86031e6d7ddefa7c8d36929296"
[dependencies.zcash_client_sqlite]
git = "https://github.com/zcash/librustzcash.git"
rev = "18b1ce7401184e86031e6d7ddefa7c8d36929296"
[dependencies.zcash_primitives]
git = "https://github.com/zcash/librustzcash.git"
rev = "18b1ce7401184e86031e6d7ddefa7c8d36929296"
[dependencies.zcash_proofs]
git = "https://github.com/zcash/librustzcash.git"
rev = "18b1ce7401184e86031e6d7ddefa7c8d36929296"
[build-dependencies]
protobuf-codegen-pure = "2.14"
#[patch.'https://github.com/zcash/librustzcash.git']
#ff = { path = '../../clones/librustzcash/ff' }
#pairing = { path = '../../clones/librustzcash/pairing' }
#[patch.crates-io]
#zcash_client_backend = { path = '../../clones/librustzcash/zcash_client_backend' }
#zcash_client_sqlite = { path = '../../clones/librustzcash/zcash_client_sqlite' }
#zcash_primitives = { path = '../../clones/librustzcash/zcash_primitives' }

View File

@ -1,11 +1,12 @@
// This file is generated by rust-protobuf 2.14.0. Do not edit
// This file is generated by rust-protobuf 2.17.0. Do not edit
// @generated
// https://github.com/rust-lang/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy::all)]
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_attributes)]
#![rustfmt::skip]
#![allow(box_pointers)]
#![allow(dead_code)]
@ -14,17 +15,13 @@
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_casts)]
#![allow(unsafe_code)]
#![allow(unused_imports)]
#![allow(unused_results)]
//! Generated file from `local_rpc_types.proto`
use protobuf::Message as Message_imported_for_functions;
use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
/// Generated files are compatible only with the same version
/// of protobuf runtime.
// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_14_0;
// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0;
#[derive(PartialEq,Clone,Default)]
pub struct TransactionDataList {
@ -130,7 +127,7 @@ impl ::protobuf::Message for TransactionDataList {
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
@ -143,29 +140,25 @@ impl ::protobuf::Message for TransactionDataList {
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"data",
|m: &TransactionDataList| { &m.data },
|m: &mut TransactionDataList| { &mut m.data },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<TransactionDataList>(
"TransactionDataList",
fields,
file_descriptor_proto()
)
})
}
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"data",
|m: &TransactionDataList| { &m.data },
|m: &mut TransactionDataList| { &mut m.data },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<TransactionDataList>(
"TransactionDataList",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static TransactionDataList {
static mut instance: ::protobuf::lazy::Lazy<TransactionDataList> = ::protobuf::lazy::Lazy::INIT;
unsafe {
instance.get(TransactionDataList::new)
}
static instance: ::protobuf::rt::LazyV2<TransactionDataList> = ::protobuf::rt::LazyV2::INIT;
instance.get(TransactionDataList::new)
}
}
@ -300,7 +293,7 @@ impl ::protobuf::Message for TransparentTransactionList {
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
@ -313,29 +306,25 @@ impl ::protobuf::Message for TransparentTransactionList {
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<TransparentTransaction>>(
"transactions",
|m: &TransparentTransactionList| { &m.transactions },
|m: &mut TransparentTransactionList| { &mut m.transactions },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<TransparentTransactionList>(
"TransparentTransactionList",
fields,
file_descriptor_proto()
)
})
}
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<TransparentTransaction>>(
"transactions",
|m: &TransparentTransactionList| { &m.transactions },
|m: &mut TransparentTransactionList| { &mut m.transactions },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<TransparentTransactionList>(
"TransparentTransactionList",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static TransparentTransactionList {
static mut instance: ::protobuf::lazy::Lazy<TransparentTransactionList> = ::protobuf::lazy::Lazy::INIT;
unsafe {
instance.get(TransparentTransactionList::new)
}
static instance: ::protobuf::rt::LazyV2<TransparentTransactionList> = ::protobuf::rt::LazyV2::INIT;
instance.get(TransparentTransactionList::new)
}
}
@ -673,7 +662,7 @@ impl ::protobuf::Message for TransparentTransaction {
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
@ -686,64 +675,60 @@ impl ::protobuf::Message for TransparentTransaction {
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"protoVersion",
|m: &TransparentTransaction| { &m.protoVersion },
|m: &mut TransparentTransaction| { &mut m.protoVersion },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"expiryHeight",
|m: &TransparentTransaction| { &m.expiryHeight },
|m: &mut TransparentTransaction| { &mut m.expiryHeight },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
"hasShieldedOutputs",
|m: &TransparentTransaction| { &m.hasShieldedOutputs },
|m: &mut TransparentTransaction| { &mut m.hasShieldedOutputs },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
"hasShieldedSpends",
|m: &TransparentTransaction| { &m.hasShieldedSpends },
|m: &mut TransparentTransaction| { &mut m.hasShieldedSpends },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"height",
|m: &TransparentTransaction| { &m.height },
|m: &mut TransparentTransaction| { &mut m.height },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
"value",
|m: &TransparentTransaction| { &m.value },
|m: &mut TransparentTransaction| { &mut m.value },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"toAddress",
|m: &TransparentTransaction| { &m.toAddress },
|m: &mut TransparentTransaction| { &mut m.toAddress },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"fromAddress",
|m: &TransparentTransaction| { &m.fromAddress },
|m: &mut TransparentTransaction| { &mut m.fromAddress },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<TransparentTransaction>(
"TransparentTransaction",
fields,
file_descriptor_proto()
)
})
}
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"protoVersion",
|m: &TransparentTransaction| { &m.protoVersion },
|m: &mut TransparentTransaction| { &mut m.protoVersion },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"expiryHeight",
|m: &TransparentTransaction| { &m.expiryHeight },
|m: &mut TransparentTransaction| { &mut m.expiryHeight },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
"hasShieldedOutputs",
|m: &TransparentTransaction| { &m.hasShieldedOutputs },
|m: &mut TransparentTransaction| { &mut m.hasShieldedOutputs },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
"hasShieldedSpends",
|m: &TransparentTransaction| { &m.hasShieldedSpends },
|m: &mut TransparentTransaction| { &mut m.hasShieldedSpends },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"height",
|m: &TransparentTransaction| { &m.height },
|m: &mut TransparentTransaction| { &mut m.height },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
"value",
|m: &TransparentTransaction| { &m.value },
|m: &mut TransparentTransaction| { &mut m.value },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"toAddress",
|m: &TransparentTransaction| { &m.toAddress },
|m: &mut TransparentTransaction| { &mut m.toAddress },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"fromAddress",
|m: &TransparentTransaction| { &m.fromAddress },
|m: &mut TransparentTransaction| { &mut m.fromAddress },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<TransparentTransaction>(
"TransparentTransaction",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static TransparentTransaction {
static mut instance: ::protobuf::lazy::Lazy<TransparentTransaction> = ::protobuf::lazy::Lazy::INIT;
unsafe {
instance.get(TransparentTransaction::new)
}
static instance: ::protobuf::rt::LazyV2<TransparentTransaction> = ::protobuf::rt::LazyV2::INIT;
instance.get(TransparentTransaction::new)
}
}
@ -774,28 +759,28 @@ impl ::protobuf::reflect::ProtobufValue for TransparentTransaction {
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n\x15local_rpc_types.proto\x12\x1acash.z.ecc.android.sdk.rpc\"'\n\x13Tr\
ansactionDataList\x12\x0e\n\x04data\x18\x01\x20\x03(\x0cB\0:\0\"j\n\x1aT\
ransparentTransactionList\x12J\n\x0ctransactions\x18\x01\x20\x03(\x0b22.\
cash.z.ecc.android.sdk.rpc.TransparentTransactionB\0:\0\"\xd4\x01\n\x16T\
ransparentTransaction\x12\x16\n\x0cprotoVersion\x18\x01\x20\x01(\rB\0\
\x12\x16\n\x0cexpiryHeight\x18\x02\x20\x01(\rB\0\x12\x1c\n\x12hasShielde\
dOutputs\x18\x03\x20\x01(\x08B\0\x12\x1b\n\x11hasShieldedSpends\x18\x04\
\x20\x01(\x08B\0\x12\x10\n\x06height\x18\x05\x20\x01(\rB\0\x12\x0f\n\x05\
value\x18\x06\x20\x01(\x03B\0\x12\x13\n\ttoAddress\x18\x07\x20\x01(\tB\0\
\x12\x15\n\x0bfromAddress\x18\x08\x20\x01(\tB\0:\0B\0b\x06proto3\
\n\x15local_rpc_types.proto\x12\x1acash.z.ecc.android.sdk.rpc\"-\n\x13Tr\
ansactionDataList\x12\x14\n\x04data\x18\x01\x20\x03(\x0cR\x04dataB\0:\0\
\"x\n\x1aTransparentTransactionList\x12X\n\x0ctransactions\x18\x01\x20\
\x03(\x0b22.cash.z.ecc.android.sdk.rpc.TransparentTransactionR\x0ctransa\
ctionsB\0:\0\"\xbe\x02\n\x16TransparentTransaction\x12$\n\x0cprotoVersio\
n\x18\x01\x20\x01(\rR\x0cprotoVersionB\0\x12$\n\x0cexpiryHeight\x18\x02\
\x20\x01(\rR\x0cexpiryHeightB\0\x120\n\x12hasShieldedOutputs\x18\x03\x20\
\x01(\x08R\x12hasShieldedOutputsB\0\x12.\n\x11hasShieldedSpends\x18\x04\
\x20\x01(\x08R\x11hasShieldedSpendsB\0\x12\x18\n\x06height\x18\x05\x20\
\x01(\rR\x06heightB\0\x12\x16\n\x05value\x18\x06\x20\x01(\x03R\x05valueB\
\0\x12\x1e\n\ttoAddress\x18\x07\x20\x01(\tR\ttoAddressB\0\x12\"\n\x0bfro\
mAddress\x18\x08\x20\x01(\tR\x0bfromAddressB\0:\0B\0b\x06proto3\
";
static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy::INIT;
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
}
pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
unsafe {
file_descriptor_proto_lazy.get(|| {
parse_descriptor_proto()
})
}
file_descriptor_proto_lazy.get(|| {
parse_descriptor_proto()
})
}