From 21eff3322fd6134404a0767e8500102fea8e9937 Mon Sep 17 00:00:00 2001 From: Samuel Onoja Date: Fri, 20 Dec 2024 11:00:22 +0100 Subject: [PATCH] delete gitignore for zcash_client_backend --- zcash_client_backend/.gitignore | 2 - .../src/proto/compact_formats.rs | 1181 +++++++++++++++++ 2 files changed, 1181 insertions(+), 2 deletions(-) delete mode 100644 zcash_client_backend/.gitignore create mode 100644 zcash_client_backend/src/proto/compact_formats.rs diff --git a/zcash_client_backend/.gitignore b/zcash_client_backend/.gitignore deleted file mode 100644 index 7025829d91..0000000000 --- a/zcash_client_backend/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Protobufs -src/proto/ diff --git a/zcash_client_backend/src/proto/compact_formats.rs b/zcash_client_backend/src/proto/compact_formats.rs new file mode 100644 index 0000000000..1b7b366c4f --- /dev/null +++ b/zcash_client_backend/src/proto/compact_formats.rs @@ -0,0 +1,1181 @@ +// This file is generated by rust-protobuf 2.28.0. Do not edit +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `compact_formats.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0; + +#[derive(PartialEq,Clone,Default)] +pub struct CompactBlock { + // message fields + pub protoVersion: u32, + pub height: u64, + pub hash: ::std::vec::Vec, + pub prevHash: ::std::vec::Vec, + pub time: u32, + pub header: ::std::vec::Vec, + pub vtx: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a CompactBlock { + fn default() -> &'a CompactBlock { + ::default_instance() + } +} + +impl CompactBlock { + pub fn new() -> CompactBlock { + ::std::default::Default::default() + } + + // uint32 protoVersion = 1; + + + pub fn get_protoVersion(&self) -> u32 { + self.protoVersion + } + pub fn clear_protoVersion(&mut self) { + self.protoVersion = 0; + } + + // Param is passed by value, moved + pub fn set_protoVersion(&mut self, v: u32) { + self.protoVersion = v; + } + + // uint64 height = 2; + + + pub fn get_height(&self) -> u64 { + self.height + } + pub fn clear_height(&mut self) { + self.height = 0; + } + + // Param is passed by value, moved + pub fn set_height(&mut self, v: u64) { + self.height = v; + } + + // bytes hash = 3; + + + pub fn get_hash(&self) -> &[u8] { + &self.hash + } + pub fn clear_hash(&mut self) { + self.hash.clear(); + } + + // Param is passed by value, moved + pub fn set_hash(&mut self, v: ::std::vec::Vec) { + self.hash = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_hash(&mut self) -> &mut ::std::vec::Vec { + &mut self.hash + } + + // Take field + pub fn take_hash(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.hash, ::std::vec::Vec::new()) + } + + // bytes prevHash = 4; + + + pub fn get_prevHash(&self) -> &[u8] { + &self.prevHash + } + pub fn clear_prevHash(&mut self) { + self.prevHash.clear(); + } + + // Param is passed by value, moved + pub fn set_prevHash(&mut self, v: ::std::vec::Vec) { + self.prevHash = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_prevHash(&mut self) -> &mut ::std::vec::Vec { + &mut self.prevHash + } + + // Take field + pub fn take_prevHash(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.prevHash, ::std::vec::Vec::new()) + } + + // uint32 time = 5; + + + pub fn get_time(&self) -> u32 { + self.time + } + pub fn clear_time(&mut self) { + self.time = 0; + } + + // Param is passed by value, moved + pub fn set_time(&mut self, v: u32) { + self.time = v; + } + + // bytes header = 6; + + + pub fn get_header(&self) -> &[u8] { + &self.header + } + pub fn clear_header(&mut self) { + self.header.clear(); + } + + // Param is passed by value, moved + pub fn set_header(&mut self, v: ::std::vec::Vec) { + self.header = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_header(&mut self) -> &mut ::std::vec::Vec { + &mut self.header + } + + // Take field + pub fn take_header(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.header, ::std::vec::Vec::new()) + } + + // repeated .cash.z.wallet.sdk.rpc.CompactTx vtx = 7; + + + pub fn get_vtx(&self) -> &[CompactTx] { + &self.vtx + } + pub fn clear_vtx(&mut self) { + self.vtx.clear(); + } + + // Param is passed by value, moved + pub fn set_vtx(&mut self, v: ::protobuf::RepeatedField) { + self.vtx = v; + } + + // Mutable pointer to the field. + pub fn mut_vtx(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.vtx + } + + // Take field + pub fn take_vtx(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.vtx, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for CompactBlock { + fn is_initialized(&self) -> bool { + for v in &self.vtx { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.protoVersion = tmp; + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint64()?; + self.height = tmp; + }, + 3 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.hash)?; + }, + 4 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.prevHash)?; + }, + 5 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.time = tmp; + }, + 6 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.header)?; + }, + 7 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.vtx)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if self.protoVersion != 0 { + my_size += ::protobuf::rt::value_size(1, self.protoVersion, ::protobuf::wire_format::WireTypeVarint); + } + if self.height != 0 { + my_size += ::protobuf::rt::value_size(2, self.height, ::protobuf::wire_format::WireTypeVarint); + } + if !self.hash.is_empty() { + my_size += ::protobuf::rt::bytes_size(3, &self.hash); + } + if !self.prevHash.is_empty() { + my_size += ::protobuf::rt::bytes_size(4, &self.prevHash); + } + if self.time != 0 { + my_size += ::protobuf::rt::value_size(5, self.time, ::protobuf::wire_format::WireTypeVarint); + } + if !self.header.is_empty() { + my_size += ::protobuf::rt::bytes_size(6, &self.header); + } + for value in &self.vtx { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if self.protoVersion != 0 { + os.write_uint32(1, self.protoVersion)?; + } + if self.height != 0 { + os.write_uint64(2, self.height)?; + } + if !self.hash.is_empty() { + os.write_bytes(3, &self.hash)?; + } + if !self.prevHash.is_empty() { + os.write_bytes(4, &self.prevHash)?; + } + if self.time != 0 { + os.write_uint32(5, self.time)?; + } + if !self.header.is_empty() { + os.write_bytes(6, &self.header)?; + } + for v in &self.vtx { + os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CompactBlock { + CompactBlock::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + 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: &CompactBlock| { &m.protoVersion }, + |m: &mut CompactBlock| { &mut m.protoVersion }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>( + "height", + |m: &CompactBlock| { &m.height }, + |m: &mut CompactBlock| { &mut m.height }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "hash", + |m: &CompactBlock| { &m.hash }, + |m: &mut CompactBlock| { &mut m.hash }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "prevHash", + |m: &CompactBlock| { &m.prevHash }, + |m: &mut CompactBlock| { &mut m.prevHash }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "time", + |m: &CompactBlock| { &m.time }, + |m: &mut CompactBlock| { &mut m.time }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "header", + |m: &CompactBlock| { &m.header }, + |m: &mut CompactBlock| { &mut m.header }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "vtx", + |m: &CompactBlock| { &m.vtx }, + |m: &mut CompactBlock| { &mut m.vtx }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "CompactBlock", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static CompactBlock { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(CompactBlock::new) + } +} + +impl ::protobuf::Clear for CompactBlock { + fn clear(&mut self) { + self.protoVersion = 0; + self.height = 0; + self.hash.clear(); + self.prevHash.clear(); + self.time = 0; + self.header.clear(); + self.vtx.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CompactBlock { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CompactBlock { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct CompactTx { + // message fields + pub index: u64, + pub hash: ::std::vec::Vec, + pub fee: u32, + pub spends: ::protobuf::RepeatedField, + pub outputs: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a CompactTx { + fn default() -> &'a CompactTx { + ::default_instance() + } +} + +impl CompactTx { + pub fn new() -> CompactTx { + ::std::default::Default::default() + } + + // uint64 index = 1; + + + pub fn get_index(&self) -> u64 { + self.index + } + pub fn clear_index(&mut self) { + self.index = 0; + } + + // Param is passed by value, moved + pub fn set_index(&mut self, v: u64) { + self.index = v; + } + + // bytes hash = 2; + + + pub fn get_hash(&self) -> &[u8] { + &self.hash + } + pub fn clear_hash(&mut self) { + self.hash.clear(); + } + + // Param is passed by value, moved + pub fn set_hash(&mut self, v: ::std::vec::Vec) { + self.hash = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_hash(&mut self) -> &mut ::std::vec::Vec { + &mut self.hash + } + + // Take field + pub fn take_hash(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.hash, ::std::vec::Vec::new()) + } + + // uint32 fee = 3; + + + pub fn get_fee(&self) -> u32 { + self.fee + } + pub fn clear_fee(&mut self) { + self.fee = 0; + } + + // Param is passed by value, moved + pub fn set_fee(&mut self, v: u32) { + self.fee = v; + } + + // repeated .cash.z.wallet.sdk.rpc.CompactSpend spends = 4; + + + pub fn get_spends(&self) -> &[CompactSpend] { + &self.spends + } + pub fn clear_spends(&mut self) { + self.spends.clear(); + } + + // Param is passed by value, moved + pub fn set_spends(&mut self, v: ::protobuf::RepeatedField) { + self.spends = v; + } + + // Mutable pointer to the field. + pub fn mut_spends(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.spends + } + + // Take field + pub fn take_spends(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.spends, ::protobuf::RepeatedField::new()) + } + + // repeated .cash.z.wallet.sdk.rpc.CompactOutput outputs = 5; + + + pub fn get_outputs(&self) -> &[CompactOutput] { + &self.outputs + } + pub fn clear_outputs(&mut self) { + self.outputs.clear(); + } + + // Param is passed by value, moved + pub fn set_outputs(&mut self, v: ::protobuf::RepeatedField) { + self.outputs = v; + } + + // Mutable pointer to the field. + pub fn mut_outputs(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.outputs + } + + // Take field + pub fn take_outputs(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.outputs, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for CompactTx { + fn is_initialized(&self) -> bool { + for v in &self.spends { + if !v.is_initialized() { + return false; + } + }; + for v in &self.outputs { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint64()?; + self.index = tmp; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.hash)?; + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.fee = tmp; + }, + 4 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.spends)?; + }, + 5 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.outputs)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if self.index != 0 { + my_size += ::protobuf::rt::value_size(1, self.index, ::protobuf::wire_format::WireTypeVarint); + } + if !self.hash.is_empty() { + my_size += ::protobuf::rt::bytes_size(2, &self.hash); + } + if self.fee != 0 { + my_size += ::protobuf::rt::value_size(3, self.fee, ::protobuf::wire_format::WireTypeVarint); + } + for value in &self.spends { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + for value in &self.outputs { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if self.index != 0 { + os.write_uint64(1, self.index)?; + } + if !self.hash.is_empty() { + os.write_bytes(2, &self.hash)?; + } + if self.fee != 0 { + os.write_uint32(3, self.fee)?; + } + for v in &self.spends { + os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + for v in &self.outputs { + os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CompactTx { + CompactTx::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + 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::ProtobufTypeUint64>( + "index", + |m: &CompactTx| { &m.index }, + |m: &mut CompactTx| { &mut m.index }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "hash", + |m: &CompactTx| { &m.hash }, + |m: &mut CompactTx| { &mut m.hash }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "fee", + |m: &CompactTx| { &m.fee }, + |m: &mut CompactTx| { &mut m.fee }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "spends", + |m: &CompactTx| { &m.spends }, + |m: &mut CompactTx| { &mut m.spends }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "outputs", + |m: &CompactTx| { &m.outputs }, + |m: &mut CompactTx| { &mut m.outputs }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "CompactTx", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static CompactTx { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(CompactTx::new) + } +} + +impl ::protobuf::Clear for CompactTx { + fn clear(&mut self) { + self.index = 0; + self.hash.clear(); + self.fee = 0; + self.spends.clear(); + self.outputs.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CompactTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CompactTx { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct CompactSpend { + // message fields + pub nf: ::std::vec::Vec, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a CompactSpend { + fn default() -> &'a CompactSpend { + ::default_instance() + } +} + +impl CompactSpend { + pub fn new() -> CompactSpend { + ::std::default::Default::default() + } + + // bytes nf = 1; + + + pub fn get_nf(&self) -> &[u8] { + &self.nf + } + pub fn clear_nf(&mut self) { + self.nf.clear(); + } + + // Param is passed by value, moved + pub fn set_nf(&mut self, v: ::std::vec::Vec) { + self.nf = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_nf(&mut self) -> &mut ::std::vec::Vec { + &mut self.nf + } + + // Take field + pub fn take_nf(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.nf, ::std::vec::Vec::new()) + } +} + +impl ::protobuf::Message for CompactSpend { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.nf)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.nf.is_empty() { + my_size += ::protobuf::rt::bytes_size(1, &self.nf); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.nf.is_empty() { + os.write_bytes(1, &self.nf)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CompactSpend { + CompactSpend::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + 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::ProtobufTypeBytes>( + "nf", + |m: &CompactSpend| { &m.nf }, + |m: &mut CompactSpend| { &mut m.nf }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "CompactSpend", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static CompactSpend { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(CompactSpend::new) + } +} + +impl ::protobuf::Clear for CompactSpend { + fn clear(&mut self) { + self.nf.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CompactSpend { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CompactSpend { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct CompactOutput { + // message fields + pub cmu: ::std::vec::Vec, + pub epk: ::std::vec::Vec, + pub ciphertext: ::std::vec::Vec, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a CompactOutput { + fn default() -> &'a CompactOutput { + ::default_instance() + } +} + +impl CompactOutput { + pub fn new() -> CompactOutput { + ::std::default::Default::default() + } + + // bytes cmu = 1; + + + pub fn get_cmu(&self) -> &[u8] { + &self.cmu + } + pub fn clear_cmu(&mut self) { + self.cmu.clear(); + } + + // Param is passed by value, moved + pub fn set_cmu(&mut self, v: ::std::vec::Vec) { + self.cmu = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_cmu(&mut self) -> &mut ::std::vec::Vec { + &mut self.cmu + } + + // Take field + pub fn take_cmu(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.cmu, ::std::vec::Vec::new()) + } + + // bytes epk = 2; + + + pub fn get_epk(&self) -> &[u8] { + &self.epk + } + pub fn clear_epk(&mut self) { + self.epk.clear(); + } + + // Param is passed by value, moved + pub fn set_epk(&mut self, v: ::std::vec::Vec) { + self.epk = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_epk(&mut self) -> &mut ::std::vec::Vec { + &mut self.epk + } + + // Take field + pub fn take_epk(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.epk, ::std::vec::Vec::new()) + } + + // bytes ciphertext = 3; + + + pub fn get_ciphertext(&self) -> &[u8] { + &self.ciphertext + } + pub fn clear_ciphertext(&mut self) { + self.ciphertext.clear(); + } + + // Param is passed by value, moved + pub fn set_ciphertext(&mut self, v: ::std::vec::Vec) { + self.ciphertext = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_ciphertext(&mut self) -> &mut ::std::vec::Vec { + &mut self.ciphertext + } + + // Take field + pub fn take_ciphertext(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.ciphertext, ::std::vec::Vec::new()) + } +} + +impl ::protobuf::Message for CompactOutput { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.cmu)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.epk)?; + }, + 3 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.ciphertext)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.cmu.is_empty() { + my_size += ::protobuf::rt::bytes_size(1, &self.cmu); + } + if !self.epk.is_empty() { + my_size += ::protobuf::rt::bytes_size(2, &self.epk); + } + if !self.ciphertext.is_empty() { + my_size += ::protobuf::rt::bytes_size(3, &self.ciphertext); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.cmu.is_empty() { + os.write_bytes(1, &self.cmu)?; + } + if !self.epk.is_empty() { + os.write_bytes(2, &self.epk)?; + } + if !self.ciphertext.is_empty() { + os.write_bytes(3, &self.ciphertext)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CompactOutput { + CompactOutput::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + 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::ProtobufTypeBytes>( + "cmu", + |m: &CompactOutput| { &m.cmu }, + |m: &mut CompactOutput| { &mut m.cmu }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "epk", + |m: &CompactOutput| { &m.epk }, + |m: &mut CompactOutput| { &mut m.epk }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "ciphertext", + |m: &CompactOutput| { &m.ciphertext }, + |m: &mut CompactOutput| { &mut m.ciphertext }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "CompactOutput", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static CompactOutput { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(CompactOutput::new) + } +} + +impl ::protobuf::Clear for CompactOutput { + fn clear(&mut self) { + self.cmu.clear(); + self.epk.clear(); + self.ciphertext.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CompactOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CompactOutput { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x15compact_formats.proto\x12\x15cash.z.wallet.sdk.rpc\"\xea\x01\n\x0c\ + CompactBlock\x12$\n\x0cprotoVersion\x18\x01\x20\x01(\rR\x0cprotoVersionB\ + \0\x12\x18\n\x06height\x18\x02\x20\x01(\x04R\x06heightB\0\x12\x14\n\x04h\ + ash\x18\x03\x20\x01(\x0cR\x04hashB\0\x12\x1c\n\x08prevHash\x18\x04\x20\ + \x01(\x0cR\x08prevHashB\0\x12\x14\n\x04time\x18\x05\x20\x01(\rR\x04timeB\ + \0\x12\x18\n\x06header\x18\x06\x20\x01(\x0cR\x06headerB\0\x124\n\x03vtx\ + \x18\x07\x20\x03(\x0b2\x20.cash.z.wallet.sdk.rpc.CompactTxR\x03vtxB\0:\0\ + \"\xd0\x01\n\tCompactTx\x12\x16\n\x05index\x18\x01\x20\x01(\x04R\x05inde\ + xB\0\x12\x14\n\x04hash\x18\x02\x20\x01(\x0cR\x04hashB\0\x12\x12\n\x03fee\ + \x18\x03\x20\x01(\rR\x03feeB\0\x12=\n\x06spends\x18\x04\x20\x03(\x0b2#.c\ + ash.z.wallet.sdk.rpc.CompactSpendR\x06spendsB\0\x12@\n\x07outputs\x18\ + \x05\x20\x03(\x0b2$.cash.z.wallet.sdk.rpc.CompactOutputR\x07outputsB\0:\ + \0\"\"\n\x0cCompactSpend\x12\x10\n\x02nf\x18\x01\x20\x01(\x0cR\x02nfB\0:\ + \0\"[\n\rCompactOutput\x12\x12\n\x03cmu\x18\x01\x20\x01(\x0cR\x03cmuB\0\ + \x12\x12\n\x03epk\x18\x02\x20\x01(\x0cR\x03epkB\0\x12\x20\n\nciphertext\ + \x18\x03\x20\x01(\x0cR\nciphertextB\0:\0B\0b\x06proto3\ +"; + +static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) +}