#![allow(unknown_lints)]
#![allow(clippy::all)]
#![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(unsafe_code)]
#![allow(unused_imports)]
#![allow(unused_results)]
use protobuf::Message as Message_imported_for_functions;
use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_0;
#[derive(PartialEq,Clone,Default)]
#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
pub struct Transfer {
pub to: ::protobuf::SingularPtrField<super::helpers::PublicKey>,
pub amount: u64,
pub seed: u64,
#[cfg_attr(feature = "with-serde", serde(skip))]
pub unknown_fields: ::protobuf::UnknownFields,
#[cfg_attr(feature = "with-serde", serde(skip))]
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Transfer {
fn default() -> &'a Transfer {
<Transfer as ::protobuf::Message>::default_instance()
}
}
impl Transfer {
pub fn new() -> Transfer {
::std::default::Default::default()
}
pub fn get_to(&self) -> &super::helpers::PublicKey {
self.to.as_ref().unwrap_or_else(|| super::helpers::PublicKey::default_instance())
}
pub fn clear_to(&mut self) {
self.to.clear();
}
pub fn has_to(&self) -> bool {
self.to.is_some()
}
pub fn set_to(&mut self, v: super::helpers::PublicKey) {
self.to = ::protobuf::SingularPtrField::some(v);
}
pub fn mut_to(&mut self) -> &mut super::helpers::PublicKey {
if self.to.is_none() {
self.to.set_default();
}
self.to.as_mut().unwrap()
}
pub fn take_to(&mut self) -> super::helpers::PublicKey {
self.to.take().unwrap_or_else(|| super::helpers::PublicKey::new())
}
pub fn get_amount(&self) -> u64 {
self.amount
}
pub fn clear_amount(&mut self) {
self.amount = 0;
}
pub fn set_amount(&mut self, v: u64) {
self.amount = v;
}
pub fn get_seed(&self) -> u64 {
self.seed
}
pub fn clear_seed(&mut self) {
self.seed = 0;
}
pub fn set_seed(&mut self, v: u64) {
self.seed = v;
}
}
impl ::protobuf::Message for Transfer {
fn is_initialized(&self) -> bool {
for v in &self.to {
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 => {
::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.to)?;
},
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.amount = tmp;
},
3 => {
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.seed = tmp;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if let Some(ref v) = self.to.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
}
if self.amount != 0 {
my_size += ::protobuf::rt::value_size(2, self.amount, ::protobuf::wire_format::WireTypeVarint);
}
if self.seed != 0 {
my_size += ::protobuf::rt::value_size(3, self.seed, ::protobuf::wire_format::WireTypeVarint);
}
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 let Some(ref v) = self.to.as_ref() {
os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(v.get_cached_size())?;
v.write_to_with_cached_sizes(os)?;
}
if self.amount != 0 {
os.write_uint64(2, self.amount)?;
}
if self.seed != 0 {
os.write_uint64(3, self.seed)?;
}
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: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Transfer {
Transfer::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
};
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::helpers::PublicKey>>(
"to",
|m: &Transfer| { &m.to },
|m: &mut Transfer| { &mut m.to },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"amount",
|m: &Transfer| { &m.amount },
|m: &mut Transfer| { &mut m.amount },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"seed",
|m: &Transfer| { &m.seed },
|m: &mut Transfer| { &mut m.seed },
));
::protobuf::reflect::MessageDescriptor::new::<Transfer>(
"Transfer",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Transfer {
static mut instance: ::protobuf::lazy::Lazy<Transfer> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Transfer,
};
unsafe {
instance.get(Transfer::new)
}
}
}
impl ::protobuf::Clear for Transfer {
fn clear(&mut self) {
self.to.clear();
self.amount = 0;
self.seed = 0;
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Transfer {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Transfer {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
pub struct Issue {
pub amount: u64,
pub seed: u64,
#[cfg_attr(feature = "with-serde", serde(skip))]
pub unknown_fields: ::protobuf::UnknownFields,
#[cfg_attr(feature = "with-serde", serde(skip))]
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Issue {
fn default() -> &'a Issue {
<Issue as ::protobuf::Message>::default_instance()
}
}
impl Issue {
pub fn new() -> Issue {
::std::default::Default::default()
}
pub fn get_amount(&self) -> u64 {
self.amount
}
pub fn clear_amount(&mut self) {
self.amount = 0;
}
pub fn set_amount(&mut self, v: u64) {
self.amount = v;
}
pub fn get_seed(&self) -> u64 {
self.seed
}
pub fn clear_seed(&mut self) {
self.seed = 0;
}
pub fn set_seed(&mut self, v: u64) {
self.seed = v;
}
}
impl ::protobuf::Message for Issue {
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 => {
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.amount = 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.seed = tmp;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if self.amount != 0 {
my_size += ::protobuf::rt::value_size(1, self.amount, ::protobuf::wire_format::WireTypeVarint);
}
if self.seed != 0 {
my_size += ::protobuf::rt::value_size(2, self.seed, ::protobuf::wire_format::WireTypeVarint);
}
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.amount != 0 {
os.write_uint64(1, self.amount)?;
}
if self.seed != 0 {
os.write_uint64(2, self.seed)?;
}
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: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Issue {
Issue::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
};
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"amount",
|m: &Issue| { &m.amount },
|m: &mut Issue| { &mut m.amount },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"seed",
|m: &Issue| { &m.seed },
|m: &mut Issue| { &mut m.seed },
));
::protobuf::reflect::MessageDescriptor::new::<Issue>(
"Issue",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Issue {
static mut instance: ::protobuf::lazy::Lazy<Issue> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Issue,
};
unsafe {
instance.get(Issue::new)
}
}
}
impl ::protobuf::Clear for Issue {
fn clear(&mut self) {
self.amount = 0;
self.seed = 0;
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Issue {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Issue {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
pub struct CreateWallet {
pub name: ::std::string::String,
#[cfg_attr(feature = "with-serde", serde(skip))]
pub unknown_fields: ::protobuf::UnknownFields,
#[cfg_attr(feature = "with-serde", serde(skip))]
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a CreateWallet {
fn default() -> &'a CreateWallet {
<CreateWallet as ::protobuf::Message>::default_instance()
}
}
impl CreateWallet {
pub fn new() -> CreateWallet {
::std::default::Default::default()
}
pub fn get_name(&self) -> &str {
&self.name
}
pub fn clear_name(&mut self) {
self.name.clear();
}
pub fn set_name(&mut self, v: ::std::string::String) {
self.name = v;
}
pub fn mut_name(&mut self) -> &mut ::std::string::String {
&mut self.name
}
pub fn take_name(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.name, ::std::string::String::new())
}
}
impl ::protobuf::Message for CreateWallet {
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_string_into(wire_type, is, &mut self.name)?;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if !self.name.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.name);
}
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.name.is_empty() {
os.write_string(1, &self.name)?;
}
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: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> CreateWallet {
CreateWallet::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
};
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"name",
|m: &CreateWallet| { &m.name },
|m: &mut CreateWallet| { &mut m.name },
));
::protobuf::reflect::MessageDescriptor::new::<CreateWallet>(
"CreateWallet",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static CreateWallet {
static mut instance: ::protobuf::lazy::Lazy<CreateWallet> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const CreateWallet,
};
unsafe {
instance.get(CreateWallet::new)
}
}
}
impl ::protobuf::Clear for CreateWallet {
fn clear(&mut self) {
self.name.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for CreateWallet {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for CreateWallet {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
pub struct Wallet {
pub pub_key: ::protobuf::SingularPtrField<super::helpers::PublicKey>,
pub name: ::std::string::String,
pub balance: u64,
pub history_len: u64,
pub history_hash: ::protobuf::SingularPtrField<super::helpers::Hash>,
#[cfg_attr(feature = "with-serde", serde(skip))]
pub unknown_fields: ::protobuf::UnknownFields,
#[cfg_attr(feature = "with-serde", serde(skip))]
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Wallet {
fn default() -> &'a Wallet {
<Wallet as ::protobuf::Message>::default_instance()
}
}
impl Wallet {
pub fn new() -> Wallet {
::std::default::Default::default()
}
pub fn get_pub_key(&self) -> &super::helpers::PublicKey {
self.pub_key.as_ref().unwrap_or_else(|| super::helpers::PublicKey::default_instance())
}
pub fn clear_pub_key(&mut self) {
self.pub_key.clear();
}
pub fn has_pub_key(&self) -> bool {
self.pub_key.is_some()
}
pub fn set_pub_key(&mut self, v: super::helpers::PublicKey) {
self.pub_key = ::protobuf::SingularPtrField::some(v);
}
pub fn mut_pub_key(&mut self) -> &mut super::helpers::PublicKey {
if self.pub_key.is_none() {
self.pub_key.set_default();
}
self.pub_key.as_mut().unwrap()
}
pub fn take_pub_key(&mut self) -> super::helpers::PublicKey {
self.pub_key.take().unwrap_or_else(|| super::helpers::PublicKey::new())
}
pub fn get_name(&self) -> &str {
&self.name
}
pub fn clear_name(&mut self) {
self.name.clear();
}
pub fn set_name(&mut self, v: ::std::string::String) {
self.name = v;
}
pub fn mut_name(&mut self) -> &mut ::std::string::String {
&mut self.name
}
pub fn take_name(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.name, ::std::string::String::new())
}
pub fn get_balance(&self) -> u64 {
self.balance
}
pub fn clear_balance(&mut self) {
self.balance = 0;
}
pub fn set_balance(&mut self, v: u64) {
self.balance = v;
}
pub fn get_history_len(&self) -> u64 {
self.history_len
}
pub fn clear_history_len(&mut self) {
self.history_len = 0;
}
pub fn set_history_len(&mut self, v: u64) {
self.history_len = v;
}
pub fn get_history_hash(&self) -> &super::helpers::Hash {
self.history_hash.as_ref().unwrap_or_else(|| super::helpers::Hash::default_instance())
}
pub fn clear_history_hash(&mut self) {
self.history_hash.clear();
}
pub fn has_history_hash(&self) -> bool {
self.history_hash.is_some()
}
pub fn set_history_hash(&mut self, v: super::helpers::Hash) {
self.history_hash = ::protobuf::SingularPtrField::some(v);
}
pub fn mut_history_hash(&mut self) -> &mut super::helpers::Hash {
if self.history_hash.is_none() {
self.history_hash.set_default();
}
self.history_hash.as_mut().unwrap()
}
pub fn take_history_hash(&mut self) -> super::helpers::Hash {
self.history_hash.take().unwrap_or_else(|| super::helpers::Hash::new())
}
}
impl ::protobuf::Message for Wallet {
fn is_initialized(&self) -> bool {
for v in &self.pub_key {
if !v.is_initialized() {
return false;
}
};
for v in &self.history_hash {
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 => {
::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.pub_key)?;
},
2 => {
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
},
3 => {
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.balance = tmp;
},
4 => {
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.history_len = tmp;
},
5 => {
::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.history_hash)?;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if let Some(ref v) = self.pub_key.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
}
if !self.name.is_empty() {
my_size += ::protobuf::rt::string_size(2, &self.name);
}
if self.balance != 0 {
my_size += ::protobuf::rt::value_size(3, self.balance, ::protobuf::wire_format::WireTypeVarint);
}
if self.history_len != 0 {
my_size += ::protobuf::rt::value_size(4, self.history_len, ::protobuf::wire_format::WireTypeVarint);
}
if let Some(ref v) = self.history_hash.as_ref() {
let len = v.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 let Some(ref v) = self.pub_key.as_ref() {
os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(v.get_cached_size())?;
v.write_to_with_cached_sizes(os)?;
}
if !self.name.is_empty() {
os.write_string(2, &self.name)?;
}
if self.balance != 0 {
os.write_uint64(3, self.balance)?;
}
if self.history_len != 0 {
os.write_uint64(4, self.history_len)?;
}
if let Some(ref v) = self.history_hash.as_ref() {
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: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Wallet {
Wallet::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
};
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::helpers::PublicKey>>(
"pub_key",
|m: &Wallet| { &m.pub_key },
|m: &mut Wallet| { &mut m.pub_key },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"name",
|m: &Wallet| { &m.name },
|m: &mut Wallet| { &mut m.name },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"balance",
|m: &Wallet| { &m.balance },
|m: &mut Wallet| { &mut m.balance },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"history_len",
|m: &Wallet| { &m.history_len },
|m: &mut Wallet| { &mut m.history_len },
));
fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::helpers::Hash>>(
"history_hash",
|m: &Wallet| { &m.history_hash },
|m: &mut Wallet| { &mut m.history_hash },
));
::protobuf::reflect::MessageDescriptor::new::<Wallet>(
"Wallet",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Wallet {
static mut instance: ::protobuf::lazy::Lazy<Wallet> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Wallet,
};
unsafe {
instance.get(Wallet::new)
}
}
}
impl ::protobuf::Clear for Wallet {
fn clear(&mut self) {
self.pub_key.clear();
self.name.clear();
self.balance = 0;
self.history_len = 0;
self.history_hash.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Wallet {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Wallet {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n\x14cryptocurrency.proto\x12'exonum.examples.cryptocurrency_advanced\
\x1a\rhelpers.proto\"Y\n\x08Transfer\x12!\n\x02to\x18\x01\x20\x01(\x0b2\
\x11.exonum.PublicKeyR\x02to\x12\x16\n\x06amount\x18\x02\x20\x01(\x04R\
\x06amount\x12\x12\n\x04seed\x18\x03\x20\x01(\x04R\x04seed\"3\n\x05Issue\
\x12\x16\n\x06amount\x18\x01\x20\x01(\x04R\x06amount\x12\x12\n\x04seed\
\x18\x02\x20\x01(\x04R\x04seed\"\"\n\x0cCreateWallet\x12\x12\n\x04name\
\x18\x01\x20\x01(\tR\x04name\"\xb4\x01\n\x06Wallet\x12*\n\x07pub_key\x18\
\x01\x20\x01(\x0b2\x11.exonum.PublicKeyR\x06pubKey\x12\x12\n\x04name\x18\
\x02\x20\x01(\tR\x04name\x12\x18\n\x07balance\x18\x03\x20\x01(\x04R\x07b\
alance\x12\x1f\n\x0bhistory_len\x18\x04\x20\x01(\x04R\nhistoryLen\x12/\n\
\x0chistory_hash\x18\x05\x20\x01(\x0b2\x0c.exonum.HashR\x0bhistoryHashb\
\x06proto3\
";
static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto,
};
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()
})
}
}