You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
994 lines
34 KiB
994 lines
34 KiB
// This file is generated by rust-protobuf 3.2.0. Do not edit
|
|
// .proto file is parsed by protoc 3.19.6
|
|
// @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_results)]
|
|
#![allow(unused_mut)]
|
|
|
|
//! Generated file from `messages-ethereum-definitions.proto`
|
|
|
|
/// Generated files are compatible only with the same version
|
|
/// of protobuf runtime.
|
|
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0;
|
|
|
|
#[derive(PartialEq,Clone,Default,Debug)]
|
|
// @@protoc_insertion_point(message:hw.trezor.messages.ethereum_definitions.EthereumNetworkInfo)
|
|
pub struct EthereumNetworkInfo {
|
|
// message fields
|
|
// @@protoc_insertion_point(field:hw.trezor.messages.ethereum_definitions.EthereumNetworkInfo.chain_id)
|
|
pub chain_id: ::std::option::Option<u64>,
|
|
// @@protoc_insertion_point(field:hw.trezor.messages.ethereum_definitions.EthereumNetworkInfo.symbol)
|
|
pub symbol: ::std::option::Option<::std::string::String>,
|
|
// @@protoc_insertion_point(field:hw.trezor.messages.ethereum_definitions.EthereumNetworkInfo.slip44)
|
|
pub slip44: ::std::option::Option<u32>,
|
|
// @@protoc_insertion_point(field:hw.trezor.messages.ethereum_definitions.EthereumNetworkInfo.name)
|
|
pub name: ::std::option::Option<::std::string::String>,
|
|
// special fields
|
|
// @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum_definitions.EthereumNetworkInfo.special_fields)
|
|
pub special_fields: ::protobuf::SpecialFields,
|
|
}
|
|
|
|
impl<'a> ::std::default::Default for &'a EthereumNetworkInfo {
|
|
fn default() -> &'a EthereumNetworkInfo {
|
|
<EthereumNetworkInfo as ::protobuf::Message>::default_instance()
|
|
}
|
|
}
|
|
|
|
impl EthereumNetworkInfo {
|
|
pub fn new() -> EthereumNetworkInfo {
|
|
::std::default::Default::default()
|
|
}
|
|
|
|
// required uint64 chain_id = 1;
|
|
|
|
pub fn chain_id(&self) -> u64 {
|
|
self.chain_id.unwrap_or(0)
|
|
}
|
|
|
|
pub fn clear_chain_id(&mut self) {
|
|
self.chain_id = ::std::option::Option::None;
|
|
}
|
|
|
|
pub fn has_chain_id(&self) -> bool {
|
|
self.chain_id.is_some()
|
|
}
|
|
|
|
// Param is passed by value, moved
|
|
pub fn set_chain_id(&mut self, v: u64) {
|
|
self.chain_id = ::std::option::Option::Some(v);
|
|
}
|
|
|
|
// required string symbol = 2;
|
|
|
|
pub fn symbol(&self) -> &str {
|
|
match self.symbol.as_ref() {
|
|
Some(v) => v,
|
|
None => "",
|
|
}
|
|
}
|
|
|
|
pub fn clear_symbol(&mut self) {
|
|
self.symbol = ::std::option::Option::None;
|
|
}
|
|
|
|
pub fn has_symbol(&self) -> bool {
|
|
self.symbol.is_some()
|
|
}
|
|
|
|
// Param is passed by value, moved
|
|
pub fn set_symbol(&mut self, v: ::std::string::String) {
|
|
self.symbol = ::std::option::Option::Some(v);
|
|
}
|
|
|
|
// Mutable pointer to the field.
|
|
// If field is not initialized, it is initialized with default value first.
|
|
pub fn mut_symbol(&mut self) -> &mut ::std::string::String {
|
|
if self.symbol.is_none() {
|
|
self.symbol = ::std::option::Option::Some(::std::string::String::new());
|
|
}
|
|
self.symbol.as_mut().unwrap()
|
|
}
|
|
|
|
// Take field
|
|
pub fn take_symbol(&mut self) -> ::std::string::String {
|
|
self.symbol.take().unwrap_or_else(|| ::std::string::String::new())
|
|
}
|
|
|
|
// required uint32 slip44 = 3;
|
|
|
|
pub fn slip44(&self) -> u32 {
|
|
self.slip44.unwrap_or(0)
|
|
}
|
|
|
|
pub fn clear_slip44(&mut self) {
|
|
self.slip44 = ::std::option::Option::None;
|
|
}
|
|
|
|
pub fn has_slip44(&self) -> bool {
|
|
self.slip44.is_some()
|
|
}
|
|
|
|
// Param is passed by value, moved
|
|
pub fn set_slip44(&mut self, v: u32) {
|
|
self.slip44 = ::std::option::Option::Some(v);
|
|
}
|
|
|
|
// required string name = 4;
|
|
|
|
pub fn name(&self) -> &str {
|
|
match self.name.as_ref() {
|
|
Some(v) => v,
|
|
None => "",
|
|
}
|
|
}
|
|
|
|
pub fn clear_name(&mut self) {
|
|
self.name = ::std::option::Option::None;
|
|
}
|
|
|
|
pub fn has_name(&self) -> bool {
|
|
self.name.is_some()
|
|
}
|
|
|
|
// Param is passed by value, moved
|
|
pub fn set_name(&mut self, v: ::std::string::String) {
|
|
self.name = ::std::option::Option::Some(v);
|
|
}
|
|
|
|
// Mutable pointer to the field.
|
|
// If field is not initialized, it is initialized with default value first.
|
|
pub fn mut_name(&mut self) -> &mut ::std::string::String {
|
|
if self.name.is_none() {
|
|
self.name = ::std::option::Option::Some(::std::string::String::new());
|
|
}
|
|
self.name.as_mut().unwrap()
|
|
}
|
|
|
|
// Take field
|
|
pub fn take_name(&mut self) -> ::std::string::String {
|
|
self.name.take().unwrap_or_else(|| ::std::string::String::new())
|
|
}
|
|
|
|
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
|
|
let mut fields = ::std::vec::Vec::with_capacity(4);
|
|
let mut oneofs = ::std::vec::Vec::with_capacity(0);
|
|
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
|
|
"chain_id",
|
|
|m: &EthereumNetworkInfo| { &m.chain_id },
|
|
|m: &mut EthereumNetworkInfo| { &mut m.chain_id },
|
|
));
|
|
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
|
|
"symbol",
|
|
|m: &EthereumNetworkInfo| { &m.symbol },
|
|
|m: &mut EthereumNetworkInfo| { &mut m.symbol },
|
|
));
|
|
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
|
|
"slip44",
|
|
|m: &EthereumNetworkInfo| { &m.slip44 },
|
|
|m: &mut EthereumNetworkInfo| { &mut m.slip44 },
|
|
));
|
|
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
|
|
"name",
|
|
|m: &EthereumNetworkInfo| { &m.name },
|
|
|m: &mut EthereumNetworkInfo| { &mut m.name },
|
|
));
|
|
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<EthereumNetworkInfo>(
|
|
"EthereumNetworkInfo",
|
|
fields,
|
|
oneofs,
|
|
)
|
|
}
|
|
}
|
|
|
|
impl ::protobuf::Message for EthereumNetworkInfo {
|
|
const NAME: &'static str = "EthereumNetworkInfo";
|
|
|
|
fn is_initialized(&self) -> bool {
|
|
if self.chain_id.is_none() {
|
|
return false;
|
|
}
|
|
if self.symbol.is_none() {
|
|
return false;
|
|
}
|
|
if self.slip44.is_none() {
|
|
return false;
|
|
}
|
|
if self.name.is_none() {
|
|
return false;
|
|
}
|
|
true
|
|
}
|
|
|
|
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
|
|
while let Some(tag) = is.read_raw_tag_or_eof()? {
|
|
match tag {
|
|
8 => {
|
|
self.chain_id = ::std::option::Option::Some(is.read_uint64()?);
|
|
},
|
|
18 => {
|
|
self.symbol = ::std::option::Option::Some(is.read_string()?);
|
|
},
|
|
24 => {
|
|
self.slip44 = ::std::option::Option::Some(is.read_uint32()?);
|
|
},
|
|
34 => {
|
|
self.name = ::std::option::Option::Some(is.read_string()?);
|
|
},
|
|
tag => {
|
|
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
|
|
},
|
|
};
|
|
}
|
|
::std::result::Result::Ok(())
|
|
}
|
|
|
|
// Compute sizes of nested messages
|
|
#[allow(unused_variables)]
|
|
fn compute_size(&self) -> u64 {
|
|
let mut my_size = 0;
|
|
if let Some(v) = self.chain_id {
|
|
my_size += ::protobuf::rt::uint64_size(1, v);
|
|
}
|
|
if let Some(v) = self.symbol.as_ref() {
|
|
my_size += ::protobuf::rt::string_size(2, &v);
|
|
}
|
|
if let Some(v) = self.slip44 {
|
|
my_size += ::protobuf::rt::uint32_size(3, v);
|
|
}
|
|
if let Some(v) = self.name.as_ref() {
|
|
my_size += ::protobuf::rt::string_size(4, &v);
|
|
}
|
|
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
|
|
self.special_fields.cached_size().set(my_size as u32);
|
|
my_size
|
|
}
|
|
|
|
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
|
|
if let Some(v) = self.chain_id {
|
|
os.write_uint64(1, v)?;
|
|
}
|
|
if let Some(v) = self.symbol.as_ref() {
|
|
os.write_string(2, v)?;
|
|
}
|
|
if let Some(v) = self.slip44 {
|
|
os.write_uint32(3, v)?;
|
|
}
|
|
if let Some(v) = self.name.as_ref() {
|
|
os.write_string(4, v)?;
|
|
}
|
|
os.write_unknown_fields(self.special_fields.unknown_fields())?;
|
|
::std::result::Result::Ok(())
|
|
}
|
|
|
|
fn special_fields(&self) -> &::protobuf::SpecialFields {
|
|
&self.special_fields
|
|
}
|
|
|
|
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
|
|
&mut self.special_fields
|
|
}
|
|
|
|
fn new() -> EthereumNetworkInfo {
|
|
EthereumNetworkInfo::new()
|
|
}
|
|
|
|
fn clear(&mut self) {
|
|
self.chain_id = ::std::option::Option::None;
|
|
self.symbol = ::std::option::Option::None;
|
|
self.slip44 = ::std::option::Option::None;
|
|
self.name = ::std::option::Option::None;
|
|
self.special_fields.clear();
|
|
}
|
|
|
|
fn default_instance() -> &'static EthereumNetworkInfo {
|
|
static instance: EthereumNetworkInfo = EthereumNetworkInfo {
|
|
chain_id: ::std::option::Option::None,
|
|
symbol: ::std::option::Option::None,
|
|
slip44: ::std::option::Option::None,
|
|
name: ::std::option::Option::None,
|
|
special_fields: ::protobuf::SpecialFields::new(),
|
|
};
|
|
&instance
|
|
}
|
|
}
|
|
|
|
impl ::protobuf::MessageFull for EthereumNetworkInfo {
|
|
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
|
|
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
|
|
descriptor.get(|| file_descriptor().message_by_package_relative_name("EthereumNetworkInfo").unwrap()).clone()
|
|
}
|
|
}
|
|
|
|
impl ::std::fmt::Display for EthereumNetworkInfo {
|
|
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
|
::protobuf::text_format::fmt(self, f)
|
|
}
|
|
}
|
|
|
|
impl ::protobuf::reflect::ProtobufValue for EthereumNetworkInfo {
|
|
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
|
|
}
|
|
|
|
#[derive(PartialEq,Clone,Default,Debug)]
|
|
// @@protoc_insertion_point(message:hw.trezor.messages.ethereum_definitions.EthereumTokenInfo)
|
|
pub struct EthereumTokenInfo {
|
|
// message fields
|
|
// @@protoc_insertion_point(field:hw.trezor.messages.ethereum_definitions.EthereumTokenInfo.address)
|
|
pub address: ::std::option::Option<::std::vec::Vec<u8>>,
|
|
// @@protoc_insertion_point(field:hw.trezor.messages.ethereum_definitions.EthereumTokenInfo.chain_id)
|
|
pub chain_id: ::std::option::Option<u64>,
|
|
// @@protoc_insertion_point(field:hw.trezor.messages.ethereum_definitions.EthereumTokenInfo.symbol)
|
|
pub symbol: ::std::option::Option<::std::string::String>,
|
|
// @@protoc_insertion_point(field:hw.trezor.messages.ethereum_definitions.EthereumTokenInfo.decimals)
|
|
pub decimals: ::std::option::Option<u32>,
|
|
// @@protoc_insertion_point(field:hw.trezor.messages.ethereum_definitions.EthereumTokenInfo.name)
|
|
pub name: ::std::option::Option<::std::string::String>,
|
|
// special fields
|
|
// @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum_definitions.EthereumTokenInfo.special_fields)
|
|
pub special_fields: ::protobuf::SpecialFields,
|
|
}
|
|
|
|
impl<'a> ::std::default::Default for &'a EthereumTokenInfo {
|
|
fn default() -> &'a EthereumTokenInfo {
|
|
<EthereumTokenInfo as ::protobuf::Message>::default_instance()
|
|
}
|
|
}
|
|
|
|
impl EthereumTokenInfo {
|
|
pub fn new() -> EthereumTokenInfo {
|
|
::std::default::Default::default()
|
|
}
|
|
|
|
// required bytes address = 1;
|
|
|
|
pub fn address(&self) -> &[u8] {
|
|
match self.address.as_ref() {
|
|
Some(v) => v,
|
|
None => &[],
|
|
}
|
|
}
|
|
|
|
pub fn clear_address(&mut self) {
|
|
self.address = ::std::option::Option::None;
|
|
}
|
|
|
|
pub fn has_address(&self) -> bool {
|
|
self.address.is_some()
|
|
}
|
|
|
|
// Param is passed by value, moved
|
|
pub fn set_address(&mut self, v: ::std::vec::Vec<u8>) {
|
|
self.address = ::std::option::Option::Some(v);
|
|
}
|
|
|
|
// Mutable pointer to the field.
|
|
// If field is not initialized, it is initialized with default value first.
|
|
pub fn mut_address(&mut self) -> &mut ::std::vec::Vec<u8> {
|
|
if self.address.is_none() {
|
|
self.address = ::std::option::Option::Some(::std::vec::Vec::new());
|
|
}
|
|
self.address.as_mut().unwrap()
|
|
}
|
|
|
|
// Take field
|
|
pub fn take_address(&mut self) -> ::std::vec::Vec<u8> {
|
|
self.address.take().unwrap_or_else(|| ::std::vec::Vec::new())
|
|
}
|
|
|
|
// required uint64 chain_id = 2;
|
|
|
|
pub fn chain_id(&self) -> u64 {
|
|
self.chain_id.unwrap_or(0)
|
|
}
|
|
|
|
pub fn clear_chain_id(&mut self) {
|
|
self.chain_id = ::std::option::Option::None;
|
|
}
|
|
|
|
pub fn has_chain_id(&self) -> bool {
|
|
self.chain_id.is_some()
|
|
}
|
|
|
|
// Param is passed by value, moved
|
|
pub fn set_chain_id(&mut self, v: u64) {
|
|
self.chain_id = ::std::option::Option::Some(v);
|
|
}
|
|
|
|
// required string symbol = 3;
|
|
|
|
pub fn symbol(&self) -> &str {
|
|
match self.symbol.as_ref() {
|
|
Some(v) => v,
|
|
None => "",
|
|
}
|
|
}
|
|
|
|
pub fn clear_symbol(&mut self) {
|
|
self.symbol = ::std::option::Option::None;
|
|
}
|
|
|
|
pub fn has_symbol(&self) -> bool {
|
|
self.symbol.is_some()
|
|
}
|
|
|
|
// Param is passed by value, moved
|
|
pub fn set_symbol(&mut self, v: ::std::string::String) {
|
|
self.symbol = ::std::option::Option::Some(v);
|
|
}
|
|
|
|
// Mutable pointer to the field.
|
|
// If field is not initialized, it is initialized with default value first.
|
|
pub fn mut_symbol(&mut self) -> &mut ::std::string::String {
|
|
if self.symbol.is_none() {
|
|
self.symbol = ::std::option::Option::Some(::std::string::String::new());
|
|
}
|
|
self.symbol.as_mut().unwrap()
|
|
}
|
|
|
|
// Take field
|
|
pub fn take_symbol(&mut self) -> ::std::string::String {
|
|
self.symbol.take().unwrap_or_else(|| ::std::string::String::new())
|
|
}
|
|
|
|
// required uint32 decimals = 4;
|
|
|
|
pub fn decimals(&self) -> u32 {
|
|
self.decimals.unwrap_or(0)
|
|
}
|
|
|
|
pub fn clear_decimals(&mut self) {
|
|
self.decimals = ::std::option::Option::None;
|
|
}
|
|
|
|
pub fn has_decimals(&self) -> bool {
|
|
self.decimals.is_some()
|
|
}
|
|
|
|
// Param is passed by value, moved
|
|
pub fn set_decimals(&mut self, v: u32) {
|
|
self.decimals = ::std::option::Option::Some(v);
|
|
}
|
|
|
|
// required string name = 5;
|
|
|
|
pub fn name(&self) -> &str {
|
|
match self.name.as_ref() {
|
|
Some(v) => v,
|
|
None => "",
|
|
}
|
|
}
|
|
|
|
pub fn clear_name(&mut self) {
|
|
self.name = ::std::option::Option::None;
|
|
}
|
|
|
|
pub fn has_name(&self) -> bool {
|
|
self.name.is_some()
|
|
}
|
|
|
|
// Param is passed by value, moved
|
|
pub fn set_name(&mut self, v: ::std::string::String) {
|
|
self.name = ::std::option::Option::Some(v);
|
|
}
|
|
|
|
// Mutable pointer to the field.
|
|
// If field is not initialized, it is initialized with default value first.
|
|
pub fn mut_name(&mut self) -> &mut ::std::string::String {
|
|
if self.name.is_none() {
|
|
self.name = ::std::option::Option::Some(::std::string::String::new());
|
|
}
|
|
self.name.as_mut().unwrap()
|
|
}
|
|
|
|
// Take field
|
|
pub fn take_name(&mut self) -> ::std::string::String {
|
|
self.name.take().unwrap_or_else(|| ::std::string::String::new())
|
|
}
|
|
|
|
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
|
|
let mut fields = ::std::vec::Vec::with_capacity(5);
|
|
let mut oneofs = ::std::vec::Vec::with_capacity(0);
|
|
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
|
|
"address",
|
|
|m: &EthereumTokenInfo| { &m.address },
|
|
|m: &mut EthereumTokenInfo| { &mut m.address },
|
|
));
|
|
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
|
|
"chain_id",
|
|
|m: &EthereumTokenInfo| { &m.chain_id },
|
|
|m: &mut EthereumTokenInfo| { &mut m.chain_id },
|
|
));
|
|
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
|
|
"symbol",
|
|
|m: &EthereumTokenInfo| { &m.symbol },
|
|
|m: &mut EthereumTokenInfo| { &mut m.symbol },
|
|
));
|
|
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
|
|
"decimals",
|
|
|m: &EthereumTokenInfo| { &m.decimals },
|
|
|m: &mut EthereumTokenInfo| { &mut m.decimals },
|
|
));
|
|
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
|
|
"name",
|
|
|m: &EthereumTokenInfo| { &m.name },
|
|
|m: &mut EthereumTokenInfo| { &mut m.name },
|
|
));
|
|
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<EthereumTokenInfo>(
|
|
"EthereumTokenInfo",
|
|
fields,
|
|
oneofs,
|
|
)
|
|
}
|
|
}
|
|
|
|
impl ::protobuf::Message for EthereumTokenInfo {
|
|
const NAME: &'static str = "EthereumTokenInfo";
|
|
|
|
fn is_initialized(&self) -> bool {
|
|
if self.address.is_none() {
|
|
return false;
|
|
}
|
|
if self.chain_id.is_none() {
|
|
return false;
|
|
}
|
|
if self.symbol.is_none() {
|
|
return false;
|
|
}
|
|
if self.decimals.is_none() {
|
|
return false;
|
|
}
|
|
if self.name.is_none() {
|
|
return false;
|
|
}
|
|
true
|
|
}
|
|
|
|
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
|
|
while let Some(tag) = is.read_raw_tag_or_eof()? {
|
|
match tag {
|
|
10 => {
|
|
self.address = ::std::option::Option::Some(is.read_bytes()?);
|
|
},
|
|
16 => {
|
|
self.chain_id = ::std::option::Option::Some(is.read_uint64()?);
|
|
},
|
|
26 => {
|
|
self.symbol = ::std::option::Option::Some(is.read_string()?);
|
|
},
|
|
32 => {
|
|
self.decimals = ::std::option::Option::Some(is.read_uint32()?);
|
|
},
|
|
42 => {
|
|
self.name = ::std::option::Option::Some(is.read_string()?);
|
|
},
|
|
tag => {
|
|
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
|
|
},
|
|
};
|
|
}
|
|
::std::result::Result::Ok(())
|
|
}
|
|
|
|
// Compute sizes of nested messages
|
|
#[allow(unused_variables)]
|
|
fn compute_size(&self) -> u64 {
|
|
let mut my_size = 0;
|
|
if let Some(v) = self.address.as_ref() {
|
|
my_size += ::protobuf::rt::bytes_size(1, &v);
|
|
}
|
|
if let Some(v) = self.chain_id {
|
|
my_size += ::protobuf::rt::uint64_size(2, v);
|
|
}
|
|
if let Some(v) = self.symbol.as_ref() {
|
|
my_size += ::protobuf::rt::string_size(3, &v);
|
|
}
|
|
if let Some(v) = self.decimals {
|
|
my_size += ::protobuf::rt::uint32_size(4, v);
|
|
}
|
|
if let Some(v) = self.name.as_ref() {
|
|
my_size += ::protobuf::rt::string_size(5, &v);
|
|
}
|
|
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
|
|
self.special_fields.cached_size().set(my_size as u32);
|
|
my_size
|
|
}
|
|
|
|
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
|
|
if let Some(v) = self.address.as_ref() {
|
|
os.write_bytes(1, v)?;
|
|
}
|
|
if let Some(v) = self.chain_id {
|
|
os.write_uint64(2, v)?;
|
|
}
|
|
if let Some(v) = self.symbol.as_ref() {
|
|
os.write_string(3, v)?;
|
|
}
|
|
if let Some(v) = self.decimals {
|
|
os.write_uint32(4, v)?;
|
|
}
|
|
if let Some(v) = self.name.as_ref() {
|
|
os.write_string(5, v)?;
|
|
}
|
|
os.write_unknown_fields(self.special_fields.unknown_fields())?;
|
|
::std::result::Result::Ok(())
|
|
}
|
|
|
|
fn special_fields(&self) -> &::protobuf::SpecialFields {
|
|
&self.special_fields
|
|
}
|
|
|
|
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
|
|
&mut self.special_fields
|
|
}
|
|
|
|
fn new() -> EthereumTokenInfo {
|
|
EthereumTokenInfo::new()
|
|
}
|
|
|
|
fn clear(&mut self) {
|
|
self.address = ::std::option::Option::None;
|
|
self.chain_id = ::std::option::Option::None;
|
|
self.symbol = ::std::option::Option::None;
|
|
self.decimals = ::std::option::Option::None;
|
|
self.name = ::std::option::Option::None;
|
|
self.special_fields.clear();
|
|
}
|
|
|
|
fn default_instance() -> &'static EthereumTokenInfo {
|
|
static instance: EthereumTokenInfo = EthereumTokenInfo {
|
|
address: ::std::option::Option::None,
|
|
chain_id: ::std::option::Option::None,
|
|
symbol: ::std::option::Option::None,
|
|
decimals: ::std::option::Option::None,
|
|
name: ::std::option::Option::None,
|
|
special_fields: ::protobuf::SpecialFields::new(),
|
|
};
|
|
&instance
|
|
}
|
|
}
|
|
|
|
impl ::protobuf::MessageFull for EthereumTokenInfo {
|
|
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
|
|
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
|
|
descriptor.get(|| file_descriptor().message_by_package_relative_name("EthereumTokenInfo").unwrap()).clone()
|
|
}
|
|
}
|
|
|
|
impl ::std::fmt::Display for EthereumTokenInfo {
|
|
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
|
::protobuf::text_format::fmt(self, f)
|
|
}
|
|
}
|
|
|
|
impl ::protobuf::reflect::ProtobufValue for EthereumTokenInfo {
|
|
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
|
|
}
|
|
|
|
#[derive(PartialEq,Clone,Default,Debug)]
|
|
// @@protoc_insertion_point(message:hw.trezor.messages.ethereum_definitions.EthereumDefinitions)
|
|
pub struct EthereumDefinitions {
|
|
// message fields
|
|
// @@protoc_insertion_point(field:hw.trezor.messages.ethereum_definitions.EthereumDefinitions.encoded_network)
|
|
pub encoded_network: ::std::option::Option<::std::vec::Vec<u8>>,
|
|
// @@protoc_insertion_point(field:hw.trezor.messages.ethereum_definitions.EthereumDefinitions.encoded_token)
|
|
pub encoded_token: ::std::option::Option<::std::vec::Vec<u8>>,
|
|
// special fields
|
|
// @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum_definitions.EthereumDefinitions.special_fields)
|
|
pub special_fields: ::protobuf::SpecialFields,
|
|
}
|
|
|
|
impl<'a> ::std::default::Default for &'a EthereumDefinitions {
|
|
fn default() -> &'a EthereumDefinitions {
|
|
<EthereumDefinitions as ::protobuf::Message>::default_instance()
|
|
}
|
|
}
|
|
|
|
impl EthereumDefinitions {
|
|
pub fn new() -> EthereumDefinitions {
|
|
::std::default::Default::default()
|
|
}
|
|
|
|
// optional bytes encoded_network = 1;
|
|
|
|
pub fn encoded_network(&self) -> &[u8] {
|
|
match self.encoded_network.as_ref() {
|
|
Some(v) => v,
|
|
None => &[],
|
|
}
|
|
}
|
|
|
|
pub fn clear_encoded_network(&mut self) {
|
|
self.encoded_network = ::std::option::Option::None;
|
|
}
|
|
|
|
pub fn has_encoded_network(&self) -> bool {
|
|
self.encoded_network.is_some()
|
|
}
|
|
|
|
// Param is passed by value, moved
|
|
pub fn set_encoded_network(&mut self, v: ::std::vec::Vec<u8>) {
|
|
self.encoded_network = ::std::option::Option::Some(v);
|
|
}
|
|
|
|
// Mutable pointer to the field.
|
|
// If field is not initialized, it is initialized with default value first.
|
|
pub fn mut_encoded_network(&mut self) -> &mut ::std::vec::Vec<u8> {
|
|
if self.encoded_network.is_none() {
|
|
self.encoded_network = ::std::option::Option::Some(::std::vec::Vec::new());
|
|
}
|
|
self.encoded_network.as_mut().unwrap()
|
|
}
|
|
|
|
// Take field
|
|
pub fn take_encoded_network(&mut self) -> ::std::vec::Vec<u8> {
|
|
self.encoded_network.take().unwrap_or_else(|| ::std::vec::Vec::new())
|
|
}
|
|
|
|
// optional bytes encoded_token = 2;
|
|
|
|
pub fn encoded_token(&self) -> &[u8] {
|
|
match self.encoded_token.as_ref() {
|
|
Some(v) => v,
|
|
None => &[],
|
|
}
|
|
}
|
|
|
|
pub fn clear_encoded_token(&mut self) {
|
|
self.encoded_token = ::std::option::Option::None;
|
|
}
|
|
|
|
pub fn has_encoded_token(&self) -> bool {
|
|
self.encoded_token.is_some()
|
|
}
|
|
|
|
// Param is passed by value, moved
|
|
pub fn set_encoded_token(&mut self, v: ::std::vec::Vec<u8>) {
|
|
self.encoded_token = ::std::option::Option::Some(v);
|
|
}
|
|
|
|
// Mutable pointer to the field.
|
|
// If field is not initialized, it is initialized with default value first.
|
|
pub fn mut_encoded_token(&mut self) -> &mut ::std::vec::Vec<u8> {
|
|
if self.encoded_token.is_none() {
|
|
self.encoded_token = ::std::option::Option::Some(::std::vec::Vec::new());
|
|
}
|
|
self.encoded_token.as_mut().unwrap()
|
|
}
|
|
|
|
// Take field
|
|
pub fn take_encoded_token(&mut self) -> ::std::vec::Vec<u8> {
|
|
self.encoded_token.take().unwrap_or_else(|| ::std::vec::Vec::new())
|
|
}
|
|
|
|
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
|
|
let mut fields = ::std::vec::Vec::with_capacity(2);
|
|
let mut oneofs = ::std::vec::Vec::with_capacity(0);
|
|
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
|
|
"encoded_network",
|
|
|m: &EthereumDefinitions| { &m.encoded_network },
|
|
|m: &mut EthereumDefinitions| { &mut m.encoded_network },
|
|
));
|
|
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
|
|
"encoded_token",
|
|
|m: &EthereumDefinitions| { &m.encoded_token },
|
|
|m: &mut EthereumDefinitions| { &mut m.encoded_token },
|
|
));
|
|
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<EthereumDefinitions>(
|
|
"EthereumDefinitions",
|
|
fields,
|
|
oneofs,
|
|
)
|
|
}
|
|
}
|
|
|
|
impl ::protobuf::Message for EthereumDefinitions {
|
|
const NAME: &'static str = "EthereumDefinitions";
|
|
|
|
fn is_initialized(&self) -> bool {
|
|
true
|
|
}
|
|
|
|
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
|
|
while let Some(tag) = is.read_raw_tag_or_eof()? {
|
|
match tag {
|
|
10 => {
|
|
self.encoded_network = ::std::option::Option::Some(is.read_bytes()?);
|
|
},
|
|
18 => {
|
|
self.encoded_token = ::std::option::Option::Some(is.read_bytes()?);
|
|
},
|
|
tag => {
|
|
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
|
|
},
|
|
};
|
|
}
|
|
::std::result::Result::Ok(())
|
|
}
|
|
|
|
// Compute sizes of nested messages
|
|
#[allow(unused_variables)]
|
|
fn compute_size(&self) -> u64 {
|
|
let mut my_size = 0;
|
|
if let Some(v) = self.encoded_network.as_ref() {
|
|
my_size += ::protobuf::rt::bytes_size(1, &v);
|
|
}
|
|
if let Some(v) = self.encoded_token.as_ref() {
|
|
my_size += ::protobuf::rt::bytes_size(2, &v);
|
|
}
|
|
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
|
|
self.special_fields.cached_size().set(my_size as u32);
|
|
my_size
|
|
}
|
|
|
|
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
|
|
if let Some(v) = self.encoded_network.as_ref() {
|
|
os.write_bytes(1, v)?;
|
|
}
|
|
if let Some(v) = self.encoded_token.as_ref() {
|
|
os.write_bytes(2, v)?;
|
|
}
|
|
os.write_unknown_fields(self.special_fields.unknown_fields())?;
|
|
::std::result::Result::Ok(())
|
|
}
|
|
|
|
fn special_fields(&self) -> &::protobuf::SpecialFields {
|
|
&self.special_fields
|
|
}
|
|
|
|
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
|
|
&mut self.special_fields
|
|
}
|
|
|
|
fn new() -> EthereumDefinitions {
|
|
EthereumDefinitions::new()
|
|
}
|
|
|
|
fn clear(&mut self) {
|
|
self.encoded_network = ::std::option::Option::None;
|
|
self.encoded_token = ::std::option::Option::None;
|
|
self.special_fields.clear();
|
|
}
|
|
|
|
fn default_instance() -> &'static EthereumDefinitions {
|
|
static instance: EthereumDefinitions = EthereumDefinitions {
|
|
encoded_network: ::std::option::Option::None,
|
|
encoded_token: ::std::option::Option::None,
|
|
special_fields: ::protobuf::SpecialFields::new(),
|
|
};
|
|
&instance
|
|
}
|
|
}
|
|
|
|
impl ::protobuf::MessageFull for EthereumDefinitions {
|
|
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
|
|
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
|
|
descriptor.get(|| file_descriptor().message_by_package_relative_name("EthereumDefinitions").unwrap()).clone()
|
|
}
|
|
}
|
|
|
|
impl ::std::fmt::Display for EthereumDefinitions {
|
|
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
|
::protobuf::text_format::fmt(self, f)
|
|
}
|
|
}
|
|
|
|
impl ::protobuf::reflect::ProtobufValue for EthereumDefinitions {
|
|
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
|
|
}
|
|
|
|
#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
|
|
// @@protoc_insertion_point(enum:hw.trezor.messages.ethereum_definitions.EthereumDefinitionType)
|
|
pub enum EthereumDefinitionType {
|
|
// @@protoc_insertion_point(enum_value:hw.trezor.messages.ethereum_definitions.EthereumDefinitionType.NETWORK)
|
|
NETWORK = 0,
|
|
// @@protoc_insertion_point(enum_value:hw.trezor.messages.ethereum_definitions.EthereumDefinitionType.TOKEN)
|
|
TOKEN = 1,
|
|
}
|
|
|
|
impl ::protobuf::Enum for EthereumDefinitionType {
|
|
const NAME: &'static str = "EthereumDefinitionType";
|
|
|
|
fn value(&self) -> i32 {
|
|
*self as i32
|
|
}
|
|
|
|
fn from_i32(value: i32) -> ::std::option::Option<EthereumDefinitionType> {
|
|
match value {
|
|
0 => ::std::option::Option::Some(EthereumDefinitionType::NETWORK),
|
|
1 => ::std::option::Option::Some(EthereumDefinitionType::TOKEN),
|
|
_ => ::std::option::Option::None
|
|
}
|
|
}
|
|
|
|
const VALUES: &'static [EthereumDefinitionType] = &[
|
|
EthereumDefinitionType::NETWORK,
|
|
EthereumDefinitionType::TOKEN,
|
|
];
|
|
}
|
|
|
|
impl ::protobuf::EnumFull for EthereumDefinitionType {
|
|
fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor {
|
|
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new();
|
|
descriptor.get(|| file_descriptor().enum_by_package_relative_name("EthereumDefinitionType").unwrap()).clone()
|
|
}
|
|
|
|
fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor {
|
|
let index = *self as usize;
|
|
Self::enum_descriptor().value_by_index(index)
|
|
}
|
|
}
|
|
|
|
impl ::std::default::Default for EthereumDefinitionType {
|
|
fn default() -> Self {
|
|
EthereumDefinitionType::NETWORK
|
|
}
|
|
}
|
|
|
|
impl EthereumDefinitionType {
|
|
fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData {
|
|
::protobuf::reflect::GeneratedEnumDescriptorData::new::<EthereumDefinitionType>("EthereumDefinitionType")
|
|
}
|
|
}
|
|
|
|
static file_descriptor_proto_data: &'static [u8] = b"\
|
|
\n#messages-ethereum-definitions.proto\x12'hw.trezor.messages.ethereum_d\
|
|
efinitions\"t\n\x13EthereumNetworkInfo\x12\x19\n\x08chain_id\x18\x01\x20\
|
|
\x02(\x04R\x07chainId\x12\x16\n\x06symbol\x18\x02\x20\x02(\tR\x06symbol\
|
|
\x12\x16\n\x06slip44\x18\x03\x20\x02(\rR\x06slip44\x12\x12\n\x04name\x18\
|
|
\x04\x20\x02(\tR\x04name\"\x90\x01\n\x11EthereumTokenInfo\x12\x18\n\x07a\
|
|
ddress\x18\x01\x20\x02(\x0cR\x07address\x12\x19\n\x08chain_id\x18\x02\
|
|
\x20\x02(\x04R\x07chainId\x12\x16\n\x06symbol\x18\x03\x20\x02(\tR\x06sym\
|
|
bol\x12\x1a\n\x08decimals\x18\x04\x20\x02(\rR\x08decimals\x12\x12\n\x04n\
|
|
ame\x18\x05\x20\x02(\tR\x04name\"c\n\x13EthereumDefinitions\x12'\n\x0fen\
|
|
coded_network\x18\x01\x20\x01(\x0cR\x0eencodedNetwork\x12#\n\rencoded_to\
|
|
ken\x18\x02\x20\x01(\x0cR\x0cencodedToken*0\n\x16EthereumDefinitionType\
|
|
\x12\x0b\n\x07NETWORK\x10\0\x12\t\n\x05TOKEN\x10\x01BG\n#com.satoshilabs\
|
|
.trezor.lib.protobufB\x20TrezorMessageEthereumDefinitions\
|
|
";
|
|
|
|
/// `FileDescriptorProto` object which was a source for this generated file
|
|
fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
|
|
static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
|
|
file_descriptor_proto_lazy.get(|| {
|
|
::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
|
|
})
|
|
}
|
|
|
|
/// `FileDescriptor` object which allows dynamic access to files
|
|
pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
|
|
static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
|
|
static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
|
|
file_descriptor.get(|| {
|
|
let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
|
|
let mut deps = ::std::vec::Vec::with_capacity(0);
|
|
let mut messages = ::std::vec::Vec::with_capacity(3);
|
|
messages.push(EthereumNetworkInfo::generated_message_descriptor_data());
|
|
messages.push(EthereumTokenInfo::generated_message_descriptor_data());
|
|
messages.push(EthereumDefinitions::generated_message_descriptor_data());
|
|
let mut enums = ::std::vec::Vec::with_capacity(1);
|
|
enums.push(EthereumDefinitionType::generated_enum_descriptor_data());
|
|
::protobuf::reflect::GeneratedFileDescriptor::new_generated(
|
|
file_descriptor_proto(),
|
|
deps,
|
|
messages,
|
|
enums,
|
|
)
|
|
});
|
|
::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
|
|
})
|
|
}
|