From e1f4596f9fbb9c2a1e802f9e7f9fb81a10c56ac1 Mon Sep 17 00:00:00 2001 From: Boris Oncev Date: Thu, 20 Jun 2024 05:58:09 +0200 Subject: [PATCH] add trezor-client generated code --- Cargo.lock | 55 +- Cargo.toml | 1 + wallet/Cargo.toml | 2 +- wallet/src/key_chain/mod.rs | 10 + wallet/src/signer/trezor_signer/mod.rs | 70 +- wallet/src/signer/trezor_signer/tests.rs | 48 +- wallet/trezor-client/.gitignore | 1 + wallet/trezor-client/Cargo.toml | 77 + wallet/trezor-client/LICENSE | 122 + wallet/trezor-client/README.md | 40 + wallet/trezor-client/build/Cargo.toml | 8 + wallet/trezor-client/build/README.md | 7 + wallet/trezor-client/build/src/main.rs | 34 + wallet/trezor-client/examples/change_pin.rs | 31 + wallet/trezor-client/examples/features.rs | 101 + wallet/trezor-client/examples/find.rs | 11 + wallet/trezor-client/examples/interaction.rs | 57 + wallet/trezor-client/examples/sign_message.rs | 40 + wallet/trezor-client/examples/sign_tx.rs | 119 + wallet/trezor-client/examples/solana.rs | 17 + wallet/trezor-client/scripts/build_messages | 110 + wallet/trezor-client/scripts/build_protos | 27 + wallet/trezor-client/src/client/bitcoin.rs | 95 + wallet/trezor-client/src/client/common.rs | 247 + wallet/trezor-client/src/client/ethereum.rs | 168 + wallet/trezor-client/src/client/mintlayer.rs | 130 + wallet/trezor-client/src/client/mod.rs | 266 + wallet/trezor-client/src/client/solana.rs | 16 + wallet/trezor-client/src/error.rs | 105 + wallet/trezor-client/src/flows/sign_tx.rs | 332 + wallet/trezor-client/src/lib.rs | 247 + .../trezor-client/src/messages/generated.rs | 306 + wallet/trezor-client/src/messages/mod.rs | 26 + .../src/protos/generated/messages.rs | 1963 +++ .../src/protos/generated/messages_binance.rs | 3083 ++++ .../src/protos/generated/messages_bitcoin.rs | 13682 ++++++++++++++++ .../protos/generated/messages_bootloader.rs | 767 + .../src/protos/generated/messages_cardano.rs | 10240 ++++++++++++ .../src/protos/generated/messages_common.rs | 2521 +++ .../src/protos/generated/messages_crypto.rs | 2956 ++++ .../src/protos/generated/messages_debug.rs | 3555 ++++ .../src/protos/generated/messages_eos.rs | 6536 ++++++++ .../src/protos/generated/messages_ethereum.rs | 4199 +++++ .../messages_ethereum_definitions.rs | 1001 ++ .../generated/messages_ethereum_eip712.rs | 1465 ++ .../protos/generated/messages_management.rs | 10842 ++++++++++++ .../protos/generated/messages_mintlayer.rs | 3772 +++++ .../src/protos/generated/messages_monero.rs | 12061 ++++++++++++++ .../src/protos/generated/messages_nem.rs | 4998 ++++++ .../src/protos/generated/messages_ripple.rs | 1241 ++ .../src/protos/generated/messages_solana.rs | 1594 ++ .../src/protos/generated/messages_stellar.rs | 6413 ++++++++ .../src/protos/generated/messages_tezos.rs | 4584 ++++++ .../src/protos/generated/messages_webauthn.rs | 1257 ++ wallet/trezor-client/src/protos/mod.rs | 44 + wallet/trezor-client/src/transport/error.rs | 49 + wallet/trezor-client/src/transport/mod.rs | 85 + .../trezor-client/src/transport/protocol.rs | 214 + wallet/trezor-client/src/transport/udp.rs | 159 + wallet/trezor-client/src/transport/webusb.rs | 173 + wallet/trezor-client/src/utils.rs | 73 + 61 files changed, 102393 insertions(+), 60 deletions(-) create mode 100644 wallet/trezor-client/.gitignore create mode 100644 wallet/trezor-client/Cargo.toml create mode 100644 wallet/trezor-client/LICENSE create mode 100644 wallet/trezor-client/README.md create mode 100644 wallet/trezor-client/build/Cargo.toml create mode 100644 wallet/trezor-client/build/README.md create mode 100644 wallet/trezor-client/build/src/main.rs create mode 100644 wallet/trezor-client/examples/change_pin.rs create mode 100644 wallet/trezor-client/examples/features.rs create mode 100644 wallet/trezor-client/examples/find.rs create mode 100644 wallet/trezor-client/examples/interaction.rs create mode 100644 wallet/trezor-client/examples/sign_message.rs create mode 100644 wallet/trezor-client/examples/sign_tx.rs create mode 100644 wallet/trezor-client/examples/solana.rs create mode 100755 wallet/trezor-client/scripts/build_messages create mode 100755 wallet/trezor-client/scripts/build_protos create mode 100644 wallet/trezor-client/src/client/bitcoin.rs create mode 100644 wallet/trezor-client/src/client/common.rs create mode 100644 wallet/trezor-client/src/client/ethereum.rs create mode 100644 wallet/trezor-client/src/client/mintlayer.rs create mode 100644 wallet/trezor-client/src/client/mod.rs create mode 100644 wallet/trezor-client/src/client/solana.rs create mode 100644 wallet/trezor-client/src/error.rs create mode 100644 wallet/trezor-client/src/flows/sign_tx.rs create mode 100644 wallet/trezor-client/src/lib.rs create mode 100644 wallet/trezor-client/src/messages/generated.rs create mode 100644 wallet/trezor-client/src/messages/mod.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_binance.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_bitcoin.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_bootloader.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_cardano.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_common.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_crypto.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_debug.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_eos.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_ethereum.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_ethereum_definitions.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_ethereum_eip712.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_management.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_mintlayer.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_monero.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_nem.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_ripple.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_solana.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_stellar.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_tezos.rs create mode 100644 wallet/trezor-client/src/protos/generated/messages_webauthn.rs create mode 100644 wallet/trezor-client/src/protos/mod.rs create mode 100644 wallet/trezor-client/src/transport/error.rs create mode 100644 wallet/trezor-client/src/transport/mod.rs create mode 100644 wallet/trezor-client/src/transport/protocol.rs create mode 100644 wallet/trezor-client/src/transport/udp.rs create mode 100644 wallet/trezor-client/src/transport/webusb.rs create mode 100644 wallet/trezor-client/src/utils.rs diff --git a/Cargo.lock b/Cargo.lock index e817f1587b..8828d6acd2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1562,7 +1562,7 @@ dependencies = [ "serde", "serde_json", "serde_test", - "serial_test", + "serial_test 3.1.1", "serialization", "static_assertions", "test-utils", @@ -1925,16 +1925,15 @@ checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "curve25519-dalek" -version = "4.1.2" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "platforms", "rustc_version", "subtle", "zeroize", @@ -1997,6 +1996,19 @@ dependencies = [ "syn 2.0.66", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core 0.9.10", +] + [[package]] name = "data-encoding" version = "2.6.0" @@ -5307,12 +5319,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" -[[package]] -name = "platforms" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" - [[package]] name = "plotters" version = "0.3.6" @@ -6749,6 +6755,20 @@ dependencies = [ "syn 2.0.66", ] +[[package]] +name = "serial_test" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e56dd856803e253c8f298af3f4d7eb0ae5e23a737252cd90bb4f3b435033b2d" +dependencies = [ + "dashmap", + "futures", + "lazy_static", + "log", + "parking_lot 0.12.3", + "serial_test_derive 2.0.0", +] + [[package]] name = "serial_test" version = "3.1.1" @@ -6760,7 +6780,18 @@ dependencies = [ "once_cell", "parking_lot 0.12.3", "scc", - "serial_test_derive", + "serial_test_derive 3.1.1", +] + +[[package]] +name = "serial_test_derive" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", ] [[package]] @@ -7968,8 +7999,10 @@ dependencies = [ "hex", "protobuf", "rusb", + "serial_test 2.0.0", "thiserror", "tracing", + "tracing-subscriber", "unicode-normalization", ] diff --git a/Cargo.toml b/Cargo.toml index b7fc7d11e7..cbb8040b51 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,6 +74,7 @@ members = [ "wallet/wallet-rpc-daemon", # Wallet RPC daemon binary. "wallet/wallet-rpc-lib", # Wallet RPC definitions library. "wallet/wallet-test-node", # Node for wallet testing as a library. + "wallet/trezor-client", # Auto generated trezor client library from trezor firmware repo "wasm-wrappers", # WASM wrappers for various components. "wasm-wrappers/wasm-doc-gen", # WASM wrappers documentation generator. ] diff --git a/wallet/Cargo.toml b/wallet/Cargo.toml index db991201af..aa66779c05 100644 --- a/wallet/Cargo.toml +++ b/wallet/Cargo.toml @@ -25,7 +25,7 @@ utils-networking = { path = "../utils/networking" } utxo = { path = "../utxo" } wallet-storage = { path = "./storage" } wallet-types = { path = "./types" } -trezor-client = { path = "../../trezor-firmware/rust/trezor-client", features = ["bitcoin", "mintlayer"], optional = true } +trezor-client = { path = "./trezor-client", features = ["bitcoin", "mintlayer"], optional = true } bip39 = { workspace = true, default-features = false, features = ["std", "zeroize"] } hex.workspace = true diff --git a/wallet/src/key_chain/mod.rs b/wallet/src/key_chain/mod.rs index 777c9b5faa..a3e0dc4df0 100644 --- a/wallet/src/key_chain/mod.rs +++ b/wallet/src/key_chain/mod.rs @@ -35,6 +35,7 @@ mod with_purpose; pub use account_key_chain::AccountKeyChainImpl; use common::chain::classic_multisig::ClassicMultisigChallenge; use crypto::key::hdkd::u31::U31; +use crypto::key::PublicKey; use crypto::vrf::VRFKeyKind; pub use master_key_chain::MasterKeyChain; @@ -112,6 +113,15 @@ pub enum FoundPubKey { Standalone(AccountPublicKey), } +impl FoundPubKey { + pub fn into_public_key(self) -> PublicKey { + match self { + Self::Hierarchy(xpub) => xpub.into_public_key(), + Self::Standalone(acc_pk) => acc_pk.into_item_id(), + } + } +} + pub trait AccountKeyChains { fn find_public_key(&self, destination: &Destination) -> Option; diff --git a/wallet/src/signer/trezor_signer/mod.rs b/wallet/src/signer/trezor_signer/mod.rs index b2ce583467..69fb84fc33 100644 --- a/wallet/src/signer/trezor_signer/mod.rs +++ b/wallet/src/signer/trezor_signer/mod.rs @@ -23,6 +23,7 @@ use common::{ inputsig::{ arbitrary_message::ArbitraryMessageSignature, authorize_pubkey_spend::AuthorizedPublicKeySpend, + authorize_pubkeyhash_spend::AuthorizedPublicKeyHashSpend, standard_signature::StandardInputSignature, InputWitness, }, sighash::{sighashtype::SigHashType, signature_hash}, @@ -38,6 +39,7 @@ use crypto::key::{ use itertools::Itertools; use randomness::make_true_rng; use serialization::Encode; +#[allow(clippy::all)] use trezor_client::{ protos::{MintlayerTransferTxOutput, MintlayerUtxoTxInput}, Trezor, @@ -112,8 +114,32 @@ impl TrezorSigner { Some(InputWitness::NoSignature(None)), SignatureStatus::FullySigned, )), - Destination::PublicKey(_) | Destination::PublicKeyHash(_) => { + Destination::PublicKeyHash(_) => { if let Some(signature) = signature { + eprintln!("some signature pkh"); + let pk = + key_chain.find_public_key(destination).expect("found").into_public_key(); + eprintln!("pk {:?}", pk.encode()); + let mut signature = signature.clone(); + signature.insert(0, 0); + let sig = Signature::from_data(signature)?; + let sig = AuthorizedPublicKeyHashSpend::new(pk, sig); + let sig = InputWitness::Standard(StandardInputSignature::new( + sighash_type, + sig.encode(), + )); + + Ok((Some(sig), SignatureStatus::FullySigned)) + } else { + eprintln!("empty signature"); + Ok((None, SignatureStatus::NotSigned)) + } + } + Destination::PublicKey(_) => { + if let Some(signature) = signature { + eprintln!("some signature pk"); + let mut signature = signature.clone(); + signature.insert(0, 0); let sig = Signature::from_data(signature)?; let sig = AuthorizedPublicKeySpend::new(sig); let sig = InputWitness::Standard(StandardInputSignature::new( @@ -123,6 +149,7 @@ impl TrezorSigner { Ok((Some(sig), SignatureStatus::FullySigned)) } else { + eprintln!("empty signature"); Ok((None, SignatureStatus::NotSigned)) } } @@ -145,26 +172,21 @@ impl TrezorSigner { .tx() .outputs() .iter() - .map(|out| { - match out { - TxOutput::Transfer(value, dest) => { - match value { - OutputValue::Coin(amount) => { - let mut out_req = MintlayerTransferTxOutput::new(); - // TODO: change to u128 in trezor - out_req.set_amount(amount.into_atoms() as u64); - out_req.set_address( - Address::new(&self.chain_config, dest.clone()) - .expect("addressable") - .into_string(), - ); - out_req - } - _ => unimplemented!("support transfer of tokens in trezor"), - } + .map(|out| match out { + TxOutput::Transfer(value, dest) => match value { + OutputValue::Coin(amount) => { + let mut out_req = MintlayerTransferTxOutput::new(); + out_req.set_amount(amount.into_atoms().to_be_bytes().to_vec()); + out_req.set_address( + Address::new(&self.chain_config, dest.clone()) + .expect("addressable") + .into_string(), + ); + out_req } - _ => unimplemented!("support other output types in trezor"), - } + _ => unimplemented!("support transfer of tokens in trezor"), + }, + _ => unimplemented!("support other output types in trezor"), }) .collect(); outputs @@ -238,11 +260,13 @@ impl Signer for TrezorSigner { (Some(destination), Some(sig)) => { let sighash_type = SigHashType::try_from(SigHashType::ALL).expect("Should not fail"); + eprintln!("making sig for {i}"); let (sig, status) = self.make_signature(sig, destination, sighash_type, key_chain)?; Ok((sig, SignatureStatus::NotSigned, status)) } (Some(_) | None, None) | (None, Some(_)) => { + eprintln!("no signature!"); Ok((None, SignatureStatus::NotSigned, SignatureStatus::NotSigned)) } }, @@ -293,8 +317,7 @@ fn to_trezor_input_msgs(ptx: &PartiallySignedTransaction) -> Vec { - // TODO: - inp_req.set_amount(amount.into_atoms() as u64); + inp_req.set_amount(amount.into_atoms().to_be_bytes().to_vec()); } OutputValue::TokenV1(_, _) | OutputValue::TokenV0(_) => { unimplemented!("support for tokens") @@ -328,8 +351,7 @@ fn to_trezor_utxo_msgs( let mut out_req = MintlayerTransferTxOutput::new(); match value { OutputValue::Coin(amount) => { - // TODO: change to u128 in trezor - out_req.set_amount(amount.into_atoms() as u64); + out_req.set_amount(amount.into_atoms().to_be_bytes().to_vec()); } OutputValue::TokenV0(_) | OutputValue::TokenV1(_, _) => { unimplemented!("support tokens in trezor") diff --git a/wallet/src/signer/trezor_signer/tests.rs b/wallet/src/signer/trezor_signer/tests.rs index 2769a23b17..ff8fddf06d 100644 --- a/wallet/src/signer/trezor_signer/tests.rs +++ b/wallet/src/signer/trezor_signer/tests.rs @@ -22,10 +22,8 @@ use crate::{Account, SendRequest}; use common::chain::config::create_regtest; use common::chain::output_value::OutputValue; use common::chain::signature::verify_signature; -use common::chain::{GenBlock, Transaction, TxInput}; -use common::primitives::amount::UnsignedIntType; +use common::chain::{Transaction, TxInput}; use common::primitives::{Amount, Id, H256}; -use crypto::key::KeyKind; use randomness::{Rng, RngCore}; use rstest::rstest; use test_utils::random::{make_seedable_rng, Seed}; @@ -44,12 +42,12 @@ const MNEMONIC: &str = fn sign_transaction(#[case] seed: Seed) { let mut rng = make_seedable_rng(seed); - let config = Arc::new(create_regtest()); + let chain_config = Arc::new(create_regtest()); let db = Arc::new(Store::new(DefaultBackend::new_in_memory()).unwrap()); let mut db_tx = db.transaction_rw_unlocked(None).unwrap(); let master_key_chain = MasterKeyChain::new_from_mnemonic( - config.clone(), + chain_config.clone(), &mut db_tx, MNEMONIC, None, @@ -60,10 +58,11 @@ fn sign_transaction(#[case] seed: Seed) { let key_chain = master_key_chain .create_account_key_chain(&mut db_tx, DEFAULT_ACCOUNT_INDEX, LOOKAHEAD_SIZE) .unwrap(); - let mut account = Account::new(config.clone(), &mut db_tx, key_chain, None).unwrap(); + let mut account = Account::new(chain_config.clone(), &mut db_tx, key_chain, None).unwrap(); - let amounts: Vec = (0..(2 + rng.next_u32() % 5)) - .map(|_| Amount::from_atoms(rng.next_u32() as UnsignedIntType)) + let amounts: Vec = (0..1) //(0..(2 + rng.next_u32() % 5)) + // .map(|_| Amount::from_atoms(rng.next_u32() as UnsignedIntType)) + .map(|_| Amount::from_atoms(1)) .collect(); let total_amount = amounts.iter().fold(Amount::ZERO, |acc, a| acc.add(*a).unwrap()); @@ -87,11 +86,11 @@ fn sign_transaction(#[case] seed: Seed) { let inputs: Vec = utxos .iter() .map(|_txo| { - let source_id = if rng.gen_bool(0.5) { - Id::::new(H256::random_using(&mut rng)).into() - } else { - Id::::new(H256::random_using(&mut rng)).into() - }; + // let source_id = if rng.gen_bool(0.5) { + let source_id = Id::::new(H256::random_using(&mut rng)).into(); + // } else { + // Id::::new(H256::random_using(&mut rng)).into() + // }; TxInput::from_utxo(source_id, rng.next_u32()) }) .collect(); @@ -105,13 +104,13 @@ fn sign_transaction(#[case] seed: Seed) { .fold(Amount::ZERO, |acc, a| acc.add(*a).unwrap()); let _fee_amount = total_amount.sub(outputs_amounts_sum).unwrap(); - let (_dest_prv, dest_pub) = PrivateKey::new_from_rng(&mut rng, KeyKind::Secp256k1Schnorr); + // let (_dest_prv, dest_pub) = PrivateKey::new_from_rng(&mut rng, KeyKind::Secp256k1Schnorr); let outputs = vec![ - TxOutput::Transfer( - OutputValue::Coin(dest_amount), - Destination::PublicKey(dest_pub), - ), + // TxOutput::Transfer( + // OutputValue::Coin(dest_amount), + // Destination::PublicKey(dest_pub), + // ), // TxOutput::LockThenTransfer( // OutputValue::Coin(lock_amount), // Destination::AnyoneCanSpend, @@ -119,12 +118,12 @@ fn sign_transaction(#[case] seed: Seed) { // ), // TxOutput::Burn(OutputValue::Coin(burn_amount)), TxOutput::Transfer( - OutputValue::Coin(Amount::from_atoms(100)), + OutputValue::Coin(Amount::from_atoms(100_000_000_000)), account.get_new_address(&mut db_tx, Change).unwrap().1.into_object(), ), ]; - let tx = Transaction::new(0, inputs, outputs).unwrap(); + let tx = Transaction::new(0, inputs.clone(), outputs).unwrap(); let req = SendRequest::from_transaction(tx, utxos.clone(), &|_| None).unwrap(); let ptx = req.into_partially_signed_tx().unwrap(); @@ -134,21 +133,22 @@ fn sign_transaction(#[case] seed: Seed) { let client = devices.pop().unwrap().connect().unwrap(); let mut signer = TrezorSigner::new( - config.clone(), + chain_config.clone(), DEFAULT_ACCOUNT_INDEX, Rc::new(RefCell::new(client)), ); let (ptx, _, _) = signer.sign_tx(ptx, account.key_chain(), &db_tx).unwrap(); - assert!(ptx.is_fully_signed(&config)); + eprintln!("num inputs in tx: {}", inputs.len()); + assert!(ptx.is_fully_signed(&chain_config)); - let sig_tx = ptx.into_signed_tx(&config).unwrap(); + let sig_tx = ptx.into_signed_tx(&chain_config).unwrap(); let utxos_ref = utxos.iter().map(Some).collect::>(); for i in 0..sig_tx.inputs().len() { let destination = crate::get_tx_output_destination(utxos_ref[i].unwrap(), &|_| None).unwrap(); - verify_signature(&config, &destination, &sig_tx, &utxos_ref, i).unwrap(); + verify_signature(&chain_config, &destination, &sig_tx, &utxos_ref, i).unwrap(); } } diff --git a/wallet/trezor-client/.gitignore b/wallet/trezor-client/.gitignore new file mode 100644 index 0000000000..2f7896d1d1 --- /dev/null +++ b/wallet/trezor-client/.gitignore @@ -0,0 +1 @@ +target/ diff --git a/wallet/trezor-client/Cargo.toml b/wallet/trezor-client/Cargo.toml new file mode 100644 index 0000000000..cf93e75d6f --- /dev/null +++ b/wallet/trezor-client/Cargo.toml @@ -0,0 +1,77 @@ +[package] +name = "trezor-client" +# license.workspace = true +# version.workspace = true +# edition.workspace = true +# rust-version.workspace = true +version = "0.1.3" +authors = [ + "Piyush Kumar ", + "joshieDo ", + "DaniPopes <57450786+DaniPopes@users.noreply.github.com>", + "Roman Zeyde ", + "Steven Roose ", +] +license = "CC0-1.0" +homepage = "https://github.com/trezor/trezor-firmware/tree/master/rust/trezor-client" +repository = "https://github.com/trezor/trezor-firmware" +description = "Client library for interfacing with Trezor hardware wallet devices" +keywords = ["ethereum", "bitcoin", "trezor", "wallet"] +categories = ["api-bindings", "cryptography::cryptocurrencies"] +readme = "README.md" +exclude = [".github/", "examples/", "scripts/", ".clippy.toml", ".gitignore", "rustfmt.toml"] +edition = "2021" +rust-version = "1.60" + +# [package.metadata.docs.rs] +# all-features = true +# rustdoc-args = ["--cfg", "docsrs"] + +# [workspace] +# members = ["build", "."] + +# [workspace.dependencies] +# # important: keep in sync +# protobuf = "=3.3.0" +# protobuf-codegen = "=3.3.0" + +[dependencies] +# important: keep in sync +protobuf = "=3.3.0" +# protobuf-codegen = "=3.3.0" +byteorder = "1.4" +rusb = "0.9" + +hex = { version = "0.4", default-features = false, features = ["std"] } +thiserror = "1.0" +tracing = "0.1" + +# bitcoin +bitcoin = { version = "0.31", optional = true } +unicode-normalization = { version = "0.1.22", optional = true } + +[dev-dependencies] +tracing-subscriber = "0.3" +serial_test = "2.0.0" + +[features] +default = ["bitcoin", "ethereum", "solana", "mintlayer"] +no_clippy = [] + + +# Client implementations +bitcoin = ["dep:bitcoin", "unicode-normalization"] +ethereum = [] + +# Just bindings to the Trezor protobufs +binance = [] +cardano = [] +eos = [] +monero = [] +nem = [] +ripple = [] +solana = [] +stellar = [] +tezos = [] +webauthn = [] +mintlayer = [] diff --git a/wallet/trezor-client/LICENSE b/wallet/trezor-client/LICENSE new file mode 100644 index 0000000000..6ca207ef00 --- /dev/null +++ b/wallet/trezor-client/LICENSE @@ -0,0 +1,122 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. + diff --git a/wallet/trezor-client/README.md b/wallet/trezor-client/README.md new file mode 100644 index 0000000000..0dc9820ade --- /dev/null +++ b/wallet/trezor-client/README.md @@ -0,0 +1,40 @@ +# trezor-client + +[![Downloads][downloads-badge]][crates-io] +[![License][license-badge]][license-url] +[![CI Status][actions-badge]][actions-url] + +A fork of a [fork](https://github.com/romanz/rust-trezor-api) of a [library](https://github.com/stevenroose/rust-trezor-api) that provides a way to communicate with a Trezor T device from a Rust project. + +Previous iterations provided implementations for Bitcoin only. **This crate also provides an Ethereum interface**, mainly for use in [ethers-rs](https://github.com/gakonst/ethers-rs/). + +## Requirements + +**MSRV: 1.60** + +See the [Trezor guide](https://trezor.io/learn/a/os-requirements-for-trezor) on how to install and use the Trezor Suite app. + +Last tested with firmware v2.4.2. + +## Examples / Tests + +`cargo run --example features` + +## Features + +- `bitcoin` and `ethereum`: client implementation and full support; +- `cardano`, `monero`, `nem`, `ripple`, `stellar` and `tezos`: only protobuf bindings. + +## Credits + +- [Trezor](https://github.com/trezor/trezor-firmware) +- [joshieDo](https://github.com/joshieDo) +- [Piyush Kumar](https://github.com/wszdexdrf) +- [stevenroose](https://github.com/stevenroose) +- [romanz](https://github.com/romanz) +- [DaniPopes](https://github.com/DaniPopes) + +[downloads-badge]: https://img.shields.io/crates/d/trezor-client?style=for-the-badge&logo=rust +[crates-io]: https://crates.io/crates/trezor-client +[license-badge]: https://img.shields.io/badge/license-CC0--1.0-blue.svg?style=for-the-badge +[license-url]: https://github.com/trezor/trezor-firmware/blob/master/rust/trezor-client/LICENSE diff --git a/wallet/trezor-client/build/Cargo.toml b/wallet/trezor-client/build/Cargo.toml new file mode 100644 index 0000000000..384591b7bd --- /dev/null +++ b/wallet/trezor-client/build/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "trezor-client-build" +version = "0.0.0" +description = "Builds Trezor protobuf bindings for trezor-client" +publish = false + +[dependencies] +protobuf-codegen.workspace = true diff --git a/wallet/trezor-client/build/README.md b/wallet/trezor-client/build/README.md new file mode 100644 index 0000000000..d78f14296e --- /dev/null +++ b/wallet/trezor-client/build/README.md @@ -0,0 +1,7 @@ +# trezor-client-build + +Simple build script for [`trezor-client`](../). +Builds the Rust bindings for the [Trezor protobufs](../../../common/protob/). + +This crate is separate from the main crate to avoid dependencies on the +protobuf compiler (`protoc`) and the `protobuf-codegen` crate in `trezor-client`. diff --git a/wallet/trezor-client/build/src/main.rs b/wallet/trezor-client/build/src/main.rs new file mode 100644 index 0000000000..752edf14e6 --- /dev/null +++ b/wallet/trezor-client/build/src/main.rs @@ -0,0 +1,34 @@ +use std::{ + fs, + path::{Path, PathBuf}, +}; + +fn main() { + let proto_path = concat!(env!("CARGO_MANIFEST_DIR"), "/../../../common/protob"); + let proto_dir = Path::new(proto_path).canonicalize().unwrap(); + let protos: Vec = fs::read_dir(&proto_dir) + .unwrap() + .filter_map(|entry| { + let entry = entry.unwrap(); + let path = entry.path(); + if path.is_file() && path.extension().map_or(false, |ext| ext == "proto") { + Some(path) + } else { + None + } + }) + .collect(); + + let out_path = std::env::args().skip(1).next().expect("No output directory given"); + let out_dir = PathBuf::from(out_path); + fs::create_dir_all(&out_dir).expect("Failed to create output directory"); + protobuf_codegen::Codegen::new() + .protoc() + .includes(&[proto_dir]) + .inputs(protos) + .out_dir(&out_dir) + .run_from_script(); + + // Remove mod.rs because we want to feature-gate some modules manually + fs::remove_file(out_dir.join("mod.rs")).expect("Failed to remove mod.rs"); +} diff --git a/wallet/trezor-client/examples/change_pin.rs b/wallet/trezor-client/examples/change_pin.rs new file mode 100644 index 0000000000..59ed37257c --- /dev/null +++ b/wallet/trezor-client/examples/change_pin.rs @@ -0,0 +1,31 @@ +use std::io; + +fn read_pin() -> String { + println!("Enter PIN"); + let mut pin = String::new(); + if io::stdin().read_line(&mut pin).unwrap() != 5 { + println!("must enter pin, received: {}", pin); + } + // trim newline + pin[..4].to_owned() +} + +fn do_main() -> Result<(), trezor_client::Error> { + // init with debugging + let mut trezor = trezor_client::unique(true)?; + trezor.init_device(None)?; + + let old_pin = trezor.change_pin(false)?.button_request()?.ack()?.pin_matrix_request()?; + + let new_pin1 = old_pin.ack_pin(read_pin())?.pin_matrix_request()?; + + let new_pin2 = new_pin1.ack_pin(read_pin())?.pin_matrix_request()?; + + new_pin2.ack_pin(read_pin())?.ok()?; + + Ok(()) +} + +fn main() { + do_main().unwrap() +} diff --git a/wallet/trezor-client/examples/features.rs b/wallet/trezor-client/examples/features.rs new file mode 100644 index 0000000000..00bc185cc6 --- /dev/null +++ b/wallet/trezor-client/examples/features.rs @@ -0,0 +1,101 @@ +use std::io; + +fn convert_path_from_str(derivation: &str) -> Vec { + let derivation = derivation.to_string(); + let elements = derivation.split('/').skip(1).collect::>(); + + let mut path = vec![]; + for derivation_index in elements { + let hardened = derivation_index.contains('\''); + let mut index = derivation_index.replace('\'', "").parse::().unwrap(); + if hardened { + index |= 0x80000000; + } + path.push(index); + } + + path +} + +fn device_selector() -> trezor_client::Trezor { + let mut devices = trezor_client::find_devices(false); + + if devices.is_empty() { + panic!("No devices connected"); + } else if devices.len() == 1 { + devices.remove(0).connect().expect("connection error") + } else { + println!("Choose device:"); + for (i, dev) in devices.iter().enumerate() { + println!("{}: {}", i + 1, dev); + } + println!("Enter device number: "); + let mut inp = String::new(); + io::stdin().read_line(&mut inp).expect("stdin error"); + let idx: usize = inp[..inp.len() - 1].parse().expect("invalid number"); + assert!(idx < devices.len(), "Index out of range"); + devices.remove(idx).connect().unwrap() + } +} + +fn do_main() -> Result<(), trezor_client::Error> { + // init with debugging + tracing_subscriber::fmt().with_max_level(tracing::Level::TRACE).init(); + + let mut trezor = device_selector(); + trezor.init_device(None)?; + let f = trezor.features().expect("no features").clone(); + + println!("Features:"); + println!("vendor: {}", f.vendor()); + println!( + "version: {}.{}.{}", + f.major_version(), + f.minor_version(), + f.patch_version() + ); + println!("device id: {}", f.device_id()); + println!("label: {}", f.label()); + println!("is initialized: {}", f.initialized()); + println!("pin protection: {}", f.pin_protection()); + println!("passphrase protection: {}", f.passphrase_protection()); + println!( + "{:?}", + trezor.ethereum_get_address(convert_path_from_str("m/44'/60'/1'/0/0")).unwrap() + ); + drop(trezor); + + let mut trezor2 = device_selector(); + + trezor2.init_device(Some(f.session_id().to_vec()))?; + + println!( + "{:?}", + trezor2.ethereum_get_address(convert_path_from_str("m/44'/60'/1'/0/0")).unwrap() + ); + //optional bool bootloader_mode = 5; // is device in bootloader mode? + //optional string language = 9; // device language + //optional bytes revision = 13; // SCM revision of firmware + //optional bytes bootloader_hash = 14; // hash of the bootloader + //optional bool imported = 15; // was storage imported from an external source? + //optional bool pin_cached = 16; // is PIN already cached in session? + //optional bool passphrase_cached = 17; // is passphrase already cached in session? + //optional bool firmware_present = 18; // is valid firmware loaded? + //optional bool needs_backup = 19; // does storage need backup? (equals to + // Storage.needs_backup) optional uint32 flags = 20; // device flags (equals + // to Storage.flags) optional string model = 21; // device hardware model + //optional uint32 fw_major = 22; // reported firmware version if in bootloader + // mode optional uint32 fw_minor = 23; // reported firmware version if in + // bootloader mode optional uint32 fw_patch = 24; // reported firmware version + // if in bootloader mode optional string fw_vendor = 25; // reported firmware + // vendor if in bootloader mode optional bytes fw_vendor_keys = 26; // reported + // firmware vendor keys (their hash) optional bool unfinished_backup = 27; // report + // unfinished backup (equals to Storage.unfinished_backup) optional bool no_backup = 28; + // // report no backup (equals to Storage.no_backup) + + Ok(()) +} + +fn main() { + do_main().unwrap() +} diff --git a/wallet/trezor-client/examples/find.rs b/wallet/trezor-client/examples/find.rs new file mode 100644 index 0000000000..b538fa95da --- /dev/null +++ b/wallet/trezor-client/examples/find.rs @@ -0,0 +1,11 @@ +fn main() { + let trezors = trezor_client::find_devices(false); + println!("Found {} devices: ", trezors.len()); + for t in trezors.into_iter() { + println!("- {}", t); + { + let mut client = t.connect().unwrap(); + println!("{:?}", client.initialize(None).unwrap()); + } + } +} diff --git a/wallet/trezor-client/examples/interaction.rs b/wallet/trezor-client/examples/interaction.rs new file mode 100644 index 0000000000..9931ecc7d7 --- /dev/null +++ b/wallet/trezor-client/examples/interaction.rs @@ -0,0 +1,57 @@ +use std::io; + +use bitcoin::{bip32, network::Network, Address}; +use trezor_client::{Error, TrezorMessage, TrezorResponse}; + +fn handle_interaction(resp: TrezorResponse) -> Result { + match resp { + TrezorResponse::Ok(res) => Ok(res), + TrezorResponse::Failure(_) => resp.ok(), // assering ok() returns the failure error + TrezorResponse::ButtonRequest(req) => handle_interaction(req.ack()?), + TrezorResponse::PinMatrixRequest(req) => { + println!("Enter PIN"); + let mut pin = String::new(); + if io::stdin().read_line(&mut pin).unwrap() != 5 { + println!("must enter pin, received: {}", pin); + } + // trim newline + handle_interaction(req.ack_pin(pin[..4].to_owned())?) + } + TrezorResponse::PassphraseRequest(req) => { + println!("Enter passphrase"); + let mut pass = String::new(); + io::stdin().read_line(&mut pass).unwrap(); + // trim newline + handle_interaction(req.ack_passphrase(pass[..pass.len() - 1].to_owned())?) + } + } +} + +fn do_main() -> Result<(), trezor_client::Error> { + // init with debugging + let mut trezor = trezor_client::unique(true)?; + trezor.init_device(None)?; + + let xpub = handle_interaction( + trezor.get_public_key( + &vec![ + bip32::ChildNumber::from_hardened_idx(0).unwrap(), + bip32::ChildNumber::from_hardened_idx(0).unwrap(), + bip32::ChildNumber::from_hardened_idx(0).unwrap(), + ] + .into(), + trezor_client::protos::InputScriptType::SPENDADDRESS, + Network::Testnet, + true, + )?, + )?; + println!("{}", xpub); + println!("{:?}", xpub); + println!("{}", Address::p2pkh(&xpub.to_pub(), Network::Testnet)); + + Ok(()) +} + +fn main() { + do_main().unwrap() +} diff --git a/wallet/trezor-client/examples/sign_message.rs b/wallet/trezor-client/examples/sign_message.rs new file mode 100644 index 0000000000..8e373685b3 --- /dev/null +++ b/wallet/trezor-client/examples/sign_message.rs @@ -0,0 +1,40 @@ +use std::str::FromStr; + +use bitcoin::{bip32::DerivationPath, network::Network, Address}; +use trezor_client::{client::common::handle_interaction, InputScriptType}; + +fn main() { + tracing_subscriber::fmt().with_max_level(tracing::Level::TRACE).init(); + + // init with debugging + let mut trezor = trezor_client::unique(false).unwrap(); + trezor.init_device(None).unwrap(); + + let pubkey = handle_interaction( + trezor + .get_public_key( + &DerivationPath::from_str("m/44h/1h/0h/0/0").unwrap(), + trezor_client::protos::InputScriptType::SPENDADDRESS, + Network::Testnet, + true, + ) + .unwrap(), + ) + .unwrap(); + let addr = Address::p2pkh(&pubkey.to_pub(), Network::Testnet); + println!("address: {}", addr); + + let (addr, signature) = handle_interaction( + trezor + .sign_message( + "regel het".to_owned(), + &DerivationPath::from_str("m/44h/1h/0h/0/0").unwrap(), + InputScriptType::SPENDADDRESS, + Network::Testnet, + ) + .unwrap(), + ) + .unwrap(); + println!("Addr from device: {}", addr); + println!("Signature: {:?}", signature); +} diff --git a/wallet/trezor-client/examples/sign_tx.rs b/wallet/trezor-client/examples/sign_tx.rs new file mode 100644 index 0000000000..69aa3ed3e7 --- /dev/null +++ b/wallet/trezor-client/examples/sign_tx.rs @@ -0,0 +1,119 @@ +use std::io::{self, Write}; + +use bitcoin::{ + bip32, blockdata::script::Builder, consensus::encode::Decodable, network::Network, psbt, + transaction::Version, Address, Amount, Sequence, Transaction, TxIn, TxOut, +}; + +use trezor_client::{Error, SignTxProgress, TrezorMessage, TrezorResponse}; + +fn handle_interaction(resp: TrezorResponse) -> T { + match resp { + TrezorResponse::Ok(res) => res, + // assering ok() returns the failure error + TrezorResponse::Failure(_) => resp.ok().unwrap(), + TrezorResponse::ButtonRequest(req) => handle_interaction(req.ack().unwrap()), + TrezorResponse::PinMatrixRequest(req) => { + println!("Enter PIN"); + let mut pin = String::new(); + if io::stdin().read_line(&mut pin).unwrap() != 5 { + println!("must enter pin, received: {}", pin); + } + // trim newline + handle_interaction(req.ack_pin(pin[..4].to_owned()).unwrap()) + } + TrezorResponse::PassphraseRequest(req) => { + println!("Enter passphrase"); + let mut pass = String::new(); + io::stdin().read_line(&mut pass).unwrap(); + // trim newline + handle_interaction(req.ack_passphrase(pass[..pass.len() - 1].to_owned()).unwrap()) + } + } +} + +fn tx_progress( + psbt: &mut psbt::Psbt, + progress: SignTxProgress, + raw_tx: &mut Vec, +) -> Result<(), Error> { + if let Some(part) = progress.get_serialized_tx_part() { + raw_tx.write_all(part).unwrap(); + } + + if !progress.finished() { + let progress = handle_interaction(progress.ack_psbt(psbt, Network::Testnet).unwrap()); + tx_progress(psbt, progress, raw_tx) + } else { + Ok(()) + } +} + +fn main() { + tracing_subscriber::fmt().with_max_level(tracing::Level::TRACE).init(); + + // init with debugging + let mut trezor = trezor_client::unique(false).unwrap(); + trezor.init_device(None).unwrap(); + + let pubkey = handle_interaction( + trezor + .get_public_key( + &vec![ + bip32::ChildNumber::from_hardened_idx(0).unwrap(), + bip32::ChildNumber::from_hardened_idx(0).unwrap(), + bip32::ChildNumber::from_hardened_idx(1).unwrap(), + ] + .into(), + trezor_client::protos::InputScriptType::SPENDADDRESS, + Network::Testnet, + true, + ) + .unwrap(), + ); + let addr = Address::p2pkh(&pubkey.to_pub(), Network::Testnet); + println!("address: {}", addr); + + let mut psbt = psbt::Psbt { + unsigned_tx: Transaction { + version: Version::ONE, + lock_time: bitcoin::absolute::LockTime::from_consensus(0), + input: vec![TxIn { + previous_output: "c5bdb27907b78ce03f94e4bf2e94f7a39697b9074b79470019e3dbc76a10ecb6:0".parse().unwrap(), + sequence: Sequence(0xffffffff), + script_sig: Builder::new().into_script(), + witness: Default::default(), + }], + output: vec![TxOut { + value: Amount::from_sat(14245301), + script_pubkey: addr.script_pubkey(), + }], + }, + inputs: vec![psbt::Input { + non_witness_utxo: Some(Transaction::consensus_decode(&mut &hex::decode("020000000001011eb5a3e65946f88b00d67b321e5fd980b32a2316fb1fc9b712baa6a1033a04e30100000017160014f0f81ee77d552b4c81497451d1abf5c22ce8e352feffffff02b55dd900000000001976a9142c3cf5686f47c1de9cc90b4255cc2a1ef8c01b3188acfb0391ae6800000017a914a3a79e37ad366d9bf9471b28a9a8f64b50de0c968702483045022100c0aa7b262967fc2803c8a9f38f26682edba7cafb7d4870ebdc116040ad5338b502205dfebd08e993af2e6aa3118a438ad70ed9f6e09bc6abfd21f8f2957af936bc070121031f4e69fcf110bb31f019321834c0948b5487f2782489f370f66dc20f7ac767ca8bf81500").unwrap()[..]).unwrap()), + ..Default::default() + }], + outputs: vec![ + psbt::Output { + ..Default::default() + }, + ], + proprietary: Default::default(), + unknown: Default::default(), + version: 0, + xpub: Default::default(), + }; + + println!("psbt before: {:?}", psbt); + println!("unsigned txid: {}", psbt.unsigned_tx.txid()); + println!( + "unsigned tx: {}", + hex::encode(bitcoin::consensus::encode::serialize(&psbt.unsigned_tx)) + ); + + let mut raw_tx = Vec::new(); + let progress = handle_interaction(trezor.sign_tx(&psbt, Network::Testnet).unwrap()); + tx_progress(&mut psbt, progress, &mut raw_tx).unwrap(); + + println!("signed tx: {}", hex::encode(raw_tx)); +} diff --git a/wallet/trezor-client/examples/solana.rs b/wallet/trezor-client/examples/solana.rs new file mode 100644 index 0000000000..9f943c082b --- /dev/null +++ b/wallet/trezor-client/examples/solana.rs @@ -0,0 +1,17 @@ +use std::str::FromStr; + +use bitcoin::bip32::DerivationPath; +use trezor_client::utils::convert_path; + +fn do_main() -> Result<(), trezor_client::Error> { + let mut trezor = trezor_client::unique(false)?; + trezor.init_device(None)?; + let path = DerivationPath::from_str("m/44'/501'/0'/0'").expect("Hardended Derivation Path"); + let solana_address = trezor.solana_get_address(convert_path(&path))?; + println!("solana address: {:?}", solana_address); + Ok(()) +} + +fn main() { + do_main().unwrap() +} diff --git a/wallet/trezor-client/scripts/build_messages b/wallet/trezor-client/scripts/build_messages new file mode 100755 index 0000000000..8e0da67d66 --- /dev/null +++ b/wallet/trezor-client/scripts/build_messages @@ -0,0 +1,110 @@ +#!/usr/bin/env python3 + +# Generates the `trezor_message_impl!` macro calls for the `src/messages/mod.rs` file. + +from os import path + +# Path to the `messages.proto` file +PATH = path.abspath(path.join(__file__, "../../../../common/protob/messages.proto")) +# Prefix of the enum variants +PREFIX = "MessageType_" +# Mapping of block name to feature name +FEATURES = { + # no features + "Management": "default", + "Bootloader": "default", + "Crypto": "default", + "Debug": "default", + # + "Bitcoin": "bitcoin", + "Ethereum": "ethereum", + # + "Binance": "binance", + "Cardano": "cardano", + "EOS": "eos", + "Monero": "monero", + "NEM": "nem", + "Ripple": "ripple", + "Solana": "solana", + "Stellar": "stellar", + "Tezos": "tezos", + "WebAuthn": "webauthn", + "Mintlayer": "mintlayer", +} +MACRO = "trezor_message_impl" +INDENT = " " + + +def main(): + blocks = get_blocks() + features = {} + defaults = [] + for block, variants in blocks.items(): + f = FEATURES.get(block) + if not f or f == "default": + defaults.extend(variants) + else: + vs = features.get(f) + if vs: + vs.extend(variants) + else: + features[f] = variants + + items = list(features.items()) + items.sort() + + out = write_block(defaults) + for feature, variants in items: + if variants and feature: + out += "\n" + out += write_block(variants, feature) + print(out.strip()) + + +# Parse feature blocks based on comments in the `messages.proto` file +def get_blocks() -> dict[str, list[str]]: + blocks = {} + current_block = "" + with open(PATH, "r") as file: + in_enum = False + in_block_comment = False + for line in file: + line = line.strip() + + if "/*" in line: + in_block_comment = True + if "*/" in line: + in_block_comment = False + if in_block_comment: + continue + + if line.startswith("enum MessageType {"): + in_enum = True + continue + if in_enum: + if line == "}": + break + if line.startswith("//"): + comment = line.removeprefix("//").strip() + if comment[0].isupper() and len(comment.split(" ")) == 1: + current_block = comment + blocks[current_block] = [] + elif line.startswith(PREFIX): + blocks[current_block].append(line.split(" ")[0]) + return blocks + + +# Writes a macro block +def write_block(variants: list[str], feature: str = "") -> str: + s = "" + if feature: + s += f'#[cfg(feature = "{feature}")]\n' + s += f"{MACRO}! {{\n" + for variant in variants: + s += f"{INDENT}{variant.removeprefix(PREFIX)} => {variant},\n" + s += "}\n" + return s + + +if __name__ == "__main__": + main() diff --git a/wallet/trezor-client/scripts/build_protos b/wallet/trezor-client/scripts/build_protos new file mode 100755 index 0000000000..b7a4a97a79 --- /dev/null +++ b/wallet/trezor-client/scripts/build_protos @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# Generates src/protos/generated and src/messages/generated.rs + +crate_root="$(dirname "$(dirname "$(realpath "$0")")")" + +protos="$crate_root/src/protos/generated" +messages="$crate_root/src/messages/generated.rs" + +if [ "$1" = "--check" ]; then + protos_out=$(mktemp -d) + messages_out=$(mktemp) +else + protos_out=$protos + messages_out=$messages +fi + +cargo run --manifest-path "$crate_root/build/Cargo.toml" -- "$protos_out" + +"$crate_root/scripts/build_messages" > "$messages_out" +rustfmt "$messages_out" + +if [ "$1" = "--check" ]; then + set -e + diff -ur "$protos_out" "$protos" + diff -ur "$messages_out" "$messages" +fi diff --git a/wallet/trezor-client/src/client/bitcoin.rs b/wallet/trezor-client/src/client/bitcoin.rs new file mode 100644 index 0000000000..ed3b204a30 --- /dev/null +++ b/wallet/trezor-client/src/client/bitcoin.rs @@ -0,0 +1,95 @@ +use super::{Trezor, TrezorResponse}; +use crate::{error::Result, flows::sign_tx::SignTxProgress, protos, utils}; +use bitcoin::{ + address::NetworkUnchecked, bip32, network::Network, psbt, + secp256k1::ecdsa::RecoverableSignature, Address, +}; + +pub use crate::protos::InputScriptType; + +impl Trezor { + pub fn get_public_key( + &mut self, + path: &bip32::DerivationPath, + script_type: InputScriptType, + network: Network, + show_display: bool, + ) -> Result> { + let mut req = protos::GetPublicKey::new(); + req.address_n = utils::convert_path(path); + req.set_show_display(show_display); + req.set_coin_name(utils::coin_name(network)?); + req.set_script_type(script_type); + self.call(req, Box::new(|_, m| Ok(m.xpub().parse()?))) + } + + //TODO(stevenroose) multisig + pub fn get_address( + &mut self, + path: &bip32::DerivationPath, + script_type: InputScriptType, + network: Network, + show_display: bool, + ) -> Result> { + let mut req = protos::GetAddress::new(); + req.address_n = utils::convert_path(path); + req.set_coin_name(utils::coin_name(network)?); + req.set_show_display(show_display); + req.set_script_type(script_type); + self.call(req, Box::new(|_, m| parse_address(m.address()))) + } + + pub fn sign_tx( + &mut self, + psbt: &psbt::Psbt, + network: Network, + ) -> Result, protos::TxRequest>> { + let tx = &psbt.unsigned_tx; + let mut req = protos::SignTx::new(); + req.set_inputs_count(tx.input.len() as u32); + req.set_outputs_count(tx.output.len() as u32); + req.set_coin_name(utils::coin_name(network)?); + req.set_version(tx.version.0 as u32); + req.set_lock_time(tx.lock_time.to_consensus_u32()); + self.call(req, Box::new(|c, m| Ok(SignTxProgress::new(c, m)))) + } + + pub fn sign_message( + &mut self, + message: String, + path: &bip32::DerivationPath, + script_type: InputScriptType, + network: Network, + ) -> Result> { + let mut req = protos::SignMessage::new(); + req.address_n = utils::convert_path(path); + // Normalize to Unicode NFC. + let msg_bytes = nfc_normalize(&message).into_bytes(); + req.set_message(msg_bytes); + req.set_coin_name(utils::coin_name(network)?); + req.set_script_type(script_type); + self.call( + req, + Box::new(|_, m| { + let address = parse_address(m.address())?; + let signature = utils::parse_recoverable_signature(m.signature())?; + Ok((address, signature)) + }), + ) + } +} + +fn parse_address(s: &str) -> Result
{ + let address = s.parse::>()?; + Ok(address.assume_checked()) +} + +// Modified from: +// https://github.com/rust-lang/rust/blob/2a8221dbdfd180a2d56d4b0089f4f3952d8c2bcd/compiler/rustc_parse/src/lexer/mod.rs#LL754C5-L754C5 +fn nfc_normalize(string: &str) -> String { + use unicode_normalization::{is_nfc_quick, IsNormalized, UnicodeNormalization}; + match is_nfc_quick(string.chars()) { + IsNormalized::Yes => string.to_string(), + _ => string.chars().nfc().collect::(), + } +} diff --git a/wallet/trezor-client/src/client/common.rs b/wallet/trezor-client/src/client/common.rs new file mode 100644 index 0000000000..9da4eb4025 --- /dev/null +++ b/wallet/trezor-client/src/client/common.rs @@ -0,0 +1,247 @@ +use crate::{ + error::{Error, Result}, + messages::TrezorMessage, + protos, Trezor, +}; +use std::fmt; + +// Some types with raw protos that we use in the public interface so they have to be exported. +pub use protos::{ + button_request::ButtonRequestType, pin_matrix_request::PinMatrixRequestType, Features, +}; + +#[cfg(feature = "bitcoin")] +pub use protos::InputScriptType; + +/// The different options for the number of words in a seed phrase. +pub enum WordCount { + W12 = 12, + W18 = 18, + W24 = 24, +} + +/// The different types of user interactions the Trezor device can request. +#[derive(PartialEq, Eq, Clone, Debug)] +pub enum InteractionType { + Button, + PinMatrix, + Passphrase, + PassphraseState, +} + +//TODO(stevenroose) should this be FnOnce and put in an FnBox? +/// Function to be passed to the `Trezor.call` method to process the Trezor response message into a +/// general-purpose type. +pub type ResultHandler<'a, T, R> = dyn Fn(&'a mut Trezor, R) -> Result; + +/// A button request message sent by the device. +pub struct ButtonRequest<'a, T, R: TrezorMessage> { + pub message: protos::ButtonRequest, + pub client: &'a mut Trezor, + pub result_handler: Box>, +} + +impl<'a, T, R: TrezorMessage> fmt::Debug for ButtonRequest<'a, T, R> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Debug::fmt(&self.message, f) + } +} + +impl<'a, T, R: TrezorMessage> ButtonRequest<'a, T, R> { + /// The type of button request. + pub fn request_type(&self) -> ButtonRequestType { + self.message.code() + } + + /// Ack the request and get the next message from the device. + pub fn ack(self) -> Result> { + let req = protos::ButtonAck::new(); + self.client.call(req, self.result_handler) + } +} + +/// A PIN matrix request message sent by the device. +pub struct PinMatrixRequest<'a, T, R: TrezorMessage> { + pub message: protos::PinMatrixRequest, + pub client: &'a mut Trezor, + pub result_handler: Box>, +} + +impl<'a, T, R: TrezorMessage> fmt::Debug for PinMatrixRequest<'a, T, R> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Debug::fmt(&self.message, f) + } +} + +impl<'a, T, R: TrezorMessage> PinMatrixRequest<'a, T, R> { + /// The type of PIN matrix request. + pub fn request_type(&self) -> PinMatrixRequestType { + self.message.type_() + } + + /// Ack the request with a PIN and get the next message from the device. + pub fn ack_pin(self, pin: String) -> Result> { + let mut req = protos::PinMatrixAck::new(); + req.set_pin(pin); + self.client.call(req, self.result_handler) + } +} + +/// A passphrase request message sent by the device. +pub struct PassphraseRequest<'a, T, R: TrezorMessage> { + pub message: protos::PassphraseRequest, + pub client: &'a mut Trezor, + pub result_handler: Box>, +} + +impl<'a, T, R: TrezorMessage> fmt::Debug for PassphraseRequest<'a, T, R> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Debug::fmt(&self.message, f) + } +} + +impl<'a, T, R: TrezorMessage> PassphraseRequest<'a, T, R> { + /// Check whether the use is supposed to enter the passphrase on the device or not. + pub fn on_device(&self) -> bool { + self.message._on_device() + } + + /// Ack the request with a passphrase and get the next message from the device. + pub fn ack_passphrase(self, passphrase: String) -> Result> { + let mut req = protos::PassphraseAck::new(); + req.set_passphrase(passphrase); + self.client.call(req, self.result_handler) + } + + /// Ack the request without a passphrase to let the user enter it on the device + /// and get the next message from the device. + pub fn ack(self, on_device: bool) -> Result> { + let mut req = protos::PassphraseAck::new(); + if on_device { + req.set_on_device(on_device); + } + self.client.call(req, self.result_handler) + } +} + +/// A response from a Trezor device. On every message exchange, instead of the expected/desired +/// response, the Trezor can ask for some user interaction, or can send a failure. +#[derive(Debug)] +pub enum TrezorResponse<'a, T, R: TrezorMessage> { + Ok(T), + Failure(protos::Failure), + ButtonRequest(ButtonRequest<'a, T, R>), + PinMatrixRequest(PinMatrixRequest<'a, T, R>), + PassphraseRequest(PassphraseRequest<'a, T, R>), + //TODO(stevenroose) This should be taken out of this enum and intrinsically attached to the + // PassphraseRequest variant. However, it's currently impossible to do this. It might be + // possible to do with FnBox (currently nightly) or when Box becomes possible. +} + +impl<'a, T, R: TrezorMessage> fmt::Display for TrezorResponse<'a, T, R> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + // TODO(stevenroose) should we make T: Debug? + TrezorResponse::Ok(ref _m) => f.write_str("Ok"), + TrezorResponse::Failure(ref m) => write!(f, "Failure: {:?}", m), + TrezorResponse::ButtonRequest(ref r) => write!(f, "ButtonRequest: {:?}", r), + TrezorResponse::PinMatrixRequest(ref r) => write!(f, "PinMatrixRequest: {:?}", r), + TrezorResponse::PassphraseRequest(ref r) => write!(f, "PassphraseRequest: {:?}", r), + } + } +} + +impl<'a, T, R: TrezorMessage> TrezorResponse<'a, T, R> { + /// Get the actual `Ok` response value or an error if not `Ok`. + pub fn ok(self) -> Result { + match self { + TrezorResponse::Ok(m) => Ok(m), + TrezorResponse::Failure(m) => Err(Error::FailureResponse(m)), + TrezorResponse::ButtonRequest(_) => { + Err(Error::UnexpectedInteractionRequest(InteractionType::Button)) + } + TrezorResponse::PinMatrixRequest(_) => Err(Error::UnexpectedInteractionRequest( + InteractionType::PinMatrix, + )), + TrezorResponse::PassphraseRequest(_) => Err(Error::UnexpectedInteractionRequest( + InteractionType::Passphrase, + )), + } + } + + /// Get the button request object or an error if not `ButtonRequest`. + pub fn button_request(self) -> Result> { + match self { + TrezorResponse::ButtonRequest(r) => Ok(r), + TrezorResponse::Ok(_) => Err(Error::UnexpectedMessageType(R::MESSAGE_TYPE)), + TrezorResponse::Failure(m) => Err(Error::FailureResponse(m)), + TrezorResponse::PinMatrixRequest(_) => Err(Error::UnexpectedInteractionRequest( + InteractionType::PinMatrix, + )), + TrezorResponse::PassphraseRequest(_) => Err(Error::UnexpectedInteractionRequest( + InteractionType::Passphrase, + )), + } + } + + /// Get the PIN matrix request object or an error if not `PinMatrixRequest`. + pub fn pin_matrix_request(self) -> Result> { + match self { + TrezorResponse::PinMatrixRequest(r) => Ok(r), + TrezorResponse::Ok(_) => Err(Error::UnexpectedMessageType(R::MESSAGE_TYPE)), + TrezorResponse::Failure(m) => Err(Error::FailureResponse(m)), + TrezorResponse::ButtonRequest(_) => { + Err(Error::UnexpectedInteractionRequest(InteractionType::Button)) + } + TrezorResponse::PassphraseRequest(_) => Err(Error::UnexpectedInteractionRequest( + InteractionType::Passphrase, + )), + } + } + + /// Get the passphrase request object or an error if not `PassphraseRequest`. + pub fn passphrase_request(self) -> Result> { + match self { + TrezorResponse::PassphraseRequest(r) => Ok(r), + TrezorResponse::Ok(_) => Err(Error::UnexpectedMessageType(R::MESSAGE_TYPE)), + TrezorResponse::Failure(m) => Err(Error::FailureResponse(m)), + TrezorResponse::ButtonRequest(_) => { + Err(Error::UnexpectedInteractionRequest(InteractionType::Button)) + } + TrezorResponse::PinMatrixRequest(_) => Err(Error::UnexpectedInteractionRequest( + InteractionType::PinMatrix, + )), + } + } +} + +pub fn handle_interaction(resp: TrezorResponse<'_, T, R>) -> Result { + match resp { + TrezorResponse::Ok(res) => Ok(res), + TrezorResponse::Failure(_) => resp.ok(), // assering ok() returns the failure error + TrezorResponse::ButtonRequest(req) => handle_interaction(req.ack()?), + TrezorResponse::PinMatrixRequest(_) => Err(Error::UnsupportedNetwork), + TrezorResponse::PassphraseRequest(req) => handle_interaction({ + let on_device = req.on_device(); + req.ack(!on_device)? + }), + } +} + +/// When resetting the device, it will ask for entropy to aid key generation. +pub struct EntropyRequest<'a> { + pub client: &'a mut Trezor, +} + +impl<'a> EntropyRequest<'a> { + /// Provide exactly 32 bytes or entropy. + pub fn ack_entropy(self, entropy: Vec) -> Result> { + if entropy.len() != 32 { + return Err(Error::InvalidEntropy); + } + + let mut req = protos::EntropyAck::new(); + req.set_entropy(entropy); + self.client.call(req, Box::new(|_, _| Ok(()))) + } +} diff --git a/wallet/trezor-client/src/client/ethereum.rs b/wallet/trezor-client/src/client/ethereum.rs new file mode 100644 index 0000000000..548a0ae505 --- /dev/null +++ b/wallet/trezor-client/src/client/ethereum.rs @@ -0,0 +1,168 @@ +use super::{handle_interaction, Trezor}; +use crate::{ + error::Result, + protos::{self, ethereum_sign_tx_eip1559::EthereumAccessList, EthereumTxRequest}, + Error, +}; + +/// Access list item. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct AccessListItem { + /// Accessed address + pub address: String, + /// Accessed storage keys + pub storage_keys: Vec>, +} + +/// An ECDSA signature. +#[derive(Debug, Clone, PartialEq, Eq, Copy)] +pub struct Signature { + /// R value + pub r: [u8; 32], + /// S Value + pub s: [u8; 32], + /// V value in 'Electrum' notation. + pub v: u64, +} + +impl Trezor { + // ETHEREUM + pub fn ethereum_get_address(&mut self, path: Vec) -> Result { + let mut req = protos::EthereumGetAddress::new(); + req.address_n = path; + let address = handle_interaction(self.call( + req, + Box::new(|_, m: protos::EthereumAddress| Ok(m.address().into())), + )?)?; + Ok(address) + } + + pub fn ethereum_sign_message(&mut self, message: Vec, path: Vec) -> Result { + let mut req = protos::EthereumSignMessage::new(); + req.address_n = path; + req.set_message(message); + let signature = handle_interaction(self.call( + req, + Box::new(|_, m: protos::EthereumMessageSignature| { + let signature = m.signature(); + if signature.len() != 65 { + return Err(Error::MalformedSignature); + } + let r = signature[0..32].try_into().unwrap(); + let s = signature[32..64].try_into().unwrap(); + let v = signature[64] as u64; + Ok(Signature { r, s, v }) + }), + )?)?; + + Ok(signature) + } + + #[allow(clippy::too_many_arguments)] + pub fn ethereum_sign_tx( + &mut self, + path: Vec, + nonce: Vec, + gas_price: Vec, + gas_limit: Vec, + to: String, + value: Vec, + data: Vec, + chain_id: Option, + ) -> Result { + let mut req = protos::EthereumSignTx::new(); + let mut data = data; + + req.address_n = path; + req.set_nonce(nonce); + req.set_gas_price(gas_price); + req.set_gas_limit(gas_limit); + req.set_value(value); + if let Some(chain_id) = chain_id { + req.set_chain_id(chain_id); + } + req.set_to(to); + + req.set_data_length(data.len() as u32); + req.set_data_initial_chunk(data.splice(..std::cmp::min(1024, data.len()), []).collect()); + + let mut resp = + handle_interaction(self.call(req, Box::new(|_, m: protos::EthereumTxRequest| Ok(m)))?)?; + + while resp.data_length() > 0 { + let mut ack = protos::EthereumTxAck::new(); + ack.set_data_chunk(data.splice(..std::cmp::min(1024, data.len()), []).collect()); + + resp = self.call(ack, Box::new(|_, m: protos::EthereumTxRequest| Ok(m)))?.ok()?; + } + + convert_signature(&resp, chain_id) + } + + #[allow(clippy::too_many_arguments)] + pub fn ethereum_sign_eip1559_tx( + &mut self, + path: Vec, + nonce: Vec, + gas_limit: Vec, + to: String, + value: Vec, + data: Vec, + chain_id: Option, + max_gas_fee: Vec, + max_priority_fee: Vec, + access_list: Vec, + ) -> Result { + let mut req = protos::EthereumSignTxEIP1559::new(); + let mut data = data; + + req.address_n = path; + req.set_nonce(nonce); + req.set_max_gas_fee(max_gas_fee); + req.set_max_priority_fee(max_priority_fee); + req.set_gas_limit(gas_limit); + req.set_value(value); + if let Some(chain_id) = chain_id { + req.set_chain_id(chain_id); + } + req.set_to(to); + + if !access_list.is_empty() { + req.access_list = access_list + .into_iter() + .map(|item| EthereumAccessList { + address: Some(item.address), + storage_keys: item.storage_keys, + ..Default::default() + }) + .collect(); + } + + req.set_data_length(data.len() as u32); + req.set_data_initial_chunk(data.splice(..std::cmp::min(1024, data.len()), []).collect()); + + let mut resp = + handle_interaction(self.call(req, Box::new(|_, m: protos::EthereumTxRequest| Ok(m)))?)?; + + while resp.data_length() > 0 { + let mut ack = protos::EthereumTxAck::new(); + ack.set_data_chunk(data.splice(..std::cmp::min(1024, data.len()), []).collect()); + + resp = self.call(ack, Box::new(|_, m: protos::EthereumTxRequest| Ok(m)))?.ok()? + } + + convert_signature(&resp, chain_id) + } +} + +fn convert_signature(resp: &EthereumTxRequest, chain_id: Option) -> Result { + let mut v = resp.signature_v() as u64; + if let Some(chain_id) = chain_id { + if v <= 1 { + v = v + 2 * chain_id + 35; + } + } + let r = resp.signature_r().try_into().map_err(|_| Error::MalformedSignature)?; + let s = resp.signature_r().try_into().map_err(|_| Error::MalformedSignature)?; + Ok(Signature { r, s, v }) +} diff --git a/wallet/trezor-client/src/client/mintlayer.rs b/wallet/trezor-client/src/client/mintlayer.rs new file mode 100644 index 0000000000..95e413a9ee --- /dev/null +++ b/wallet/trezor-client/src/client/mintlayer.rs @@ -0,0 +1,130 @@ +use std::collections::BTreeMap; + +use bitcoin::secp256k1; +use protobuf::MessageField; + +use super::Trezor; +use crate::{ + error::Result, + protos::{ + self, mintlayer_tx_ack_output::MintlayerTxAckOutputWrapper, + mintlayer_tx_ack_utxo_input::MintlayerTxAckInputWrapper, + mintlayer_tx_request::MintlayerRequestType, MintlayerTransferTxOutput, + MintlayerTxAckOutput, MintlayerTxAckUtxoInput, MintlayerUtxoTxInput, + }, + Error, TrezorResponse, +}; + +/// A chain code +#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct ChainCode([u8; 32]); +// impl_array_newtype!(ChainCode, u8, 32); +// impl_bytes_newtype!(ChainCode, 32); + +pub struct XPub { + /// Public key + pub public_key: secp256k1::PublicKey, + /// Chain code + pub chain_code: ChainCode, +} + +impl Trezor { + // Mintlayer + pub fn mintlayer_get_public_key( + &mut self, + path: Vec, + ) -> Result> { + let mut req = protos::MintlayerGetPublicKey::new(); + req.address_n = path; + self.call( + req, + Box::new(|_, m| { + Ok(XPub { + public_key: secp256k1::PublicKey::from_slice(m.public_key())?, + chain_code: ChainCode( + m.chain_code().try_into().map_err(|_| Error::InvalidChaincodeFromDevice)?, + ), + }) + }), + ) + } + + pub fn mintlayer_sign_tx( + &mut self, + inputs: Vec, + outputs: Vec, + utxos: BTreeMap<[u8; 32], BTreeMap>, + ) -> Result>>> { + let mut req = protos::MintlayerSignTx::new(); + req.set_version(1); + req.set_inputs_count(inputs.len() as u32); + req.set_outputs_count(outputs.len() as u32); + + eprintln!("sending tx request"); + let mut msg = self.call::<_, _, protos::MintlayerTxRequest>(req, Box::new(|_, m| Ok(m)))?; + let mut should_ack_button = 0; + loop { + if should_ack_button > 0 { + eprintln!("waiting for button to sending button ack"); + msg = msg.button_request()?.ack()?; + should_ack_button -= 1; + continue; + } + + eprintln!("waiting for ok msg"); + let response = msg.ok()?; + match response.request_type() { + MintlayerRequestType::TXINPUT => { + let mut req = MintlayerTxAckInputWrapper::new(); + req.input = MessageField::from_option( + inputs.get(response.details.request_index() as usize).cloned(), + ); + let mut req2 = MintlayerTxAckUtxoInput::new(); + req2.tx = MessageField::some(req); + eprintln!("sending tx input ack {req2:?}"); + msg = self + .call::<_, _, protos::MintlayerTxRequest>(req2, Box::new(|_, m| Ok(m)))?; + } + MintlayerRequestType::TXOUTPUT => { + let mut req = MintlayerTxAckOutputWrapper::new(); + if response.details.has_tx_hash() { + let tx_id: [u8; 32] = response + .details + .tx_hash() + .try_into() + .map_err(|_| Error::InvalidChaincodeFromDevice)?; + let out = utxos + .get(&tx_id) + .and_then(|tx| tx.get(&response.details.request_index())); + req.output = MessageField::from_option(out.cloned()); + eprintln!("sending tx input output utxo"); + } else { + req.output = MessageField::from_option( + outputs.get(response.details.request_index() as usize).cloned(), + ); + eprintln!("sending tx output"); + should_ack_button += 2; + if response.details.request_index() as usize == outputs.len() - 1 { + eprintln!("last output will wait for one more ack"); + should_ack_button += 1; + } + } + let mut req2 = MintlayerTxAckOutput::new(); + req2.tx = MessageField::some(req); + msg = self + .call::<_, _, protos::MintlayerTxRequest>(req2, Box::new(|_, m| Ok(m)))?; + } + MintlayerRequestType::TXMETA => { + return Err(Error::MalformedMintlayerTxRequest(response)) + } + MintlayerRequestType::TXFINISHED => { + return Ok(response + .serialized + .iter() + .map(|s| Some(s.signature().to_vec())) + .collect()) + } + } + } + } +} diff --git a/wallet/trezor-client/src/client/mod.rs b/wallet/trezor-client/src/client/mod.rs new file mode 100644 index 0000000000..d36fa372ca --- /dev/null +++ b/wallet/trezor-client/src/client/mod.rs @@ -0,0 +1,266 @@ +#[cfg(feature = "bitcoin")] +mod bitcoin; +#[cfg(feature = "bitcoin")] +pub use self::bitcoin::*; + +#[cfg(feature = "ethereum")] +mod ethereum; +#[cfg(feature = "ethereum")] +pub use ethereum::*; + +#[cfg(feature = "solana")] +mod solana; +// #[cfg(feature = "solana")] +// pub use solana::*; + +pub mod common; +pub use common::*; + +pub mod mintlayer; +pub use mintlayer::*; + +use crate::{ + error::{Error, Result}, + messages::TrezorMessage, + protos, + protos::MessageType::*, + transport::{ProtoMessage, Transport}, + Model, +}; +use protobuf::MessageField; +use tracing::{debug, trace}; + +/// A Trezor client. +pub struct Trezor { + model: Model, + // Cached features for later inspection. + features: Option, + transport: Box, +} + +/// Create a new Trezor instance with the given transport. +pub fn trezor_with_transport(model: Model, transport: Box) -> Trezor { + Trezor { + model, + transport, + features: None, + } +} + +impl Trezor { + /// Get the model of the Trezor device. + pub fn model(&self) -> Model { + self.model + } + + /// Get the features of the Trezor device. + pub fn features(&self) -> Option<&protos::Features> { + self.features.as_ref() + } + + /// Sends a message and returns the raw ProtoMessage struct that was responded by the device. + /// This method is only exported for users that want to expand the features of this library + /// f.e. for supporting additional coins etc. + pub fn call_raw(&mut self, message: S) -> Result { + let proto_msg = ProtoMessage(S::MESSAGE_TYPE, message.write_to_bytes()?); + self.transport.write_message(proto_msg).map_err(Error::TransportSendMessage)?; + self.transport.read_message().map_err(Error::TransportReceiveMessage) + } + + /// Sends a message and returns a TrezorResponse with either the expected response message, + /// a failure or an interaction request. + /// This method is only exported for users that want to expand the features of this library + /// f.e. for supporting additional coins etc. + pub fn call<'a, T, S: TrezorMessage, R: TrezorMessage>( + &'a mut self, + message: S, + result_handler: Box>, + ) -> Result> { + trace!("Sending {:?} msg: {:?}", S::MESSAGE_TYPE, message); + let resp = self.call_raw(message)?; + if resp.message_type() == R::MESSAGE_TYPE { + let resp_msg = resp.into_message()?; + trace!("Received {:?} msg: {:?}", R::MESSAGE_TYPE, resp_msg); + Ok(TrezorResponse::Ok(result_handler(self, resp_msg)?)) + } else { + match resp.message_type() { + MessageType_Failure => { + let fail_msg = resp.into_message()?; + debug!("Received failure: {:?}", fail_msg); + Ok(TrezorResponse::Failure(fail_msg)) + } + MessageType_ButtonRequest => { + let req_msg = resp.into_message()?; + trace!("Received ButtonRequest: {:?}", req_msg); + Ok(TrezorResponse::ButtonRequest(ButtonRequest { + message: req_msg, + client: self, + result_handler, + })) + } + MessageType_PinMatrixRequest => { + let req_msg = resp.into_message()?; + trace!("Received PinMatrixRequest: {:?}", req_msg); + Ok(TrezorResponse::PinMatrixRequest(PinMatrixRequest { + message: req_msg, + client: self, + result_handler, + })) + } + MessageType_PassphraseRequest => { + let req_msg = resp.into_message()?; + trace!("Received PassphraseRequest: {:?}", req_msg); + Ok(TrezorResponse::PassphraseRequest(PassphraseRequest { + message: req_msg, + client: self, + result_handler, + })) + } + mtype => { + debug!( + "Received unexpected msg type: {:?}; raw msg: {}", + mtype, + hex::encode(resp.into_payload()) + ); + Err(Error::UnexpectedMessageType(mtype)) + } + } + } + } + + pub fn init_device(&mut self, session_id: Option>) -> Result<()> { + let features = self.initialize(session_id)?.ok()?; + self.features = Some(features); + Ok(()) + } + + pub fn initialize( + &mut self, + session_id: Option>, + ) -> Result> { + let mut req = protos::Initialize::new(); + if let Some(session_id) = session_id { + req.set_session_id(session_id); + } + self.call(req, Box::new(|_, m| Ok(m))) + } + + pub fn ping(&mut self, message: &str) -> Result> { + let mut req = protos::Ping::new(); + req.set_message(message.to_owned()); + self.call(req, Box::new(|_, _| Ok(()))) + } + + pub fn change_pin(&mut self, remove: bool) -> Result> { + let mut req = protos::ChangePin::new(); + req.set_remove(remove); + self.call(req, Box::new(|_, _| Ok(()))) + } + + pub fn wipe_device(&mut self) -> Result> { + let req = protos::WipeDevice::new(); + self.call(req, Box::new(|_, _| Ok(()))) + } + + pub fn recover_device( + &mut self, + word_count: WordCount, + passphrase_protection: bool, + pin_protection: bool, + label: String, + dry_run: bool, + ) -> Result> { + let mut req = protos::RecoveryDevice::new(); + req.set_word_count(word_count as u32); + req.set_passphrase_protection(passphrase_protection); + req.set_pin_protection(pin_protection); + req.set_label(label); + req.set_enforce_wordlist(true); + req.set_dry_run(dry_run); + req.set_type( + protos::recovery_device::RecoveryDeviceType::RecoveryDeviceType_ScrambledWords, + ); + //TODO(stevenroose) support languages + req.set_language("english".to_owned()); + self.call(req, Box::new(|_, _| Ok(()))) + } + + #[allow(clippy::too_many_arguments)] + pub fn reset_device( + &mut self, + display_random: bool, + strength: usize, + passphrase_protection: bool, + pin_protection: bool, + label: String, + skip_backup: bool, + no_backup: bool, + ) -> Result, protos::EntropyRequest>> { + let mut req = protos::ResetDevice::new(); + req.set_display_random(display_random); + req.set_strength(strength as u32); + req.set_passphrase_protection(passphrase_protection); + req.set_pin_protection(pin_protection); + req.set_label(label); + req.set_skip_backup(skip_backup); + req.set_no_backup(no_backup); + self.call(req, Box::new(|c, _| Ok(EntropyRequest { client: c }))) + } + + pub fn backup(&mut self) -> Result> { + let req = protos::BackupDevice::new(); + self.call(req, Box::new(|_, _| Ok(()))) + } + + //TODO(stevenroose) support U2F stuff? currently ignored all + + pub fn apply_settings( + &mut self, + label: Option, + use_passphrase: Option, + homescreen: Option>, + auto_lock_delay_ms: Option, + ) -> Result> { + let mut req = protos::ApplySettings::new(); + if let Some(label) = label { + req.set_label(label); + } + if let Some(use_passphrase) = use_passphrase { + req.set_use_passphrase(use_passphrase); + } + if let Some(homescreen) = homescreen { + req.set_homescreen(homescreen); + } + if let Some(auto_lock_delay_ms) = auto_lock_delay_ms { + req.set_auto_lock_delay_ms(auto_lock_delay_ms as u32); + } + self.call(req, Box::new(|_, _| Ok(()))) + } + + pub fn sign_identity( + &mut self, + identity: protos::IdentityType, + digest: Vec, + curve: String, + ) -> Result, protos::SignedIdentity>> { + let mut req = protos::SignIdentity::new(); + req.identity = MessageField::some(identity); + req.set_challenge_hidden(digest); + req.set_challenge_visual("".to_owned()); + req.set_ecdsa_curve_name(curve); + self.call(req, Box::new(|_, m| Ok(m.signature().to_owned()))) + } + + pub fn get_ecdh_session_key( + &mut self, + identity: protos::IdentityType, + peer_public_key: Vec, + curve: String, + ) -> Result> { + let mut req = protos::GetECDHSessionKey::new(); + req.identity = MessageField::some(identity); + req.set_peer_public_key(peer_public_key); + req.set_ecdsa_curve_name(curve); + self.call(req, Box::new(|_, m| Ok(m))) + } +} diff --git a/wallet/trezor-client/src/client/solana.rs b/wallet/trezor-client/src/client/solana.rs new file mode 100644 index 0000000000..483ae259d8 --- /dev/null +++ b/wallet/trezor-client/src/client/solana.rs @@ -0,0 +1,16 @@ +use super::{handle_interaction, Trezor}; +use crate::{error::Result, protos}; + +impl Trezor { + // SOLANA + pub fn solana_get_address(&mut self, path: Vec) -> Result { + let mut req = protos::SolanaGetAddress::new(); + req.address_n = path; + req.show_display = Some(true); + let address = handle_interaction(self.call( + req, + Box::new(|_, m: protos::SolanaAddress| Ok(m.address().into())), + )?)?; + Ok(address) + } +} diff --git a/wallet/trezor-client/src/error.rs b/wallet/trezor-client/src/error.rs new file mode 100644 index 0000000000..777e9bfc6e --- /dev/null +++ b/wallet/trezor-client/src/error.rs @@ -0,0 +1,105 @@ +//! # Error Handling + +use crate::{client::InteractionType, protos, transport::error::Error as TransportError}; + +/// Trezor result type. Aliased to [`std::result::Result`] with the error type +/// set to [`Error`]. +pub type Result = std::result::Result; + +/// Trezor error. +#[derive(Debug, thiserror::Error)] +pub enum Error { + /// Less than one device was plugged in. + #[error("Trezor device not found")] + NoDeviceFound, + /// More than one device was plugged in. + #[error("multiple Trezor devices found")] + DeviceNotUnique, + /// The device returned an invalid signature. + #[error("device returned invalid signature")] + MalformedSignature, + /// Transport error connecting to device. + #[error("transport connect: {0}")] + TransportConnect(#[source] TransportError), + /// Transport error while beginning a session. + #[error("transport beginning session: {0}")] + TransportBeginSession(#[source] TransportError), + /// Transport error while ending a session. + #[error("transport ending session: {0}")] + TransportEndSession(#[source] TransportError), + /// Transport error while sending a message. + #[error("transport sending message: {0}")] + TransportSendMessage(#[source] TransportError), + /// Transport error while receiving a message. + #[error("transport receiving message: {0}")] + TransportReceiveMessage(#[source] TransportError), + /// Received an unexpected message type from the device. + #[error("received unexpected message type: {0:?}")] + UnexpectedMessageType(protos::MessageType), //TODO(stevenroose) type alias + /// Error reading or writing protobuf messages. + #[error(transparent)] + Protobuf(#[from] protobuf::Error), + /// A failure message was returned by the device. + #[error("failure received: code={:?} message=\"{}\"", .0.code(), .0.message())] + FailureResponse(protos::Failure), + /// An unexpected interaction request was returned by the device. + #[error("unexpected interaction request: {0:?}")] + UnexpectedInteractionRequest(InteractionType), + /// The given Bitcoin network is not supported. + #[error("given network is not supported")] + UnsupportedNetwork, + /// Provided entropy is not 32 bytes. + #[error("provided entropy is not 32 bytes")] + InvalidEntropy, + /// The device erenced a non-existing input or output index. + #[error("device referenced non-existing input or output index: {0}")] + TxRequestInvalidIndex(usize), + + /// User provided invalid PSBT. + #[error("PSBT missing input tx: {0}")] + InvalidPsbt(String), + + // bitcoin + /// Error in Base58 decoding + #[cfg(feature = "bitcoin")] + #[error(transparent)] + Base58(#[from] bitcoin::base58::Error), + /// The device erenced an unknown TXID. + #[cfg(feature = "bitcoin")] + #[error("device referenced unknown TXID: {0}")] + TxRequestUnknownTxid(bitcoin::hashes::sha256d::Hash), + /// The PSBT is missing the full tx for given input. + #[cfg(feature = "bitcoin")] + #[error("PSBT missing input tx: {0}")] + PsbtMissingInputTx(bitcoin::hashes::sha256d::Hash), + /// Device produced invalid TxRequest message. + #[cfg(feature = "bitcoin")] + #[error("malformed TxRequest: {0:?}")] + MalformedTxRequest(protos::TxRequest), + /// Error encoding/decoding a Bitcoin data structure. + #[cfg(feature = "bitcoin")] + #[error(transparent)] + BitcoinEncode(#[from] bitcoin::consensus::encode::Error), + /// Elliptic curve crypto error. + #[cfg(feature = "bitcoin")] + #[error(transparent)] + Secp256k1(#[from] bitcoin::secp256k1::Error), + /// Bip32 error. + #[cfg(feature = "bitcoin")] + #[error(transparent)] + Bip32(#[from] bitcoin::bip32::Error), + /// Address error. + #[cfg(feature = "bitcoin")] + #[error(transparent)] + Address(#[from] bitcoin::address::ParseError), + + // bintlayer + /// Chaincode error. + #[cfg(feature = "mintlayer")] + #[error("Invalid chaincode length returned from device")] + InvalidChaincodeFromDevice, + /// Device produced invalid TxRequest message. + #[cfg(feature = "mintlayer")] + #[error("malformed MintlayerTxRequest: {0:?}")] + MalformedMintlayerTxRequest(protos::MintlayerTxRequest), +} diff --git a/wallet/trezor-client/src/flows/sign_tx.rs b/wallet/trezor-client/src/flows/sign_tx.rs new file mode 100644 index 0000000000..e02972a9fb --- /dev/null +++ b/wallet/trezor-client/src/flows/sign_tx.rs @@ -0,0 +1,332 @@ +//! Logic to handle the sign_tx command flow. + +#![allow(clippy::all)] + +use crate::{ + client::*, + error::{Error, Result}, + protos::{ + self, + tx_ack::{ + transaction_type::{TxOutputBinType, TxOutputType}, + TransactionType, + }, + }, + utils, +}; +use bitcoin::{hashes::sha256d, psbt, Network, Transaction}; +use protos::{ + tx_ack::transaction_type::TxInputType, tx_request::RequestType as TxRequestType, + InputScriptType, OutputScriptType, +}; +use tracing::trace; + +/// Fulfill a TxRequest for TXINPUT. +fn ack_input_request(req: &protos::TxRequest, psbt: &psbt::Psbt) -> Result { + if req.details.is_none() || !req.details.has_request_index() { + return Err(Error::MalformedTxRequest(req.clone())); + } + + // Choose either the tx we are signing or a dependent tx. + let input_index = req.details.request_index() as usize; + let input = if req.details.has_tx_hash() { + let req_hash: sha256d::Hash = utils::from_rev_bytes(req.details.tx_hash()) + .ok_or_else(|| Error::MalformedTxRequest(req.clone()))?; + trace!("Preparing ack for input {}:{}", req_hash, input_index); + let inp = utils::psbt_find_input(psbt, req_hash)?; + let tx = inp.non_witness_utxo.as_ref().ok_or(Error::PsbtMissingInputTx(req_hash))?; + let opt = &tx.input.get(input_index); + opt.ok_or_else(|| Error::TxRequestInvalidIndex(input_index))? + } else { + trace!("Preparing ack for tx input #{}", input_index); + let opt = &psbt.unsigned_tx.input.get(input_index); + opt.ok_or(Error::TxRequestInvalidIndex(input_index))? + }; + + let mut data_input = TxInputType::new(); + data_input + .set_prev_hash(utils::to_rev_bytes(input.previous_output.txid.as_raw_hash()).to_vec()); + data_input.set_prev_index(input.previous_output.vout); + data_input.set_script_sig(input.script_sig.to_bytes()); + data_input.set_sequence(input.sequence.to_consensus_u32()); + + // Extra data only for currently signing tx. + if !req.details.has_tx_hash() { + let psbt_input = psbt + .inputs + .get(input_index) + .ok_or_else(|| Error::InvalidPsbt("not enough psbt inputs".to_owned()))?; + + // Get the output we are spending from the PSBT input. + let txout = if let Some(ref txout) = psbt_input.witness_utxo { + txout + } else if let Some(ref tx) = psbt_input.non_witness_utxo { + tx.output.get(input.previous_output.vout as usize).ok_or_else(|| { + Error::InvalidPsbt(format!("invalid utxo for PSBT input {}", input_index)) + })? + } else { + return Err(Error::InvalidPsbt(format!( + "no utxo for PSBT input {}", + input_index + ))); + }; + + // If there is exactly 1 HD keypath known, we can provide it. If more it's multisig. + if psbt_input.bip32_derivation.len() == 1 { + let (_, (_, path)) = psbt_input.bip32_derivation.iter().next().unwrap(); + data_input.address_n = path.as_ref().iter().map(|i| (*i).into()).collect(); + } + + // Since we know the keypath, we probably have to sign it. So update script_type. + let script_type = { + let script_pubkey = &txout.script_pubkey; + + if script_pubkey.is_p2pkh() { + InputScriptType::SPENDADDRESS + } else if script_pubkey.is_p2wpkh() || script_pubkey.is_p2wsh() { + InputScriptType::SPENDWITNESS + } else if script_pubkey.is_p2sh() && psbt_input.witness_script.is_some() { + InputScriptType::SPENDP2SHWITNESS + } else { + //TODO(stevenroose) normal p2sh is probably multisig + InputScriptType::EXTERNAL + } + }; + data_input.set_script_type(script_type); + //TODO(stevenroose) multisig + + data_input.set_amount(txout.value.to_sat()); + } + + trace!("Prepared input to ack: {:?}", data_input); + let mut txdata = TransactionType::new(); + txdata.inputs.push(data_input); + let mut msg = protos::TxAck::new(); + msg.tx = protobuf::MessageField::some(txdata); + Ok(msg) +} + +/// Fulfill a TxRequest for TXOUTPUT. +fn ack_output_request( + req: &protos::TxRequest, + psbt: &psbt::Psbt, + network: Network, +) -> Result { + if req.details.is_none() || !req.details.has_request_index() { + return Err(Error::MalformedTxRequest(req.clone())); + } + + // For outputs, the Trezor only needs bin_outputs to be set for dependent txs and full outputs + // for the signing tx. + let mut txdata = TransactionType::new(); + if req.details.has_tx_hash() { + // Dependent tx, take the output from the PSBT and just create bin_output. + let output_index = req.details.request_index() as usize; + let req_hash: sha256d::Hash = utils::from_rev_bytes(req.details.tx_hash()) + .ok_or_else(|| Error::MalformedTxRequest(req.clone()))?; + trace!("Preparing ack for output {}:{}", req_hash, output_index); + let inp = utils::psbt_find_input(psbt, req_hash)?; + let output = if let Some(ref tx) = inp.non_witness_utxo { + let opt = &tx.output.get(output_index); + opt.ok_or_else(|| Error::TxRequestInvalidIndex(output_index))? + } else if let Some(ref utxo) = inp.witness_utxo { + utxo + } else { + return Err(Error::InvalidPsbt( + "not all inputs have utxo data".to_owned(), + )); + }; + + let mut bin_output = TxOutputBinType::new(); + bin_output.set_amount(output.value.to_sat()); + bin_output.set_script_pubkey(output.script_pubkey.to_bytes()); + + trace!("Prepared bin_output to ack: {:?}", bin_output); + txdata.bin_outputs.push(bin_output); + } else { + // Signing tx, we need to fill the full output meta object. + let output_index = req.details.request_index() as usize; + trace!("Preparing ack for tx output #{}", output_index); + let opt = &psbt.unsigned_tx.output.get(output_index); + let output = opt.ok_or(Error::TxRequestInvalidIndex(output_index))?; + + let mut data_output = TxOutputType::new(); + data_output.set_amount(output.value.to_sat()); + // Set script type to PAYTOADDRESS unless we find out otherwise from the PSBT. + data_output.set_script_type(OutputScriptType::PAYTOADDRESS); + if let Some(addr) = utils::address_from_script(&output.script_pubkey, network) { + data_output.set_address(addr.to_string()); + } + + let psbt_output = psbt + .outputs + .get(output_index) + .ok_or_else(|| Error::InvalidPsbt("output indices don't match".to_owned()))?; + if psbt_output.bip32_derivation.len() == 1 { + let (_, (_, path)) = psbt_output.bip32_derivation.iter().next().unwrap(); + data_output.address_n = path.as_ref().iter().map(|i| (*i).into()).collect(); + + // Since we know the keypath, it's probably a change output. So update script_type. + let script_pubkey = &psbt.unsigned_tx.output[output_index].script_pubkey; + if script_pubkey.is_op_return() { + data_output.set_script_type(OutputScriptType::PAYTOOPRETURN); + data_output.set_op_return_data(script_pubkey.as_bytes()[1..].to_vec()); + } else if psbt_output.witness_script.is_some() { + if psbt_output.redeem_script.is_some() { + data_output.set_script_type(OutputScriptType::PAYTOP2SHWITNESS); + } else { + data_output.set_script_type(OutputScriptType::PAYTOWITNESS); + } + } else { + data_output.set_script_type(OutputScriptType::PAYTOADDRESS); + } + } + + trace!("Prepared output to ack: {:?}", data_output); + txdata.outputs.push(data_output); + }; + + let mut msg = protos::TxAck::new(); + msg.tx = protobuf::MessageField::some(txdata); + Ok(msg) +} + +/// Fulfill a TxRequest for TXMETA. +fn ack_meta_request(req: &protos::TxRequest, psbt: &psbt::Psbt) -> Result { + if req.details.is_none() { + return Err(Error::MalformedTxRequest(req.clone())); + } + + // Choose either the tx we are signing or a dependent tx. + let tx: &Transaction = if req.details.has_tx_hash() { + // dependeny tx, look for it in PSBT inputs + let req_hash: sha256d::Hash = utils::from_rev_bytes(req.details.tx_hash()) + .ok_or_else(|| Error::MalformedTxRequest(req.clone()))?; + trace!("Preparing ack for tx meta of {}", req_hash); + let inp = utils::psbt_find_input(psbt, req_hash)?; + inp.non_witness_utxo.as_ref().ok_or(Error::PsbtMissingInputTx(req_hash))? + } else { + // currently signing tx + trace!("Preparing ack for tx meta of tx being signed"); + &psbt.unsigned_tx + }; + + let mut txdata = TransactionType::new(); + txdata.set_version(tx.version.0 as u32); + txdata.set_lock_time(tx.lock_time.to_consensus_u32()); + txdata.set_inputs_cnt(tx.input.len() as u32); + txdata.set_outputs_cnt(tx.output.len() as u32); + //TODO(stevenroose) python does something with extra data? + + trace!("Prepared tx meta to ack: {:?}", txdata); + let mut msg = protos::TxAck::new(); + msg.tx = protobuf::MessageField::some(txdata); + Ok(msg) +} + +/// Object to track the progress in the transaction signing flow. The device will ask for various +/// parts of the transaction and dependent transactions and can at any point also ask for user +/// interaction. The information asked for by the device is provided based on a PSBT object and the +/// resulting extra signatures are also added to the PSBT file. +/// +/// It's important to always first check with the `finished()` method if more data is requested by +/// the device. If you're not yet finished you must call the `ack_psbt()` method to send more +/// information to the device. +pub struct SignTxProgress<'a> { + client: &'a mut Trezor, + req: protos::TxRequest, +} + +impl<'a> SignTxProgress<'a> { + /// Only intended for internal usage. + pub fn new(client: &mut Trezor, req: protos::TxRequest) -> SignTxProgress<'_> { + SignTxProgress { client, req } + } + + /// Inspector to the request message received from the device. + pub fn tx_request(&self) -> &protos::TxRequest { + &self.req + } + + /// Check whether or not the signing process is finished. + pub fn finished(&self) -> bool { + self.req.request_type() == TxRequestType::TXFINISHED + } + + /// Check if a signature is provided by the device. + pub fn has_signature(&self) -> bool { + let serialized = &self.req.serialized; + serialized.is_some() && serialized.has_signature_index() && serialized.has_signature() + } + + /// Get the signature provided from the device along with the input index of the signature. + pub fn get_signature(&self) -> Option<(usize, &[u8])> { + if self.has_signature() { + let serialized = &self.req.serialized; + Some(( + serialized.signature_index() as usize, + serialized.signature(), + )) + } else { + None + } + } + + //TODO(stevenroose) We used to have a method here `apply_signature(&mut psbt)` that would put + // the received signature in the correct PSBT input. However, since the signature is just a raw + // signature instead of a scriptSig, this is harder. It can be done, but then we'd have to have + // the pubkey provided in the PSBT (possible thought HD path) and we'd have to do some Script + // inspection to see if we should put it as a p2pkh sciptSig or witness data. + + /// Check if a part of the serialized signed tx is provided by the device. + pub fn has_serialized_tx_part(&self) -> bool { + let serialized = &self.req.serialized; + serialized.is_some() && serialized.has_serialized_tx() + } + + /// Get the part of the serialized signed tx from the device. + pub fn get_serialized_tx_part(&self) -> Option<&[u8]> { + if self.has_serialized_tx_part() { + Some(self.req.serialized.serialized_tx()) + } else { + None + } + } + + /// Manually provide a TxAck message to the device. + /// + /// This method will panic if `finished()` returned true, + /// so it should always be checked in advance. + pub fn ack_msg( + self, + ack: protos::TxAck, + ) -> Result, protos::TxRequest>> { + assert!(!self.finished()); + + self.client.call(ack, Box::new(|c, m| Ok(SignTxProgress::new(c, m)))) + } + + /// Provide additional PSBT information to the device. + /// + /// This method will panic if `apply()` returned true, + /// so it should always be checked in advance. + pub fn ack_psbt( + self, + psbt: &psbt::Psbt, + network: Network, + ) -> Result, protos::TxRequest>> { + assert!(self.req.request_type() != TxRequestType::TXFINISHED); + + let ack = match self.req.request_type() { + TxRequestType::TXINPUT => ack_input_request(&self.req, psbt), + TxRequestType::TXOUTPUT => ack_output_request(&self.req, psbt, network), + TxRequestType::TXMETA => ack_meta_request(&self.req, psbt), + TxRequestType::TXEXTRADATA => unimplemented!(), //TODO(stevenroose) implement + TxRequestType::TXORIGINPUT + | TxRequestType::TXORIGOUTPUT + | TxRequestType::TXPAYMENTREQ => unimplemented!(), + TxRequestType::TXFINISHED => unreachable!(), + }?; + self.ack_msg(ack) + } +} diff --git a/wallet/trezor-client/src/lib.rs b/wallet/trezor-client/src/lib.rs new file mode 100644 index 0000000000..d69445e641 --- /dev/null +++ b/wallet/trezor-client/src/lib.rs @@ -0,0 +1,247 @@ +//! # Trezor API library +//! +//! ## Connecting +//! +//! Use the public top-level methods `find_devices()` and `unique()` to find devices. When using +//! `find_devices()`, a list of different available devices is returned. To connect to one or more +//! of them, use their `connect()` method. +//! +//! ## Logging +//! +//! We use the log package interface, so any logger that supports log can be attached. +//! Please be aware that `trace` logging can contain sensitive data. + +#![allow(clippy::all)] +#![warn(unreachable_pub, rustdoc::all)] +#![cfg_attr(not(test), warn(unused_crate_dependencies))] +#![deny(unused_must_use, rust_2018_idioms)] +#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] + +#[allow(clippy::all)] +mod messages; + +pub mod client; +pub mod error; +pub mod protos; +pub mod transport; +#[cfg(feature = "bitcoin")] +pub mod utils; + +#[allow(clippy::all)] +mod flows { + #[cfg(feature = "bitcoin")] + pub(crate) mod sign_tx; +} + +pub use client::{ + ButtonRequest, ButtonRequestType, EntropyRequest, Features, PassphraseRequest, + PinMatrixRequest, PinMatrixRequestType, Trezor, TrezorResponse, WordCount, +}; +pub use error::{Error, Result}; +pub use messages::TrezorMessage; + +#[cfg(feature = "bitcoin")] +pub use flows::sign_tx::SignTxProgress; +#[cfg(feature = "bitcoin")] +pub use protos::InputScriptType; + +use std::fmt; +use tracing::{debug, warn}; +use transport::{udp::UdpTransport, webusb::WebUsbTransport}; + +/// The different kind of Trezor device models. +#[derive(PartialEq, Eq, Clone, Debug, Copy)] +pub enum Model { + TrezorLegacy, + Trezor, + TrezorBootloader, + TrezorEmulator, +} + +impl fmt::Display for Model { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(self.as_str()) + } +} + +impl Model { + pub const fn as_str(&self) -> &'static str { + match self { + Model::TrezorLegacy => "Trezor (legacy)", + Model::Trezor => "Trezor", + Model::TrezorBootloader => "Trezor (bootloader)", + Model::TrezorEmulator => "Trezor Emulator", + } + } +} + +/// A device found by the `find_devices()` method. It can be connected to using the `connect()` +/// method. +#[derive(Debug)] +pub struct AvailableDevice { + pub model: Model, + pub debug: bool, + transport: transport::AvailableDeviceTransport, +} + +impl fmt::Display for AvailableDevice { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!( + f, + "{} (transport: {}) (debug: {})", + self.model, &self.transport, self.debug + ) + } +} + +impl AvailableDevice { + /// Connect to the device. + pub fn connect(self) -> Result { + let transport = transport::connect(&self).map_err(Error::TransportConnect)?; + Ok(client::trezor_with_transport(self.model, transport)) + } +} + +/// Search for all available devices. +/// Most devices will show up twice both either debugging enables or disabled. +pub fn find_devices(debug: bool) -> Vec { + let mut devices = vec![]; + + match WebUsbTransport::find_devices(debug) { + Ok(usb) => devices.extend(usb), + Err(err) => { + warn!("{}", Error::TransportConnect(err)) + } + }; + + match UdpTransport::find_devices(debug, None) { + Ok(udp) => devices.extend(udp), + Err(err) => { + warn!("{}", Error::TransportConnect(err)) + } + }; + + devices +} + +/// Try to get a single device. Optionally specify whether debug should be enabled or not. +/// Can error if there are multiple or no devices available. +/// For more fine-grained device selection, use `find_devices()`. +/// When using USB mode, the device will show up both with debug and without debug, so it's +/// necessary to specify the debug option in order to find a unique one. +pub fn unique(debug: bool) -> Result { + let mut devices = find_devices(debug); + match devices.len() { + 0 => Err(Error::NoDeviceFound), + 1 => Ok(devices.remove(0).connect()?), + _ => { + debug!("Trezor devices found: {:?}", devices); + Err(Error::DeviceNotUnique) + } + } +} + +#[cfg(test)] +mod tests { + use serial_test::serial; + use std::str::FromStr; + + use crate::{client::handle_interaction, protos::IdentityType}; + use bitcoin::{bip32::DerivationPath, hex::FromHex}; + + use super::*; + + fn init_emulator() -> Trezor { + let mut emulator = find_devices(false) + .into_iter() + .find(|t| t.model == Model::TrezorEmulator) + .expect("No emulator found") + .connect() + .expect("Failed to connect to emulator"); + emulator.init_device(None).expect("Failed to intialize device"); + emulator + } + + #[test] + #[serial] + fn test_emulator_find() { + let trezors = find_devices(false); + assert!(!trezors.is_empty()); + assert!(trezors.iter().any(|t| t.model == Model::TrezorEmulator)); + } + + #[test] + #[serial] + fn test_emulator_features() { + let emulator = init_emulator(); + let features = emulator.features().expect("Failed to get features"); + assert_eq!(features.vendor(), "trezor.io"); + assert!(features.initialized()); + assert!(!features.firmware_present()); + assert!(features.initialized()); + assert!(!features.pin_protection()); + assert!(!features.passphrase_protection()); + assert!(["T", "Safe 3"].contains(&features.model())); + } + + #[test] + #[serial] + fn test_bitcoin_address() { + let mut emulator = init_emulator(); + assert_eq!( + emulator.features().expect("Failed to get features").label(), + "SLIP-0014" + ); + let path = DerivationPath::from_str("m/44'/1'/0'/0/0").expect("Failed to parse path"); + let address = emulator + .get_address( + &path, + InputScriptType::SPENDADDRESS, + bitcoin::Network::Testnet, + false, + ) + .expect("Failed to get address"); + assert_eq!( + address.ok().unwrap().to_string(), + "mvbu1Gdy8SUjTenqerxUaZyYjmveZvt33q" + ); + } + + #[ignore] + #[test] + #[serial] + fn test_ecdh_shared_secret() { + tracing_subscriber::fmt().with_max_level(tracing::Level::TRACE).init(); + + let mut emulator = init_emulator(); + assert_eq!( + emulator.features().expect("Failed to get features").label(), + "SLIP-0014" + ); + + let mut ident = IdentityType::new(); + ident.set_proto("gpg".to_owned()); + ident.set_user("".to_owned()); + ident.set_host("Satoshi Nakamoto ".to_owned()); + ident.set_port("".to_owned()); + ident.set_path("".to_owned()); + ident.set_index(0); + + let peer_public_key = Vec::from_hex("0407f2c6e5becf3213c1d07df0cfbe8e39f70a8c643df7575e5c56859ec52c45ca950499c019719dae0fda04248d851e52cf9d66eeb211d89a77be40de22b6c89d").unwrap(); + let curve_name = "secp256k1".to_owned(); + let response = handle_interaction( + emulator + .get_ecdh_session_key(ident, peer_public_key, curve_name) + .expect("Failed to get ECDH shared secret"), + ) + .unwrap(); + + let expected_session_key = Vec::from_hex("048125883b086746244b0d2c548860ecc723346e14c87e51dc7ba32791bc780d132dbd814fbee77134f318afac6ad6db3c5334efe6a8798628a1038195b96e82e2").unwrap(); + assert_eq!(response.session_key(), &expected_session_key); + + let expected_public_key = + Vec::from_hex("032726ba71aa066b47fc0f90b389f8c3e02fe20b94c858395d71f260e9944e3c65") + .unwrap(); + assert_eq!(response.public_key(), &expected_public_key); + } +} diff --git a/wallet/trezor-client/src/messages/generated.rs b/wallet/trezor-client/src/messages/generated.rs new file mode 100644 index 0000000000..83b12bf65f --- /dev/null +++ b/wallet/trezor-client/src/messages/generated.rs @@ -0,0 +1,306 @@ +trezor_message_impl! { + Initialize => MessageType_Initialize, + Ping => MessageType_Ping, + Success => MessageType_Success, + Failure => MessageType_Failure, + ChangePin => MessageType_ChangePin, + WipeDevice => MessageType_WipeDevice, + GetEntropy => MessageType_GetEntropy, + Entropy => MessageType_Entropy, + LoadDevice => MessageType_LoadDevice, + ResetDevice => MessageType_ResetDevice, + SetBusy => MessageType_SetBusy, + Features => MessageType_Features, + PinMatrixRequest => MessageType_PinMatrixRequest, + PinMatrixAck => MessageType_PinMatrixAck, + Cancel => MessageType_Cancel, + LockDevice => MessageType_LockDevice, + ApplySettings => MessageType_ApplySettings, + ButtonRequest => MessageType_ButtonRequest, + ButtonAck => MessageType_ButtonAck, + ApplyFlags => MessageType_ApplyFlags, + GetNonce => MessageType_GetNonce, + Nonce => MessageType_Nonce, + BackupDevice => MessageType_BackupDevice, + EntropyRequest => MessageType_EntropyRequest, + EntropyAck => MessageType_EntropyAck, + PassphraseRequest => MessageType_PassphraseRequest, + PassphraseAck => MessageType_PassphraseAck, + RecoveryDevice => MessageType_RecoveryDevice, + WordRequest => MessageType_WordRequest, + WordAck => MessageType_WordAck, + GetFeatures => MessageType_GetFeatures, + SdProtect => MessageType_SdProtect, + ChangeWipeCode => MessageType_ChangeWipeCode, + EndSession => MessageType_EndSession, + DoPreauthorized => MessageType_DoPreauthorized, + PreauthorizedRequest => MessageType_PreauthorizedRequest, + CancelAuthorization => MessageType_CancelAuthorization, + RebootToBootloader => MessageType_RebootToBootloader, + GetFirmwareHash => MessageType_GetFirmwareHash, + FirmwareHash => MessageType_FirmwareHash, + UnlockPath => MessageType_UnlockPath, + UnlockedPathRequest => MessageType_UnlockedPathRequest, + ShowDeviceTutorial => MessageType_ShowDeviceTutorial, + UnlockBootloader => MessageType_UnlockBootloader, + AuthenticateDevice => MessageType_AuthenticateDevice, + AuthenticityProof => MessageType_AuthenticityProof, + ChangeLanguage => MessageType_ChangeLanguage, + TranslationDataRequest => MessageType_TranslationDataRequest, + TranslationDataAck => MessageType_TranslationDataAck, + SetU2FCounter => MessageType_SetU2FCounter, + GetNextU2FCounter => MessageType_GetNextU2FCounter, + NextU2FCounter => MessageType_NextU2FCounter, + Deprecated_PassphraseStateRequest => MessageType_Deprecated_PassphraseStateRequest, + Deprecated_PassphraseStateAck => MessageType_Deprecated_PassphraseStateAck, + FirmwareErase => MessageType_FirmwareErase, + FirmwareUpload => MessageType_FirmwareUpload, + FirmwareRequest => MessageType_FirmwareRequest, + ProdTestT1 => MessageType_ProdTestT1, + CipherKeyValue => MessageType_CipherKeyValue, + CipheredKeyValue => MessageType_CipheredKeyValue, + SignIdentity => MessageType_SignIdentity, + SignedIdentity => MessageType_SignedIdentity, + GetECDHSessionKey => MessageType_GetECDHSessionKey, + ECDHSessionKey => MessageType_ECDHSessionKey, + CosiCommit => MessageType_CosiCommit, + CosiCommitment => MessageType_CosiCommitment, + CosiSign => MessageType_CosiSign, + CosiSignature => MessageType_CosiSignature, + DebugLinkDecision => MessageType_DebugLinkDecision, + DebugLinkGetState => MessageType_DebugLinkGetState, + DebugLinkState => MessageType_DebugLinkState, + DebugLinkStop => MessageType_DebugLinkStop, + DebugLinkLog => MessageType_DebugLinkLog, + DebugLinkMemoryRead => MessageType_DebugLinkMemoryRead, + DebugLinkMemory => MessageType_DebugLinkMemory, + DebugLinkMemoryWrite => MessageType_DebugLinkMemoryWrite, + DebugLinkFlashErase => MessageType_DebugLinkFlashErase, + DebugLinkLayout => MessageType_DebugLinkLayout, + DebugLinkReseedRandom => MessageType_DebugLinkReseedRandom, + DebugLinkRecordScreen => MessageType_DebugLinkRecordScreen, + DebugLinkEraseSdCard => MessageType_DebugLinkEraseSdCard, + DebugLinkWatchLayout => MessageType_DebugLinkWatchLayout, + DebugLinkResetDebugEvents => MessageType_DebugLinkResetDebugEvents, +} + +#[cfg(feature = "binance")] +trezor_message_impl! { + BinanceGetAddress => MessageType_BinanceGetAddress, + BinanceAddress => MessageType_BinanceAddress, + BinanceGetPublicKey => MessageType_BinanceGetPublicKey, + BinancePublicKey => MessageType_BinancePublicKey, + BinanceSignTx => MessageType_BinanceSignTx, + BinanceTxRequest => MessageType_BinanceTxRequest, + BinanceTransferMsg => MessageType_BinanceTransferMsg, + BinanceOrderMsg => MessageType_BinanceOrderMsg, + BinanceCancelMsg => MessageType_BinanceCancelMsg, + BinanceSignedTx => MessageType_BinanceSignedTx, +} + +#[cfg(feature = "bitcoin")] +trezor_message_impl! { + GetPublicKey => MessageType_GetPublicKey, + PublicKey => MessageType_PublicKey, + SignTx => MessageType_SignTx, + TxRequest => MessageType_TxRequest, + TxAck => MessageType_TxAck, + GetAddress => MessageType_GetAddress, + Address => MessageType_Address, + TxAckPaymentRequest => MessageType_TxAckPaymentRequest, + SignMessage => MessageType_SignMessage, + VerifyMessage => MessageType_VerifyMessage, + MessageSignature => MessageType_MessageSignature, + GetOwnershipId => MessageType_GetOwnershipId, + OwnershipId => MessageType_OwnershipId, + GetOwnershipProof => MessageType_GetOwnershipProof, + OwnershipProof => MessageType_OwnershipProof, + AuthorizeCoinJoin => MessageType_AuthorizeCoinJoin, +} + +#[cfg(feature = "cardano")] +trezor_message_impl! { + CardanoGetPublicKey => MessageType_CardanoGetPublicKey, + CardanoPublicKey => MessageType_CardanoPublicKey, + CardanoGetAddress => MessageType_CardanoGetAddress, + CardanoAddress => MessageType_CardanoAddress, + CardanoTxItemAck => MessageType_CardanoTxItemAck, + CardanoTxAuxiliaryDataSupplement => MessageType_CardanoTxAuxiliaryDataSupplement, + CardanoTxWitnessRequest => MessageType_CardanoTxWitnessRequest, + CardanoTxWitnessResponse => MessageType_CardanoTxWitnessResponse, + CardanoTxHostAck => MessageType_CardanoTxHostAck, + CardanoTxBodyHash => MessageType_CardanoTxBodyHash, + CardanoSignTxFinished => MessageType_CardanoSignTxFinished, + CardanoSignTxInit => MessageType_CardanoSignTxInit, + CardanoTxInput => MessageType_CardanoTxInput, + CardanoTxOutput => MessageType_CardanoTxOutput, + CardanoAssetGroup => MessageType_CardanoAssetGroup, + CardanoToken => MessageType_CardanoToken, + CardanoTxCertificate => MessageType_CardanoTxCertificate, + CardanoTxWithdrawal => MessageType_CardanoTxWithdrawal, + CardanoTxAuxiliaryData => MessageType_CardanoTxAuxiliaryData, + CardanoPoolOwner => MessageType_CardanoPoolOwner, + CardanoPoolRelayParameters => MessageType_CardanoPoolRelayParameters, + CardanoGetNativeScriptHash => MessageType_CardanoGetNativeScriptHash, + CardanoNativeScriptHash => MessageType_CardanoNativeScriptHash, + CardanoTxMint => MessageType_CardanoTxMint, + CardanoTxCollateralInput => MessageType_CardanoTxCollateralInput, + CardanoTxRequiredSigner => MessageType_CardanoTxRequiredSigner, + CardanoTxInlineDatumChunk => MessageType_CardanoTxInlineDatumChunk, + CardanoTxReferenceScriptChunk => MessageType_CardanoTxReferenceScriptChunk, + CardanoTxReferenceInput => MessageType_CardanoTxReferenceInput, +} + +#[cfg(feature = "eos")] +trezor_message_impl! { + EosGetPublicKey => MessageType_EosGetPublicKey, + EosPublicKey => MessageType_EosPublicKey, + EosSignTx => MessageType_EosSignTx, + EosTxActionRequest => MessageType_EosTxActionRequest, + EosTxActionAck => MessageType_EosTxActionAck, + EosSignedTx => MessageType_EosSignedTx, +} + +#[cfg(feature = "ethereum")] +trezor_message_impl! { + EthereumGetPublicKey => MessageType_EthereumGetPublicKey, + EthereumPublicKey => MessageType_EthereumPublicKey, + EthereumGetAddress => MessageType_EthereumGetAddress, + EthereumAddress => MessageType_EthereumAddress, + EthereumSignTx => MessageType_EthereumSignTx, + EthereumSignTxEIP1559 => MessageType_EthereumSignTxEIP1559, + EthereumTxRequest => MessageType_EthereumTxRequest, + EthereumTxAck => MessageType_EthereumTxAck, + EthereumSignMessage => MessageType_EthereumSignMessage, + EthereumVerifyMessage => MessageType_EthereumVerifyMessage, + EthereumMessageSignature => MessageType_EthereumMessageSignature, + EthereumSignTypedData => MessageType_EthereumSignTypedData, + EthereumTypedDataStructRequest => MessageType_EthereumTypedDataStructRequest, + EthereumTypedDataStructAck => MessageType_EthereumTypedDataStructAck, + EthereumTypedDataValueRequest => MessageType_EthereumTypedDataValueRequest, + EthereumTypedDataValueAck => MessageType_EthereumTypedDataValueAck, + EthereumTypedDataSignature => MessageType_EthereumTypedDataSignature, + EthereumSignTypedHash => MessageType_EthereumSignTypedHash, +} + +#[cfg(feature = "mintlayer")] +trezor_message_impl! { + MintlayerGetAddress => MessageType_MintlayerGetAddress, + MintlayerAddress => MessageType_MintlayerAddress, + MintlayerGetPublicKey => MessageType_MintlayerGetPublicKey, + MintlayerPublicKey => MessageType_MintlayerPublicKey, + MintlayerVerifySig => MessageType_MintlayerVerifySig, + MintlayerSignTx => MessageType_MintlayerSignTx, + MintlayerTxRequest => MessageType_MintlayerTxRequest, + MintlayerTxAckUtxoInput => MessageType_MintlayerTxAckUtxoInput, + MintlayerTxAckOutput => MessageType_MintlayerTxAckOutput, +} + +#[cfg(feature = "monero")] +trezor_message_impl! { + MoneroTransactionInitRequest => MessageType_MoneroTransactionInitRequest, + MoneroTransactionInitAck => MessageType_MoneroTransactionInitAck, + MoneroTransactionSetInputRequest => MessageType_MoneroTransactionSetInputRequest, + MoneroTransactionSetInputAck => MessageType_MoneroTransactionSetInputAck, + MoneroTransactionInputViniRequest => MessageType_MoneroTransactionInputViniRequest, + MoneroTransactionInputViniAck => MessageType_MoneroTransactionInputViniAck, + MoneroTransactionAllInputsSetRequest => MessageType_MoneroTransactionAllInputsSetRequest, + MoneroTransactionAllInputsSetAck => MessageType_MoneroTransactionAllInputsSetAck, + MoneroTransactionSetOutputRequest => MessageType_MoneroTransactionSetOutputRequest, + MoneroTransactionSetOutputAck => MessageType_MoneroTransactionSetOutputAck, + MoneroTransactionAllOutSetRequest => MessageType_MoneroTransactionAllOutSetRequest, + MoneroTransactionAllOutSetAck => MessageType_MoneroTransactionAllOutSetAck, + MoneroTransactionSignInputRequest => MessageType_MoneroTransactionSignInputRequest, + MoneroTransactionSignInputAck => MessageType_MoneroTransactionSignInputAck, + MoneroTransactionFinalRequest => MessageType_MoneroTransactionFinalRequest, + MoneroTransactionFinalAck => MessageType_MoneroTransactionFinalAck, + MoneroKeyImageExportInitRequest => MessageType_MoneroKeyImageExportInitRequest, + MoneroKeyImageExportInitAck => MessageType_MoneroKeyImageExportInitAck, + MoneroKeyImageSyncStepRequest => MessageType_MoneroKeyImageSyncStepRequest, + MoneroKeyImageSyncStepAck => MessageType_MoneroKeyImageSyncStepAck, + MoneroKeyImageSyncFinalRequest => MessageType_MoneroKeyImageSyncFinalRequest, + MoneroKeyImageSyncFinalAck => MessageType_MoneroKeyImageSyncFinalAck, + MoneroGetAddress => MessageType_MoneroGetAddress, + MoneroAddress => MessageType_MoneroAddress, + MoneroGetWatchKey => MessageType_MoneroGetWatchKey, + MoneroWatchKey => MessageType_MoneroWatchKey, + DebugMoneroDiagRequest => MessageType_DebugMoneroDiagRequest, + DebugMoneroDiagAck => MessageType_DebugMoneroDiagAck, + MoneroGetTxKeyRequest => MessageType_MoneroGetTxKeyRequest, + MoneroGetTxKeyAck => MessageType_MoneroGetTxKeyAck, + MoneroLiveRefreshStartRequest => MessageType_MoneroLiveRefreshStartRequest, + MoneroLiveRefreshStartAck => MessageType_MoneroLiveRefreshStartAck, + MoneroLiveRefreshStepRequest => MessageType_MoneroLiveRefreshStepRequest, + MoneroLiveRefreshStepAck => MessageType_MoneroLiveRefreshStepAck, + MoneroLiveRefreshFinalRequest => MessageType_MoneroLiveRefreshFinalRequest, + MoneroLiveRefreshFinalAck => MessageType_MoneroLiveRefreshFinalAck, +} + +#[cfg(feature = "nem")] +trezor_message_impl! { + NEMGetAddress => MessageType_NEMGetAddress, + NEMAddress => MessageType_NEMAddress, + NEMSignTx => MessageType_NEMSignTx, + NEMSignedTx => MessageType_NEMSignedTx, + NEMDecryptMessage => MessageType_NEMDecryptMessage, + NEMDecryptedMessage => MessageType_NEMDecryptedMessage, +} + +#[cfg(feature = "ripple")] +trezor_message_impl! { + RippleGetAddress => MessageType_RippleGetAddress, + RippleAddress => MessageType_RippleAddress, + RippleSignTx => MessageType_RippleSignTx, + RippleSignedTx => MessageType_RippleSignedTx, +} + +#[cfg(feature = "solana")] +trezor_message_impl! { + SolanaGetPublicKey => MessageType_SolanaGetPublicKey, + SolanaPublicKey => MessageType_SolanaPublicKey, + SolanaGetAddress => MessageType_SolanaGetAddress, + SolanaAddress => MessageType_SolanaAddress, + SolanaSignTx => MessageType_SolanaSignTx, + SolanaTxSignature => MessageType_SolanaTxSignature, +} + +#[cfg(feature = "stellar")] +trezor_message_impl! { + StellarSignTx => MessageType_StellarSignTx, + StellarTxOpRequest => MessageType_StellarTxOpRequest, + StellarGetAddress => MessageType_StellarGetAddress, + StellarAddress => MessageType_StellarAddress, + StellarCreateAccountOp => MessageType_StellarCreateAccountOp, + StellarPaymentOp => MessageType_StellarPaymentOp, + StellarPathPaymentStrictReceiveOp => MessageType_StellarPathPaymentStrictReceiveOp, + StellarManageSellOfferOp => MessageType_StellarManageSellOfferOp, + StellarCreatePassiveSellOfferOp => MessageType_StellarCreatePassiveSellOfferOp, + StellarSetOptionsOp => MessageType_StellarSetOptionsOp, + StellarChangeTrustOp => MessageType_StellarChangeTrustOp, + StellarAllowTrustOp => MessageType_StellarAllowTrustOp, + StellarAccountMergeOp => MessageType_StellarAccountMergeOp, + StellarManageDataOp => MessageType_StellarManageDataOp, + StellarBumpSequenceOp => MessageType_StellarBumpSequenceOp, + StellarManageBuyOfferOp => MessageType_StellarManageBuyOfferOp, + StellarPathPaymentStrictSendOp => MessageType_StellarPathPaymentStrictSendOp, + StellarClaimClaimableBalanceOp => MessageType_StellarClaimClaimableBalanceOp, + StellarSignedTx => MessageType_StellarSignedTx, +} + +#[cfg(feature = "tezos")] +trezor_message_impl! { + TezosGetAddress => MessageType_TezosGetAddress, + TezosAddress => MessageType_TezosAddress, + TezosSignTx => MessageType_TezosSignTx, + TezosSignedTx => MessageType_TezosSignedTx, + TezosGetPublicKey => MessageType_TezosGetPublicKey, + TezosPublicKey => MessageType_TezosPublicKey, +} + +#[cfg(feature = "webauthn")] +trezor_message_impl! { + WebAuthnListResidentCredentials => MessageType_WebAuthnListResidentCredentials, + WebAuthnCredentials => MessageType_WebAuthnCredentials, + WebAuthnAddResidentCredential => MessageType_WebAuthnAddResidentCredential, + WebAuthnRemoveResidentCredential => MessageType_WebAuthnRemoveResidentCredential, +} diff --git a/wallet/trezor-client/src/messages/mod.rs b/wallet/trezor-client/src/messages/mod.rs new file mode 100644 index 0000000000..f558259bc8 --- /dev/null +++ b/wallet/trezor-client/src/messages/mod.rs @@ -0,0 +1,26 @@ +//! This module implements the `message_type` getter for all protobuf message types. + +use crate::protos::{MessageType::*, *}; + +/// Extends the protobuf Message trait to also have a static getter for the message +/// type code. +pub trait TrezorMessage: protobuf::Message + std::fmt::Debug { + const MESSAGE_TYPE: MessageType; + + #[inline] + #[deprecated(note = "Use `MESSAGE_TYPE` instead")] + fn message_type() -> MessageType { + Self::MESSAGE_TYPE + } +} + +/// This macro provides the TrezorMessage trait for a protobuf message. +macro_rules! trezor_message_impl { + ($($struct:ident => $mtype:expr),+ $(,)?) => {$( + impl TrezorMessage for $struct { + const MESSAGE_TYPE: MessageType = $mtype; + } + )+}; +} + +include!("./generated.rs"); diff --git a/wallet/trezor-client/src/protos/generated/messages.rs b/wallet/trezor-client/src/protos/generated/messages.rs new file mode 100644 index 0000000000..4ce75c2df3 --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages.rs @@ -0,0 +1,1963 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.MessageType) +pub enum MessageType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_Initialize) + MessageType_Initialize = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_Ping) + MessageType_Ping = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_Success) + MessageType_Success = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_Failure) + MessageType_Failure = 3, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ChangePin) + MessageType_ChangePin = 4, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_WipeDevice) + MessageType_WipeDevice = 5, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_GetEntropy) + MessageType_GetEntropy = 9, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_Entropy) + MessageType_Entropy = 10, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_LoadDevice) + MessageType_LoadDevice = 13, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ResetDevice) + MessageType_ResetDevice = 14, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_SetBusy) + MessageType_SetBusy = 16, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_Features) + MessageType_Features = 17, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_PinMatrixRequest) + MessageType_PinMatrixRequest = 18, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_PinMatrixAck) + MessageType_PinMatrixAck = 19, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_Cancel) + MessageType_Cancel = 20, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_LockDevice) + MessageType_LockDevice = 24, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ApplySettings) + MessageType_ApplySettings = 25, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ButtonRequest) + MessageType_ButtonRequest = 26, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ButtonAck) + MessageType_ButtonAck = 27, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ApplyFlags) + MessageType_ApplyFlags = 28, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_GetNonce) + MessageType_GetNonce = 31, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_Nonce) + MessageType_Nonce = 33, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_BackupDevice) + MessageType_BackupDevice = 34, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EntropyRequest) + MessageType_EntropyRequest = 35, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EntropyAck) + MessageType_EntropyAck = 36, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_PassphraseRequest) + MessageType_PassphraseRequest = 41, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_PassphraseAck) + MessageType_PassphraseAck = 42, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_RecoveryDevice) + MessageType_RecoveryDevice = 45, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_WordRequest) + MessageType_WordRequest = 46, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_WordAck) + MessageType_WordAck = 47, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_GetFeatures) + MessageType_GetFeatures = 55, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_SdProtect) + MessageType_SdProtect = 79, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ChangeWipeCode) + MessageType_ChangeWipeCode = 82, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EndSession) + MessageType_EndSession = 83, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DoPreauthorized) + MessageType_DoPreauthorized = 84, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_PreauthorizedRequest) + MessageType_PreauthorizedRequest = 85, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CancelAuthorization) + MessageType_CancelAuthorization = 86, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_RebootToBootloader) + MessageType_RebootToBootloader = 87, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_GetFirmwareHash) + MessageType_GetFirmwareHash = 88, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_FirmwareHash) + MessageType_FirmwareHash = 89, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_UnlockPath) + MessageType_UnlockPath = 93, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_UnlockedPathRequest) + MessageType_UnlockedPathRequest = 94, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ShowDeviceTutorial) + MessageType_ShowDeviceTutorial = 95, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_UnlockBootloader) + MessageType_UnlockBootloader = 96, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_AuthenticateDevice) + MessageType_AuthenticateDevice = 97, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_AuthenticityProof) + MessageType_AuthenticityProof = 98, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ChangeLanguage) + MessageType_ChangeLanguage = 990, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_TranslationDataRequest) + MessageType_TranslationDataRequest = 991, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_TranslationDataAck) + MessageType_TranslationDataAck = 992, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_SetU2FCounter) + MessageType_SetU2FCounter = 63, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_GetNextU2FCounter) + MessageType_GetNextU2FCounter = 80, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_NextU2FCounter) + MessageType_NextU2FCounter = 81, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_Deprecated_PassphraseStateRequest) + MessageType_Deprecated_PassphraseStateRequest = 77, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_Deprecated_PassphraseStateAck) + MessageType_Deprecated_PassphraseStateAck = 78, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_FirmwareErase) + MessageType_FirmwareErase = 6, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_FirmwareUpload) + MessageType_FirmwareUpload = 7, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_FirmwareRequest) + MessageType_FirmwareRequest = 8, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ProdTestT1) + MessageType_ProdTestT1 = 32, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_GetPublicKey) + MessageType_GetPublicKey = 11, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_PublicKey) + MessageType_PublicKey = 12, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_SignTx) + MessageType_SignTx = 15, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_TxRequest) + MessageType_TxRequest = 21, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_TxAck) + MessageType_TxAck = 22, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_GetAddress) + MessageType_GetAddress = 29, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_Address) + MessageType_Address = 30, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_TxAckPaymentRequest) + MessageType_TxAckPaymentRequest = 37, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_SignMessage) + MessageType_SignMessage = 38, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_VerifyMessage) + MessageType_VerifyMessage = 39, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MessageSignature) + MessageType_MessageSignature = 40, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_GetOwnershipId) + MessageType_GetOwnershipId = 43, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_OwnershipId) + MessageType_OwnershipId = 44, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_GetOwnershipProof) + MessageType_GetOwnershipProof = 49, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_OwnershipProof) + MessageType_OwnershipProof = 50, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_AuthorizeCoinJoin) + MessageType_AuthorizeCoinJoin = 51, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CipherKeyValue) + MessageType_CipherKeyValue = 23, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CipheredKeyValue) + MessageType_CipheredKeyValue = 48, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_SignIdentity) + MessageType_SignIdentity = 53, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_SignedIdentity) + MessageType_SignedIdentity = 54, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_GetECDHSessionKey) + MessageType_GetECDHSessionKey = 61, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ECDHSessionKey) + MessageType_ECDHSessionKey = 62, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CosiCommit) + MessageType_CosiCommit = 71, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CosiCommitment) + MessageType_CosiCommitment = 72, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CosiSign) + MessageType_CosiSign = 73, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CosiSignature) + MessageType_CosiSignature = 74, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugLinkDecision) + MessageType_DebugLinkDecision = 100, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugLinkGetState) + MessageType_DebugLinkGetState = 101, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugLinkState) + MessageType_DebugLinkState = 102, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugLinkStop) + MessageType_DebugLinkStop = 103, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugLinkLog) + MessageType_DebugLinkLog = 104, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugLinkMemoryRead) + MessageType_DebugLinkMemoryRead = 110, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugLinkMemory) + MessageType_DebugLinkMemory = 111, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugLinkMemoryWrite) + MessageType_DebugLinkMemoryWrite = 112, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugLinkFlashErase) + MessageType_DebugLinkFlashErase = 113, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugLinkLayout) + MessageType_DebugLinkLayout = 9001, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugLinkReseedRandom) + MessageType_DebugLinkReseedRandom = 9002, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugLinkRecordScreen) + MessageType_DebugLinkRecordScreen = 9003, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugLinkEraseSdCard) + MessageType_DebugLinkEraseSdCard = 9005, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugLinkWatchLayout) + MessageType_DebugLinkWatchLayout = 9006, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugLinkResetDebugEvents) + MessageType_DebugLinkResetDebugEvents = 9007, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumGetPublicKey) + MessageType_EthereumGetPublicKey = 450, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumPublicKey) + MessageType_EthereumPublicKey = 451, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumGetAddress) + MessageType_EthereumGetAddress = 56, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumAddress) + MessageType_EthereumAddress = 57, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumSignTx) + MessageType_EthereumSignTx = 58, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumSignTxEIP1559) + MessageType_EthereumSignTxEIP1559 = 452, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumTxRequest) + MessageType_EthereumTxRequest = 59, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumTxAck) + MessageType_EthereumTxAck = 60, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumSignMessage) + MessageType_EthereumSignMessage = 64, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumVerifyMessage) + MessageType_EthereumVerifyMessage = 65, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumMessageSignature) + MessageType_EthereumMessageSignature = 66, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumSignTypedData) + MessageType_EthereumSignTypedData = 464, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumTypedDataStructRequest) + MessageType_EthereumTypedDataStructRequest = 465, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumTypedDataStructAck) + MessageType_EthereumTypedDataStructAck = 466, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumTypedDataValueRequest) + MessageType_EthereumTypedDataValueRequest = 467, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumTypedDataValueAck) + MessageType_EthereumTypedDataValueAck = 468, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumTypedDataSignature) + MessageType_EthereumTypedDataSignature = 469, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EthereumSignTypedHash) + MessageType_EthereumSignTypedHash = 470, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_NEMGetAddress) + MessageType_NEMGetAddress = 67, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_NEMAddress) + MessageType_NEMAddress = 68, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_NEMSignTx) + MessageType_NEMSignTx = 69, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_NEMSignedTx) + MessageType_NEMSignedTx = 70, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_NEMDecryptMessage) + MessageType_NEMDecryptMessage = 75, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_NEMDecryptedMessage) + MessageType_NEMDecryptedMessage = 76, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_TezosGetAddress) + MessageType_TezosGetAddress = 150, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_TezosAddress) + MessageType_TezosAddress = 151, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_TezosSignTx) + MessageType_TezosSignTx = 152, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_TezosSignedTx) + MessageType_TezosSignedTx = 153, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_TezosGetPublicKey) + MessageType_TezosGetPublicKey = 154, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_TezosPublicKey) + MessageType_TezosPublicKey = 155, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarSignTx) + MessageType_StellarSignTx = 202, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarTxOpRequest) + MessageType_StellarTxOpRequest = 203, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarGetAddress) + MessageType_StellarGetAddress = 207, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarAddress) + MessageType_StellarAddress = 208, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarCreateAccountOp) + MessageType_StellarCreateAccountOp = 210, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarPaymentOp) + MessageType_StellarPaymentOp = 211, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarPathPaymentStrictReceiveOp) + MessageType_StellarPathPaymentStrictReceiveOp = 212, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarManageSellOfferOp) + MessageType_StellarManageSellOfferOp = 213, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarCreatePassiveSellOfferOp) + MessageType_StellarCreatePassiveSellOfferOp = 214, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarSetOptionsOp) + MessageType_StellarSetOptionsOp = 215, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarChangeTrustOp) + MessageType_StellarChangeTrustOp = 216, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarAllowTrustOp) + MessageType_StellarAllowTrustOp = 217, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarAccountMergeOp) + MessageType_StellarAccountMergeOp = 218, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarManageDataOp) + MessageType_StellarManageDataOp = 220, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarBumpSequenceOp) + MessageType_StellarBumpSequenceOp = 221, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarManageBuyOfferOp) + MessageType_StellarManageBuyOfferOp = 222, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarPathPaymentStrictSendOp) + MessageType_StellarPathPaymentStrictSendOp = 223, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarClaimClaimableBalanceOp) + MessageType_StellarClaimClaimableBalanceOp = 225, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_StellarSignedTx) + MessageType_StellarSignedTx = 230, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoGetPublicKey) + MessageType_CardanoGetPublicKey = 305, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoPublicKey) + MessageType_CardanoPublicKey = 306, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoGetAddress) + MessageType_CardanoGetAddress = 307, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoAddress) + MessageType_CardanoAddress = 308, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxItemAck) + MessageType_CardanoTxItemAck = 313, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxAuxiliaryDataSupplement) + MessageType_CardanoTxAuxiliaryDataSupplement = 314, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxWitnessRequest) + MessageType_CardanoTxWitnessRequest = 315, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxWitnessResponse) + MessageType_CardanoTxWitnessResponse = 316, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxHostAck) + MessageType_CardanoTxHostAck = 317, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxBodyHash) + MessageType_CardanoTxBodyHash = 318, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoSignTxFinished) + MessageType_CardanoSignTxFinished = 319, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoSignTxInit) + MessageType_CardanoSignTxInit = 320, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxInput) + MessageType_CardanoTxInput = 321, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxOutput) + MessageType_CardanoTxOutput = 322, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoAssetGroup) + MessageType_CardanoAssetGroup = 323, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoToken) + MessageType_CardanoToken = 324, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxCertificate) + MessageType_CardanoTxCertificate = 325, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxWithdrawal) + MessageType_CardanoTxWithdrawal = 326, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxAuxiliaryData) + MessageType_CardanoTxAuxiliaryData = 327, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoPoolOwner) + MessageType_CardanoPoolOwner = 328, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoPoolRelayParameters) + MessageType_CardanoPoolRelayParameters = 329, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoGetNativeScriptHash) + MessageType_CardanoGetNativeScriptHash = 330, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoNativeScriptHash) + MessageType_CardanoNativeScriptHash = 331, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxMint) + MessageType_CardanoTxMint = 332, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxCollateralInput) + MessageType_CardanoTxCollateralInput = 333, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxRequiredSigner) + MessageType_CardanoTxRequiredSigner = 334, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxInlineDatumChunk) + MessageType_CardanoTxInlineDatumChunk = 335, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxReferenceScriptChunk) + MessageType_CardanoTxReferenceScriptChunk = 336, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_CardanoTxReferenceInput) + MessageType_CardanoTxReferenceInput = 337, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_RippleGetAddress) + MessageType_RippleGetAddress = 400, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_RippleAddress) + MessageType_RippleAddress = 401, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_RippleSignTx) + MessageType_RippleSignTx = 402, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_RippleSignedTx) + MessageType_RippleSignedTx = 403, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroTransactionInitRequest) + MessageType_MoneroTransactionInitRequest = 501, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroTransactionInitAck) + MessageType_MoneroTransactionInitAck = 502, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroTransactionSetInputRequest) + MessageType_MoneroTransactionSetInputRequest = 503, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroTransactionSetInputAck) + MessageType_MoneroTransactionSetInputAck = 504, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroTransactionInputViniRequest) + MessageType_MoneroTransactionInputViniRequest = 507, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroTransactionInputViniAck) + MessageType_MoneroTransactionInputViniAck = 508, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroTransactionAllInputsSetRequest) + MessageType_MoneroTransactionAllInputsSetRequest = 509, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroTransactionAllInputsSetAck) + MessageType_MoneroTransactionAllInputsSetAck = 510, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroTransactionSetOutputRequest) + MessageType_MoneroTransactionSetOutputRequest = 511, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroTransactionSetOutputAck) + MessageType_MoneroTransactionSetOutputAck = 512, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroTransactionAllOutSetRequest) + MessageType_MoneroTransactionAllOutSetRequest = 513, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroTransactionAllOutSetAck) + MessageType_MoneroTransactionAllOutSetAck = 514, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroTransactionSignInputRequest) + MessageType_MoneroTransactionSignInputRequest = 515, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroTransactionSignInputAck) + MessageType_MoneroTransactionSignInputAck = 516, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroTransactionFinalRequest) + MessageType_MoneroTransactionFinalRequest = 517, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroTransactionFinalAck) + MessageType_MoneroTransactionFinalAck = 518, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroKeyImageExportInitRequest) + MessageType_MoneroKeyImageExportInitRequest = 530, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroKeyImageExportInitAck) + MessageType_MoneroKeyImageExportInitAck = 531, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroKeyImageSyncStepRequest) + MessageType_MoneroKeyImageSyncStepRequest = 532, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroKeyImageSyncStepAck) + MessageType_MoneroKeyImageSyncStepAck = 533, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroKeyImageSyncFinalRequest) + MessageType_MoneroKeyImageSyncFinalRequest = 534, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroKeyImageSyncFinalAck) + MessageType_MoneroKeyImageSyncFinalAck = 535, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroGetAddress) + MessageType_MoneroGetAddress = 540, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroAddress) + MessageType_MoneroAddress = 541, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroGetWatchKey) + MessageType_MoneroGetWatchKey = 542, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroWatchKey) + MessageType_MoneroWatchKey = 543, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugMoneroDiagRequest) + MessageType_DebugMoneroDiagRequest = 546, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_DebugMoneroDiagAck) + MessageType_DebugMoneroDiagAck = 547, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroGetTxKeyRequest) + MessageType_MoneroGetTxKeyRequest = 550, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroGetTxKeyAck) + MessageType_MoneroGetTxKeyAck = 551, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroLiveRefreshStartRequest) + MessageType_MoneroLiveRefreshStartRequest = 552, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroLiveRefreshStartAck) + MessageType_MoneroLiveRefreshStartAck = 553, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroLiveRefreshStepRequest) + MessageType_MoneroLiveRefreshStepRequest = 554, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroLiveRefreshStepAck) + MessageType_MoneroLiveRefreshStepAck = 555, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroLiveRefreshFinalRequest) + MessageType_MoneroLiveRefreshFinalRequest = 556, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MoneroLiveRefreshFinalAck) + MessageType_MoneroLiveRefreshFinalAck = 557, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EosGetPublicKey) + MessageType_EosGetPublicKey = 600, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EosPublicKey) + MessageType_EosPublicKey = 601, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EosSignTx) + MessageType_EosSignTx = 602, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EosTxActionRequest) + MessageType_EosTxActionRequest = 603, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EosTxActionAck) + MessageType_EosTxActionAck = 604, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_EosSignedTx) + MessageType_EosSignedTx = 605, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_BinanceGetAddress) + MessageType_BinanceGetAddress = 700, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_BinanceAddress) + MessageType_BinanceAddress = 701, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_BinanceGetPublicKey) + MessageType_BinanceGetPublicKey = 702, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_BinancePublicKey) + MessageType_BinancePublicKey = 703, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_BinanceSignTx) + MessageType_BinanceSignTx = 704, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_BinanceTxRequest) + MessageType_BinanceTxRequest = 705, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_BinanceTransferMsg) + MessageType_BinanceTransferMsg = 706, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_BinanceOrderMsg) + MessageType_BinanceOrderMsg = 707, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_BinanceCancelMsg) + MessageType_BinanceCancelMsg = 708, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_BinanceSignedTx) + MessageType_BinanceSignedTx = 709, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_WebAuthnListResidentCredentials) + MessageType_WebAuthnListResidentCredentials = 800, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_WebAuthnCredentials) + MessageType_WebAuthnCredentials = 801, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_WebAuthnAddResidentCredential) + MessageType_WebAuthnAddResidentCredential = 802, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_WebAuthnRemoveResidentCredential) + MessageType_WebAuthnRemoveResidentCredential = 803, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_SolanaGetPublicKey) + MessageType_SolanaGetPublicKey = 900, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_SolanaPublicKey) + MessageType_SolanaPublicKey = 901, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_SolanaGetAddress) + MessageType_SolanaGetAddress = 902, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_SolanaAddress) + MessageType_SolanaAddress = 903, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_SolanaSignTx) + MessageType_SolanaSignTx = 904, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_SolanaTxSignature) + MessageType_SolanaTxSignature = 905, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MintlayerGetAddress) + MessageType_MintlayerGetAddress = 1000, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MintlayerAddress) + MessageType_MintlayerAddress = 1001, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MintlayerGetPublicKey) + MessageType_MintlayerGetPublicKey = 1002, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MintlayerPublicKey) + MessageType_MintlayerPublicKey = 1003, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MintlayerVerifySig) + MessageType_MintlayerVerifySig = 1004, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MintlayerSignTx) + MessageType_MintlayerSignTx = 1005, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MintlayerTxRequest) + MessageType_MintlayerTxRequest = 1006, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MintlayerTxAckUtxoInput) + MessageType_MintlayerTxAckUtxoInput = 1007, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_MintlayerTxAckOutput) + MessageType_MintlayerTxAckOutput = 1008, +} + +impl ::protobuf::Enum for MessageType { + const NAME: &'static str = "MessageType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(MessageType::MessageType_Initialize), + 1 => ::std::option::Option::Some(MessageType::MessageType_Ping), + 2 => ::std::option::Option::Some(MessageType::MessageType_Success), + 3 => ::std::option::Option::Some(MessageType::MessageType_Failure), + 4 => ::std::option::Option::Some(MessageType::MessageType_ChangePin), + 5 => ::std::option::Option::Some(MessageType::MessageType_WipeDevice), + 9 => ::std::option::Option::Some(MessageType::MessageType_GetEntropy), + 10 => ::std::option::Option::Some(MessageType::MessageType_Entropy), + 13 => ::std::option::Option::Some(MessageType::MessageType_LoadDevice), + 14 => ::std::option::Option::Some(MessageType::MessageType_ResetDevice), + 16 => ::std::option::Option::Some(MessageType::MessageType_SetBusy), + 17 => ::std::option::Option::Some(MessageType::MessageType_Features), + 18 => ::std::option::Option::Some(MessageType::MessageType_PinMatrixRequest), + 19 => ::std::option::Option::Some(MessageType::MessageType_PinMatrixAck), + 20 => ::std::option::Option::Some(MessageType::MessageType_Cancel), + 24 => ::std::option::Option::Some(MessageType::MessageType_LockDevice), + 25 => ::std::option::Option::Some(MessageType::MessageType_ApplySettings), + 26 => ::std::option::Option::Some(MessageType::MessageType_ButtonRequest), + 27 => ::std::option::Option::Some(MessageType::MessageType_ButtonAck), + 28 => ::std::option::Option::Some(MessageType::MessageType_ApplyFlags), + 31 => ::std::option::Option::Some(MessageType::MessageType_GetNonce), + 33 => ::std::option::Option::Some(MessageType::MessageType_Nonce), + 34 => ::std::option::Option::Some(MessageType::MessageType_BackupDevice), + 35 => ::std::option::Option::Some(MessageType::MessageType_EntropyRequest), + 36 => ::std::option::Option::Some(MessageType::MessageType_EntropyAck), + 41 => ::std::option::Option::Some(MessageType::MessageType_PassphraseRequest), + 42 => ::std::option::Option::Some(MessageType::MessageType_PassphraseAck), + 45 => ::std::option::Option::Some(MessageType::MessageType_RecoveryDevice), + 46 => ::std::option::Option::Some(MessageType::MessageType_WordRequest), + 47 => ::std::option::Option::Some(MessageType::MessageType_WordAck), + 55 => ::std::option::Option::Some(MessageType::MessageType_GetFeatures), + 79 => ::std::option::Option::Some(MessageType::MessageType_SdProtect), + 82 => ::std::option::Option::Some(MessageType::MessageType_ChangeWipeCode), + 83 => ::std::option::Option::Some(MessageType::MessageType_EndSession), + 84 => ::std::option::Option::Some(MessageType::MessageType_DoPreauthorized), + 85 => ::std::option::Option::Some(MessageType::MessageType_PreauthorizedRequest), + 86 => ::std::option::Option::Some(MessageType::MessageType_CancelAuthorization), + 87 => ::std::option::Option::Some(MessageType::MessageType_RebootToBootloader), + 88 => ::std::option::Option::Some(MessageType::MessageType_GetFirmwareHash), + 89 => ::std::option::Option::Some(MessageType::MessageType_FirmwareHash), + 93 => ::std::option::Option::Some(MessageType::MessageType_UnlockPath), + 94 => ::std::option::Option::Some(MessageType::MessageType_UnlockedPathRequest), + 95 => ::std::option::Option::Some(MessageType::MessageType_ShowDeviceTutorial), + 96 => ::std::option::Option::Some(MessageType::MessageType_UnlockBootloader), + 97 => ::std::option::Option::Some(MessageType::MessageType_AuthenticateDevice), + 98 => ::std::option::Option::Some(MessageType::MessageType_AuthenticityProof), + 990 => ::std::option::Option::Some(MessageType::MessageType_ChangeLanguage), + 991 => ::std::option::Option::Some(MessageType::MessageType_TranslationDataRequest), + 992 => ::std::option::Option::Some(MessageType::MessageType_TranslationDataAck), + 63 => ::std::option::Option::Some(MessageType::MessageType_SetU2FCounter), + 80 => ::std::option::Option::Some(MessageType::MessageType_GetNextU2FCounter), + 81 => ::std::option::Option::Some(MessageType::MessageType_NextU2FCounter), + 77 => ::std::option::Option::Some(MessageType::MessageType_Deprecated_PassphraseStateRequest), + 78 => ::std::option::Option::Some(MessageType::MessageType_Deprecated_PassphraseStateAck), + 6 => ::std::option::Option::Some(MessageType::MessageType_FirmwareErase), + 7 => ::std::option::Option::Some(MessageType::MessageType_FirmwareUpload), + 8 => ::std::option::Option::Some(MessageType::MessageType_FirmwareRequest), + 32 => ::std::option::Option::Some(MessageType::MessageType_ProdTestT1), + 11 => ::std::option::Option::Some(MessageType::MessageType_GetPublicKey), + 12 => ::std::option::Option::Some(MessageType::MessageType_PublicKey), + 15 => ::std::option::Option::Some(MessageType::MessageType_SignTx), + 21 => ::std::option::Option::Some(MessageType::MessageType_TxRequest), + 22 => ::std::option::Option::Some(MessageType::MessageType_TxAck), + 29 => ::std::option::Option::Some(MessageType::MessageType_GetAddress), + 30 => ::std::option::Option::Some(MessageType::MessageType_Address), + 37 => ::std::option::Option::Some(MessageType::MessageType_TxAckPaymentRequest), + 38 => ::std::option::Option::Some(MessageType::MessageType_SignMessage), + 39 => ::std::option::Option::Some(MessageType::MessageType_VerifyMessage), + 40 => ::std::option::Option::Some(MessageType::MessageType_MessageSignature), + 43 => ::std::option::Option::Some(MessageType::MessageType_GetOwnershipId), + 44 => ::std::option::Option::Some(MessageType::MessageType_OwnershipId), + 49 => ::std::option::Option::Some(MessageType::MessageType_GetOwnershipProof), + 50 => ::std::option::Option::Some(MessageType::MessageType_OwnershipProof), + 51 => ::std::option::Option::Some(MessageType::MessageType_AuthorizeCoinJoin), + 23 => ::std::option::Option::Some(MessageType::MessageType_CipherKeyValue), + 48 => ::std::option::Option::Some(MessageType::MessageType_CipheredKeyValue), + 53 => ::std::option::Option::Some(MessageType::MessageType_SignIdentity), + 54 => ::std::option::Option::Some(MessageType::MessageType_SignedIdentity), + 61 => ::std::option::Option::Some(MessageType::MessageType_GetECDHSessionKey), + 62 => ::std::option::Option::Some(MessageType::MessageType_ECDHSessionKey), + 71 => ::std::option::Option::Some(MessageType::MessageType_CosiCommit), + 72 => ::std::option::Option::Some(MessageType::MessageType_CosiCommitment), + 73 => ::std::option::Option::Some(MessageType::MessageType_CosiSign), + 74 => ::std::option::Option::Some(MessageType::MessageType_CosiSignature), + 100 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkDecision), + 101 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkGetState), + 102 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkState), + 103 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkStop), + 104 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkLog), + 110 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkMemoryRead), + 111 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkMemory), + 112 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkMemoryWrite), + 113 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkFlashErase), + 9001 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkLayout), + 9002 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkReseedRandom), + 9003 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkRecordScreen), + 9005 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkEraseSdCard), + 9006 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkWatchLayout), + 9007 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkResetDebugEvents), + 450 => ::std::option::Option::Some(MessageType::MessageType_EthereumGetPublicKey), + 451 => ::std::option::Option::Some(MessageType::MessageType_EthereumPublicKey), + 56 => ::std::option::Option::Some(MessageType::MessageType_EthereumGetAddress), + 57 => ::std::option::Option::Some(MessageType::MessageType_EthereumAddress), + 58 => ::std::option::Option::Some(MessageType::MessageType_EthereumSignTx), + 452 => ::std::option::Option::Some(MessageType::MessageType_EthereumSignTxEIP1559), + 59 => ::std::option::Option::Some(MessageType::MessageType_EthereumTxRequest), + 60 => ::std::option::Option::Some(MessageType::MessageType_EthereumTxAck), + 64 => ::std::option::Option::Some(MessageType::MessageType_EthereumSignMessage), + 65 => ::std::option::Option::Some(MessageType::MessageType_EthereumVerifyMessage), + 66 => ::std::option::Option::Some(MessageType::MessageType_EthereumMessageSignature), + 464 => ::std::option::Option::Some(MessageType::MessageType_EthereumSignTypedData), + 465 => ::std::option::Option::Some(MessageType::MessageType_EthereumTypedDataStructRequest), + 466 => ::std::option::Option::Some(MessageType::MessageType_EthereumTypedDataStructAck), + 467 => ::std::option::Option::Some(MessageType::MessageType_EthereumTypedDataValueRequest), + 468 => ::std::option::Option::Some(MessageType::MessageType_EthereumTypedDataValueAck), + 469 => ::std::option::Option::Some(MessageType::MessageType_EthereumTypedDataSignature), + 470 => ::std::option::Option::Some(MessageType::MessageType_EthereumSignTypedHash), + 67 => ::std::option::Option::Some(MessageType::MessageType_NEMGetAddress), + 68 => ::std::option::Option::Some(MessageType::MessageType_NEMAddress), + 69 => ::std::option::Option::Some(MessageType::MessageType_NEMSignTx), + 70 => ::std::option::Option::Some(MessageType::MessageType_NEMSignedTx), + 75 => ::std::option::Option::Some(MessageType::MessageType_NEMDecryptMessage), + 76 => ::std::option::Option::Some(MessageType::MessageType_NEMDecryptedMessage), + 150 => ::std::option::Option::Some(MessageType::MessageType_TezosGetAddress), + 151 => ::std::option::Option::Some(MessageType::MessageType_TezosAddress), + 152 => ::std::option::Option::Some(MessageType::MessageType_TezosSignTx), + 153 => ::std::option::Option::Some(MessageType::MessageType_TezosSignedTx), + 154 => ::std::option::Option::Some(MessageType::MessageType_TezosGetPublicKey), + 155 => ::std::option::Option::Some(MessageType::MessageType_TezosPublicKey), + 202 => ::std::option::Option::Some(MessageType::MessageType_StellarSignTx), + 203 => ::std::option::Option::Some(MessageType::MessageType_StellarTxOpRequest), + 207 => ::std::option::Option::Some(MessageType::MessageType_StellarGetAddress), + 208 => ::std::option::Option::Some(MessageType::MessageType_StellarAddress), + 210 => ::std::option::Option::Some(MessageType::MessageType_StellarCreateAccountOp), + 211 => ::std::option::Option::Some(MessageType::MessageType_StellarPaymentOp), + 212 => ::std::option::Option::Some(MessageType::MessageType_StellarPathPaymentStrictReceiveOp), + 213 => ::std::option::Option::Some(MessageType::MessageType_StellarManageSellOfferOp), + 214 => ::std::option::Option::Some(MessageType::MessageType_StellarCreatePassiveSellOfferOp), + 215 => ::std::option::Option::Some(MessageType::MessageType_StellarSetOptionsOp), + 216 => ::std::option::Option::Some(MessageType::MessageType_StellarChangeTrustOp), + 217 => ::std::option::Option::Some(MessageType::MessageType_StellarAllowTrustOp), + 218 => ::std::option::Option::Some(MessageType::MessageType_StellarAccountMergeOp), + 220 => ::std::option::Option::Some(MessageType::MessageType_StellarManageDataOp), + 221 => ::std::option::Option::Some(MessageType::MessageType_StellarBumpSequenceOp), + 222 => ::std::option::Option::Some(MessageType::MessageType_StellarManageBuyOfferOp), + 223 => ::std::option::Option::Some(MessageType::MessageType_StellarPathPaymentStrictSendOp), + 225 => ::std::option::Option::Some(MessageType::MessageType_StellarClaimClaimableBalanceOp), + 230 => ::std::option::Option::Some(MessageType::MessageType_StellarSignedTx), + 305 => ::std::option::Option::Some(MessageType::MessageType_CardanoGetPublicKey), + 306 => ::std::option::Option::Some(MessageType::MessageType_CardanoPublicKey), + 307 => ::std::option::Option::Some(MessageType::MessageType_CardanoGetAddress), + 308 => ::std::option::Option::Some(MessageType::MessageType_CardanoAddress), + 313 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxItemAck), + 314 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxAuxiliaryDataSupplement), + 315 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxWitnessRequest), + 316 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxWitnessResponse), + 317 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxHostAck), + 318 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxBodyHash), + 319 => ::std::option::Option::Some(MessageType::MessageType_CardanoSignTxFinished), + 320 => ::std::option::Option::Some(MessageType::MessageType_CardanoSignTxInit), + 321 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxInput), + 322 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxOutput), + 323 => ::std::option::Option::Some(MessageType::MessageType_CardanoAssetGroup), + 324 => ::std::option::Option::Some(MessageType::MessageType_CardanoToken), + 325 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxCertificate), + 326 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxWithdrawal), + 327 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxAuxiliaryData), + 328 => ::std::option::Option::Some(MessageType::MessageType_CardanoPoolOwner), + 329 => ::std::option::Option::Some(MessageType::MessageType_CardanoPoolRelayParameters), + 330 => ::std::option::Option::Some(MessageType::MessageType_CardanoGetNativeScriptHash), + 331 => ::std::option::Option::Some(MessageType::MessageType_CardanoNativeScriptHash), + 332 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxMint), + 333 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxCollateralInput), + 334 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxRequiredSigner), + 335 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxInlineDatumChunk), + 336 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxReferenceScriptChunk), + 337 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxReferenceInput), + 400 => ::std::option::Option::Some(MessageType::MessageType_RippleGetAddress), + 401 => ::std::option::Option::Some(MessageType::MessageType_RippleAddress), + 402 => ::std::option::Option::Some(MessageType::MessageType_RippleSignTx), + 403 => ::std::option::Option::Some(MessageType::MessageType_RippleSignedTx), + 501 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionInitRequest), + 502 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionInitAck), + 503 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSetInputRequest), + 504 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSetInputAck), + 507 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionInputViniRequest), + 508 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionInputViniAck), + 509 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionAllInputsSetRequest), + 510 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionAllInputsSetAck), + 511 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSetOutputRequest), + 512 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSetOutputAck), + 513 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionAllOutSetRequest), + 514 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionAllOutSetAck), + 515 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSignInputRequest), + 516 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSignInputAck), + 517 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionFinalRequest), + 518 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionFinalAck), + 530 => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageExportInitRequest), + 531 => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageExportInitAck), + 532 => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageSyncStepRequest), + 533 => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageSyncStepAck), + 534 => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageSyncFinalRequest), + 535 => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageSyncFinalAck), + 540 => ::std::option::Option::Some(MessageType::MessageType_MoneroGetAddress), + 541 => ::std::option::Option::Some(MessageType::MessageType_MoneroAddress), + 542 => ::std::option::Option::Some(MessageType::MessageType_MoneroGetWatchKey), + 543 => ::std::option::Option::Some(MessageType::MessageType_MoneroWatchKey), + 546 => ::std::option::Option::Some(MessageType::MessageType_DebugMoneroDiagRequest), + 547 => ::std::option::Option::Some(MessageType::MessageType_DebugMoneroDiagAck), + 550 => ::std::option::Option::Some(MessageType::MessageType_MoneroGetTxKeyRequest), + 551 => ::std::option::Option::Some(MessageType::MessageType_MoneroGetTxKeyAck), + 552 => ::std::option::Option::Some(MessageType::MessageType_MoneroLiveRefreshStartRequest), + 553 => ::std::option::Option::Some(MessageType::MessageType_MoneroLiveRefreshStartAck), + 554 => ::std::option::Option::Some(MessageType::MessageType_MoneroLiveRefreshStepRequest), + 555 => ::std::option::Option::Some(MessageType::MessageType_MoneroLiveRefreshStepAck), + 556 => ::std::option::Option::Some(MessageType::MessageType_MoneroLiveRefreshFinalRequest), + 557 => ::std::option::Option::Some(MessageType::MessageType_MoneroLiveRefreshFinalAck), + 600 => ::std::option::Option::Some(MessageType::MessageType_EosGetPublicKey), + 601 => ::std::option::Option::Some(MessageType::MessageType_EosPublicKey), + 602 => ::std::option::Option::Some(MessageType::MessageType_EosSignTx), + 603 => ::std::option::Option::Some(MessageType::MessageType_EosTxActionRequest), + 604 => ::std::option::Option::Some(MessageType::MessageType_EosTxActionAck), + 605 => ::std::option::Option::Some(MessageType::MessageType_EosSignedTx), + 700 => ::std::option::Option::Some(MessageType::MessageType_BinanceGetAddress), + 701 => ::std::option::Option::Some(MessageType::MessageType_BinanceAddress), + 702 => ::std::option::Option::Some(MessageType::MessageType_BinanceGetPublicKey), + 703 => ::std::option::Option::Some(MessageType::MessageType_BinancePublicKey), + 704 => ::std::option::Option::Some(MessageType::MessageType_BinanceSignTx), + 705 => ::std::option::Option::Some(MessageType::MessageType_BinanceTxRequest), + 706 => ::std::option::Option::Some(MessageType::MessageType_BinanceTransferMsg), + 707 => ::std::option::Option::Some(MessageType::MessageType_BinanceOrderMsg), + 708 => ::std::option::Option::Some(MessageType::MessageType_BinanceCancelMsg), + 709 => ::std::option::Option::Some(MessageType::MessageType_BinanceSignedTx), + 800 => ::std::option::Option::Some(MessageType::MessageType_WebAuthnListResidentCredentials), + 801 => ::std::option::Option::Some(MessageType::MessageType_WebAuthnCredentials), + 802 => ::std::option::Option::Some(MessageType::MessageType_WebAuthnAddResidentCredential), + 803 => ::std::option::Option::Some(MessageType::MessageType_WebAuthnRemoveResidentCredential), + 900 => ::std::option::Option::Some(MessageType::MessageType_SolanaGetPublicKey), + 901 => ::std::option::Option::Some(MessageType::MessageType_SolanaPublicKey), + 902 => ::std::option::Option::Some(MessageType::MessageType_SolanaGetAddress), + 903 => ::std::option::Option::Some(MessageType::MessageType_SolanaAddress), + 904 => ::std::option::Option::Some(MessageType::MessageType_SolanaSignTx), + 905 => ::std::option::Option::Some(MessageType::MessageType_SolanaTxSignature), + 1000 => ::std::option::Option::Some(MessageType::MessageType_MintlayerGetAddress), + 1001 => ::std::option::Option::Some(MessageType::MessageType_MintlayerAddress), + 1002 => ::std::option::Option::Some(MessageType::MessageType_MintlayerGetPublicKey), + 1003 => ::std::option::Option::Some(MessageType::MessageType_MintlayerPublicKey), + 1004 => ::std::option::Option::Some(MessageType::MessageType_MintlayerVerifySig), + 1005 => ::std::option::Option::Some(MessageType::MessageType_MintlayerSignTx), + 1006 => ::std::option::Option::Some(MessageType::MessageType_MintlayerTxRequest), + 1007 => ::std::option::Option::Some(MessageType::MessageType_MintlayerTxAckUtxoInput), + 1008 => ::std::option::Option::Some(MessageType::MessageType_MintlayerTxAckOutput), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "MessageType_Initialize" => ::std::option::Option::Some(MessageType::MessageType_Initialize), + "MessageType_Ping" => ::std::option::Option::Some(MessageType::MessageType_Ping), + "MessageType_Success" => ::std::option::Option::Some(MessageType::MessageType_Success), + "MessageType_Failure" => ::std::option::Option::Some(MessageType::MessageType_Failure), + "MessageType_ChangePin" => ::std::option::Option::Some(MessageType::MessageType_ChangePin), + "MessageType_WipeDevice" => ::std::option::Option::Some(MessageType::MessageType_WipeDevice), + "MessageType_GetEntropy" => ::std::option::Option::Some(MessageType::MessageType_GetEntropy), + "MessageType_Entropy" => ::std::option::Option::Some(MessageType::MessageType_Entropy), + "MessageType_LoadDevice" => ::std::option::Option::Some(MessageType::MessageType_LoadDevice), + "MessageType_ResetDevice" => ::std::option::Option::Some(MessageType::MessageType_ResetDevice), + "MessageType_SetBusy" => ::std::option::Option::Some(MessageType::MessageType_SetBusy), + "MessageType_Features" => ::std::option::Option::Some(MessageType::MessageType_Features), + "MessageType_PinMatrixRequest" => ::std::option::Option::Some(MessageType::MessageType_PinMatrixRequest), + "MessageType_PinMatrixAck" => ::std::option::Option::Some(MessageType::MessageType_PinMatrixAck), + "MessageType_Cancel" => ::std::option::Option::Some(MessageType::MessageType_Cancel), + "MessageType_LockDevice" => ::std::option::Option::Some(MessageType::MessageType_LockDevice), + "MessageType_ApplySettings" => ::std::option::Option::Some(MessageType::MessageType_ApplySettings), + "MessageType_ButtonRequest" => ::std::option::Option::Some(MessageType::MessageType_ButtonRequest), + "MessageType_ButtonAck" => ::std::option::Option::Some(MessageType::MessageType_ButtonAck), + "MessageType_ApplyFlags" => ::std::option::Option::Some(MessageType::MessageType_ApplyFlags), + "MessageType_GetNonce" => ::std::option::Option::Some(MessageType::MessageType_GetNonce), + "MessageType_Nonce" => ::std::option::Option::Some(MessageType::MessageType_Nonce), + "MessageType_BackupDevice" => ::std::option::Option::Some(MessageType::MessageType_BackupDevice), + "MessageType_EntropyRequest" => ::std::option::Option::Some(MessageType::MessageType_EntropyRequest), + "MessageType_EntropyAck" => ::std::option::Option::Some(MessageType::MessageType_EntropyAck), + "MessageType_PassphraseRequest" => ::std::option::Option::Some(MessageType::MessageType_PassphraseRequest), + "MessageType_PassphraseAck" => ::std::option::Option::Some(MessageType::MessageType_PassphraseAck), + "MessageType_RecoveryDevice" => ::std::option::Option::Some(MessageType::MessageType_RecoveryDevice), + "MessageType_WordRequest" => ::std::option::Option::Some(MessageType::MessageType_WordRequest), + "MessageType_WordAck" => ::std::option::Option::Some(MessageType::MessageType_WordAck), + "MessageType_GetFeatures" => ::std::option::Option::Some(MessageType::MessageType_GetFeatures), + "MessageType_SdProtect" => ::std::option::Option::Some(MessageType::MessageType_SdProtect), + "MessageType_ChangeWipeCode" => ::std::option::Option::Some(MessageType::MessageType_ChangeWipeCode), + "MessageType_EndSession" => ::std::option::Option::Some(MessageType::MessageType_EndSession), + "MessageType_DoPreauthorized" => ::std::option::Option::Some(MessageType::MessageType_DoPreauthorized), + "MessageType_PreauthorizedRequest" => ::std::option::Option::Some(MessageType::MessageType_PreauthorizedRequest), + "MessageType_CancelAuthorization" => ::std::option::Option::Some(MessageType::MessageType_CancelAuthorization), + "MessageType_RebootToBootloader" => ::std::option::Option::Some(MessageType::MessageType_RebootToBootloader), + "MessageType_GetFirmwareHash" => ::std::option::Option::Some(MessageType::MessageType_GetFirmwareHash), + "MessageType_FirmwareHash" => ::std::option::Option::Some(MessageType::MessageType_FirmwareHash), + "MessageType_UnlockPath" => ::std::option::Option::Some(MessageType::MessageType_UnlockPath), + "MessageType_UnlockedPathRequest" => ::std::option::Option::Some(MessageType::MessageType_UnlockedPathRequest), + "MessageType_ShowDeviceTutorial" => ::std::option::Option::Some(MessageType::MessageType_ShowDeviceTutorial), + "MessageType_UnlockBootloader" => ::std::option::Option::Some(MessageType::MessageType_UnlockBootloader), + "MessageType_AuthenticateDevice" => ::std::option::Option::Some(MessageType::MessageType_AuthenticateDevice), + "MessageType_AuthenticityProof" => ::std::option::Option::Some(MessageType::MessageType_AuthenticityProof), + "MessageType_ChangeLanguage" => ::std::option::Option::Some(MessageType::MessageType_ChangeLanguage), + "MessageType_TranslationDataRequest" => ::std::option::Option::Some(MessageType::MessageType_TranslationDataRequest), + "MessageType_TranslationDataAck" => ::std::option::Option::Some(MessageType::MessageType_TranslationDataAck), + "MessageType_SetU2FCounter" => ::std::option::Option::Some(MessageType::MessageType_SetU2FCounter), + "MessageType_GetNextU2FCounter" => ::std::option::Option::Some(MessageType::MessageType_GetNextU2FCounter), + "MessageType_NextU2FCounter" => ::std::option::Option::Some(MessageType::MessageType_NextU2FCounter), + "MessageType_Deprecated_PassphraseStateRequest" => ::std::option::Option::Some(MessageType::MessageType_Deprecated_PassphraseStateRequest), + "MessageType_Deprecated_PassphraseStateAck" => ::std::option::Option::Some(MessageType::MessageType_Deprecated_PassphraseStateAck), + "MessageType_FirmwareErase" => ::std::option::Option::Some(MessageType::MessageType_FirmwareErase), + "MessageType_FirmwareUpload" => ::std::option::Option::Some(MessageType::MessageType_FirmwareUpload), + "MessageType_FirmwareRequest" => ::std::option::Option::Some(MessageType::MessageType_FirmwareRequest), + "MessageType_ProdTestT1" => ::std::option::Option::Some(MessageType::MessageType_ProdTestT1), + "MessageType_GetPublicKey" => ::std::option::Option::Some(MessageType::MessageType_GetPublicKey), + "MessageType_PublicKey" => ::std::option::Option::Some(MessageType::MessageType_PublicKey), + "MessageType_SignTx" => ::std::option::Option::Some(MessageType::MessageType_SignTx), + "MessageType_TxRequest" => ::std::option::Option::Some(MessageType::MessageType_TxRequest), + "MessageType_TxAck" => ::std::option::Option::Some(MessageType::MessageType_TxAck), + "MessageType_GetAddress" => ::std::option::Option::Some(MessageType::MessageType_GetAddress), + "MessageType_Address" => ::std::option::Option::Some(MessageType::MessageType_Address), + "MessageType_TxAckPaymentRequest" => ::std::option::Option::Some(MessageType::MessageType_TxAckPaymentRequest), + "MessageType_SignMessage" => ::std::option::Option::Some(MessageType::MessageType_SignMessage), + "MessageType_VerifyMessage" => ::std::option::Option::Some(MessageType::MessageType_VerifyMessage), + "MessageType_MessageSignature" => ::std::option::Option::Some(MessageType::MessageType_MessageSignature), + "MessageType_GetOwnershipId" => ::std::option::Option::Some(MessageType::MessageType_GetOwnershipId), + "MessageType_OwnershipId" => ::std::option::Option::Some(MessageType::MessageType_OwnershipId), + "MessageType_GetOwnershipProof" => ::std::option::Option::Some(MessageType::MessageType_GetOwnershipProof), + "MessageType_OwnershipProof" => ::std::option::Option::Some(MessageType::MessageType_OwnershipProof), + "MessageType_AuthorizeCoinJoin" => ::std::option::Option::Some(MessageType::MessageType_AuthorizeCoinJoin), + "MessageType_CipherKeyValue" => ::std::option::Option::Some(MessageType::MessageType_CipherKeyValue), + "MessageType_CipheredKeyValue" => ::std::option::Option::Some(MessageType::MessageType_CipheredKeyValue), + "MessageType_SignIdentity" => ::std::option::Option::Some(MessageType::MessageType_SignIdentity), + "MessageType_SignedIdentity" => ::std::option::Option::Some(MessageType::MessageType_SignedIdentity), + "MessageType_GetECDHSessionKey" => ::std::option::Option::Some(MessageType::MessageType_GetECDHSessionKey), + "MessageType_ECDHSessionKey" => ::std::option::Option::Some(MessageType::MessageType_ECDHSessionKey), + "MessageType_CosiCommit" => ::std::option::Option::Some(MessageType::MessageType_CosiCommit), + "MessageType_CosiCommitment" => ::std::option::Option::Some(MessageType::MessageType_CosiCommitment), + "MessageType_CosiSign" => ::std::option::Option::Some(MessageType::MessageType_CosiSign), + "MessageType_CosiSignature" => ::std::option::Option::Some(MessageType::MessageType_CosiSignature), + "MessageType_DebugLinkDecision" => ::std::option::Option::Some(MessageType::MessageType_DebugLinkDecision), + "MessageType_DebugLinkGetState" => ::std::option::Option::Some(MessageType::MessageType_DebugLinkGetState), + "MessageType_DebugLinkState" => ::std::option::Option::Some(MessageType::MessageType_DebugLinkState), + "MessageType_DebugLinkStop" => ::std::option::Option::Some(MessageType::MessageType_DebugLinkStop), + "MessageType_DebugLinkLog" => ::std::option::Option::Some(MessageType::MessageType_DebugLinkLog), + "MessageType_DebugLinkMemoryRead" => ::std::option::Option::Some(MessageType::MessageType_DebugLinkMemoryRead), + "MessageType_DebugLinkMemory" => ::std::option::Option::Some(MessageType::MessageType_DebugLinkMemory), + "MessageType_DebugLinkMemoryWrite" => ::std::option::Option::Some(MessageType::MessageType_DebugLinkMemoryWrite), + "MessageType_DebugLinkFlashErase" => ::std::option::Option::Some(MessageType::MessageType_DebugLinkFlashErase), + "MessageType_DebugLinkLayout" => ::std::option::Option::Some(MessageType::MessageType_DebugLinkLayout), + "MessageType_DebugLinkReseedRandom" => ::std::option::Option::Some(MessageType::MessageType_DebugLinkReseedRandom), + "MessageType_DebugLinkRecordScreen" => ::std::option::Option::Some(MessageType::MessageType_DebugLinkRecordScreen), + "MessageType_DebugLinkEraseSdCard" => ::std::option::Option::Some(MessageType::MessageType_DebugLinkEraseSdCard), + "MessageType_DebugLinkWatchLayout" => ::std::option::Option::Some(MessageType::MessageType_DebugLinkWatchLayout), + "MessageType_DebugLinkResetDebugEvents" => ::std::option::Option::Some(MessageType::MessageType_DebugLinkResetDebugEvents), + "MessageType_EthereumGetPublicKey" => ::std::option::Option::Some(MessageType::MessageType_EthereumGetPublicKey), + "MessageType_EthereumPublicKey" => ::std::option::Option::Some(MessageType::MessageType_EthereumPublicKey), + "MessageType_EthereumGetAddress" => ::std::option::Option::Some(MessageType::MessageType_EthereumGetAddress), + "MessageType_EthereumAddress" => ::std::option::Option::Some(MessageType::MessageType_EthereumAddress), + "MessageType_EthereumSignTx" => ::std::option::Option::Some(MessageType::MessageType_EthereumSignTx), + "MessageType_EthereumSignTxEIP1559" => ::std::option::Option::Some(MessageType::MessageType_EthereumSignTxEIP1559), + "MessageType_EthereumTxRequest" => ::std::option::Option::Some(MessageType::MessageType_EthereumTxRequest), + "MessageType_EthereumTxAck" => ::std::option::Option::Some(MessageType::MessageType_EthereumTxAck), + "MessageType_EthereumSignMessage" => ::std::option::Option::Some(MessageType::MessageType_EthereumSignMessage), + "MessageType_EthereumVerifyMessage" => ::std::option::Option::Some(MessageType::MessageType_EthereumVerifyMessage), + "MessageType_EthereumMessageSignature" => ::std::option::Option::Some(MessageType::MessageType_EthereumMessageSignature), + "MessageType_EthereumSignTypedData" => ::std::option::Option::Some(MessageType::MessageType_EthereumSignTypedData), + "MessageType_EthereumTypedDataStructRequest" => ::std::option::Option::Some(MessageType::MessageType_EthereumTypedDataStructRequest), + "MessageType_EthereumTypedDataStructAck" => ::std::option::Option::Some(MessageType::MessageType_EthereumTypedDataStructAck), + "MessageType_EthereumTypedDataValueRequest" => ::std::option::Option::Some(MessageType::MessageType_EthereumTypedDataValueRequest), + "MessageType_EthereumTypedDataValueAck" => ::std::option::Option::Some(MessageType::MessageType_EthereumTypedDataValueAck), + "MessageType_EthereumTypedDataSignature" => ::std::option::Option::Some(MessageType::MessageType_EthereumTypedDataSignature), + "MessageType_EthereumSignTypedHash" => ::std::option::Option::Some(MessageType::MessageType_EthereumSignTypedHash), + "MessageType_NEMGetAddress" => ::std::option::Option::Some(MessageType::MessageType_NEMGetAddress), + "MessageType_NEMAddress" => ::std::option::Option::Some(MessageType::MessageType_NEMAddress), + "MessageType_NEMSignTx" => ::std::option::Option::Some(MessageType::MessageType_NEMSignTx), + "MessageType_NEMSignedTx" => ::std::option::Option::Some(MessageType::MessageType_NEMSignedTx), + "MessageType_NEMDecryptMessage" => ::std::option::Option::Some(MessageType::MessageType_NEMDecryptMessage), + "MessageType_NEMDecryptedMessage" => ::std::option::Option::Some(MessageType::MessageType_NEMDecryptedMessage), + "MessageType_TezosGetAddress" => ::std::option::Option::Some(MessageType::MessageType_TezosGetAddress), + "MessageType_TezosAddress" => ::std::option::Option::Some(MessageType::MessageType_TezosAddress), + "MessageType_TezosSignTx" => ::std::option::Option::Some(MessageType::MessageType_TezosSignTx), + "MessageType_TezosSignedTx" => ::std::option::Option::Some(MessageType::MessageType_TezosSignedTx), + "MessageType_TezosGetPublicKey" => ::std::option::Option::Some(MessageType::MessageType_TezosGetPublicKey), + "MessageType_TezosPublicKey" => ::std::option::Option::Some(MessageType::MessageType_TezosPublicKey), + "MessageType_StellarSignTx" => ::std::option::Option::Some(MessageType::MessageType_StellarSignTx), + "MessageType_StellarTxOpRequest" => ::std::option::Option::Some(MessageType::MessageType_StellarTxOpRequest), + "MessageType_StellarGetAddress" => ::std::option::Option::Some(MessageType::MessageType_StellarGetAddress), + "MessageType_StellarAddress" => ::std::option::Option::Some(MessageType::MessageType_StellarAddress), + "MessageType_StellarCreateAccountOp" => ::std::option::Option::Some(MessageType::MessageType_StellarCreateAccountOp), + "MessageType_StellarPaymentOp" => ::std::option::Option::Some(MessageType::MessageType_StellarPaymentOp), + "MessageType_StellarPathPaymentStrictReceiveOp" => ::std::option::Option::Some(MessageType::MessageType_StellarPathPaymentStrictReceiveOp), + "MessageType_StellarManageSellOfferOp" => ::std::option::Option::Some(MessageType::MessageType_StellarManageSellOfferOp), + "MessageType_StellarCreatePassiveSellOfferOp" => ::std::option::Option::Some(MessageType::MessageType_StellarCreatePassiveSellOfferOp), + "MessageType_StellarSetOptionsOp" => ::std::option::Option::Some(MessageType::MessageType_StellarSetOptionsOp), + "MessageType_StellarChangeTrustOp" => ::std::option::Option::Some(MessageType::MessageType_StellarChangeTrustOp), + "MessageType_StellarAllowTrustOp" => ::std::option::Option::Some(MessageType::MessageType_StellarAllowTrustOp), + "MessageType_StellarAccountMergeOp" => ::std::option::Option::Some(MessageType::MessageType_StellarAccountMergeOp), + "MessageType_StellarManageDataOp" => ::std::option::Option::Some(MessageType::MessageType_StellarManageDataOp), + "MessageType_StellarBumpSequenceOp" => ::std::option::Option::Some(MessageType::MessageType_StellarBumpSequenceOp), + "MessageType_StellarManageBuyOfferOp" => ::std::option::Option::Some(MessageType::MessageType_StellarManageBuyOfferOp), + "MessageType_StellarPathPaymentStrictSendOp" => ::std::option::Option::Some(MessageType::MessageType_StellarPathPaymentStrictSendOp), + "MessageType_StellarClaimClaimableBalanceOp" => ::std::option::Option::Some(MessageType::MessageType_StellarClaimClaimableBalanceOp), + "MessageType_StellarSignedTx" => ::std::option::Option::Some(MessageType::MessageType_StellarSignedTx), + "MessageType_CardanoGetPublicKey" => ::std::option::Option::Some(MessageType::MessageType_CardanoGetPublicKey), + "MessageType_CardanoPublicKey" => ::std::option::Option::Some(MessageType::MessageType_CardanoPublicKey), + "MessageType_CardanoGetAddress" => ::std::option::Option::Some(MessageType::MessageType_CardanoGetAddress), + "MessageType_CardanoAddress" => ::std::option::Option::Some(MessageType::MessageType_CardanoAddress), + "MessageType_CardanoTxItemAck" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxItemAck), + "MessageType_CardanoTxAuxiliaryDataSupplement" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxAuxiliaryDataSupplement), + "MessageType_CardanoTxWitnessRequest" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxWitnessRequest), + "MessageType_CardanoTxWitnessResponse" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxWitnessResponse), + "MessageType_CardanoTxHostAck" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxHostAck), + "MessageType_CardanoTxBodyHash" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxBodyHash), + "MessageType_CardanoSignTxFinished" => ::std::option::Option::Some(MessageType::MessageType_CardanoSignTxFinished), + "MessageType_CardanoSignTxInit" => ::std::option::Option::Some(MessageType::MessageType_CardanoSignTxInit), + "MessageType_CardanoTxInput" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxInput), + "MessageType_CardanoTxOutput" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxOutput), + "MessageType_CardanoAssetGroup" => ::std::option::Option::Some(MessageType::MessageType_CardanoAssetGroup), + "MessageType_CardanoToken" => ::std::option::Option::Some(MessageType::MessageType_CardanoToken), + "MessageType_CardanoTxCertificate" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxCertificate), + "MessageType_CardanoTxWithdrawal" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxWithdrawal), + "MessageType_CardanoTxAuxiliaryData" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxAuxiliaryData), + "MessageType_CardanoPoolOwner" => ::std::option::Option::Some(MessageType::MessageType_CardanoPoolOwner), + "MessageType_CardanoPoolRelayParameters" => ::std::option::Option::Some(MessageType::MessageType_CardanoPoolRelayParameters), + "MessageType_CardanoGetNativeScriptHash" => ::std::option::Option::Some(MessageType::MessageType_CardanoGetNativeScriptHash), + "MessageType_CardanoNativeScriptHash" => ::std::option::Option::Some(MessageType::MessageType_CardanoNativeScriptHash), + "MessageType_CardanoTxMint" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxMint), + "MessageType_CardanoTxCollateralInput" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxCollateralInput), + "MessageType_CardanoTxRequiredSigner" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxRequiredSigner), + "MessageType_CardanoTxInlineDatumChunk" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxInlineDatumChunk), + "MessageType_CardanoTxReferenceScriptChunk" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxReferenceScriptChunk), + "MessageType_CardanoTxReferenceInput" => ::std::option::Option::Some(MessageType::MessageType_CardanoTxReferenceInput), + "MessageType_RippleGetAddress" => ::std::option::Option::Some(MessageType::MessageType_RippleGetAddress), + "MessageType_RippleAddress" => ::std::option::Option::Some(MessageType::MessageType_RippleAddress), + "MessageType_RippleSignTx" => ::std::option::Option::Some(MessageType::MessageType_RippleSignTx), + "MessageType_RippleSignedTx" => ::std::option::Option::Some(MessageType::MessageType_RippleSignedTx), + "MessageType_MoneroTransactionInitRequest" => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionInitRequest), + "MessageType_MoneroTransactionInitAck" => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionInitAck), + "MessageType_MoneroTransactionSetInputRequest" => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSetInputRequest), + "MessageType_MoneroTransactionSetInputAck" => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSetInputAck), + "MessageType_MoneroTransactionInputViniRequest" => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionInputViniRequest), + "MessageType_MoneroTransactionInputViniAck" => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionInputViniAck), + "MessageType_MoneroTransactionAllInputsSetRequest" => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionAllInputsSetRequest), + "MessageType_MoneroTransactionAllInputsSetAck" => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionAllInputsSetAck), + "MessageType_MoneroTransactionSetOutputRequest" => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSetOutputRequest), + "MessageType_MoneroTransactionSetOutputAck" => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSetOutputAck), + "MessageType_MoneroTransactionAllOutSetRequest" => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionAllOutSetRequest), + "MessageType_MoneroTransactionAllOutSetAck" => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionAllOutSetAck), + "MessageType_MoneroTransactionSignInputRequest" => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSignInputRequest), + "MessageType_MoneroTransactionSignInputAck" => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSignInputAck), + "MessageType_MoneroTransactionFinalRequest" => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionFinalRequest), + "MessageType_MoneroTransactionFinalAck" => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionFinalAck), + "MessageType_MoneroKeyImageExportInitRequest" => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageExportInitRequest), + "MessageType_MoneroKeyImageExportInitAck" => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageExportInitAck), + "MessageType_MoneroKeyImageSyncStepRequest" => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageSyncStepRequest), + "MessageType_MoneroKeyImageSyncStepAck" => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageSyncStepAck), + "MessageType_MoneroKeyImageSyncFinalRequest" => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageSyncFinalRequest), + "MessageType_MoneroKeyImageSyncFinalAck" => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageSyncFinalAck), + "MessageType_MoneroGetAddress" => ::std::option::Option::Some(MessageType::MessageType_MoneroGetAddress), + "MessageType_MoneroAddress" => ::std::option::Option::Some(MessageType::MessageType_MoneroAddress), + "MessageType_MoneroGetWatchKey" => ::std::option::Option::Some(MessageType::MessageType_MoneroGetWatchKey), + "MessageType_MoneroWatchKey" => ::std::option::Option::Some(MessageType::MessageType_MoneroWatchKey), + "MessageType_DebugMoneroDiagRequest" => ::std::option::Option::Some(MessageType::MessageType_DebugMoneroDiagRequest), + "MessageType_DebugMoneroDiagAck" => ::std::option::Option::Some(MessageType::MessageType_DebugMoneroDiagAck), + "MessageType_MoneroGetTxKeyRequest" => ::std::option::Option::Some(MessageType::MessageType_MoneroGetTxKeyRequest), + "MessageType_MoneroGetTxKeyAck" => ::std::option::Option::Some(MessageType::MessageType_MoneroGetTxKeyAck), + "MessageType_MoneroLiveRefreshStartRequest" => ::std::option::Option::Some(MessageType::MessageType_MoneroLiveRefreshStartRequest), + "MessageType_MoneroLiveRefreshStartAck" => ::std::option::Option::Some(MessageType::MessageType_MoneroLiveRefreshStartAck), + "MessageType_MoneroLiveRefreshStepRequest" => ::std::option::Option::Some(MessageType::MessageType_MoneroLiveRefreshStepRequest), + "MessageType_MoneroLiveRefreshStepAck" => ::std::option::Option::Some(MessageType::MessageType_MoneroLiveRefreshStepAck), + "MessageType_MoneroLiveRefreshFinalRequest" => ::std::option::Option::Some(MessageType::MessageType_MoneroLiveRefreshFinalRequest), + "MessageType_MoneroLiveRefreshFinalAck" => ::std::option::Option::Some(MessageType::MessageType_MoneroLiveRefreshFinalAck), + "MessageType_EosGetPublicKey" => ::std::option::Option::Some(MessageType::MessageType_EosGetPublicKey), + "MessageType_EosPublicKey" => ::std::option::Option::Some(MessageType::MessageType_EosPublicKey), + "MessageType_EosSignTx" => ::std::option::Option::Some(MessageType::MessageType_EosSignTx), + "MessageType_EosTxActionRequest" => ::std::option::Option::Some(MessageType::MessageType_EosTxActionRequest), + "MessageType_EosTxActionAck" => ::std::option::Option::Some(MessageType::MessageType_EosTxActionAck), + "MessageType_EosSignedTx" => ::std::option::Option::Some(MessageType::MessageType_EosSignedTx), + "MessageType_BinanceGetAddress" => ::std::option::Option::Some(MessageType::MessageType_BinanceGetAddress), + "MessageType_BinanceAddress" => ::std::option::Option::Some(MessageType::MessageType_BinanceAddress), + "MessageType_BinanceGetPublicKey" => ::std::option::Option::Some(MessageType::MessageType_BinanceGetPublicKey), + "MessageType_BinancePublicKey" => ::std::option::Option::Some(MessageType::MessageType_BinancePublicKey), + "MessageType_BinanceSignTx" => ::std::option::Option::Some(MessageType::MessageType_BinanceSignTx), + "MessageType_BinanceTxRequest" => ::std::option::Option::Some(MessageType::MessageType_BinanceTxRequest), + "MessageType_BinanceTransferMsg" => ::std::option::Option::Some(MessageType::MessageType_BinanceTransferMsg), + "MessageType_BinanceOrderMsg" => ::std::option::Option::Some(MessageType::MessageType_BinanceOrderMsg), + "MessageType_BinanceCancelMsg" => ::std::option::Option::Some(MessageType::MessageType_BinanceCancelMsg), + "MessageType_BinanceSignedTx" => ::std::option::Option::Some(MessageType::MessageType_BinanceSignedTx), + "MessageType_WebAuthnListResidentCredentials" => ::std::option::Option::Some(MessageType::MessageType_WebAuthnListResidentCredentials), + "MessageType_WebAuthnCredentials" => ::std::option::Option::Some(MessageType::MessageType_WebAuthnCredentials), + "MessageType_WebAuthnAddResidentCredential" => ::std::option::Option::Some(MessageType::MessageType_WebAuthnAddResidentCredential), + "MessageType_WebAuthnRemoveResidentCredential" => ::std::option::Option::Some(MessageType::MessageType_WebAuthnRemoveResidentCredential), + "MessageType_SolanaGetPublicKey" => ::std::option::Option::Some(MessageType::MessageType_SolanaGetPublicKey), + "MessageType_SolanaPublicKey" => ::std::option::Option::Some(MessageType::MessageType_SolanaPublicKey), + "MessageType_SolanaGetAddress" => ::std::option::Option::Some(MessageType::MessageType_SolanaGetAddress), + "MessageType_SolanaAddress" => ::std::option::Option::Some(MessageType::MessageType_SolanaAddress), + "MessageType_SolanaSignTx" => ::std::option::Option::Some(MessageType::MessageType_SolanaSignTx), + "MessageType_SolanaTxSignature" => ::std::option::Option::Some(MessageType::MessageType_SolanaTxSignature), + "MessageType_MintlayerGetAddress" => ::std::option::Option::Some(MessageType::MessageType_MintlayerGetAddress), + "MessageType_MintlayerAddress" => ::std::option::Option::Some(MessageType::MessageType_MintlayerAddress), + "MessageType_MintlayerGetPublicKey" => ::std::option::Option::Some(MessageType::MessageType_MintlayerGetPublicKey), + "MessageType_MintlayerPublicKey" => ::std::option::Option::Some(MessageType::MessageType_MintlayerPublicKey), + "MessageType_MintlayerVerifySig" => ::std::option::Option::Some(MessageType::MessageType_MintlayerVerifySig), + "MessageType_MintlayerSignTx" => ::std::option::Option::Some(MessageType::MessageType_MintlayerSignTx), + "MessageType_MintlayerTxRequest" => ::std::option::Option::Some(MessageType::MessageType_MintlayerTxRequest), + "MessageType_MintlayerTxAckUtxoInput" => ::std::option::Option::Some(MessageType::MessageType_MintlayerTxAckUtxoInput), + "MessageType_MintlayerTxAckOutput" => ::std::option::Option::Some(MessageType::MessageType_MintlayerTxAckOutput), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [MessageType] = &[ + MessageType::MessageType_Initialize, + MessageType::MessageType_Ping, + MessageType::MessageType_Success, + MessageType::MessageType_Failure, + MessageType::MessageType_ChangePin, + MessageType::MessageType_WipeDevice, + MessageType::MessageType_GetEntropy, + MessageType::MessageType_Entropy, + MessageType::MessageType_LoadDevice, + MessageType::MessageType_ResetDevice, + MessageType::MessageType_SetBusy, + MessageType::MessageType_Features, + MessageType::MessageType_PinMatrixRequest, + MessageType::MessageType_PinMatrixAck, + MessageType::MessageType_Cancel, + MessageType::MessageType_LockDevice, + MessageType::MessageType_ApplySettings, + MessageType::MessageType_ButtonRequest, + MessageType::MessageType_ButtonAck, + MessageType::MessageType_ApplyFlags, + MessageType::MessageType_GetNonce, + MessageType::MessageType_Nonce, + MessageType::MessageType_BackupDevice, + MessageType::MessageType_EntropyRequest, + MessageType::MessageType_EntropyAck, + MessageType::MessageType_PassphraseRequest, + MessageType::MessageType_PassphraseAck, + MessageType::MessageType_RecoveryDevice, + MessageType::MessageType_WordRequest, + MessageType::MessageType_WordAck, + MessageType::MessageType_GetFeatures, + MessageType::MessageType_SdProtect, + MessageType::MessageType_ChangeWipeCode, + MessageType::MessageType_EndSession, + MessageType::MessageType_DoPreauthorized, + MessageType::MessageType_PreauthorizedRequest, + MessageType::MessageType_CancelAuthorization, + MessageType::MessageType_RebootToBootloader, + MessageType::MessageType_GetFirmwareHash, + MessageType::MessageType_FirmwareHash, + MessageType::MessageType_UnlockPath, + MessageType::MessageType_UnlockedPathRequest, + MessageType::MessageType_ShowDeviceTutorial, + MessageType::MessageType_UnlockBootloader, + MessageType::MessageType_AuthenticateDevice, + MessageType::MessageType_AuthenticityProof, + MessageType::MessageType_ChangeLanguage, + MessageType::MessageType_TranslationDataRequest, + MessageType::MessageType_TranslationDataAck, + MessageType::MessageType_SetU2FCounter, + MessageType::MessageType_GetNextU2FCounter, + MessageType::MessageType_NextU2FCounter, + MessageType::MessageType_Deprecated_PassphraseStateRequest, + MessageType::MessageType_Deprecated_PassphraseStateAck, + MessageType::MessageType_FirmwareErase, + MessageType::MessageType_FirmwareUpload, + MessageType::MessageType_FirmwareRequest, + MessageType::MessageType_ProdTestT1, + MessageType::MessageType_GetPublicKey, + MessageType::MessageType_PublicKey, + MessageType::MessageType_SignTx, + MessageType::MessageType_TxRequest, + MessageType::MessageType_TxAck, + MessageType::MessageType_GetAddress, + MessageType::MessageType_Address, + MessageType::MessageType_TxAckPaymentRequest, + MessageType::MessageType_SignMessage, + MessageType::MessageType_VerifyMessage, + MessageType::MessageType_MessageSignature, + MessageType::MessageType_GetOwnershipId, + MessageType::MessageType_OwnershipId, + MessageType::MessageType_GetOwnershipProof, + MessageType::MessageType_OwnershipProof, + MessageType::MessageType_AuthorizeCoinJoin, + MessageType::MessageType_CipherKeyValue, + MessageType::MessageType_CipheredKeyValue, + MessageType::MessageType_SignIdentity, + MessageType::MessageType_SignedIdentity, + MessageType::MessageType_GetECDHSessionKey, + MessageType::MessageType_ECDHSessionKey, + MessageType::MessageType_CosiCommit, + MessageType::MessageType_CosiCommitment, + MessageType::MessageType_CosiSign, + MessageType::MessageType_CosiSignature, + MessageType::MessageType_DebugLinkDecision, + MessageType::MessageType_DebugLinkGetState, + MessageType::MessageType_DebugLinkState, + MessageType::MessageType_DebugLinkStop, + MessageType::MessageType_DebugLinkLog, + MessageType::MessageType_DebugLinkMemoryRead, + MessageType::MessageType_DebugLinkMemory, + MessageType::MessageType_DebugLinkMemoryWrite, + MessageType::MessageType_DebugLinkFlashErase, + MessageType::MessageType_DebugLinkLayout, + MessageType::MessageType_DebugLinkReseedRandom, + MessageType::MessageType_DebugLinkRecordScreen, + MessageType::MessageType_DebugLinkEraseSdCard, + MessageType::MessageType_DebugLinkWatchLayout, + MessageType::MessageType_DebugLinkResetDebugEvents, + MessageType::MessageType_EthereumGetPublicKey, + MessageType::MessageType_EthereumPublicKey, + MessageType::MessageType_EthereumGetAddress, + MessageType::MessageType_EthereumAddress, + MessageType::MessageType_EthereumSignTx, + MessageType::MessageType_EthereumSignTxEIP1559, + MessageType::MessageType_EthereumTxRequest, + MessageType::MessageType_EthereumTxAck, + MessageType::MessageType_EthereumSignMessage, + MessageType::MessageType_EthereumVerifyMessage, + MessageType::MessageType_EthereumMessageSignature, + MessageType::MessageType_EthereumSignTypedData, + MessageType::MessageType_EthereumTypedDataStructRequest, + MessageType::MessageType_EthereumTypedDataStructAck, + MessageType::MessageType_EthereumTypedDataValueRequest, + MessageType::MessageType_EthereumTypedDataValueAck, + MessageType::MessageType_EthereumTypedDataSignature, + MessageType::MessageType_EthereumSignTypedHash, + MessageType::MessageType_NEMGetAddress, + MessageType::MessageType_NEMAddress, + MessageType::MessageType_NEMSignTx, + MessageType::MessageType_NEMSignedTx, + MessageType::MessageType_NEMDecryptMessage, + MessageType::MessageType_NEMDecryptedMessage, + MessageType::MessageType_TezosGetAddress, + MessageType::MessageType_TezosAddress, + MessageType::MessageType_TezosSignTx, + MessageType::MessageType_TezosSignedTx, + MessageType::MessageType_TezosGetPublicKey, + MessageType::MessageType_TezosPublicKey, + MessageType::MessageType_StellarSignTx, + MessageType::MessageType_StellarTxOpRequest, + MessageType::MessageType_StellarGetAddress, + MessageType::MessageType_StellarAddress, + MessageType::MessageType_StellarCreateAccountOp, + MessageType::MessageType_StellarPaymentOp, + MessageType::MessageType_StellarPathPaymentStrictReceiveOp, + MessageType::MessageType_StellarManageSellOfferOp, + MessageType::MessageType_StellarCreatePassiveSellOfferOp, + MessageType::MessageType_StellarSetOptionsOp, + MessageType::MessageType_StellarChangeTrustOp, + MessageType::MessageType_StellarAllowTrustOp, + MessageType::MessageType_StellarAccountMergeOp, + MessageType::MessageType_StellarManageDataOp, + MessageType::MessageType_StellarBumpSequenceOp, + MessageType::MessageType_StellarManageBuyOfferOp, + MessageType::MessageType_StellarPathPaymentStrictSendOp, + MessageType::MessageType_StellarClaimClaimableBalanceOp, + MessageType::MessageType_StellarSignedTx, + MessageType::MessageType_CardanoGetPublicKey, + MessageType::MessageType_CardanoPublicKey, + MessageType::MessageType_CardanoGetAddress, + MessageType::MessageType_CardanoAddress, + MessageType::MessageType_CardanoTxItemAck, + MessageType::MessageType_CardanoTxAuxiliaryDataSupplement, + MessageType::MessageType_CardanoTxWitnessRequest, + MessageType::MessageType_CardanoTxWitnessResponse, + MessageType::MessageType_CardanoTxHostAck, + MessageType::MessageType_CardanoTxBodyHash, + MessageType::MessageType_CardanoSignTxFinished, + MessageType::MessageType_CardanoSignTxInit, + MessageType::MessageType_CardanoTxInput, + MessageType::MessageType_CardanoTxOutput, + MessageType::MessageType_CardanoAssetGroup, + MessageType::MessageType_CardanoToken, + MessageType::MessageType_CardanoTxCertificate, + MessageType::MessageType_CardanoTxWithdrawal, + MessageType::MessageType_CardanoTxAuxiliaryData, + MessageType::MessageType_CardanoPoolOwner, + MessageType::MessageType_CardanoPoolRelayParameters, + MessageType::MessageType_CardanoGetNativeScriptHash, + MessageType::MessageType_CardanoNativeScriptHash, + MessageType::MessageType_CardanoTxMint, + MessageType::MessageType_CardanoTxCollateralInput, + MessageType::MessageType_CardanoTxRequiredSigner, + MessageType::MessageType_CardanoTxInlineDatumChunk, + MessageType::MessageType_CardanoTxReferenceScriptChunk, + MessageType::MessageType_CardanoTxReferenceInput, + MessageType::MessageType_RippleGetAddress, + MessageType::MessageType_RippleAddress, + MessageType::MessageType_RippleSignTx, + MessageType::MessageType_RippleSignedTx, + MessageType::MessageType_MoneroTransactionInitRequest, + MessageType::MessageType_MoneroTransactionInitAck, + MessageType::MessageType_MoneroTransactionSetInputRequest, + MessageType::MessageType_MoneroTransactionSetInputAck, + MessageType::MessageType_MoneroTransactionInputViniRequest, + MessageType::MessageType_MoneroTransactionInputViniAck, + MessageType::MessageType_MoneroTransactionAllInputsSetRequest, + MessageType::MessageType_MoneroTransactionAllInputsSetAck, + MessageType::MessageType_MoneroTransactionSetOutputRequest, + MessageType::MessageType_MoneroTransactionSetOutputAck, + MessageType::MessageType_MoneroTransactionAllOutSetRequest, + MessageType::MessageType_MoneroTransactionAllOutSetAck, + MessageType::MessageType_MoneroTransactionSignInputRequest, + MessageType::MessageType_MoneroTransactionSignInputAck, + MessageType::MessageType_MoneroTransactionFinalRequest, + MessageType::MessageType_MoneroTransactionFinalAck, + MessageType::MessageType_MoneroKeyImageExportInitRequest, + MessageType::MessageType_MoneroKeyImageExportInitAck, + MessageType::MessageType_MoneroKeyImageSyncStepRequest, + MessageType::MessageType_MoneroKeyImageSyncStepAck, + MessageType::MessageType_MoneroKeyImageSyncFinalRequest, + MessageType::MessageType_MoneroKeyImageSyncFinalAck, + MessageType::MessageType_MoneroGetAddress, + MessageType::MessageType_MoneroAddress, + MessageType::MessageType_MoneroGetWatchKey, + MessageType::MessageType_MoneroWatchKey, + MessageType::MessageType_DebugMoneroDiagRequest, + MessageType::MessageType_DebugMoneroDiagAck, + MessageType::MessageType_MoneroGetTxKeyRequest, + MessageType::MessageType_MoneroGetTxKeyAck, + MessageType::MessageType_MoneroLiveRefreshStartRequest, + MessageType::MessageType_MoneroLiveRefreshStartAck, + MessageType::MessageType_MoneroLiveRefreshStepRequest, + MessageType::MessageType_MoneroLiveRefreshStepAck, + MessageType::MessageType_MoneroLiveRefreshFinalRequest, + MessageType::MessageType_MoneroLiveRefreshFinalAck, + MessageType::MessageType_EosGetPublicKey, + MessageType::MessageType_EosPublicKey, + MessageType::MessageType_EosSignTx, + MessageType::MessageType_EosTxActionRequest, + MessageType::MessageType_EosTxActionAck, + MessageType::MessageType_EosSignedTx, + MessageType::MessageType_BinanceGetAddress, + MessageType::MessageType_BinanceAddress, + MessageType::MessageType_BinanceGetPublicKey, + MessageType::MessageType_BinancePublicKey, + MessageType::MessageType_BinanceSignTx, + MessageType::MessageType_BinanceTxRequest, + MessageType::MessageType_BinanceTransferMsg, + MessageType::MessageType_BinanceOrderMsg, + MessageType::MessageType_BinanceCancelMsg, + MessageType::MessageType_BinanceSignedTx, + MessageType::MessageType_WebAuthnListResidentCredentials, + MessageType::MessageType_WebAuthnCredentials, + MessageType::MessageType_WebAuthnAddResidentCredential, + MessageType::MessageType_WebAuthnRemoveResidentCredential, + MessageType::MessageType_SolanaGetPublicKey, + MessageType::MessageType_SolanaPublicKey, + MessageType::MessageType_SolanaGetAddress, + MessageType::MessageType_SolanaAddress, + MessageType::MessageType_SolanaSignTx, + MessageType::MessageType_SolanaTxSignature, + MessageType::MessageType_MintlayerGetAddress, + MessageType::MessageType_MintlayerAddress, + MessageType::MessageType_MintlayerGetPublicKey, + MessageType::MessageType_MintlayerPublicKey, + MessageType::MessageType_MintlayerVerifySig, + MessageType::MessageType_MintlayerSignTx, + MessageType::MessageType_MintlayerTxRequest, + MessageType::MessageType_MintlayerTxAckUtxoInput, + MessageType::MessageType_MintlayerTxAckOutput, + ]; +} + +impl ::protobuf::EnumFull for MessageType { + 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("MessageType").unwrap()).clone() + } + + fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { + let index = match self { + MessageType::MessageType_Initialize => 0, + MessageType::MessageType_Ping => 1, + MessageType::MessageType_Success => 2, + MessageType::MessageType_Failure => 3, + MessageType::MessageType_ChangePin => 4, + MessageType::MessageType_WipeDevice => 5, + MessageType::MessageType_GetEntropy => 6, + MessageType::MessageType_Entropy => 7, + MessageType::MessageType_LoadDevice => 8, + MessageType::MessageType_ResetDevice => 9, + MessageType::MessageType_SetBusy => 10, + MessageType::MessageType_Features => 11, + MessageType::MessageType_PinMatrixRequest => 12, + MessageType::MessageType_PinMatrixAck => 13, + MessageType::MessageType_Cancel => 14, + MessageType::MessageType_LockDevice => 15, + MessageType::MessageType_ApplySettings => 16, + MessageType::MessageType_ButtonRequest => 17, + MessageType::MessageType_ButtonAck => 18, + MessageType::MessageType_ApplyFlags => 19, + MessageType::MessageType_GetNonce => 20, + MessageType::MessageType_Nonce => 21, + MessageType::MessageType_BackupDevice => 22, + MessageType::MessageType_EntropyRequest => 23, + MessageType::MessageType_EntropyAck => 24, + MessageType::MessageType_PassphraseRequest => 25, + MessageType::MessageType_PassphraseAck => 26, + MessageType::MessageType_RecoveryDevice => 27, + MessageType::MessageType_WordRequest => 28, + MessageType::MessageType_WordAck => 29, + MessageType::MessageType_GetFeatures => 30, + MessageType::MessageType_SdProtect => 31, + MessageType::MessageType_ChangeWipeCode => 32, + MessageType::MessageType_EndSession => 33, + MessageType::MessageType_DoPreauthorized => 34, + MessageType::MessageType_PreauthorizedRequest => 35, + MessageType::MessageType_CancelAuthorization => 36, + MessageType::MessageType_RebootToBootloader => 37, + MessageType::MessageType_GetFirmwareHash => 38, + MessageType::MessageType_FirmwareHash => 39, + MessageType::MessageType_UnlockPath => 40, + MessageType::MessageType_UnlockedPathRequest => 41, + MessageType::MessageType_ShowDeviceTutorial => 42, + MessageType::MessageType_UnlockBootloader => 43, + MessageType::MessageType_AuthenticateDevice => 44, + MessageType::MessageType_AuthenticityProof => 45, + MessageType::MessageType_ChangeLanguage => 46, + MessageType::MessageType_TranslationDataRequest => 47, + MessageType::MessageType_TranslationDataAck => 48, + MessageType::MessageType_SetU2FCounter => 49, + MessageType::MessageType_GetNextU2FCounter => 50, + MessageType::MessageType_NextU2FCounter => 51, + MessageType::MessageType_Deprecated_PassphraseStateRequest => 52, + MessageType::MessageType_Deprecated_PassphraseStateAck => 53, + MessageType::MessageType_FirmwareErase => 54, + MessageType::MessageType_FirmwareUpload => 55, + MessageType::MessageType_FirmwareRequest => 56, + MessageType::MessageType_ProdTestT1 => 57, + MessageType::MessageType_GetPublicKey => 58, + MessageType::MessageType_PublicKey => 59, + MessageType::MessageType_SignTx => 60, + MessageType::MessageType_TxRequest => 61, + MessageType::MessageType_TxAck => 62, + MessageType::MessageType_GetAddress => 63, + MessageType::MessageType_Address => 64, + MessageType::MessageType_TxAckPaymentRequest => 65, + MessageType::MessageType_SignMessage => 66, + MessageType::MessageType_VerifyMessage => 67, + MessageType::MessageType_MessageSignature => 68, + MessageType::MessageType_GetOwnershipId => 69, + MessageType::MessageType_OwnershipId => 70, + MessageType::MessageType_GetOwnershipProof => 71, + MessageType::MessageType_OwnershipProof => 72, + MessageType::MessageType_AuthorizeCoinJoin => 73, + MessageType::MessageType_CipherKeyValue => 74, + MessageType::MessageType_CipheredKeyValue => 75, + MessageType::MessageType_SignIdentity => 76, + MessageType::MessageType_SignedIdentity => 77, + MessageType::MessageType_GetECDHSessionKey => 78, + MessageType::MessageType_ECDHSessionKey => 79, + MessageType::MessageType_CosiCommit => 80, + MessageType::MessageType_CosiCommitment => 81, + MessageType::MessageType_CosiSign => 82, + MessageType::MessageType_CosiSignature => 83, + MessageType::MessageType_DebugLinkDecision => 84, + MessageType::MessageType_DebugLinkGetState => 85, + MessageType::MessageType_DebugLinkState => 86, + MessageType::MessageType_DebugLinkStop => 87, + MessageType::MessageType_DebugLinkLog => 88, + MessageType::MessageType_DebugLinkMemoryRead => 89, + MessageType::MessageType_DebugLinkMemory => 90, + MessageType::MessageType_DebugLinkMemoryWrite => 91, + MessageType::MessageType_DebugLinkFlashErase => 92, + MessageType::MessageType_DebugLinkLayout => 93, + MessageType::MessageType_DebugLinkReseedRandom => 94, + MessageType::MessageType_DebugLinkRecordScreen => 95, + MessageType::MessageType_DebugLinkEraseSdCard => 96, + MessageType::MessageType_DebugLinkWatchLayout => 97, + MessageType::MessageType_DebugLinkResetDebugEvents => 98, + MessageType::MessageType_EthereumGetPublicKey => 99, + MessageType::MessageType_EthereumPublicKey => 100, + MessageType::MessageType_EthereumGetAddress => 101, + MessageType::MessageType_EthereumAddress => 102, + MessageType::MessageType_EthereumSignTx => 103, + MessageType::MessageType_EthereumSignTxEIP1559 => 104, + MessageType::MessageType_EthereumTxRequest => 105, + MessageType::MessageType_EthereumTxAck => 106, + MessageType::MessageType_EthereumSignMessage => 107, + MessageType::MessageType_EthereumVerifyMessage => 108, + MessageType::MessageType_EthereumMessageSignature => 109, + MessageType::MessageType_EthereumSignTypedData => 110, + MessageType::MessageType_EthereumTypedDataStructRequest => 111, + MessageType::MessageType_EthereumTypedDataStructAck => 112, + MessageType::MessageType_EthereumTypedDataValueRequest => 113, + MessageType::MessageType_EthereumTypedDataValueAck => 114, + MessageType::MessageType_EthereumTypedDataSignature => 115, + MessageType::MessageType_EthereumSignTypedHash => 116, + MessageType::MessageType_NEMGetAddress => 117, + MessageType::MessageType_NEMAddress => 118, + MessageType::MessageType_NEMSignTx => 119, + MessageType::MessageType_NEMSignedTx => 120, + MessageType::MessageType_NEMDecryptMessage => 121, + MessageType::MessageType_NEMDecryptedMessage => 122, + MessageType::MessageType_TezosGetAddress => 123, + MessageType::MessageType_TezosAddress => 124, + MessageType::MessageType_TezosSignTx => 125, + MessageType::MessageType_TezosSignedTx => 126, + MessageType::MessageType_TezosGetPublicKey => 127, + MessageType::MessageType_TezosPublicKey => 128, + MessageType::MessageType_StellarSignTx => 129, + MessageType::MessageType_StellarTxOpRequest => 130, + MessageType::MessageType_StellarGetAddress => 131, + MessageType::MessageType_StellarAddress => 132, + MessageType::MessageType_StellarCreateAccountOp => 133, + MessageType::MessageType_StellarPaymentOp => 134, + MessageType::MessageType_StellarPathPaymentStrictReceiveOp => 135, + MessageType::MessageType_StellarManageSellOfferOp => 136, + MessageType::MessageType_StellarCreatePassiveSellOfferOp => 137, + MessageType::MessageType_StellarSetOptionsOp => 138, + MessageType::MessageType_StellarChangeTrustOp => 139, + MessageType::MessageType_StellarAllowTrustOp => 140, + MessageType::MessageType_StellarAccountMergeOp => 141, + MessageType::MessageType_StellarManageDataOp => 142, + MessageType::MessageType_StellarBumpSequenceOp => 143, + MessageType::MessageType_StellarManageBuyOfferOp => 144, + MessageType::MessageType_StellarPathPaymentStrictSendOp => 145, + MessageType::MessageType_StellarClaimClaimableBalanceOp => 146, + MessageType::MessageType_StellarSignedTx => 147, + MessageType::MessageType_CardanoGetPublicKey => 148, + MessageType::MessageType_CardanoPublicKey => 149, + MessageType::MessageType_CardanoGetAddress => 150, + MessageType::MessageType_CardanoAddress => 151, + MessageType::MessageType_CardanoTxItemAck => 152, + MessageType::MessageType_CardanoTxAuxiliaryDataSupplement => 153, + MessageType::MessageType_CardanoTxWitnessRequest => 154, + MessageType::MessageType_CardanoTxWitnessResponse => 155, + MessageType::MessageType_CardanoTxHostAck => 156, + MessageType::MessageType_CardanoTxBodyHash => 157, + MessageType::MessageType_CardanoSignTxFinished => 158, + MessageType::MessageType_CardanoSignTxInit => 159, + MessageType::MessageType_CardanoTxInput => 160, + MessageType::MessageType_CardanoTxOutput => 161, + MessageType::MessageType_CardanoAssetGroup => 162, + MessageType::MessageType_CardanoToken => 163, + MessageType::MessageType_CardanoTxCertificate => 164, + MessageType::MessageType_CardanoTxWithdrawal => 165, + MessageType::MessageType_CardanoTxAuxiliaryData => 166, + MessageType::MessageType_CardanoPoolOwner => 167, + MessageType::MessageType_CardanoPoolRelayParameters => 168, + MessageType::MessageType_CardanoGetNativeScriptHash => 169, + MessageType::MessageType_CardanoNativeScriptHash => 170, + MessageType::MessageType_CardanoTxMint => 171, + MessageType::MessageType_CardanoTxCollateralInput => 172, + MessageType::MessageType_CardanoTxRequiredSigner => 173, + MessageType::MessageType_CardanoTxInlineDatumChunk => 174, + MessageType::MessageType_CardanoTxReferenceScriptChunk => 175, + MessageType::MessageType_CardanoTxReferenceInput => 176, + MessageType::MessageType_RippleGetAddress => 177, + MessageType::MessageType_RippleAddress => 178, + MessageType::MessageType_RippleSignTx => 179, + MessageType::MessageType_RippleSignedTx => 180, + MessageType::MessageType_MoneroTransactionInitRequest => 181, + MessageType::MessageType_MoneroTransactionInitAck => 182, + MessageType::MessageType_MoneroTransactionSetInputRequest => 183, + MessageType::MessageType_MoneroTransactionSetInputAck => 184, + MessageType::MessageType_MoneroTransactionInputViniRequest => 185, + MessageType::MessageType_MoneroTransactionInputViniAck => 186, + MessageType::MessageType_MoneroTransactionAllInputsSetRequest => 187, + MessageType::MessageType_MoneroTransactionAllInputsSetAck => 188, + MessageType::MessageType_MoneroTransactionSetOutputRequest => 189, + MessageType::MessageType_MoneroTransactionSetOutputAck => 190, + MessageType::MessageType_MoneroTransactionAllOutSetRequest => 191, + MessageType::MessageType_MoneroTransactionAllOutSetAck => 192, + MessageType::MessageType_MoneroTransactionSignInputRequest => 193, + MessageType::MessageType_MoneroTransactionSignInputAck => 194, + MessageType::MessageType_MoneroTransactionFinalRequest => 195, + MessageType::MessageType_MoneroTransactionFinalAck => 196, + MessageType::MessageType_MoneroKeyImageExportInitRequest => 197, + MessageType::MessageType_MoneroKeyImageExportInitAck => 198, + MessageType::MessageType_MoneroKeyImageSyncStepRequest => 199, + MessageType::MessageType_MoneroKeyImageSyncStepAck => 200, + MessageType::MessageType_MoneroKeyImageSyncFinalRequest => 201, + MessageType::MessageType_MoneroKeyImageSyncFinalAck => 202, + MessageType::MessageType_MoneroGetAddress => 203, + MessageType::MessageType_MoneroAddress => 204, + MessageType::MessageType_MoneroGetWatchKey => 205, + MessageType::MessageType_MoneroWatchKey => 206, + MessageType::MessageType_DebugMoneroDiagRequest => 207, + MessageType::MessageType_DebugMoneroDiagAck => 208, + MessageType::MessageType_MoneroGetTxKeyRequest => 209, + MessageType::MessageType_MoneroGetTxKeyAck => 210, + MessageType::MessageType_MoneroLiveRefreshStartRequest => 211, + MessageType::MessageType_MoneroLiveRefreshStartAck => 212, + MessageType::MessageType_MoneroLiveRefreshStepRequest => 213, + MessageType::MessageType_MoneroLiveRefreshStepAck => 214, + MessageType::MessageType_MoneroLiveRefreshFinalRequest => 215, + MessageType::MessageType_MoneroLiveRefreshFinalAck => 216, + MessageType::MessageType_EosGetPublicKey => 217, + MessageType::MessageType_EosPublicKey => 218, + MessageType::MessageType_EosSignTx => 219, + MessageType::MessageType_EosTxActionRequest => 220, + MessageType::MessageType_EosTxActionAck => 221, + MessageType::MessageType_EosSignedTx => 222, + MessageType::MessageType_BinanceGetAddress => 223, + MessageType::MessageType_BinanceAddress => 224, + MessageType::MessageType_BinanceGetPublicKey => 225, + MessageType::MessageType_BinancePublicKey => 226, + MessageType::MessageType_BinanceSignTx => 227, + MessageType::MessageType_BinanceTxRequest => 228, + MessageType::MessageType_BinanceTransferMsg => 229, + MessageType::MessageType_BinanceOrderMsg => 230, + MessageType::MessageType_BinanceCancelMsg => 231, + MessageType::MessageType_BinanceSignedTx => 232, + MessageType::MessageType_WebAuthnListResidentCredentials => 233, + MessageType::MessageType_WebAuthnCredentials => 234, + MessageType::MessageType_WebAuthnAddResidentCredential => 235, + MessageType::MessageType_WebAuthnRemoveResidentCredential => 236, + MessageType::MessageType_SolanaGetPublicKey => 237, + MessageType::MessageType_SolanaPublicKey => 238, + MessageType::MessageType_SolanaGetAddress => 239, + MessageType::MessageType_SolanaAddress => 240, + MessageType::MessageType_SolanaSignTx => 241, + MessageType::MessageType_SolanaTxSignature => 242, + MessageType::MessageType_MintlayerGetAddress => 243, + MessageType::MessageType_MintlayerAddress => 244, + MessageType::MessageType_MintlayerGetPublicKey => 245, + MessageType::MessageType_MintlayerPublicKey => 246, + MessageType::MessageType_MintlayerVerifySig => 247, + MessageType::MessageType_MintlayerSignTx => 248, + MessageType::MessageType_MintlayerTxRequest => 249, + MessageType::MessageType_MintlayerTxAckUtxoInput => 250, + MessageType::MessageType_MintlayerTxAckOutput => 251, + }; + Self::enum_descriptor().value_by_index(index) + } +} + +impl ::std::default::Default for MessageType { + fn default() -> Self { + MessageType::MessageType_Initialize + } +} + +impl MessageType { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("MessageType") + } +} + +/// Extension fields +pub mod exts { + + pub const wire_in: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(50002, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const wire_out: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(50003, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const wire_debug_in: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(50004, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const wire_debug_out: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(50005, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const wire_tiny: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(50006, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const wire_bootloader: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(50007, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const wire_no_fsm: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(50008, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const bitcoin_only: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(60000, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const has_bitcoin_only_values: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(51001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const experimental_message: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(52001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const wire_type: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, u32> = ::protobuf::ext::ExtFieldOptional::new(52002, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_UINT32); + + pub const experimental_field: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(53001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const include_in_bitcoin_only: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(60000, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x0emessages.proto\x12\x12hw.trezor.messages\x1a\x20google/protobuf/de\ + scriptor.proto*\xa3W\n\x0bMessageType\x12(\n\x16MessageType_Initialize\ + \x10\0\x1a\x0c\x80\xa6\x1d\x01\xb0\xb5\x18\x01\x90\xb5\x18\x01\x12\x1e\n\ + \x10MessageType_Ping\x10\x01\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12\ + %\n\x13MessageType_Success\x10\x02\x1a\x0c\x80\xa6\x1d\x01\xa8\xb5\x18\ + \x01\x98\xb5\x18\x01\x12%\n\x13MessageType_Failure\x10\x03\x1a\x0c\x80\ + \xa6\x1d\x01\xa8\xb5\x18\x01\x98\xb5\x18\x01\x12#\n\x15MessageType_Chang\ + ePin\x10\x04\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12$\n\x16MessageTy\ + pe_WipeDevice\x10\x05\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12$\n\x16\ + MessageType_GetEntropy\x10\t\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12\ + !\n\x13MessageType_Entropy\x10\n\x1a\x08\x80\xa6\x1d\x01\x98\xb5\x18\x01\ + \x12$\n\x16MessageType_LoadDevice\x10\r\x1a\x08\x80\xa6\x1d\x01\x90\xb5\ + \x18\x01\x12%\n\x17MessageType_ResetDevice\x10\x0e\x1a\x08\x80\xa6\x1d\ + \x01\x90\xb5\x18\x01\x12!\n\x13MessageType_SetBusy\x10\x10\x1a\x08\x80\ + \xa6\x1d\x01\x90\xb5\x18\x01\x12\"\n\x14MessageType_Features\x10\x11\x1a\ + \x08\x80\xa6\x1d\x01\x98\xb5\x18\x01\x12*\n\x1cMessageType_PinMatrixRequ\ + est\x10\x12\x1a\x08\x80\xa6\x1d\x01\x98\xb5\x18\x01\x12.\n\x18MessageTyp\ + e_PinMatrixAck\x10\x13\x1a\x10\xc0\xb5\x18\x01\xb0\xb5\x18\x01\x80\xa6\ + \x1d\x01\x90\xb5\x18\x01\x12$\n\x12MessageType_Cancel\x10\x14\x1a\x0c\ + \x80\xa6\x1d\x01\xb0\xb5\x18\x01\x90\xb5\x18\x01\x12$\n\x16MessageType_L\ + ockDevice\x10\x18\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12'\n\x19Mess\ + ageType_ApplySettings\x10\x19\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\ + \x12'\n\x19MessageType_ButtonRequest\x10\x1a\x1a\x08\x80\xa6\x1d\x01\x98\ + \xb5\x18\x01\x12+\n\x15MessageType_ButtonAck\x10\x1b\x1a\x10\xc0\xb5\x18\ + \x01\xb0\xb5\x18\x01\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12$\n\x16MessageTy\ + pe_ApplyFlags\x10\x1c\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12\"\n\ + \x14MessageType_GetNonce\x10\x1f\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\ + \x12\x1f\n\x11MessageType_Nonce\x10!\x1a\x08\x80\xa6\x1d\x01\x98\xb5\x18\ + \x01\x12&\n\x18MessageType_BackupDevice\x10\"\x1a\x08\x80\xa6\x1d\x01\ + \x90\xb5\x18\x01\x12(\n\x1aMessageType_EntropyRequest\x10#\x1a\x08\x80\ + \xa6\x1d\x01\x98\xb5\x18\x01\x12$\n\x16MessageType_EntropyAck\x10$\x1a\ + \x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12+\n\x1dMessageType_PassphraseReq\ + uest\x10)\x1a\x08\x80\xa6\x1d\x01\x98\xb5\x18\x01\x12/\n\x19MessageType_\ + PassphraseAck\x10*\x1a\x10\xc0\xb5\x18\x01\xb0\xb5\x18\x01\x80\xa6\x1d\ + \x01\x90\xb5\x18\x01\x12(\n\x1aMessageType_RecoveryDevice\x10-\x1a\x08\ + \x80\xa6\x1d\x01\x90\xb5\x18\x01\x12%\n\x17MessageType_WordRequest\x10.\ + \x1a\x08\x80\xa6\x1d\x01\x98\xb5\x18\x01\x12!\n\x13MessageType_WordAck\ + \x10/\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12%\n\x17MessageType_GetF\ + eatures\x107\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12#\n\x15MessageTy\ + pe_SdProtect\x10O\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12(\n\x1aMess\ + ageType_ChangeWipeCode\x10R\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12$\ + \n\x16MessageType_EndSession\x10S\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\ + \x01\x12)\n\x1bMessageType_DoPreauthorized\x10T\x1a\x08\x80\xa6\x1d\x01\ + \x90\xb5\x18\x01\x12.\n\x20MessageType_PreauthorizedRequest\x10U\x1a\x08\ + \x80\xa6\x1d\x01\x98\xb5\x18\x01\x12-\n\x1fMessageType_CancelAuthorizati\ + on\x10V\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12,\n\x1eMessageType_Re\ + bootToBootloader\x10W\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12)\n\x1b\ + MessageType_GetFirmwareHash\x10X\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\ + \x12&\n\x18MessageType_FirmwareHash\x10Y\x1a\x08\x80\xa6\x1d\x01\x98\xb5\ + \x18\x01\x12$\n\x16MessageType_UnlockPath\x10]\x1a\x08\x80\xa6\x1d\x01\ + \x90\xb5\x18\x01\x12-\n\x1fMessageType_UnlockedPathRequest\x10^\x1a\x08\ + \x80\xa6\x1d\x01\x98\xb5\x18\x01\x12,\n\x1eMessageType_ShowDeviceTutoria\ + l\x10_\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12*\n\x1cMessageType_Unl\ + ockBootloader\x10`\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12,\n\x1eMes\ + sageType_AuthenticateDevice\x10a\x1a\x08\x80\xa6\x1d\x01\x98\xb5\x18\x01\ + \x12+\n\x1dMessageType_AuthenticityProof\x10b\x1a\x08\x80\xa6\x1d\x01\ + \x90\xb5\x18\x01\x12)\n\x1aMessageType_ChangeLanguage\x10\xde\x07\x1a\ + \x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x121\n\"MessageType_TranslationData\ + Request\x10\xdf\x07\x1a\x08\x80\xa6\x1d\x01\x98\xb5\x18\x01\x12-\n\x1eMe\ + ssageType_TranslationDataAck\x10\xe0\x07\x1a\x08\x80\xa6\x1d\x01\x90\xb5\ + \x18\x01\x12#\n\x19MessageType_SetU2FCounter\x10?\x1a\x04\x90\xb5\x18\ + \x01\x12'\n\x1dMessageType_GetNextU2FCounter\x10P\x1a\x04\x90\xb5\x18\ + \x01\x12$\n\x1aMessageType_NextU2FCounter\x10Q\x1a\x04\x98\xb5\x18\x01\ + \x125\n-MessageType_Deprecated_PassphraseStateRequest\x10M\x1a\x02\x08\ + \x01\x121\n)MessageType_Deprecated_PassphraseStateAck\x10N\x1a\x02\x08\ + \x01\x12+\n\x19MessageType_FirmwareErase\x10\x06\x1a\x0c\xb8\xb5\x18\x01\ + \x80\xa6\x1d\x01\x90\xb5\x18\x01\x12,\n\x1aMessageType_FirmwareUpload\ + \x10\x07\x1a\x0c\xb8\xb5\x18\x01\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12-\n\ + \x1bMessageType_FirmwareRequest\x10\x08\x1a\x0c\xb8\xb5\x18\x01\x80\xa6\ + \x1d\x01\x98\xb5\x18\x01\x12(\n\x16MessageType_ProdTestT1\x10\x20\x1a\ + \x0c\xb8\xb5\x18\x01\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12&\n\x18MessageTy\ + pe_GetPublicKey\x10\x0b\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12#\n\ + \x15MessageType_PublicKey\x10\x0c\x1a\x08\x80\xa6\x1d\x01\x98\xb5\x18\ + \x01\x12\x20\n\x12MessageType_SignTx\x10\x0f\x1a\x08\x80\xa6\x1d\x01\x90\ + \xb5\x18\x01\x12#\n\x15MessageType_TxRequest\x10\x15\x1a\x08\x80\xa6\x1d\ + \x01\x98\xb5\x18\x01\x12\x1f\n\x11MessageType_TxAck\x10\x16\x1a\x08\x80\ + \xa6\x1d\x01\x90\xb5\x18\x01\x12$\n\x16MessageType_GetAddress\x10\x1d\ + \x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12!\n\x13MessageType_Address\ + \x10\x1e\x1a\x08\x80\xa6\x1d\x01\x98\xb5\x18\x01\x12)\n\x1fMessageType_T\ + xAckPaymentRequest\x10%\x1a\x04\x90\xb5\x18\x01\x12%\n\x17MessageType_Si\ + gnMessage\x10&\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12'\n\x19Message\ + Type_VerifyMessage\x10'\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12*\n\ + \x1cMessageType_MessageSignature\x10(\x1a\x08\x80\xa6\x1d\x01\x98\xb5\ + \x18\x01\x12(\n\x1aMessageType_GetOwnershipId\x10+\x1a\x08\x80\xa6\x1d\ + \x01\x90\xb5\x18\x01\x12%\n\x17MessageType_OwnershipId\x10,\x1a\x08\x80\ + \xa6\x1d\x01\x98\xb5\x18\x01\x12+\n\x1dMessageType_GetOwnershipProof\x10\ + 1\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12(\n\x1aMessageType_Ownershi\ + pProof\x102\x1a\x08\x80\xa6\x1d\x01\x98\xb5\x18\x01\x12+\n\x1dMessageTyp\ + e_AuthorizeCoinJoin\x103\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12(\n\ + \x1aMessageType_CipherKeyValue\x10\x17\x1a\x08\x80\xa6\x1d\x01\x90\xb5\ + \x18\x01\x12*\n\x1cMessageType_CipheredKeyValue\x100\x1a\x08\x80\xa6\x1d\ + \x01\x98\xb5\x18\x01\x12&\n\x18MessageType_SignIdentity\x105\x1a\x08\x80\ + \xa6\x1d\x01\x90\xb5\x18\x01\x12(\n\x1aMessageType_SignedIdentity\x106\ + \x1a\x08\x80\xa6\x1d\x01\x98\xb5\x18\x01\x12+\n\x1dMessageType_GetECDHSe\ + ssionKey\x10=\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12(\n\x1aMessageT\ + ype_ECDHSessionKey\x10>\x1a\x08\x80\xa6\x1d\x01\x98\xb5\x18\x01\x12$\n\ + \x16MessageType_CosiCommit\x10G\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\ + \x12(\n\x1aMessageType_CosiCommitment\x10H\x1a\x08\x80\xa6\x1d\x01\x98\ + \xb5\x18\x01\x12\"\n\x14MessageType_CosiSign\x10I\x1a\x08\x80\xa6\x1d\ + \x01\x90\xb5\x18\x01\x12'\n\x19MessageType_CosiSignature\x10J\x1a\x08\ + \x80\xa6\x1d\x01\x98\xb5\x18\x01\x123\n\x1dMessageType_DebugLinkDecision\ + \x10d\x1a\x10\xc0\xb5\x18\x01\xb0\xb5\x18\x01\x80\xa6\x1d\x01\xa0\xb5\ + \x18\x01\x12/\n\x1dMessageType_DebugLinkGetState\x10e\x1a\x0c\x80\xa6\ + \x1d\x01\xb0\xb5\x18\x01\xa0\xb5\x18\x01\x12(\n\x1aMessageType_DebugLink\ + State\x10f\x1a\x08\x80\xa6\x1d\x01\xa8\xb5\x18\x01\x12'\n\x19MessageType\ + _DebugLinkStop\x10g\x1a\x08\x80\xa6\x1d\x01\xa0\xb5\x18\x01\x12&\n\x18Me\ + ssageType_DebugLinkLog\x10h\x1a\x08\x80\xa6\x1d\x01\xa8\xb5\x18\x01\x12-\ + \n\x1fMessageType_DebugLinkMemoryRead\x10n\x1a\x08\x80\xa6\x1d\x01\xa0\ + \xb5\x18\x01\x12)\n\x1bMessageType_DebugLinkMemory\x10o\x1a\x08\x80\xa6\ + \x1d\x01\xa8\xb5\x18\x01\x12.\n\x20MessageType_DebugLinkMemoryWrite\x10p\ + \x1a\x08\x80\xa6\x1d\x01\xa0\xb5\x18\x01\x12-\n\x1fMessageType_DebugLink\ + FlashErase\x10q\x1a\x08\x80\xa6\x1d\x01\xa0\xb5\x18\x01\x12*\n\x1bMessag\ + eType_DebugLinkLayout\x10\xa9F\x1a\x08\x80\xa6\x1d\x01\xa8\xb5\x18\x01\ + \x120\n!MessageType_DebugLinkReseedRandom\x10\xaaF\x1a\x08\x80\xa6\x1d\ + \x01\xa0\xb5\x18\x01\x120\n!MessageType_DebugLinkRecordScreen\x10\xabF\ + \x1a\x08\x80\xa6\x1d\x01\xa0\xb5\x18\x01\x12/\n\x20MessageType_DebugLink\ + EraseSdCard\x10\xadF\x1a\x08\x80\xa6\x1d\x01\xa0\xb5\x18\x01\x12/\n\x20M\ + essageType_DebugLinkWatchLayout\x10\xaeF\x1a\x08\x80\xa6\x1d\x01\xa0\xb5\ + \x18\x01\x124\n%MessageType_DebugLinkResetDebugEvents\x10\xafF\x1a\x08\ + \x80\xa6\x1d\x01\xa0\xb5\x18\x01\x12+\n\x20MessageType_EthereumGetPublic\ + Key\x10\xc2\x03\x1a\x04\x90\xb5\x18\x01\x12(\n\x1dMessageType_EthereumPu\ + blicKey\x10\xc3\x03\x1a\x04\x98\xb5\x18\x01\x12(\n\x1eMessageType_Ethere\ + umGetAddress\x108\x1a\x04\x90\xb5\x18\x01\x12%\n\x1bMessageType_Ethereum\ + Address\x109\x1a\x04\x98\xb5\x18\x01\x12$\n\x1aMessageType_EthereumSignT\ + x\x10:\x1a\x04\x90\xb5\x18\x01\x12,\n!MessageType_EthereumSignTxEIP1559\ + \x10\xc4\x03\x1a\x04\x90\xb5\x18\x01\x12'\n\x1dMessageType_EthereumTxReq\ + uest\x10;\x1a\x04\x98\xb5\x18\x01\x12#\n\x19MessageType_EthereumTxAck\ + \x10<\x1a\x04\x90\xb5\x18\x01\x12)\n\x1fMessageType_EthereumSignMessage\ + \x10@\x1a\x04\x90\xb5\x18\x01\x12+\n!MessageType_EthereumVerifyMessage\ + \x10A\x1a\x04\x90\xb5\x18\x01\x12.\n$MessageType_EthereumMessageSignatur\ + e\x10B\x1a\x04\x98\xb5\x18\x01\x12,\n!MessageType_EthereumSignTypedData\ + \x10\xd0\x03\x1a\x04\x90\xb5\x18\x01\x125\n*MessageType_EthereumTypedDat\ + aStructRequest\x10\xd1\x03\x1a\x04\x98\xb5\x18\x01\x121\n&MessageType_Et\ + hereumTypedDataStructAck\x10\xd2\x03\x1a\x04\x90\xb5\x18\x01\x124\n)Mess\ + ageType_EthereumTypedDataValueRequest\x10\xd3\x03\x1a\x04\x98\xb5\x18\ + \x01\x120\n%MessageType_EthereumTypedDataValueAck\x10\xd4\x03\x1a\x04\ + \x90\xb5\x18\x01\x121\n&MessageType_EthereumTypedDataSignature\x10\xd5\ + \x03\x1a\x04\x98\xb5\x18\x01\x12,\n!MessageType_EthereumSignTypedHash\ + \x10\xd6\x03\x1a\x04\x90\xb5\x18\x01\x12#\n\x19MessageType_NEMGetAddress\ + \x10C\x1a\x04\x90\xb5\x18\x01\x12\x20\n\x16MessageType_NEMAddress\x10D\ + \x1a\x04\x98\xb5\x18\x01\x12\x1f\n\x15MessageType_NEMSignTx\x10E\x1a\x04\ + \x90\xb5\x18\x01\x12!\n\x17MessageType_NEMSignedTx\x10F\x1a\x04\x98\xb5\ + \x18\x01\x12'\n\x1dMessageType_NEMDecryptMessage\x10K\x1a\x04\x90\xb5\ + \x18\x01\x12)\n\x1fMessageType_NEMDecryptedMessage\x10L\x1a\x04\x98\xb5\ + \x18\x01\x12&\n\x1bMessageType_TezosGetAddress\x10\x96\x01\x1a\x04\x90\ + \xb5\x18\x01\x12#\n\x18MessageType_TezosAddress\x10\x97\x01\x1a\x04\x98\ + \xb5\x18\x01\x12\"\n\x17MessageType_TezosSignTx\x10\x98\x01\x1a\x04\x90\ + \xb5\x18\x01\x12$\n\x19MessageType_TezosSignedTx\x10\x99\x01\x1a\x04\x98\ + \xb5\x18\x01\x12(\n\x1dMessageType_TezosGetPublicKey\x10\x9a\x01\x1a\x04\ + \x90\xb5\x18\x01\x12%\n\x1aMessageType_TezosPublicKey\x10\x9b\x01\x1a\ + \x04\x98\xb5\x18\x01\x12$\n\x19MessageType_StellarSignTx\x10\xca\x01\x1a\ + \x04\x90\xb5\x18\x01\x12)\n\x1eMessageType_StellarTxOpRequest\x10\xcb\ + \x01\x1a\x04\x98\xb5\x18\x01\x12(\n\x1dMessageType_StellarGetAddress\x10\ + \xcf\x01\x1a\x04\x90\xb5\x18\x01\x12%\n\x1aMessageType_StellarAddress\ + \x10\xd0\x01\x1a\x04\x98\xb5\x18\x01\x12-\n\"MessageType_StellarCreateAc\ + countOp\x10\xd2\x01\x1a\x04\x90\xb5\x18\x01\x12'\n\x1cMessageType_Stella\ + rPaymentOp\x10\xd3\x01\x1a\x04\x90\xb5\x18\x01\x128\n-MessageType_Stella\ + rPathPaymentStrictReceiveOp\x10\xd4\x01\x1a\x04\x90\xb5\x18\x01\x12/\n$M\ + essageType_StellarManageSellOfferOp\x10\xd5\x01\x1a\x04\x90\xb5\x18\x01\ + \x126\n+MessageType_StellarCreatePassiveSellOfferOp\x10\xd6\x01\x1a\x04\ + \x90\xb5\x18\x01\x12*\n\x1fMessageType_StellarSetOptionsOp\x10\xd7\x01\ + \x1a\x04\x90\xb5\x18\x01\x12+\n\x20MessageType_StellarChangeTrustOp\x10\ + \xd8\x01\x1a\x04\x90\xb5\x18\x01\x12*\n\x1fMessageType_StellarAllowTrust\ + Op\x10\xd9\x01\x1a\x04\x90\xb5\x18\x01\x12,\n!MessageType_StellarAccount\ + MergeOp\x10\xda\x01\x1a\x04\x90\xb5\x18\x01\x12*\n\x1fMessageType_Stella\ + rManageDataOp\x10\xdc\x01\x1a\x04\x90\xb5\x18\x01\x12,\n!MessageType_Ste\ + llarBumpSequenceOp\x10\xdd\x01\x1a\x04\x90\xb5\x18\x01\x12.\n#MessageTyp\ + e_StellarManageBuyOfferOp\x10\xde\x01\x1a\x04\x90\xb5\x18\x01\x125\n*Mes\ + sageType_StellarPathPaymentStrictSendOp\x10\xdf\x01\x1a\x04\x90\xb5\x18\ + \x01\x125\n*MessageType_StellarClaimClaimableBalanceOp\x10\xe1\x01\x1a\ + \x04\x90\xb5\x18\x01\x12&\n\x1bMessageType_StellarSignedTx\x10\xe6\x01\ + \x1a\x04\x98\xb5\x18\x01\x12*\n\x1fMessageType_CardanoGetPublicKey\x10\ + \xb1\x02\x1a\x04\x90\xb5\x18\x01\x12'\n\x1cMessageType_CardanoPublicKey\ + \x10\xb2\x02\x1a\x04\x98\xb5\x18\x01\x12(\n\x1dMessageType_CardanoGetAdd\ + ress\x10\xb3\x02\x1a\x04\x90\xb5\x18\x01\x12%\n\x1aMessageType_CardanoAd\ + dress\x10\xb4\x02\x1a\x04\x98\xb5\x18\x01\x12'\n\x1cMessageType_CardanoT\ + xItemAck\x10\xb9\x02\x1a\x04\x98\xb5\x18\x01\x127\n,MessageType_CardanoT\ + xAuxiliaryDataSupplement\x10\xba\x02\x1a\x04\x98\xb5\x18\x01\x12.\n#Mess\ + ageType_CardanoTxWitnessRequest\x10\xbb\x02\x1a\x04\x90\xb5\x18\x01\x12/\ + \n$MessageType_CardanoTxWitnessResponse\x10\xbc\x02\x1a\x04\x98\xb5\x18\ + \x01\x12'\n\x1cMessageType_CardanoTxHostAck\x10\xbd\x02\x1a\x04\x90\xb5\ + \x18\x01\x12(\n\x1dMessageType_CardanoTxBodyHash\x10\xbe\x02\x1a\x04\x98\ + \xb5\x18\x01\x12,\n!MessageType_CardanoSignTxFinished\x10\xbf\x02\x1a\ + \x04\x98\xb5\x18\x01\x12(\n\x1dMessageType_CardanoSignTxInit\x10\xc0\x02\ + \x1a\x04\x90\xb5\x18\x01\x12%\n\x1aMessageType_CardanoTxInput\x10\xc1\ + \x02\x1a\x04\x90\xb5\x18\x01\x12&\n\x1bMessageType_CardanoTxOutput\x10\ + \xc2\x02\x1a\x04\x90\xb5\x18\x01\x12(\n\x1dMessageType_CardanoAssetGroup\ + \x10\xc3\x02\x1a\x04\x90\xb5\x18\x01\x12#\n\x18MessageType_CardanoToken\ + \x10\xc4\x02\x1a\x04\x90\xb5\x18\x01\x12+\n\x20MessageType_CardanoTxCert\ + ificate\x10\xc5\x02\x1a\x04\x90\xb5\x18\x01\x12*\n\x1fMessageType_Cardan\ + oTxWithdrawal\x10\xc6\x02\x1a\x04\x90\xb5\x18\x01\x12-\n\"MessageType_Ca\ + rdanoTxAuxiliaryData\x10\xc7\x02\x1a\x04\x90\xb5\x18\x01\x12'\n\x1cMessa\ + geType_CardanoPoolOwner\x10\xc8\x02\x1a\x04\x90\xb5\x18\x01\x121\n&Messa\ + geType_CardanoPoolRelayParameters\x10\xc9\x02\x1a\x04\x90\xb5\x18\x01\ + \x121\n&MessageType_CardanoGetNativeScriptHash\x10\xca\x02\x1a\x04\x90\ + \xb5\x18\x01\x12.\n#MessageType_CardanoNativeScriptHash\x10\xcb\x02\x1a\ + \x04\x98\xb5\x18\x01\x12$\n\x19MessageType_CardanoTxMint\x10\xcc\x02\x1a\ + \x04\x90\xb5\x18\x01\x12/\n$MessageType_CardanoTxCollateralInput\x10\xcd\ + \x02\x1a\x04\x90\xb5\x18\x01\x12.\n#MessageType_CardanoTxRequiredSigner\ + \x10\xce\x02\x1a\x04\x90\xb5\x18\x01\x120\n%MessageType_CardanoTxInlineD\ + atumChunk\x10\xcf\x02\x1a\x04\x90\xb5\x18\x01\x124\n)MessageType_Cardano\ + TxReferenceScriptChunk\x10\xd0\x02\x1a\x04\x90\xb5\x18\x01\x12.\n#Messag\ + eType_CardanoTxReferenceInput\x10\xd1\x02\x1a\x04\x90\xb5\x18\x01\x12'\n\ + \x1cMessageType_RippleGetAddress\x10\x90\x03\x1a\x04\x90\xb5\x18\x01\x12\ + $\n\x19MessageType_RippleAddress\x10\x91\x03\x1a\x04\x98\xb5\x18\x01\x12\ + #\n\x18MessageType_RippleSignTx\x10\x92\x03\x1a\x04\x90\xb5\x18\x01\x12%\ + \n\x1aMessageType_RippleSignedTx\x10\x93\x03\x1a\x04\x90\xb5\x18\x01\x12\ + 3\n(MessageType_MoneroTransactionInitRequest\x10\xf5\x03\x1a\x04\x98\xb5\ + \x18\x01\x12/\n$MessageType_MoneroTransactionInitAck\x10\xf6\x03\x1a\x04\ + \x98\xb5\x18\x01\x127\n,MessageType_MoneroTransactionSetInputRequest\x10\ + \xf7\x03\x1a\x04\x98\xb5\x18\x01\x123\n(MessageType_MoneroTransactionSet\ + InputAck\x10\xf8\x03\x1a\x04\x98\xb5\x18\x01\x128\n-MessageType_MoneroTr\ + ansactionInputViniRequest\x10\xfb\x03\x1a\x04\x98\xb5\x18\x01\x124\n)Mes\ + sageType_MoneroTransactionInputViniAck\x10\xfc\x03\x1a\x04\x98\xb5\x18\ + \x01\x12;\n0MessageType_MoneroTransactionAllInputsSetRequest\x10\xfd\x03\ + \x1a\x04\x98\xb5\x18\x01\x127\n,MessageType_MoneroTransactionAllInputsSe\ + tAck\x10\xfe\x03\x1a\x04\x98\xb5\x18\x01\x128\n-MessageType_MoneroTransa\ + ctionSetOutputRequest\x10\xff\x03\x1a\x04\x98\xb5\x18\x01\x124\n)Message\ + Type_MoneroTransactionSetOutputAck\x10\x80\x04\x1a\x04\x98\xb5\x18\x01\ + \x128\n-MessageType_MoneroTransactionAllOutSetRequest\x10\x81\x04\x1a\ + \x04\x98\xb5\x18\x01\x124\n)MessageType_MoneroTransactionAllOutSetAck\ + \x10\x82\x04\x1a\x04\x98\xb5\x18\x01\x128\n-MessageType_MoneroTransactio\ + nSignInputRequest\x10\x83\x04\x1a\x04\x98\xb5\x18\x01\x124\n)MessageType\ + _MoneroTransactionSignInputAck\x10\x84\x04\x1a\x04\x98\xb5\x18\x01\x124\ + \n)MessageType_MoneroTransactionFinalRequest\x10\x85\x04\x1a\x04\x98\xb5\ + \x18\x01\x120\n%MessageType_MoneroTransactionFinalAck\x10\x86\x04\x1a\ + \x04\x98\xb5\x18\x01\x126\n+MessageType_MoneroKeyImageExportInitRequest\ + \x10\x92\x04\x1a\x04\x98\xb5\x18\x01\x122\n'MessageType_MoneroKeyImageEx\ + portInitAck\x10\x93\x04\x1a\x04\x98\xb5\x18\x01\x124\n)MessageType_Moner\ + oKeyImageSyncStepRequest\x10\x94\x04\x1a\x04\x98\xb5\x18\x01\x120\n%Mess\ + ageType_MoneroKeyImageSyncStepAck\x10\x95\x04\x1a\x04\x98\xb5\x18\x01\ + \x125\n*MessageType_MoneroKeyImageSyncFinalRequest\x10\x96\x04\x1a\x04\ + \x98\xb5\x18\x01\x121\n&MessageType_MoneroKeyImageSyncFinalAck\x10\x97\ + \x04\x1a\x04\x98\xb5\x18\x01\x12'\n\x1cMessageType_MoneroGetAddress\x10\ + \x9c\x04\x1a\x04\x90\xb5\x18\x01\x12$\n\x19MessageType_MoneroAddress\x10\ + \x9d\x04\x1a\x04\x98\xb5\x18\x01\x12(\n\x1dMessageType_MoneroGetWatchKey\ + \x10\x9e\x04\x1a\x04\x90\xb5\x18\x01\x12%\n\x1aMessageType_MoneroWatchKe\ + y\x10\x9f\x04\x1a\x04\x98\xb5\x18\x01\x12-\n\"MessageType_DebugMoneroDia\ + gRequest\x10\xa2\x04\x1a\x04\x90\xb5\x18\x01\x12)\n\x1eMessageType_Debug\ + MoneroDiagAck\x10\xa3\x04\x1a\x04\x98\xb5\x18\x01\x12,\n!MessageType_Mon\ + eroGetTxKeyRequest\x10\xa6\x04\x1a\x04\x90\xb5\x18\x01\x12(\n\x1dMessage\ + Type_MoneroGetTxKeyAck\x10\xa7\x04\x1a\x04\x98\xb5\x18\x01\x124\n)Messag\ + eType_MoneroLiveRefreshStartRequest\x10\xa8\x04\x1a\x04\x90\xb5\x18\x01\ + \x120\n%MessageType_MoneroLiveRefreshStartAck\x10\xa9\x04\x1a\x04\x98\ + \xb5\x18\x01\x123\n(MessageType_MoneroLiveRefreshStepRequest\x10\xaa\x04\ + \x1a\x04\x90\xb5\x18\x01\x12/\n$MessageType_MoneroLiveRefreshStepAck\x10\ + \xab\x04\x1a\x04\x98\xb5\x18\x01\x124\n)MessageType_MoneroLiveRefreshFin\ + alRequest\x10\xac\x04\x1a\x04\x90\xb5\x18\x01\x120\n%MessageType_MoneroL\ + iveRefreshFinalAck\x10\xad\x04\x1a\x04\x98\xb5\x18\x01\x12&\n\x1bMessage\ + Type_EosGetPublicKey\x10\xd8\x04\x1a\x04\x90\xb5\x18\x01\x12#\n\x18Messa\ + geType_EosPublicKey\x10\xd9\x04\x1a\x04\x98\xb5\x18\x01\x12\x20\n\x15Mes\ + sageType_EosSignTx\x10\xda\x04\x1a\x04\x90\xb5\x18\x01\x12)\n\x1eMessage\ + Type_EosTxActionRequest\x10\xdb\x04\x1a\x04\x98\xb5\x18\x01\x12%\n\x1aMe\ + ssageType_EosTxActionAck\x10\xdc\x04\x1a\x04\x90\xb5\x18\x01\x12\"\n\x17\ + MessageType_EosSignedTx\x10\xdd\x04\x1a\x04\x98\xb5\x18\x01\x12(\n\x1dMe\ + ssageType_BinanceGetAddress\x10\xbc\x05\x1a\x04\x90\xb5\x18\x01\x12%\n\ + \x1aMessageType_BinanceAddress\x10\xbd\x05\x1a\x04\x98\xb5\x18\x01\x12*\ + \n\x1fMessageType_BinanceGetPublicKey\x10\xbe\x05\x1a\x04\x90\xb5\x18\ + \x01\x12'\n\x1cMessageType_BinancePublicKey\x10\xbf\x05\x1a\x04\x98\xb5\ + \x18\x01\x12$\n\x19MessageType_BinanceSignTx\x10\xc0\x05\x1a\x04\x90\xb5\ + \x18\x01\x12'\n\x1cMessageType_BinanceTxRequest\x10\xc1\x05\x1a\x04\x98\ + \xb5\x18\x01\x12)\n\x1eMessageType_BinanceTransferMsg\x10\xc2\x05\x1a\ + \x04\x90\xb5\x18\x01\x12&\n\x1bMessageType_BinanceOrderMsg\x10\xc3\x05\ + \x1a\x04\x90\xb5\x18\x01\x12'\n\x1cMessageType_BinanceCancelMsg\x10\xc4\ + \x05\x1a\x04\x90\xb5\x18\x01\x12&\n\x1bMessageType_BinanceSignedTx\x10\ + \xc5\x05\x1a\x04\x98\xb5\x18\x01\x126\n+MessageType_WebAuthnListResident\ + Credentials\x10\xa0\x06\x1a\x04\x90\xb5\x18\x01\x12*\n\x1fMessageType_We\ + bAuthnCredentials\x10\xa1\x06\x1a\x04\x98\xb5\x18\x01\x124\n)MessageType\ + _WebAuthnAddResidentCredential\x10\xa2\x06\x1a\x04\x90\xb5\x18\x01\x127\ + \n,MessageType_WebAuthnRemoveResidentCredential\x10\xa3\x06\x1a\x04\x90\ + \xb5\x18\x01\x12)\n\x1eMessageType_SolanaGetPublicKey\x10\x84\x07\x1a\ + \x04\x90\xb5\x18\x01\x12&\n\x1bMessageType_SolanaPublicKey\x10\x85\x07\ + \x1a\x04\x98\xb5\x18\x01\x12'\n\x1cMessageType_SolanaGetAddress\x10\x86\ + \x07\x1a\x04\x90\xb5\x18\x01\x12$\n\x19MessageType_SolanaAddress\x10\x87\ + \x07\x1a\x04\x98\xb5\x18\x01\x12#\n\x18MessageType_SolanaSignTx\x10\x88\ + \x07\x1a\x04\x90\xb5\x18\x01\x12(\n\x1dMessageType_SolanaTxSignature\x10\ + \x89\x07\x1a\x04\x98\xb5\x18\x01\x12*\n\x1fMessageType_MintlayerGetAddre\ + ss\x10\xe8\x07\x1a\x04\x90\xb5\x18\x01\x12'\n\x1cMessageType_MintlayerAd\ + dress\x10\xe9\x07\x1a\x04\x98\xb5\x18\x01\x12,\n!MessageType_MintlayerGe\ + tPublicKey\x10\xea\x07\x1a\x04\x90\xb5\x18\x01\x12)\n\x1eMessageType_Min\ + tlayerPublicKey\x10\xeb\x07\x1a\x04\x98\xb5\x18\x01\x12)\n\x1eMessageTyp\ + e_MintlayerVerifySig\x10\xec\x07\x1a\x04\x90\xb5\x18\x01\x12&\n\x1bMessa\ + geType_MintlayerSignTx\x10\xed\x07\x1a\x04\x90\xb5\x18\x01\x12)\n\x1eMes\ + sageType_MintlayerTxRequest\x10\xee\x07\x1a\x04\x98\xb5\x18\x01\x12.\n#M\ + essageType_MintlayerTxAckUtxoInput\x10\xef\x07\x1a\x04\x90\xb5\x18\x01\ + \x12+\n\x20MessageType_MintlayerTxAckOutput\x10\xf0\x07\x1a\x04\x90\xb5\ + \x18\x01\x1a\x04\xc8\xf3\x18\x01\"\x04\x08Z\x10\\\"\x04\x08r\x10z\"\x06\ + \x08\xdb\x01\x10\xdb\x01\"\x06\x08\xe0\x01\x10\xe0\x01\"\x06\x08\xac\x02\ + \x10\xb0\x02\"\x06\x08\xb5\x02\x10\xb8\x02:<\n\x07wire_in\x18\xd2\x86\ + \x03\x20\x01(\x08\x12!.google.protobuf.EnumValueOptionsR\x06wireIn:>\n\ + \x08wire_out\x18\xd3\x86\x03\x20\x01(\x08\x12!.google.protobuf.EnumValue\ + OptionsR\x07wireOut:G\n\rwire_debug_in\x18\xd4\x86\x03\x20\x01(\x08\x12!\ + .google.protobuf.EnumValueOptionsR\x0bwireDebugIn:I\n\x0ewire_debug_out\ + \x18\xd5\x86\x03\x20\x01(\x08\x12!.google.protobuf.EnumValueOptionsR\x0c\ + wireDebugOut:@\n\twire_tiny\x18\xd6\x86\x03\x20\x01(\x08\x12!.google.pro\ + tobuf.EnumValueOptionsR\x08wireTiny:L\n\x0fwire_bootloader\x18\xd7\x86\ + \x03\x20\x01(\x08\x12!.google.protobuf.EnumValueOptionsR\x0ewireBootload\ + er:C\n\x0bwire_no_fsm\x18\xd8\x86\x03\x20\x01(\x08\x12!.google.protobuf.\ + EnumValueOptionsR\twireNoFsm:F\n\x0cbitcoin_only\x18\xe0\xd4\x03\x20\x01\ + (\x08\x12!.google.protobuf.EnumValueOptionsR\x0bbitcoinOnly:U\n\x17has_b\ + itcoin_only_values\x18\xb9\x8e\x03\x20\x01(\x08\x12\x1c.google.protobuf.\ + EnumOptionsR\x14hasBitcoinOnlyValues:T\n\x14experimental_message\x18\xa1\ + \x96\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x13experim\ + entalMessage:>\n\twire_type\x18\xa2\x96\x03\x20\x01(\r\x12\x1f.google.pr\ + otobuf.MessageOptionsR\x08wireType:N\n\x12experimental_field\x18\x89\x9e\ + \x03\x20\x01(\x08\x12\x1d.google.protobuf.FieldOptionsR\x11experimentalF\ + ield:U\n\x17include_in_bitcoin_only\x18\xe0\xd4\x03\x20\x01(\x08\x12\x1c\ + .google.protobuf.FileOptionsR\x14includeInBitcoinOnlyB8\n#com.satoshilab\ + s.trezor.lib.protobufB\rTrezorMessage\x80\xa6\x1d\x01\ +"; + +/// `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(1); + deps.push(::protobuf::descriptor::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(0); + let mut enums = ::std::vec::Vec::with_capacity(1); + enums.push(MessageType::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_binance.rs b/wallet/trezor-client/src/protos/generated/messages_binance.rs new file mode 100644 index 0000000000..4612b354f7 --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_binance.rs @@ -0,0 +1,3083 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-binance.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.binance.BinanceGetAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct BinanceGetAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceGetAddress.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceGetAddress.show_display) + pub show_display: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceGetAddress.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.binance.BinanceGetAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a BinanceGetAddress { + fn default() -> &'a BinanceGetAddress { + ::default_instance() + } +} + +impl BinanceGetAddress { + pub fn new() -> BinanceGetAddress { + ::std::default::Default::default() + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 3; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &BinanceGetAddress| { &m.address_n }, + |m: &mut BinanceGetAddress| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &BinanceGetAddress| { &m.show_display }, + |m: &mut BinanceGetAddress| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &BinanceGetAddress| { &m.chunkify }, + |m: &mut BinanceGetAddress| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "BinanceGetAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for BinanceGetAddress { + const NAME: &'static str = "BinanceGetAddress"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 24 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.show_display { + os.write_bool(2, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(3, 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() -> BinanceGetAddress { + BinanceGetAddress::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.show_display = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static BinanceGetAddress { + static instance: BinanceGetAddress = BinanceGetAddress { + address_n: ::std::vec::Vec::new(), + show_display: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for BinanceGetAddress { + 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("BinanceGetAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for BinanceGetAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for BinanceGetAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.binance.BinanceAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct BinanceAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceAddress.address) + pub address: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.binance.BinanceAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a BinanceAddress { + fn default() -> &'a BinanceAddress { + ::default_instance() + } +} + +impl BinanceAddress { + pub fn new() -> BinanceAddress { + ::std::default::Default::default() + } + + // required string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &BinanceAddress| { &m.address }, + |m: &mut BinanceAddress| { &mut m.address }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "BinanceAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for BinanceAddress { + const NAME: &'static str = "BinanceAddress"; + + fn is_initialized(&self) -> bool { + if self.address.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_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::string_size(1, &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_string(1, 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() -> BinanceAddress { + BinanceAddress::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static BinanceAddress { + static instance: BinanceAddress = BinanceAddress { + address: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for BinanceAddress { + 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("BinanceAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for BinanceAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for BinanceAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.binance.BinanceGetPublicKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct BinanceGetPublicKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceGetPublicKey.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceGetPublicKey.show_display) + pub show_display: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.binance.BinanceGetPublicKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a BinanceGetPublicKey { + fn default() -> &'a BinanceGetPublicKey { + ::default_instance() + } +} + +impl BinanceGetPublicKey { + pub fn new() -> BinanceGetPublicKey { + ::std::default::Default::default() + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + 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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &BinanceGetPublicKey| { &m.address_n }, + |m: &mut BinanceGetPublicKey| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &BinanceGetPublicKey| { &m.show_display }, + |m: &mut BinanceGetPublicKey| { &mut m.show_display }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "BinanceGetPublicKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for BinanceGetPublicKey { + const NAME: &'static str = "BinanceGetPublicKey"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.show_display { + os.write_bool(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() -> BinanceGetPublicKey { + BinanceGetPublicKey::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.show_display = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static BinanceGetPublicKey { + static instance: BinanceGetPublicKey = BinanceGetPublicKey { + address_n: ::std::vec::Vec::new(), + show_display: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for BinanceGetPublicKey { + 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("BinanceGetPublicKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for BinanceGetPublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for BinanceGetPublicKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.binance.BinancePublicKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct BinancePublicKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinancePublicKey.public_key) + pub public_key: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.binance.BinancePublicKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a BinancePublicKey { + fn default() -> &'a BinancePublicKey { + ::default_instance() + } +} + +impl BinancePublicKey { + pub fn new() -> BinancePublicKey { + ::std::default::Default::default() + } + + // required bytes public_key = 1; + + pub fn public_key(&self) -> &[u8] { + match self.public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_public_key(&mut self) { + self.public_key = ::std::option::Option::None; + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: ::std::vec::Vec) { + self.public_key = ::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_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.public_key.is_none() { + self.public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> ::std::vec::Vec { + self.public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "public_key", + |m: &BinancePublicKey| { &m.public_key }, + |m: &mut BinancePublicKey| { &mut m.public_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "BinancePublicKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for BinancePublicKey { + const NAME: &'static str = "BinancePublicKey"; + + fn is_initialized(&self) -> bool { + if self.public_key.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.public_key = ::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.public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.public_key.as_ref() { + os.write_bytes(1, 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() -> BinancePublicKey { + BinancePublicKey::new() + } + + fn clear(&mut self) { + self.public_key = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static BinancePublicKey { + static instance: BinancePublicKey = BinancePublicKey { + public_key: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for BinancePublicKey { + 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("BinancePublicKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for BinancePublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for BinancePublicKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.binance.BinanceSignTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct BinanceSignTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceSignTx.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceSignTx.msg_count) + pub msg_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceSignTx.account_number) + pub account_number: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceSignTx.chain_id) + pub chain_id: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceSignTx.memo) + pub memo: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceSignTx.sequence) + pub sequence: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceSignTx.source) + pub source: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceSignTx.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.binance.BinanceSignTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a BinanceSignTx { + fn default() -> &'a BinanceSignTx { + ::default_instance() + } +} + +impl BinanceSignTx { + pub fn new() -> BinanceSignTx { + ::std::default::Default::default() + } + + // required uint32 msg_count = 2; + + pub fn msg_count(&self) -> u32 { + self.msg_count.unwrap_or(0) + } + + pub fn clear_msg_count(&mut self) { + self.msg_count = ::std::option::Option::None; + } + + pub fn has_msg_count(&self) -> bool { + self.msg_count.is_some() + } + + // Param is passed by value, moved + pub fn set_msg_count(&mut self, v: u32) { + self.msg_count = ::std::option::Option::Some(v); + } + + // required sint64 account_number = 3; + + pub fn account_number(&self) -> i64 { + self.account_number.unwrap_or(0) + } + + pub fn clear_account_number(&mut self) { + self.account_number = ::std::option::Option::None; + } + + pub fn has_account_number(&self) -> bool { + self.account_number.is_some() + } + + // Param is passed by value, moved + pub fn set_account_number(&mut self, v: i64) { + self.account_number = ::std::option::Option::Some(v); + } + + // optional string chain_id = 4; + + pub fn chain_id(&self) -> &str { + match self.chain_id.as_ref() { + Some(v) => v, + None => "", + } + } + + 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: ::std::string::String) { + self.chain_id = ::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_chain_id(&mut self) -> &mut ::std::string::String { + if self.chain_id.is_none() { + self.chain_id = ::std::option::Option::Some(::std::string::String::new()); + } + self.chain_id.as_mut().unwrap() + } + + // Take field + pub fn take_chain_id(&mut self) -> ::std::string::String { + self.chain_id.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string memo = 5; + + pub fn memo(&self) -> &str { + match self.memo.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_memo(&mut self) { + self.memo = ::std::option::Option::None; + } + + pub fn has_memo(&self) -> bool { + self.memo.is_some() + } + + // Param is passed by value, moved + pub fn set_memo(&mut self, v: ::std::string::String) { + self.memo = ::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_memo(&mut self) -> &mut ::std::string::String { + if self.memo.is_none() { + self.memo = ::std::option::Option::Some(::std::string::String::new()); + } + self.memo.as_mut().unwrap() + } + + // Take field + pub fn take_memo(&mut self) -> ::std::string::String { + self.memo.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required sint64 sequence = 6; + + pub fn sequence(&self) -> i64 { + self.sequence.unwrap_or(0) + } + + pub fn clear_sequence(&mut self) { + self.sequence = ::std::option::Option::None; + } + + pub fn has_sequence(&self) -> bool { + self.sequence.is_some() + } + + // Param is passed by value, moved + pub fn set_sequence(&mut self, v: i64) { + self.sequence = ::std::option::Option::Some(v); + } + + // required sint64 source = 7; + + pub fn source(&self) -> i64 { + self.source.unwrap_or(0) + } + + pub fn clear_source(&mut self) { + self.source = ::std::option::Option::None; + } + + pub fn has_source(&self) -> bool { + self.source.is_some() + } + + // Param is passed by value, moved + pub fn set_source(&mut self, v: i64) { + self.source = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 8; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(8); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &BinanceSignTx| { &m.address_n }, + |m: &mut BinanceSignTx| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "msg_count", + |m: &BinanceSignTx| { &m.msg_count }, + |m: &mut BinanceSignTx| { &mut m.msg_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "account_number", + |m: &BinanceSignTx| { &m.account_number }, + |m: &mut BinanceSignTx| { &mut m.account_number }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chain_id", + |m: &BinanceSignTx| { &m.chain_id }, + |m: &mut BinanceSignTx| { &mut m.chain_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "memo", + |m: &BinanceSignTx| { &m.memo }, + |m: &mut BinanceSignTx| { &mut m.memo }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sequence", + |m: &BinanceSignTx| { &m.sequence }, + |m: &mut BinanceSignTx| { &mut m.sequence }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "source", + |m: &BinanceSignTx| { &m.source }, + |m: &mut BinanceSignTx| { &mut m.source }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &BinanceSignTx| { &m.chunkify }, + |m: &mut BinanceSignTx| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "BinanceSignTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for BinanceSignTx { + const NAME: &'static str = "BinanceSignTx"; + + fn is_initialized(&self) -> bool { + if self.msg_count.is_none() { + return false; + } + if self.account_number.is_none() { + return false; + } + if self.sequence.is_none() { + return false; + } + if self.source.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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.msg_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 24 => { + self.account_number = ::std::option::Option::Some(is.read_sint64()?); + }, + 34 => { + self.chain_id = ::std::option::Option::Some(is.read_string()?); + }, + 42 => { + self.memo = ::std::option::Option::Some(is.read_string()?); + }, + 48 => { + self.sequence = ::std::option::Option::Some(is.read_sint64()?); + }, + 56 => { + self.source = ::std::option::Option::Some(is.read_sint64()?); + }, + 64 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.msg_count { + my_size += ::protobuf::rt::uint32_size(2, v); + } + if let Some(v) = self.account_number { + my_size += ::protobuf::rt::sint64_size(3, v); + } + if let Some(v) = self.chain_id.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(v) = self.memo.as_ref() { + my_size += ::protobuf::rt::string_size(5, &v); + } + if let Some(v) = self.sequence { + my_size += ::protobuf::rt::sint64_size(6, v); + } + if let Some(v) = self.source { + my_size += ::protobuf::rt::sint64_size(7, v); + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.msg_count { + os.write_uint32(2, v)?; + } + if let Some(v) = self.account_number { + os.write_sint64(3, v)?; + } + if let Some(v) = self.chain_id.as_ref() { + os.write_string(4, v)?; + } + if let Some(v) = self.memo.as_ref() { + os.write_string(5, v)?; + } + if let Some(v) = self.sequence { + os.write_sint64(6, v)?; + } + if let Some(v) = self.source { + os.write_sint64(7, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(8, 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() -> BinanceSignTx { + BinanceSignTx::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.msg_count = ::std::option::Option::None; + self.account_number = ::std::option::Option::None; + self.chain_id = ::std::option::Option::None; + self.memo = ::std::option::Option::None; + self.sequence = ::std::option::Option::None; + self.source = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static BinanceSignTx { + static instance: BinanceSignTx = BinanceSignTx { + address_n: ::std::vec::Vec::new(), + msg_count: ::std::option::Option::None, + account_number: ::std::option::Option::None, + chain_id: ::std::option::Option::None, + memo: ::std::option::Option::None, + sequence: ::std::option::Option::None, + source: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for BinanceSignTx { + 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("BinanceSignTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for BinanceSignTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for BinanceSignTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.binance.BinanceTxRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct BinanceTxRequest { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.binance.BinanceTxRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a BinanceTxRequest { + fn default() -> &'a BinanceTxRequest { + ::default_instance() + } +} + +impl BinanceTxRequest { + pub fn new() -> BinanceTxRequest { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "BinanceTxRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for BinanceTxRequest { + const NAME: &'static str = "BinanceTxRequest"; + + 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 { + 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; + 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<()> { + 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() -> BinanceTxRequest { + BinanceTxRequest::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static BinanceTxRequest { + static instance: BinanceTxRequest = BinanceTxRequest { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for BinanceTxRequest { + 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("BinanceTxRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for BinanceTxRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for BinanceTxRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.binance.BinanceTransferMsg) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct BinanceTransferMsg { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceTransferMsg.inputs) + pub inputs: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceTransferMsg.outputs) + pub outputs: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceTransferMsg.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.binance.BinanceTransferMsg.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a BinanceTransferMsg { + fn default() -> &'a BinanceTransferMsg { + ::default_instance() + } +} + +impl BinanceTransferMsg { + pub fn new() -> BinanceTransferMsg { + ::std::default::Default::default() + } + + // optional bool chunkify = 3; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "inputs", + |m: &BinanceTransferMsg| { &m.inputs }, + |m: &mut BinanceTransferMsg| { &mut m.inputs }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "outputs", + |m: &BinanceTransferMsg| { &m.outputs }, + |m: &mut BinanceTransferMsg| { &mut m.outputs }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &BinanceTransferMsg| { &m.chunkify }, + |m: &mut BinanceTransferMsg| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "BinanceTransferMsg", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for BinanceTransferMsg { + const NAME: &'static str = "BinanceTransferMsg"; + + fn is_initialized(&self) -> bool { + for v in &self.inputs { + 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::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.inputs.push(is.read_message()?); + }, + 18 => { + self.outputs.push(is.read_message()?); + }, + 24 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.inputs { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + for value in &self.outputs { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.inputs { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + }; + for v in &self.outputs { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + }; + if let Some(v) = self.chunkify { + os.write_bool(3, 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() -> BinanceTransferMsg { + BinanceTransferMsg::new() + } + + fn clear(&mut self) { + self.inputs.clear(); + self.outputs.clear(); + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static BinanceTransferMsg { + static instance: BinanceTransferMsg = BinanceTransferMsg { + inputs: ::std::vec::Vec::new(), + outputs: ::std::vec::Vec::new(), + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for BinanceTransferMsg { + 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("BinanceTransferMsg").unwrap()).clone() + } +} + +impl ::std::fmt::Display for BinanceTransferMsg { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for BinanceTransferMsg { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `BinanceTransferMsg` +pub mod binance_transfer_msg { + // @@protoc_insertion_point(message:hw.trezor.messages.binance.BinanceTransferMsg.BinanceInputOutput) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct BinanceInputOutput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceTransferMsg.BinanceInputOutput.address) + pub address: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceTransferMsg.BinanceInputOutput.coins) + pub coins: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.binance.BinanceTransferMsg.BinanceInputOutput.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a BinanceInputOutput { + fn default() -> &'a BinanceInputOutput { + ::default_instance() + } + } + + impl BinanceInputOutput { + pub fn new() -> BinanceInputOutput { + ::std::default::Default::default() + } + + // required string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub(in super) 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::<_, _>( + "address", + |m: &BinanceInputOutput| { &m.address }, + |m: &mut BinanceInputOutput| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "coins", + |m: &BinanceInputOutput| { &m.coins }, + |m: &mut BinanceInputOutput| { &mut m.coins }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "BinanceTransferMsg.BinanceInputOutput", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for BinanceInputOutput { + const NAME: &'static str = "BinanceInputOutput"; + + fn is_initialized(&self) -> bool { + if self.address.is_none() { + return false; + } + for v in &self.coins { + if !v.is_initialized() { + 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_string()?); + }, + 18 => { + self.coins.push(is.read_message()?); + }, + 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::string_size(1, &v); + } + for value in &self.coins { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + 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_string(1, v)?; + } + for v in &self.coins { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + }; + 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() -> BinanceInputOutput { + BinanceInputOutput::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.coins.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static BinanceInputOutput { + static instance: BinanceInputOutput = BinanceInputOutput { + address: ::std::option::Option::None, + coins: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for BinanceInputOutput { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("BinanceTransferMsg.BinanceInputOutput").unwrap()).clone() + } + } + + impl ::std::fmt::Display for BinanceInputOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for BinanceInputOutput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.binance.BinanceTransferMsg.BinanceCoin) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct BinanceCoin { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceTransferMsg.BinanceCoin.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceTransferMsg.BinanceCoin.denom) + pub denom: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.binance.BinanceTransferMsg.BinanceCoin.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a BinanceCoin { + fn default() -> &'a BinanceCoin { + ::default_instance() + } + } + + impl BinanceCoin { + pub fn new() -> BinanceCoin { + ::std::default::Default::default() + } + + // required sint64 amount = 1; + + pub fn amount(&self) -> i64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: i64) { + self.amount = ::std::option::Option::Some(v); + } + + // required string denom = 2; + + pub fn denom(&self) -> &str { + match self.denom.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_denom(&mut self) { + self.denom = ::std::option::Option::None; + } + + pub fn has_denom(&self) -> bool { + self.denom.is_some() + } + + // Param is passed by value, moved + pub fn set_denom(&mut self, v: ::std::string::String) { + self.denom = ::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_denom(&mut self) -> &mut ::std::string::String { + if self.denom.is_none() { + self.denom = ::std::option::Option::Some(::std::string::String::new()); + } + self.denom.as_mut().unwrap() + } + + // Take field + pub fn take_denom(&mut self) -> ::std::string::String { + self.denom.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub(in super) 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::<_, _>( + "amount", + |m: &BinanceCoin| { &m.amount }, + |m: &mut BinanceCoin| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "denom", + |m: &BinanceCoin| { &m.denom }, + |m: &mut BinanceCoin| { &mut m.denom }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "BinanceTransferMsg.BinanceCoin", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for BinanceCoin { + const NAME: &'static str = "BinanceCoin"; + + fn is_initialized(&self) -> bool { + if self.amount.is_none() { + return false; + } + if self.denom.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.amount = ::std::option::Option::Some(is.read_sint64()?); + }, + 18 => { + self.denom = ::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.amount { + my_size += ::protobuf::rt::sint64_size(1, v); + } + if let Some(v) = self.denom.as_ref() { + my_size += ::protobuf::rt::string_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.amount { + os.write_sint64(1, v)?; + } + if let Some(v) = self.denom.as_ref() { + os.write_string(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() -> BinanceCoin { + BinanceCoin::new() + } + + fn clear(&mut self) { + self.amount = ::std::option::Option::None; + self.denom = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static BinanceCoin { + static instance: BinanceCoin = BinanceCoin { + amount: ::std::option::Option::None, + denom: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for BinanceCoin { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("BinanceTransferMsg.BinanceCoin").unwrap()).clone() + } + } + + impl ::std::fmt::Display for BinanceCoin { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for BinanceCoin { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.binance.BinanceOrderMsg) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct BinanceOrderMsg { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceOrderMsg.id) + pub id: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceOrderMsg.ordertype) + pub ordertype: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceOrderMsg.price) + pub price: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceOrderMsg.quantity) + pub quantity: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceOrderMsg.sender) + pub sender: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceOrderMsg.side) + pub side: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceOrderMsg.symbol) + pub symbol: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceOrderMsg.timeinforce) + pub timeinforce: ::std::option::Option<::protobuf::EnumOrUnknown>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.binance.BinanceOrderMsg.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a BinanceOrderMsg { + fn default() -> &'a BinanceOrderMsg { + ::default_instance() + } +} + +impl BinanceOrderMsg { + pub fn new() -> BinanceOrderMsg { + ::std::default::Default::default() + } + + // optional string id = 1; + + pub fn id(&self) -> &str { + match self.id.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_id(&mut self) { + self.id = ::std::option::Option::None; + } + + pub fn has_id(&self) -> bool { + self.id.is_some() + } + + // Param is passed by value, moved + pub fn set_id(&mut self, v: ::std::string::String) { + self.id = ::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_id(&mut self) -> &mut ::std::string::String { + if self.id.is_none() { + self.id = ::std::option::Option::Some(::std::string::String::new()); + } + self.id.as_mut().unwrap() + } + + // Take field + pub fn take_id(&mut self) -> ::std::string::String { + self.id.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required .hw.trezor.messages.binance.BinanceOrderMsg.BinanceOrderType ordertype = 2; + + pub fn ordertype(&self) -> binance_order_msg::BinanceOrderType { + match self.ordertype { + Some(e) => e.enum_value_or(binance_order_msg::BinanceOrderType::OT_UNKNOWN), + None => binance_order_msg::BinanceOrderType::OT_UNKNOWN, + } + } + + pub fn clear_ordertype(&mut self) { + self.ordertype = ::std::option::Option::None; + } + + pub fn has_ordertype(&self) -> bool { + self.ordertype.is_some() + } + + // Param is passed by value, moved + pub fn set_ordertype(&mut self, v: binance_order_msg::BinanceOrderType) { + self.ordertype = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // required sint64 price = 3; + + pub fn price(&self) -> i64 { + self.price.unwrap_or(0) + } + + pub fn clear_price(&mut self) { + self.price = ::std::option::Option::None; + } + + pub fn has_price(&self) -> bool { + self.price.is_some() + } + + // Param is passed by value, moved + pub fn set_price(&mut self, v: i64) { + self.price = ::std::option::Option::Some(v); + } + + // required sint64 quantity = 4; + + pub fn quantity(&self) -> i64 { + self.quantity.unwrap_or(0) + } + + pub fn clear_quantity(&mut self) { + self.quantity = ::std::option::Option::None; + } + + pub fn has_quantity(&self) -> bool { + self.quantity.is_some() + } + + // Param is passed by value, moved + pub fn set_quantity(&mut self, v: i64) { + self.quantity = ::std::option::Option::Some(v); + } + + // optional string sender = 5; + + pub fn sender(&self) -> &str { + match self.sender.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_sender(&mut self) { + self.sender = ::std::option::Option::None; + } + + pub fn has_sender(&self) -> bool { + self.sender.is_some() + } + + // Param is passed by value, moved + pub fn set_sender(&mut self, v: ::std::string::String) { + self.sender = ::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_sender(&mut self) -> &mut ::std::string::String { + if self.sender.is_none() { + self.sender = ::std::option::Option::Some(::std::string::String::new()); + } + self.sender.as_mut().unwrap() + } + + // Take field + pub fn take_sender(&mut self) -> ::std::string::String { + self.sender.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required .hw.trezor.messages.binance.BinanceOrderMsg.BinanceOrderSide side = 6; + + pub fn side(&self) -> binance_order_msg::BinanceOrderSide { + match self.side { + Some(e) => e.enum_value_or(binance_order_msg::BinanceOrderSide::SIDE_UNKNOWN), + None => binance_order_msg::BinanceOrderSide::SIDE_UNKNOWN, + } + } + + pub fn clear_side(&mut self) { + self.side = ::std::option::Option::None; + } + + pub fn has_side(&self) -> bool { + self.side.is_some() + } + + // Param is passed by value, moved + pub fn set_side(&mut self, v: binance_order_msg::BinanceOrderSide) { + self.side = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional string symbol = 7; + + 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 .hw.trezor.messages.binance.BinanceOrderMsg.BinanceTimeInForce timeinforce = 8; + + pub fn timeinforce(&self) -> binance_order_msg::BinanceTimeInForce { + match self.timeinforce { + Some(e) => e.enum_value_or(binance_order_msg::BinanceTimeInForce::TIF_UNKNOWN), + None => binance_order_msg::BinanceTimeInForce::TIF_UNKNOWN, + } + } + + pub fn clear_timeinforce(&mut self) { + self.timeinforce = ::std::option::Option::None; + } + + pub fn has_timeinforce(&self) -> bool { + self.timeinforce.is_some() + } + + // Param is passed by value, moved + pub fn set_timeinforce(&mut self, v: binance_order_msg::BinanceTimeInForce) { + self.timeinforce = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(8); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "id", + |m: &BinanceOrderMsg| { &m.id }, + |m: &mut BinanceOrderMsg| { &mut m.id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ordertype", + |m: &BinanceOrderMsg| { &m.ordertype }, + |m: &mut BinanceOrderMsg| { &mut m.ordertype }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "price", + |m: &BinanceOrderMsg| { &m.price }, + |m: &mut BinanceOrderMsg| { &mut m.price }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "quantity", + |m: &BinanceOrderMsg| { &m.quantity }, + |m: &mut BinanceOrderMsg| { &mut m.quantity }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sender", + |m: &BinanceOrderMsg| { &m.sender }, + |m: &mut BinanceOrderMsg| { &mut m.sender }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "side", + |m: &BinanceOrderMsg| { &m.side }, + |m: &mut BinanceOrderMsg| { &mut m.side }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "symbol", + |m: &BinanceOrderMsg| { &m.symbol }, + |m: &mut BinanceOrderMsg| { &mut m.symbol }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "timeinforce", + |m: &BinanceOrderMsg| { &m.timeinforce }, + |m: &mut BinanceOrderMsg| { &mut m.timeinforce }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "BinanceOrderMsg", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for BinanceOrderMsg { + const NAME: &'static str = "BinanceOrderMsg"; + + fn is_initialized(&self) -> bool { + if self.ordertype.is_none() { + return false; + } + if self.price.is_none() { + return false; + } + if self.quantity.is_none() { + return false; + } + if self.side.is_none() { + return false; + } + if self.timeinforce.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.id = ::std::option::Option::Some(is.read_string()?); + }, + 16 => { + self.ordertype = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 24 => { + self.price = ::std::option::Option::Some(is.read_sint64()?); + }, + 32 => { + self.quantity = ::std::option::Option::Some(is.read_sint64()?); + }, + 42 => { + self.sender = ::std::option::Option::Some(is.read_string()?); + }, + 48 => { + self.side = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 58 => { + self.symbol = ::std::option::Option::Some(is.read_string()?); + }, + 64 => { + self.timeinforce = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 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.id.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.ordertype { + my_size += ::protobuf::rt::int32_size(2, v.value()); + } + if let Some(v) = self.price { + my_size += ::protobuf::rt::sint64_size(3, v); + } + if let Some(v) = self.quantity { + my_size += ::protobuf::rt::sint64_size(4, v); + } + if let Some(v) = self.sender.as_ref() { + my_size += ::protobuf::rt::string_size(5, &v); + } + if let Some(v) = self.side { + my_size += ::protobuf::rt::int32_size(6, v.value()); + } + if let Some(v) = self.symbol.as_ref() { + my_size += ::protobuf::rt::string_size(7, &v); + } + if let Some(v) = self.timeinforce { + my_size += ::protobuf::rt::int32_size(8, v.value()); + } + 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.id.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.ordertype { + os.write_enum(2, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.price { + os.write_sint64(3, v)?; + } + if let Some(v) = self.quantity { + os.write_sint64(4, v)?; + } + if let Some(v) = self.sender.as_ref() { + os.write_string(5, v)?; + } + if let Some(v) = self.side { + os.write_enum(6, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.symbol.as_ref() { + os.write_string(7, v)?; + } + if let Some(v) = self.timeinforce { + os.write_enum(8, ::protobuf::EnumOrUnknown::value(&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() -> BinanceOrderMsg { + BinanceOrderMsg::new() + } + + fn clear(&mut self) { + self.id = ::std::option::Option::None; + self.ordertype = ::std::option::Option::None; + self.price = ::std::option::Option::None; + self.quantity = ::std::option::Option::None; + self.sender = ::std::option::Option::None; + self.side = ::std::option::Option::None; + self.symbol = ::std::option::Option::None; + self.timeinforce = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static BinanceOrderMsg { + static instance: BinanceOrderMsg = BinanceOrderMsg { + id: ::std::option::Option::None, + ordertype: ::std::option::Option::None, + price: ::std::option::Option::None, + quantity: ::std::option::Option::None, + sender: ::std::option::Option::None, + side: ::std::option::Option::None, + symbol: ::std::option::Option::None, + timeinforce: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for BinanceOrderMsg { + 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("BinanceOrderMsg").unwrap()).clone() + } +} + +impl ::std::fmt::Display for BinanceOrderMsg { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for BinanceOrderMsg { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `BinanceOrderMsg` +pub mod binance_order_msg { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.binance.BinanceOrderMsg.BinanceOrderType) + pub enum BinanceOrderType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.binance.BinanceOrderMsg.BinanceOrderType.OT_UNKNOWN) + OT_UNKNOWN = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.binance.BinanceOrderMsg.BinanceOrderType.MARKET) + MARKET = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.binance.BinanceOrderMsg.BinanceOrderType.LIMIT) + LIMIT = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.binance.BinanceOrderMsg.BinanceOrderType.OT_RESERVED) + OT_RESERVED = 3, + } + + impl ::protobuf::Enum for BinanceOrderType { + const NAME: &'static str = "BinanceOrderType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(BinanceOrderType::OT_UNKNOWN), + 1 => ::std::option::Option::Some(BinanceOrderType::MARKET), + 2 => ::std::option::Option::Some(BinanceOrderType::LIMIT), + 3 => ::std::option::Option::Some(BinanceOrderType::OT_RESERVED), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "OT_UNKNOWN" => ::std::option::Option::Some(BinanceOrderType::OT_UNKNOWN), + "MARKET" => ::std::option::Option::Some(BinanceOrderType::MARKET), + "LIMIT" => ::std::option::Option::Some(BinanceOrderType::LIMIT), + "OT_RESERVED" => ::std::option::Option::Some(BinanceOrderType::OT_RESERVED), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [BinanceOrderType] = &[ + BinanceOrderType::OT_UNKNOWN, + BinanceOrderType::MARKET, + BinanceOrderType::LIMIT, + BinanceOrderType::OT_RESERVED, + ]; + } + + impl ::protobuf::EnumFull for BinanceOrderType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("BinanceOrderMsg.BinanceOrderType").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 BinanceOrderType { + fn default() -> Self { + BinanceOrderType::OT_UNKNOWN + } + } + + impl BinanceOrderType { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("BinanceOrderMsg.BinanceOrderType") + } + } + + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.binance.BinanceOrderMsg.BinanceOrderSide) + pub enum BinanceOrderSide { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.binance.BinanceOrderMsg.BinanceOrderSide.SIDE_UNKNOWN) + SIDE_UNKNOWN = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.binance.BinanceOrderMsg.BinanceOrderSide.BUY) + BUY = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.binance.BinanceOrderMsg.BinanceOrderSide.SELL) + SELL = 2, + } + + impl ::protobuf::Enum for BinanceOrderSide { + const NAME: &'static str = "BinanceOrderSide"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(BinanceOrderSide::SIDE_UNKNOWN), + 1 => ::std::option::Option::Some(BinanceOrderSide::BUY), + 2 => ::std::option::Option::Some(BinanceOrderSide::SELL), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "SIDE_UNKNOWN" => ::std::option::Option::Some(BinanceOrderSide::SIDE_UNKNOWN), + "BUY" => ::std::option::Option::Some(BinanceOrderSide::BUY), + "SELL" => ::std::option::Option::Some(BinanceOrderSide::SELL), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [BinanceOrderSide] = &[ + BinanceOrderSide::SIDE_UNKNOWN, + BinanceOrderSide::BUY, + BinanceOrderSide::SELL, + ]; + } + + impl ::protobuf::EnumFull for BinanceOrderSide { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("BinanceOrderMsg.BinanceOrderSide").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 BinanceOrderSide { + fn default() -> Self { + BinanceOrderSide::SIDE_UNKNOWN + } + } + + impl BinanceOrderSide { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("BinanceOrderMsg.BinanceOrderSide") + } + } + + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.binance.BinanceOrderMsg.BinanceTimeInForce) + pub enum BinanceTimeInForce { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.binance.BinanceOrderMsg.BinanceTimeInForce.TIF_UNKNOWN) + TIF_UNKNOWN = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.binance.BinanceOrderMsg.BinanceTimeInForce.GTE) + GTE = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.binance.BinanceOrderMsg.BinanceTimeInForce.TIF_RESERVED) + TIF_RESERVED = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.binance.BinanceOrderMsg.BinanceTimeInForce.IOC) + IOC = 3, + } + + impl ::protobuf::Enum for BinanceTimeInForce { + const NAME: &'static str = "BinanceTimeInForce"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(BinanceTimeInForce::TIF_UNKNOWN), + 1 => ::std::option::Option::Some(BinanceTimeInForce::GTE), + 2 => ::std::option::Option::Some(BinanceTimeInForce::TIF_RESERVED), + 3 => ::std::option::Option::Some(BinanceTimeInForce::IOC), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "TIF_UNKNOWN" => ::std::option::Option::Some(BinanceTimeInForce::TIF_UNKNOWN), + "GTE" => ::std::option::Option::Some(BinanceTimeInForce::GTE), + "TIF_RESERVED" => ::std::option::Option::Some(BinanceTimeInForce::TIF_RESERVED), + "IOC" => ::std::option::Option::Some(BinanceTimeInForce::IOC), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [BinanceTimeInForce] = &[ + BinanceTimeInForce::TIF_UNKNOWN, + BinanceTimeInForce::GTE, + BinanceTimeInForce::TIF_RESERVED, + BinanceTimeInForce::IOC, + ]; + } + + impl ::protobuf::EnumFull for BinanceTimeInForce { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("BinanceOrderMsg.BinanceTimeInForce").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 BinanceTimeInForce { + fn default() -> Self { + BinanceTimeInForce::TIF_UNKNOWN + } + } + + impl BinanceTimeInForce { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("BinanceOrderMsg.BinanceTimeInForce") + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.binance.BinanceCancelMsg) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct BinanceCancelMsg { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceCancelMsg.refid) + pub refid: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceCancelMsg.sender) + pub sender: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceCancelMsg.symbol) + pub symbol: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.binance.BinanceCancelMsg.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a BinanceCancelMsg { + fn default() -> &'a BinanceCancelMsg { + ::default_instance() + } +} + +impl BinanceCancelMsg { + pub fn new() -> BinanceCancelMsg { + ::std::default::Default::default() + } + + // optional string refid = 1; + + pub fn refid(&self) -> &str { + match self.refid.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_refid(&mut self) { + self.refid = ::std::option::Option::None; + } + + pub fn has_refid(&self) -> bool { + self.refid.is_some() + } + + // Param is passed by value, moved + pub fn set_refid(&mut self, v: ::std::string::String) { + self.refid = ::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_refid(&mut self) -> &mut ::std::string::String { + if self.refid.is_none() { + self.refid = ::std::option::Option::Some(::std::string::String::new()); + } + self.refid.as_mut().unwrap() + } + + // Take field + pub fn take_refid(&mut self) -> ::std::string::String { + self.refid.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string sender = 2; + + pub fn sender(&self) -> &str { + match self.sender.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_sender(&mut self) { + self.sender = ::std::option::Option::None; + } + + pub fn has_sender(&self) -> bool { + self.sender.is_some() + } + + // Param is passed by value, moved + pub fn set_sender(&mut self, v: ::std::string::String) { + self.sender = ::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_sender(&mut self) -> &mut ::std::string::String { + if self.sender.is_none() { + self.sender = ::std::option::Option::Some(::std::string::String::new()); + } + self.sender.as_mut().unwrap() + } + + // Take field + pub fn take_sender(&mut self) -> ::std::string::String { + self.sender.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional 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()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "refid", + |m: &BinanceCancelMsg| { &m.refid }, + |m: &mut BinanceCancelMsg| { &mut m.refid }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sender", + |m: &BinanceCancelMsg| { &m.sender }, + |m: &mut BinanceCancelMsg| { &mut m.sender }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "symbol", + |m: &BinanceCancelMsg| { &m.symbol }, + |m: &mut BinanceCancelMsg| { &mut m.symbol }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "BinanceCancelMsg", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for BinanceCancelMsg { + const NAME: &'static str = "BinanceCancelMsg"; + + 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.refid = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.sender = ::std::option::Option::Some(is.read_string()?); + }, + 26 => { + self.symbol = ::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.refid.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.sender.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.symbol.as_ref() { + my_size += ::protobuf::rt::string_size(3, &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.refid.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.sender.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.symbol.as_ref() { + os.write_string(3, 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() -> BinanceCancelMsg { + BinanceCancelMsg::new() + } + + fn clear(&mut self) { + self.refid = ::std::option::Option::None; + self.sender = ::std::option::Option::None; + self.symbol = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static BinanceCancelMsg { + static instance: BinanceCancelMsg = BinanceCancelMsg { + refid: ::std::option::Option::None, + sender: ::std::option::Option::None, + symbol: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for BinanceCancelMsg { + 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("BinanceCancelMsg").unwrap()).clone() + } +} + +impl ::std::fmt::Display for BinanceCancelMsg { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for BinanceCancelMsg { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.binance.BinanceSignedTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct BinanceSignedTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceSignedTx.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.binance.BinanceSignedTx.public_key) + pub public_key: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.binance.BinanceSignedTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a BinanceSignedTx { + fn default() -> &'a BinanceSignedTx { + ::default_instance() + } +} + +impl BinanceSignedTx { + pub fn new() -> BinanceSignedTx { + ::std::default::Default::default() + } + + // required bytes signature = 1; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes public_key = 2; + + pub fn public_key(&self) -> &[u8] { + match self.public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_public_key(&mut self) { + self.public_key = ::std::option::Option::None; + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: ::std::vec::Vec) { + self.public_key = ::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_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.public_key.is_none() { + self.public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> ::std::vec::Vec { + self.public_key.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::<_, _>( + "signature", + |m: &BinanceSignedTx| { &m.signature }, + |m: &mut BinanceSignedTx| { &mut m.signature }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "public_key", + |m: &BinanceSignedTx| { &m.public_key }, + |m: &mut BinanceSignedTx| { &mut m.public_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "BinanceSignedTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for BinanceSignedTx { + const NAME: &'static str = "BinanceSignedTx"; + + fn is_initialized(&self) -> bool { + if self.signature.is_none() { + return false; + } + if self.public_key.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.signature = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.public_key = ::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.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.public_key.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.signature.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.public_key.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() -> BinanceSignedTx { + BinanceSignedTx::new() + } + + fn clear(&mut self) { + self.signature = ::std::option::Option::None; + self.public_key = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static BinanceSignedTx { + static instance: BinanceSignedTx = BinanceSignedTx { + signature: ::std::option::Option::None, + public_key: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for BinanceSignedTx { + 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("BinanceSignedTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for BinanceSignedTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for BinanceSignedTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x16messages-binance.proto\x12\x1ahw.trezor.messages.binance\"o\n\x11B\ + inanceGetAddress\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\ + \x12!\n\x0cshow_display\x18\x02\x20\x01(\x08R\x0bshowDisplay\x12\x1a\n\ + \x08chunkify\x18\x03\x20\x01(\x08R\x08chunkify\"*\n\x0eBinanceAddress\ + \x12\x18\n\x07address\x18\x01\x20\x02(\tR\x07address\"U\n\x13BinanceGetP\ + ublicKey\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12!\n\x0c\ + show_display\x18\x02\x20\x01(\x08R\x0bshowDisplay\"1\n\x10BinancePublicK\ + ey\x12\x1d\n\npublic_key\x18\x01\x20\x02(\x0cR\tpublicKey\"\xef\x01\n\rB\ + inanceSignTx\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\ + \x1b\n\tmsg_count\x18\x02\x20\x02(\rR\x08msgCount\x12%\n\x0eaccount_numb\ + er\x18\x03\x20\x02(\x12R\raccountNumber\x12\x19\n\x08chain_id\x18\x04\ + \x20\x01(\tR\x07chainId\x12\x12\n\x04memo\x18\x05\x20\x01(\tR\x04memo\ + \x12\x1a\n\x08sequence\x18\x06\x20\x02(\x12R\x08sequence\x12\x16\n\x06so\ + urce\x18\x07\x20\x02(\x12R\x06source\x12\x1a\n\x08chunkify\x18\x08\x20\ + \x01(\x08R\x08chunkify\"\x12\n\x10BinanceTxRequest\"\xa8\x03\n\x12Binanc\ + eTransferMsg\x12Y\n\x06inputs\x18\x01\x20\x03(\x0b2A.hw.trezor.messages.\ + binance.BinanceTransferMsg.BinanceInputOutputR\x06inputs\x12[\n\x07outpu\ + ts\x18\x02\x20\x03(\x0b2A.hw.trezor.messages.binance.BinanceTransferMsg.\ + BinanceInputOutputR\x07outputs\x12\x1a\n\x08chunkify\x18\x03\x20\x01(\ + \x08R\x08chunkify\x1a\x80\x01\n\x12BinanceInputOutput\x12\x18\n\x07addre\ + ss\x18\x01\x20\x02(\tR\x07address\x12P\n\x05coins\x18\x02\x20\x03(\x0b2:\ + .hw.trezor.messages.binance.BinanceTransferMsg.BinanceCoinR\x05coins\x1a\ + ;\n\x0bBinanceCoin\x12\x16\n\x06amount\x18\x01\x20\x02(\x12R\x06amount\ + \x12\x14\n\x05denom\x18\x02\x20\x02(\tR\x05denom\"\xe3\x04\n\x0fBinanceO\ + rderMsg\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12Z\n\tordertype\x18\ + \x02\x20\x02(\x0e2<.hw.trezor.messages.binance.BinanceOrderMsg.BinanceOr\ + derTypeR\tordertype\x12\x14\n\x05price\x18\x03\x20\x02(\x12R\x05price\ + \x12\x1a\n\x08quantity\x18\x04\x20\x02(\x12R\x08quantity\x12\x16\n\x06se\ + nder\x18\x05\x20\x01(\tR\x06sender\x12P\n\x04side\x18\x06\x20\x02(\x0e2<\ + .hw.trezor.messages.binance.BinanceOrderMsg.BinanceOrderSideR\x04side\ + \x12\x16\n\x06symbol\x18\x07\x20\x01(\tR\x06symbol\x12`\n\x0btimeinforce\ + \x18\x08\x20\x02(\x0e2>.hw.trezor.messages.binance.BinanceOrderMsg.Binan\ + ceTimeInForceR\x0btimeinforce\"J\n\x10BinanceOrderType\x12\x0e\n\nOT_UNK\ + NOWN\x10\0\x12\n\n\x06MARKET\x10\x01\x12\t\n\x05LIMIT\x10\x02\x12\x0f\n\ + \x0bOT_RESERVED\x10\x03\"7\n\x10BinanceOrderSide\x12\x10\n\x0cSIDE_UNKNO\ + WN\x10\0\x12\x07\n\x03BUY\x10\x01\x12\x08\n\x04SELL\x10\x02\"I\n\x12Bina\ + nceTimeInForce\x12\x0f\n\x0bTIF_UNKNOWN\x10\0\x12\x07\n\x03GTE\x10\x01\ + \x12\x10\n\x0cTIF_RESERVED\x10\x02\x12\x07\n\x03IOC\x10\x03\"X\n\x10Bina\ + nceCancelMsg\x12\x14\n\x05refid\x18\x01\x20\x01(\tR\x05refid\x12\x16\n\ + \x06sender\x18\x02\x20\x01(\tR\x06sender\x12\x16\n\x06symbol\x18\x03\x20\ + \x01(\tR\x06symbol\"N\n\x0fBinanceSignedTx\x12\x1c\n\tsignature\x18\x01\ + \x20\x02(\x0cR\tsignature\x12\x1d\n\npublic_key\x18\x02\x20\x02(\x0cR\tp\ + ublicKeyB;\n#com.satoshilabs.trezor.lib.protobufB\x14TrezorMessageBinanc\ + e\ +"; + +/// `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(12); + messages.push(BinanceGetAddress::generated_message_descriptor_data()); + messages.push(BinanceAddress::generated_message_descriptor_data()); + messages.push(BinanceGetPublicKey::generated_message_descriptor_data()); + messages.push(BinancePublicKey::generated_message_descriptor_data()); + messages.push(BinanceSignTx::generated_message_descriptor_data()); + messages.push(BinanceTxRequest::generated_message_descriptor_data()); + messages.push(BinanceTransferMsg::generated_message_descriptor_data()); + messages.push(BinanceOrderMsg::generated_message_descriptor_data()); + messages.push(BinanceCancelMsg::generated_message_descriptor_data()); + messages.push(BinanceSignedTx::generated_message_descriptor_data()); + messages.push(binance_transfer_msg::BinanceInputOutput::generated_message_descriptor_data()); + messages.push(binance_transfer_msg::BinanceCoin::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(3); + enums.push(binance_order_msg::BinanceOrderType::generated_enum_descriptor_data()); + enums.push(binance_order_msg::BinanceOrderSide::generated_enum_descriptor_data()); + enums.push(binance_order_msg::BinanceTimeInForce::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_bitcoin.rs b/wallet/trezor-client/src/protos/generated/messages_bitcoin.rs new file mode 100644 index 0000000000..59422c58bb --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_bitcoin.rs @@ -0,0 +1,13682 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-bitcoin.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.MultisigRedeemScriptType) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MultisigRedeemScriptType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.MultisigRedeemScriptType.pubkeys) + pub pubkeys: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.MultisigRedeemScriptType.signatures) + pub signatures: ::std::vec::Vec<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.MultisigRedeemScriptType.m) + pub m: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.MultisigRedeemScriptType.nodes) + pub nodes: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.MultisigRedeemScriptType.address_n) + pub address_n: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.MultisigRedeemScriptType.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MultisigRedeemScriptType { + fn default() -> &'a MultisigRedeemScriptType { + ::default_instance() + } +} + +impl MultisigRedeemScriptType { + pub fn new() -> MultisigRedeemScriptType { + ::std::default::Default::default() + } + + // required uint32 m = 3; + + pub fn m(&self) -> u32 { + self.m.unwrap_or(0) + } + + pub fn clear_m(&mut self) { + self.m = ::std::option::Option::None; + } + + pub fn has_m(&self) -> bool { + self.m.is_some() + } + + // Param is passed by value, moved + pub fn set_m(&mut self, v: u32) { + self.m = ::std::option::Option::Some(v); + } + + 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_vec_simpler_accessor::<_, _>( + "pubkeys", + |m: &MultisigRedeemScriptType| { &m.pubkeys }, + |m: &mut MultisigRedeemScriptType| { &mut m.pubkeys }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "signatures", + |m: &MultisigRedeemScriptType| { &m.signatures }, + |m: &mut MultisigRedeemScriptType| { &mut m.signatures }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "m", + |m: &MultisigRedeemScriptType| { &m.m }, + |m: &mut MultisigRedeemScriptType| { &mut m.m }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "nodes", + |m: &MultisigRedeemScriptType| { &m.nodes }, + |m: &mut MultisigRedeemScriptType| { &mut m.nodes }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &MultisigRedeemScriptType| { &m.address_n }, + |m: &mut MultisigRedeemScriptType| { &mut m.address_n }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MultisigRedeemScriptType", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MultisigRedeemScriptType { + const NAME: &'static str = "MultisigRedeemScriptType"; + + fn is_initialized(&self) -> bool { + if self.m.is_none() { + return false; + } + for v in &self.pubkeys { + if !v.is_initialized() { + return false; + } + }; + for v in &self.nodes { + if !v.is_initialized() { + 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.pubkeys.push(is.read_message()?); + }, + 18 => { + self.signatures.push(is.read_bytes()?); + }, + 24 => { + self.m = ::std::option::Option::Some(is.read_uint32()?); + }, + 34 => { + self.nodes.push(is.read_message()?); + }, + 42 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 40 => { + self.address_n.push(is.read_uint32()?); + }, + 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; + for value in &self.pubkeys { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + for value in &self.signatures { + my_size += ::protobuf::rt::bytes_size(2, &value); + }; + if let Some(v) = self.m { + my_size += ::protobuf::rt::uint32_size(3, v); + } + for value in &self.nodes { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(5, *value); + }; + 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<()> { + for v in &self.pubkeys { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + }; + for v in &self.signatures { + os.write_bytes(2, &v)?; + }; + if let Some(v) = self.m { + os.write_uint32(3, v)?; + } + for v in &self.nodes { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + }; + for v in &self.address_n { + os.write_uint32(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() -> MultisigRedeemScriptType { + MultisigRedeemScriptType::new() + } + + fn clear(&mut self) { + self.pubkeys.clear(); + self.signatures.clear(); + self.m = ::std::option::Option::None; + self.nodes.clear(); + self.address_n.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MultisigRedeemScriptType { + static instance: MultisigRedeemScriptType = MultisigRedeemScriptType { + pubkeys: ::std::vec::Vec::new(), + signatures: ::std::vec::Vec::new(), + m: ::std::option::Option::None, + nodes: ::std::vec::Vec::new(), + address_n: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MultisigRedeemScriptType { + 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("MultisigRedeemScriptType").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MultisigRedeemScriptType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MultisigRedeemScriptType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `MultisigRedeemScriptType` +pub mod multisig_redeem_script_type { + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.MultisigRedeemScriptType.HDNodePathType) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct HDNodePathType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.MultisigRedeemScriptType.HDNodePathType.node) + pub node: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.MultisigRedeemScriptType.HDNodePathType.address_n) + pub address_n: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.MultisigRedeemScriptType.HDNodePathType.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a HDNodePathType { + fn default() -> &'a HDNodePathType { + ::default_instance() + } + } + + impl HDNodePathType { + pub fn new() -> HDNodePathType { + ::std::default::Default::default() + } + + pub(in super) 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_message_field_accessor::<_, super::super::messages_common::HDNodeType>( + "node", + |m: &HDNodePathType| { &m.node }, + |m: &mut HDNodePathType| { &mut m.node }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &HDNodePathType| { &m.address_n }, + |m: &mut HDNodePathType| { &mut m.address_n }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MultisigRedeemScriptType.HDNodePathType", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for HDNodePathType { + const NAME: &'static str = "HDNodePathType"; + + fn is_initialized(&self) -> bool { + if self.node.is_none() { + return false; + } + for v in &self.node { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.node)?; + }, + 18 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 16 => { + self.address_n.push(is.read_uint32()?); + }, + 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.node.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(2, *value); + }; + 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.node.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + for v in &self.address_n { + os.write_uint32(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() -> HDNodePathType { + HDNodePathType::new() + } + + fn clear(&mut self) { + self.node.clear(); + self.address_n.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static HDNodePathType { + static instance: HDNodePathType = HDNodePathType { + node: ::protobuf::MessageField::none(), + address_n: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for HDNodePathType { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("MultisigRedeemScriptType.HDNodePathType").unwrap()).clone() + } + } + + impl ::std::fmt::Display for HDNodePathType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for HDNodePathType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.GetPublicKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct GetPublicKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetPublicKey.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetPublicKey.ecdsa_curve_name) + pub ecdsa_curve_name: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetPublicKey.show_display) + pub show_display: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetPublicKey.coin_name) + pub coin_name: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetPublicKey.script_type) + pub script_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetPublicKey.ignore_xpub_magic) + pub ignore_xpub_magic: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.GetPublicKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a GetPublicKey { + fn default() -> &'a GetPublicKey { + ::default_instance() + } +} + +impl GetPublicKey { + pub fn new() -> GetPublicKey { + ::std::default::Default::default() + } + + // optional string ecdsa_curve_name = 2; + + pub fn ecdsa_curve_name(&self) -> &str { + match self.ecdsa_curve_name.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_ecdsa_curve_name(&mut self) { + self.ecdsa_curve_name = ::std::option::Option::None; + } + + pub fn has_ecdsa_curve_name(&self) -> bool { + self.ecdsa_curve_name.is_some() + } + + // Param is passed by value, moved + pub fn set_ecdsa_curve_name(&mut self, v: ::std::string::String) { + self.ecdsa_curve_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_ecdsa_curve_name(&mut self) -> &mut ::std::string::String { + if self.ecdsa_curve_name.is_none() { + self.ecdsa_curve_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.ecdsa_curve_name.as_mut().unwrap() + } + + // Take field + pub fn take_ecdsa_curve_name(&mut self) -> ::std::string::String { + self.ecdsa_curve_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bool show_display = 3; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + // optional string coin_name = 4; + + pub fn coin_name(&self) -> &str { + match self.coin_name.as_ref() { + Some(v) => v, + None => "Bitcoin", + } + } + + pub fn clear_coin_name(&mut self) { + self.coin_name = ::std::option::Option::None; + } + + pub fn has_coin_name(&self) -> bool { + self.coin_name.is_some() + } + + // Param is passed by value, moved + pub fn set_coin_name(&mut self, v: ::std::string::String) { + self.coin_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_coin_name(&mut self) -> &mut ::std::string::String { + if self.coin_name.is_none() { + self.coin_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.coin_name.as_mut().unwrap() + } + + // Take field + pub fn take_coin_name(&mut self) -> ::std::string::String { + self.coin_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional .hw.trezor.messages.bitcoin.InputScriptType script_type = 5; + + pub fn script_type(&self) -> InputScriptType { + match self.script_type { + Some(e) => e.enum_value_or(InputScriptType::SPENDADDRESS), + None => InputScriptType::SPENDADDRESS, + } + } + + pub fn clear_script_type(&mut self) { + self.script_type = ::std::option::Option::None; + } + + pub fn has_script_type(&self) -> bool { + self.script_type.is_some() + } + + // Param is passed by value, moved + pub fn set_script_type(&mut self, v: InputScriptType) { + self.script_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bool ignore_xpub_magic = 6; + + pub fn ignore_xpub_magic(&self) -> bool { + self.ignore_xpub_magic.unwrap_or(false) + } + + pub fn clear_ignore_xpub_magic(&mut self) { + self.ignore_xpub_magic = ::std::option::Option::None; + } + + pub fn has_ignore_xpub_magic(&self) -> bool { + self.ignore_xpub_magic.is_some() + } + + // Param is passed by value, moved + pub fn set_ignore_xpub_magic(&mut self, v: bool) { + self.ignore_xpub_magic = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &GetPublicKey| { &m.address_n }, + |m: &mut GetPublicKey| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ecdsa_curve_name", + |m: &GetPublicKey| { &m.ecdsa_curve_name }, + |m: &mut GetPublicKey| { &mut m.ecdsa_curve_name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &GetPublicKey| { &m.show_display }, + |m: &mut GetPublicKey| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "coin_name", + |m: &GetPublicKey| { &m.coin_name }, + |m: &mut GetPublicKey| { &mut m.coin_name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_type", + |m: &GetPublicKey| { &m.script_type }, + |m: &mut GetPublicKey| { &mut m.script_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ignore_xpub_magic", + |m: &GetPublicKey| { &m.ignore_xpub_magic }, + |m: &mut GetPublicKey| { &mut m.ignore_xpub_magic }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "GetPublicKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for GetPublicKey { + const NAME: &'static str = "GetPublicKey"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.ecdsa_curve_name = ::std::option::Option::Some(is.read_string()?); + }, + 24 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 34 => { + self.coin_name = ::std::option::Option::Some(is.read_string()?); + }, + 40 => { + self.script_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 48 => { + self.ignore_xpub_magic = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.ecdsa_curve_name.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + if let Some(v) = self.coin_name.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(v) = self.script_type { + my_size += ::protobuf::rt::int32_size(5, v.value()); + } + if let Some(v) = self.ignore_xpub_magic { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.ecdsa_curve_name.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.show_display { + os.write_bool(3, v)?; + } + if let Some(v) = self.coin_name.as_ref() { + os.write_string(4, v)?; + } + if let Some(v) = self.script_type { + os.write_enum(5, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.ignore_xpub_magic { + os.write_bool(6, 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() -> GetPublicKey { + GetPublicKey::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.ecdsa_curve_name = ::std::option::Option::None; + self.show_display = ::std::option::Option::None; + self.coin_name = ::std::option::Option::None; + self.script_type = ::std::option::Option::None; + self.ignore_xpub_magic = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static GetPublicKey { + static instance: GetPublicKey = GetPublicKey { + address_n: ::std::vec::Vec::new(), + ecdsa_curve_name: ::std::option::Option::None, + show_display: ::std::option::Option::None, + coin_name: ::std::option::Option::None, + script_type: ::std::option::Option::None, + ignore_xpub_magic: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for GetPublicKey { + 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("GetPublicKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for GetPublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GetPublicKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.PublicKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct PublicKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PublicKey.node) + pub node: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PublicKey.xpub) + pub xpub: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PublicKey.root_fingerprint) + pub root_fingerprint: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PublicKey.descriptor) + pub descriptor: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.PublicKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a PublicKey { + fn default() -> &'a PublicKey { + ::default_instance() + } +} + +impl PublicKey { + pub fn new() -> PublicKey { + ::std::default::Default::default() + } + + // required string xpub = 2; + + pub fn xpub(&self) -> &str { + match self.xpub.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_xpub(&mut self) { + self.xpub = ::std::option::Option::None; + } + + pub fn has_xpub(&self) -> bool { + self.xpub.is_some() + } + + // Param is passed by value, moved + pub fn set_xpub(&mut self, v: ::std::string::String) { + self.xpub = ::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_xpub(&mut self) -> &mut ::std::string::String { + if self.xpub.is_none() { + self.xpub = ::std::option::Option::Some(::std::string::String::new()); + } + self.xpub.as_mut().unwrap() + } + + // Take field + pub fn take_xpub(&mut self) -> ::std::string::String { + self.xpub.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint32 root_fingerprint = 3; + + pub fn root_fingerprint(&self) -> u32 { + self.root_fingerprint.unwrap_or(0) + } + + pub fn clear_root_fingerprint(&mut self) { + self.root_fingerprint = ::std::option::Option::None; + } + + pub fn has_root_fingerprint(&self) -> bool { + self.root_fingerprint.is_some() + } + + // Param is passed by value, moved + pub fn set_root_fingerprint(&mut self, v: u32) { + self.root_fingerprint = ::std::option::Option::Some(v); + } + + // optional string descriptor = 4; + + pub fn descriptor(&self) -> &str { + match self.descriptor.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_descriptor(&mut self) { + self.descriptor = ::std::option::Option::None; + } + + pub fn has_descriptor(&self) -> bool { + self.descriptor.is_some() + } + + // Param is passed by value, moved + pub fn set_descriptor(&mut self, v: ::std::string::String) { + self.descriptor = ::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_descriptor(&mut self) -> &mut ::std::string::String { + if self.descriptor.is_none() { + self.descriptor = ::std::option::Option::Some(::std::string::String::new()); + } + self.descriptor.as_mut().unwrap() + } + + // Take field + pub fn take_descriptor(&mut self) -> ::std::string::String { + self.descriptor.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_message_field_accessor::<_, super::messages_common::HDNodeType>( + "node", + |m: &PublicKey| { &m.node }, + |m: &mut PublicKey| { &mut m.node }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "xpub", + |m: &PublicKey| { &m.xpub }, + |m: &mut PublicKey| { &mut m.xpub }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "root_fingerprint", + |m: &PublicKey| { &m.root_fingerprint }, + |m: &mut PublicKey| { &mut m.root_fingerprint }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "descriptor", + |m: &PublicKey| { &m.descriptor }, + |m: &mut PublicKey| { &mut m.descriptor }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "PublicKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for PublicKey { + const NAME: &'static str = "PublicKey"; + + fn is_initialized(&self) -> bool { + if self.node.is_none() { + return false; + } + if self.xpub.is_none() { + return false; + } + for v in &self.node { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.node)?; + }, + 18 => { + self.xpub = ::std::option::Option::Some(is.read_string()?); + }, + 24 => { + self.root_fingerprint = ::std::option::Option::Some(is.read_uint32()?); + }, + 34 => { + self.descriptor = ::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.node.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.xpub.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.root_fingerprint { + my_size += ::protobuf::rt::uint32_size(3, v); + } + if let Some(v) = self.descriptor.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.node.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.xpub.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.root_fingerprint { + os.write_uint32(3, v)?; + } + if let Some(v) = self.descriptor.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() -> PublicKey { + PublicKey::new() + } + + fn clear(&mut self) { + self.node.clear(); + self.xpub = ::std::option::Option::None; + self.root_fingerprint = ::std::option::Option::None; + self.descriptor = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static PublicKey { + static instance: PublicKey = PublicKey { + node: ::protobuf::MessageField::none(), + xpub: ::std::option::Option::None, + root_fingerprint: ::std::option::Option::None, + descriptor: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for PublicKey { + 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("PublicKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for PublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PublicKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.GetAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct GetAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetAddress.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetAddress.coin_name) + pub coin_name: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetAddress.show_display) + pub show_display: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetAddress.multisig) + pub multisig: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetAddress.script_type) + pub script_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetAddress.ignore_xpub_magic) + pub ignore_xpub_magic: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetAddress.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.GetAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a GetAddress { + fn default() -> &'a GetAddress { + ::default_instance() + } +} + +impl GetAddress { + pub fn new() -> GetAddress { + ::std::default::Default::default() + } + + // optional string coin_name = 2; + + pub fn coin_name(&self) -> &str { + match self.coin_name.as_ref() { + Some(v) => v, + None => "Bitcoin", + } + } + + pub fn clear_coin_name(&mut self) { + self.coin_name = ::std::option::Option::None; + } + + pub fn has_coin_name(&self) -> bool { + self.coin_name.is_some() + } + + // Param is passed by value, moved + pub fn set_coin_name(&mut self, v: ::std::string::String) { + self.coin_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_coin_name(&mut self) -> &mut ::std::string::String { + if self.coin_name.is_none() { + self.coin_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.coin_name.as_mut().unwrap() + } + + // Take field + pub fn take_coin_name(&mut self) -> ::std::string::String { + self.coin_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bool show_display = 3; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.bitcoin.InputScriptType script_type = 5; + + pub fn script_type(&self) -> InputScriptType { + match self.script_type { + Some(e) => e.enum_value_or(InputScriptType::SPENDADDRESS), + None => InputScriptType::SPENDADDRESS, + } + } + + pub fn clear_script_type(&mut self) { + self.script_type = ::std::option::Option::None; + } + + pub fn has_script_type(&self) -> bool { + self.script_type.is_some() + } + + // Param is passed by value, moved + pub fn set_script_type(&mut self, v: InputScriptType) { + self.script_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bool ignore_xpub_magic = 6; + + pub fn ignore_xpub_magic(&self) -> bool { + self.ignore_xpub_magic.unwrap_or(false) + } + + pub fn clear_ignore_xpub_magic(&mut self) { + self.ignore_xpub_magic = ::std::option::Option::None; + } + + pub fn has_ignore_xpub_magic(&self) -> bool { + self.ignore_xpub_magic.is_some() + } + + // Param is passed by value, moved + pub fn set_ignore_xpub_magic(&mut self, v: bool) { + self.ignore_xpub_magic = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 7; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(7); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &GetAddress| { &m.address_n }, + |m: &mut GetAddress| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "coin_name", + |m: &GetAddress| { &m.coin_name }, + |m: &mut GetAddress| { &mut m.coin_name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &GetAddress| { &m.show_display }, + |m: &mut GetAddress| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, MultisigRedeemScriptType>( + "multisig", + |m: &GetAddress| { &m.multisig }, + |m: &mut GetAddress| { &mut m.multisig }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_type", + |m: &GetAddress| { &m.script_type }, + |m: &mut GetAddress| { &mut m.script_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ignore_xpub_magic", + |m: &GetAddress| { &m.ignore_xpub_magic }, + |m: &mut GetAddress| { &mut m.ignore_xpub_magic }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &GetAddress| { &m.chunkify }, + |m: &mut GetAddress| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "GetAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for GetAddress { + const NAME: &'static str = "GetAddress"; + + fn is_initialized(&self) -> bool { + for v in &self.multisig { + if !v.is_initialized() { + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.coin_name = ::std::option::Option::Some(is.read_string()?); + }, + 24 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 34 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.multisig)?; + }, + 40 => { + self.script_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 48 => { + self.ignore_xpub_magic = ::std::option::Option::Some(is.read_bool()?); + }, + 56 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.coin_name.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + if let Some(v) = self.multisig.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.script_type { + my_size += ::protobuf::rt::int32_size(5, v.value()); + } + if let Some(v) = self.ignore_xpub_magic { + my_size += 1 + 1; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.coin_name.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.show_display { + os.write_bool(3, v)?; + } + if let Some(v) = self.multisig.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + } + if let Some(v) = self.script_type { + os.write_enum(5, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.ignore_xpub_magic { + os.write_bool(6, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(7, 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() -> GetAddress { + GetAddress::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.coin_name = ::std::option::Option::None; + self.show_display = ::std::option::Option::None; + self.multisig.clear(); + self.script_type = ::std::option::Option::None; + self.ignore_xpub_magic = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static GetAddress { + static instance: GetAddress = GetAddress { + address_n: ::std::vec::Vec::new(), + coin_name: ::std::option::Option::None, + show_display: ::std::option::Option::None, + multisig: ::protobuf::MessageField::none(), + script_type: ::std::option::Option::None, + ignore_xpub_magic: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for GetAddress { + 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("GetAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for GetAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GetAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.Address) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct Address { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.Address.address) + pub address: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.Address.mac) + pub mac: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.Address.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Address { + fn default() -> &'a Address { +
::default_instance() + } +} + +impl Address { + pub fn new() -> Address { + ::std::default::Default::default() + } + + // required string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bytes mac = 2; + + pub fn mac(&self) -> &[u8] { + match self.mac.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_mac(&mut self) { + self.mac = ::std::option::Option::None; + } + + pub fn has_mac(&self) -> bool { + self.mac.is_some() + } + + // Param is passed by value, moved + pub fn set_mac(&mut self, v: ::std::vec::Vec) { + self.mac = ::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_mac(&mut self) -> &mut ::std::vec::Vec { + if self.mac.is_none() { + self.mac = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.mac.as_mut().unwrap() + } + + // Take field + pub fn take_mac(&mut self) -> ::std::vec::Vec { + self.mac.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::<_, _>( + "address", + |m: &Address| { &m.address }, + |m: &mut Address| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "mac", + |m: &Address| { &m.mac }, + |m: &mut Address| { &mut m.mac }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::
( + "Address", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Address { + const NAME: &'static str = "Address"; + + fn is_initialized(&self) -> bool { + if self.address.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_string()?); + }, + 18 => { + self.mac = ::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.address.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.mac.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.address.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.mac.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() -> Address { + Address::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.mac = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static Address { + static instance: Address = Address { + address: ::std::option::Option::None, + mac: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Address { + 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("Address").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Address { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Address { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.GetOwnershipId) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct GetOwnershipId { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetOwnershipId.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetOwnershipId.coin_name) + pub coin_name: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetOwnershipId.multisig) + pub multisig: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetOwnershipId.script_type) + pub script_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.GetOwnershipId.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a GetOwnershipId { + fn default() -> &'a GetOwnershipId { + ::default_instance() + } +} + +impl GetOwnershipId { + pub fn new() -> GetOwnershipId { + ::std::default::Default::default() + } + + // optional string coin_name = 2; + + pub fn coin_name(&self) -> &str { + match self.coin_name.as_ref() { + Some(v) => v, + None => "Bitcoin", + } + } + + pub fn clear_coin_name(&mut self) { + self.coin_name = ::std::option::Option::None; + } + + pub fn has_coin_name(&self) -> bool { + self.coin_name.is_some() + } + + // Param is passed by value, moved + pub fn set_coin_name(&mut self, v: ::std::string::String) { + self.coin_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_coin_name(&mut self) -> &mut ::std::string::String { + if self.coin_name.is_none() { + self.coin_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.coin_name.as_mut().unwrap() + } + + // Take field + pub fn take_coin_name(&mut self) -> ::std::string::String { + self.coin_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional .hw.trezor.messages.bitcoin.InputScriptType script_type = 4; + + pub fn script_type(&self) -> InputScriptType { + match self.script_type { + Some(e) => e.enum_value_or(InputScriptType::SPENDADDRESS), + None => InputScriptType::SPENDADDRESS, + } + } + + pub fn clear_script_type(&mut self) { + self.script_type = ::std::option::Option::None; + } + + pub fn has_script_type(&self) -> bool { + self.script_type.is_some() + } + + // Param is passed by value, moved + pub fn set_script_type(&mut self, v: InputScriptType) { + self.script_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + 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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &GetOwnershipId| { &m.address_n }, + |m: &mut GetOwnershipId| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "coin_name", + |m: &GetOwnershipId| { &m.coin_name }, + |m: &mut GetOwnershipId| { &mut m.coin_name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, MultisigRedeemScriptType>( + "multisig", + |m: &GetOwnershipId| { &m.multisig }, + |m: &mut GetOwnershipId| { &mut m.multisig }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_type", + |m: &GetOwnershipId| { &m.script_type }, + |m: &mut GetOwnershipId| { &mut m.script_type }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "GetOwnershipId", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for GetOwnershipId { + const NAME: &'static str = "GetOwnershipId"; + + fn is_initialized(&self) -> bool { + for v in &self.multisig { + if !v.is_initialized() { + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.coin_name = ::std::option::Option::Some(is.read_string()?); + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.multisig)?; + }, + 32 => { + self.script_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.coin_name.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.multisig.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.script_type { + my_size += ::protobuf::rt::int32_size(4, v.value()); + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.coin_name.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.multisig.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.script_type { + os.write_enum(4, ::protobuf::EnumOrUnknown::value(&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() -> GetOwnershipId { + GetOwnershipId::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.coin_name = ::std::option::Option::None; + self.multisig.clear(); + self.script_type = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static GetOwnershipId { + static instance: GetOwnershipId = GetOwnershipId { + address_n: ::std::vec::Vec::new(), + coin_name: ::std::option::Option::None, + multisig: ::protobuf::MessageField::none(), + script_type: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for GetOwnershipId { + 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("GetOwnershipId").unwrap()).clone() + } +} + +impl ::std::fmt::Display for GetOwnershipId { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GetOwnershipId { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.OwnershipId) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct OwnershipId { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.OwnershipId.ownership_id) + pub ownership_id: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.OwnershipId.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a OwnershipId { + fn default() -> &'a OwnershipId { + ::default_instance() + } +} + +impl OwnershipId { + pub fn new() -> OwnershipId { + ::std::default::Default::default() + } + + // required bytes ownership_id = 1; + + pub fn ownership_id(&self) -> &[u8] { + match self.ownership_id.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_ownership_id(&mut self) { + self.ownership_id = ::std::option::Option::None; + } + + pub fn has_ownership_id(&self) -> bool { + self.ownership_id.is_some() + } + + // Param is passed by value, moved + pub fn set_ownership_id(&mut self, v: ::std::vec::Vec) { + self.ownership_id = ::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_ownership_id(&mut self) -> &mut ::std::vec::Vec { + if self.ownership_id.is_none() { + self.ownership_id = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.ownership_id.as_mut().unwrap() + } + + // Take field + pub fn take_ownership_id(&mut self) -> ::std::vec::Vec { + self.ownership_id.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ownership_id", + |m: &OwnershipId| { &m.ownership_id }, + |m: &mut OwnershipId| { &mut m.ownership_id }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "OwnershipId", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for OwnershipId { + const NAME: &'static str = "OwnershipId"; + + fn is_initialized(&self) -> bool { + if self.ownership_id.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.ownership_id = ::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.ownership_id.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.ownership_id.as_ref() { + os.write_bytes(1, 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() -> OwnershipId { + OwnershipId::new() + } + + fn clear(&mut self) { + self.ownership_id = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static OwnershipId { + static instance: OwnershipId = OwnershipId { + ownership_id: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for OwnershipId { + 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("OwnershipId").unwrap()).clone() + } +} + +impl ::std::fmt::Display for OwnershipId { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for OwnershipId { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.SignMessage) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SignMessage { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignMessage.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignMessage.message) + pub message: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignMessage.coin_name) + pub coin_name: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignMessage.script_type) + pub script_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignMessage.no_script_type) + pub no_script_type: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignMessage.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.SignMessage.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SignMessage { + fn default() -> &'a SignMessage { + ::default_instance() + } +} + +impl SignMessage { + pub fn new() -> SignMessage { + ::std::default::Default::default() + } + + // required bytes message = 2; + + pub fn message(&self) -> &[u8] { + match self.message.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_message(&mut self) { + self.message = ::std::option::Option::None; + } + + pub fn has_message(&self) -> bool { + self.message.is_some() + } + + // Param is passed by value, moved + pub fn set_message(&mut self, v: ::std::vec::Vec) { + self.message = ::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_message(&mut self) -> &mut ::std::vec::Vec { + if self.message.is_none() { + self.message = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.message.as_mut().unwrap() + } + + // Take field + pub fn take_message(&mut self) -> ::std::vec::Vec { + self.message.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional string coin_name = 3; + + pub fn coin_name(&self) -> &str { + match self.coin_name.as_ref() { + Some(v) => v, + None => "Bitcoin", + } + } + + pub fn clear_coin_name(&mut self) { + self.coin_name = ::std::option::Option::None; + } + + pub fn has_coin_name(&self) -> bool { + self.coin_name.is_some() + } + + // Param is passed by value, moved + pub fn set_coin_name(&mut self, v: ::std::string::String) { + self.coin_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_coin_name(&mut self) -> &mut ::std::string::String { + if self.coin_name.is_none() { + self.coin_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.coin_name.as_mut().unwrap() + } + + // Take field + pub fn take_coin_name(&mut self) -> ::std::string::String { + self.coin_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional .hw.trezor.messages.bitcoin.InputScriptType script_type = 4; + + pub fn script_type(&self) -> InputScriptType { + match self.script_type { + Some(e) => e.enum_value_or(InputScriptType::SPENDADDRESS), + None => InputScriptType::SPENDADDRESS, + } + } + + pub fn clear_script_type(&mut self) { + self.script_type = ::std::option::Option::None; + } + + pub fn has_script_type(&self) -> bool { + self.script_type.is_some() + } + + // Param is passed by value, moved + pub fn set_script_type(&mut self, v: InputScriptType) { + self.script_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bool no_script_type = 5; + + pub fn no_script_type(&self) -> bool { + self.no_script_type.unwrap_or(false) + } + + pub fn clear_no_script_type(&mut self) { + self.no_script_type = ::std::option::Option::None; + } + + pub fn has_no_script_type(&self) -> bool { + self.no_script_type.is_some() + } + + // Param is passed by value, moved + pub fn set_no_script_type(&mut self, v: bool) { + self.no_script_type = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 6; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &SignMessage| { &m.address_n }, + |m: &mut SignMessage| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "message", + |m: &SignMessage| { &m.message }, + |m: &mut SignMessage| { &mut m.message }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "coin_name", + |m: &SignMessage| { &m.coin_name }, + |m: &mut SignMessage| { &mut m.coin_name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_type", + |m: &SignMessage| { &m.script_type }, + |m: &mut SignMessage| { &mut m.script_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "no_script_type", + |m: &SignMessage| { &m.no_script_type }, + |m: &mut SignMessage| { &mut m.no_script_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &SignMessage| { &m.chunkify }, + |m: &mut SignMessage| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SignMessage", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SignMessage { + const NAME: &'static str = "SignMessage"; + + fn is_initialized(&self) -> bool { + if self.message.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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.message = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.coin_name = ::std::option::Option::Some(is.read_string()?); + }, + 32 => { + self.script_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 40 => { + self.no_script_type = ::std::option::Option::Some(is.read_bool()?); + }, + 48 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.message.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.coin_name.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.script_type { + my_size += ::protobuf::rt::int32_size(4, v.value()); + } + if let Some(v) = self.no_script_type { + my_size += 1 + 1; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.message.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.coin_name.as_ref() { + os.write_string(3, v)?; + } + if let Some(v) = self.script_type { + os.write_enum(4, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.no_script_type { + os.write_bool(5, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(6, 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() -> SignMessage { + SignMessage::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.message = ::std::option::Option::None; + self.coin_name = ::std::option::Option::None; + self.script_type = ::std::option::Option::None; + self.no_script_type = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static SignMessage { + static instance: SignMessage = SignMessage { + address_n: ::std::vec::Vec::new(), + message: ::std::option::Option::None, + coin_name: ::std::option::Option::None, + script_type: ::std::option::Option::None, + no_script_type: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SignMessage { + 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("SignMessage").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SignMessage { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SignMessage { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.MessageSignature) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MessageSignature { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.MessageSignature.address) + pub address: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.MessageSignature.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.MessageSignature.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MessageSignature { + fn default() -> &'a MessageSignature { + ::default_instance() + } +} + +impl MessageSignature { + pub fn new() -> MessageSignature { + ::std::default::Default::default() + } + + // required string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required bytes signature = 2; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.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::<_, _>( + "address", + |m: &MessageSignature| { &m.address }, + |m: &mut MessageSignature| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &MessageSignature| { &m.signature }, + |m: &mut MessageSignature| { &mut m.signature }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MessageSignature", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MessageSignature { + const NAME: &'static str = "MessageSignature"; + + fn is_initialized(&self) -> bool { + if self.address.is_none() { + return false; + } + if self.signature.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_string()?); + }, + 18 => { + self.signature = ::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.address.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.signature.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.address.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.signature.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() -> MessageSignature { + MessageSignature::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.signature = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MessageSignature { + static instance: MessageSignature = MessageSignature { + address: ::std::option::Option::None, + signature: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MessageSignature { + 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("MessageSignature").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MessageSignature { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MessageSignature { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.VerifyMessage) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct VerifyMessage { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.VerifyMessage.address) + pub address: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.VerifyMessage.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.VerifyMessage.message) + pub message: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.VerifyMessage.coin_name) + pub coin_name: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.VerifyMessage.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.VerifyMessage.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a VerifyMessage { + fn default() -> &'a VerifyMessage { + ::default_instance() + } +} + +impl VerifyMessage { + pub fn new() -> VerifyMessage { + ::std::default::Default::default() + } + + // required string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required bytes signature = 2; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes message = 3; + + pub fn message(&self) -> &[u8] { + match self.message.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_message(&mut self) { + self.message = ::std::option::Option::None; + } + + pub fn has_message(&self) -> bool { + self.message.is_some() + } + + // Param is passed by value, moved + pub fn set_message(&mut self, v: ::std::vec::Vec) { + self.message = ::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_message(&mut self) -> &mut ::std::vec::Vec { + if self.message.is_none() { + self.message = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.message.as_mut().unwrap() + } + + // Take field + pub fn take_message(&mut self) -> ::std::vec::Vec { + self.message.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional string coin_name = 4; + + pub fn coin_name(&self) -> &str { + match self.coin_name.as_ref() { + Some(v) => v, + None => "Bitcoin", + } + } + + pub fn clear_coin_name(&mut self) { + self.coin_name = ::std::option::Option::None; + } + + pub fn has_coin_name(&self) -> bool { + self.coin_name.is_some() + } + + // Param is passed by value, moved + pub fn set_coin_name(&mut self, v: ::std::string::String) { + self.coin_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_coin_name(&mut self) -> &mut ::std::string::String { + if self.coin_name.is_none() { + self.coin_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.coin_name.as_mut().unwrap() + } + + // Take field + pub fn take_coin_name(&mut self) -> ::std::string::String { + self.coin_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bool chunkify = 5; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + 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: &VerifyMessage| { &m.address }, + |m: &mut VerifyMessage| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &VerifyMessage| { &m.signature }, + |m: &mut VerifyMessage| { &mut m.signature }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "message", + |m: &VerifyMessage| { &m.message }, + |m: &mut VerifyMessage| { &mut m.message }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "coin_name", + |m: &VerifyMessage| { &m.coin_name }, + |m: &mut VerifyMessage| { &mut m.coin_name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &VerifyMessage| { &m.chunkify }, + |m: &mut VerifyMessage| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "VerifyMessage", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for VerifyMessage { + const NAME: &'static str = "VerifyMessage"; + + fn is_initialized(&self) -> bool { + if self.address.is_none() { + return false; + } + if self.signature.is_none() { + return false; + } + if self.message.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_string()?); + }, + 18 => { + self.signature = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.message = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.coin_name = ::std::option::Option::Some(is.read_string()?); + }, + 40 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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::string_size(1, &v); + } + if let Some(v) = self.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.message.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.coin_name.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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_string(1, v)?; + } + if let Some(v) = self.signature.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.message.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.coin_name.as_ref() { + os.write_string(4, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(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() -> VerifyMessage { + VerifyMessage::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.signature = ::std::option::Option::None; + self.message = ::std::option::Option::None; + self.coin_name = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static VerifyMessage { + static instance: VerifyMessage = VerifyMessage { + address: ::std::option::Option::None, + signature: ::std::option::Option::None, + message: ::std::option::Option::None, + coin_name: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for VerifyMessage { + 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("VerifyMessage").unwrap()).clone() + } +} + +impl ::std::fmt::Display for VerifyMessage { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for VerifyMessage { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.SignTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SignTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.outputs_count) + pub outputs_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.inputs_count) + pub inputs_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.coin_name) + pub coin_name: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.version) + pub version: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.lock_time) + pub lock_time: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.expiry) + pub expiry: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.overwintered) + pub overwintered: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.version_group_id) + pub version_group_id: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.timestamp) + pub timestamp: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.branch_id) + pub branch_id: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.amount_unit) + pub amount_unit: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.decred_staking_ticket) + pub decred_staking_ticket: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.serialize) + pub serialize: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.coinjoin_request) + pub coinjoin_request: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.SignTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SignTx { + fn default() -> &'a SignTx { + ::default_instance() + } +} + +impl SignTx { + pub fn new() -> SignTx { + ::std::default::Default::default() + } + + // required uint32 outputs_count = 1; + + pub fn outputs_count(&self) -> u32 { + self.outputs_count.unwrap_or(0) + } + + pub fn clear_outputs_count(&mut self) { + self.outputs_count = ::std::option::Option::None; + } + + pub fn has_outputs_count(&self) -> bool { + self.outputs_count.is_some() + } + + // Param is passed by value, moved + pub fn set_outputs_count(&mut self, v: u32) { + self.outputs_count = ::std::option::Option::Some(v); + } + + // required uint32 inputs_count = 2; + + pub fn inputs_count(&self) -> u32 { + self.inputs_count.unwrap_or(0) + } + + pub fn clear_inputs_count(&mut self) { + self.inputs_count = ::std::option::Option::None; + } + + pub fn has_inputs_count(&self) -> bool { + self.inputs_count.is_some() + } + + // Param is passed by value, moved + pub fn set_inputs_count(&mut self, v: u32) { + self.inputs_count = ::std::option::Option::Some(v); + } + + // optional string coin_name = 3; + + pub fn coin_name(&self) -> &str { + match self.coin_name.as_ref() { + Some(v) => v, + None => "Bitcoin", + } + } + + pub fn clear_coin_name(&mut self) { + self.coin_name = ::std::option::Option::None; + } + + pub fn has_coin_name(&self) -> bool { + self.coin_name.is_some() + } + + // Param is passed by value, moved + pub fn set_coin_name(&mut self, v: ::std::string::String) { + self.coin_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_coin_name(&mut self) -> &mut ::std::string::String { + if self.coin_name.is_none() { + self.coin_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.coin_name.as_mut().unwrap() + } + + // Take field + pub fn take_coin_name(&mut self) -> ::std::string::String { + self.coin_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint32 version = 4; + + pub fn version(&self) -> u32 { + self.version.unwrap_or(1u32) + } + + pub fn clear_version(&mut self) { + self.version = ::std::option::Option::None; + } + + pub fn has_version(&self) -> bool { + self.version.is_some() + } + + // Param is passed by value, moved + pub fn set_version(&mut self, v: u32) { + self.version = ::std::option::Option::Some(v); + } + + // optional uint32 lock_time = 5; + + pub fn lock_time(&self) -> u32 { + self.lock_time.unwrap_or(0u32) + } + + pub fn clear_lock_time(&mut self) { + self.lock_time = ::std::option::Option::None; + } + + pub fn has_lock_time(&self) -> bool { + self.lock_time.is_some() + } + + // Param is passed by value, moved + pub fn set_lock_time(&mut self, v: u32) { + self.lock_time = ::std::option::Option::Some(v); + } + + // optional uint32 expiry = 6; + + pub fn expiry(&self) -> u32 { + self.expiry.unwrap_or(0) + } + + pub fn clear_expiry(&mut self) { + self.expiry = ::std::option::Option::None; + } + + pub fn has_expiry(&self) -> bool { + self.expiry.is_some() + } + + // Param is passed by value, moved + pub fn set_expiry(&mut self, v: u32) { + self.expiry = ::std::option::Option::Some(v); + } + + // optional bool overwintered = 7; + + pub fn overwintered(&self) -> bool { + self.overwintered.unwrap_or(false) + } + + pub fn clear_overwintered(&mut self) { + self.overwintered = ::std::option::Option::None; + } + + pub fn has_overwintered(&self) -> bool { + self.overwintered.is_some() + } + + // Param is passed by value, moved + pub fn set_overwintered(&mut self, v: bool) { + self.overwintered = ::std::option::Option::Some(v); + } + + // optional uint32 version_group_id = 8; + + pub fn version_group_id(&self) -> u32 { + self.version_group_id.unwrap_or(0) + } + + pub fn clear_version_group_id(&mut self) { + self.version_group_id = ::std::option::Option::None; + } + + pub fn has_version_group_id(&self) -> bool { + self.version_group_id.is_some() + } + + // Param is passed by value, moved + pub fn set_version_group_id(&mut self, v: u32) { + self.version_group_id = ::std::option::Option::Some(v); + } + + // optional uint32 timestamp = 9; + + pub fn timestamp(&self) -> u32 { + self.timestamp.unwrap_or(0) + } + + pub fn clear_timestamp(&mut self) { + self.timestamp = ::std::option::Option::None; + } + + pub fn has_timestamp(&self) -> bool { + self.timestamp.is_some() + } + + // Param is passed by value, moved + pub fn set_timestamp(&mut self, v: u32) { + self.timestamp = ::std::option::Option::Some(v); + } + + // optional uint32 branch_id = 10; + + pub fn branch_id(&self) -> u32 { + self.branch_id.unwrap_or(0) + } + + pub fn clear_branch_id(&mut self) { + self.branch_id = ::std::option::Option::None; + } + + pub fn has_branch_id(&self) -> bool { + self.branch_id.is_some() + } + + // Param is passed by value, moved + pub fn set_branch_id(&mut self, v: u32) { + self.branch_id = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.bitcoin.AmountUnit amount_unit = 11; + + pub fn amount_unit(&self) -> AmountUnit { + match self.amount_unit { + Some(e) => e.enum_value_or(AmountUnit::BITCOIN), + None => AmountUnit::BITCOIN, + } + } + + pub fn clear_amount_unit(&mut self) { + self.amount_unit = ::std::option::Option::None; + } + + pub fn has_amount_unit(&self) -> bool { + self.amount_unit.is_some() + } + + // Param is passed by value, moved + pub fn set_amount_unit(&mut self, v: AmountUnit) { + self.amount_unit = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bool decred_staking_ticket = 12; + + pub fn decred_staking_ticket(&self) -> bool { + self.decred_staking_ticket.unwrap_or(false) + } + + pub fn clear_decred_staking_ticket(&mut self) { + self.decred_staking_ticket = ::std::option::Option::None; + } + + pub fn has_decred_staking_ticket(&self) -> bool { + self.decred_staking_ticket.is_some() + } + + // Param is passed by value, moved + pub fn set_decred_staking_ticket(&mut self, v: bool) { + self.decred_staking_ticket = ::std::option::Option::Some(v); + } + + // optional bool serialize = 13; + + pub fn serialize(&self) -> bool { + self.serialize.unwrap_or(true) + } + + pub fn clear_serialize(&mut self) { + self.serialize = ::std::option::Option::None; + } + + pub fn has_serialize(&self) -> bool { + self.serialize.is_some() + } + + // Param is passed by value, moved + pub fn set_serialize(&mut self, v: bool) { + self.serialize = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 15; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(15); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "outputs_count", + |m: &SignTx| { &m.outputs_count }, + |m: &mut SignTx| { &mut m.outputs_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "inputs_count", + |m: &SignTx| { &m.inputs_count }, + |m: &mut SignTx| { &mut m.inputs_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "coin_name", + |m: &SignTx| { &m.coin_name }, + |m: &mut SignTx| { &mut m.coin_name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "version", + |m: &SignTx| { &m.version }, + |m: &mut SignTx| { &mut m.version }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "lock_time", + |m: &SignTx| { &m.lock_time }, + |m: &mut SignTx| { &mut m.lock_time }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "expiry", + |m: &SignTx| { &m.expiry }, + |m: &mut SignTx| { &mut m.expiry }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "overwintered", + |m: &SignTx| { &m.overwintered }, + |m: &mut SignTx| { &mut m.overwintered }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "version_group_id", + |m: &SignTx| { &m.version_group_id }, + |m: &mut SignTx| { &mut m.version_group_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "timestamp", + |m: &SignTx| { &m.timestamp }, + |m: &mut SignTx| { &mut m.timestamp }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "branch_id", + |m: &SignTx| { &m.branch_id }, + |m: &mut SignTx| { &mut m.branch_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount_unit", + |m: &SignTx| { &m.amount_unit }, + |m: &mut SignTx| { &mut m.amount_unit }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "decred_staking_ticket", + |m: &SignTx| { &m.decred_staking_ticket }, + |m: &mut SignTx| { &mut m.decred_staking_ticket }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "serialize", + |m: &SignTx| { &m.serialize }, + |m: &mut SignTx| { &mut m.serialize }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, sign_tx::CoinJoinRequest>( + "coinjoin_request", + |m: &SignTx| { &m.coinjoin_request }, + |m: &mut SignTx| { &mut m.coinjoin_request }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &SignTx| { &m.chunkify }, + |m: &mut SignTx| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SignTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SignTx { + const NAME: &'static str = "SignTx"; + + fn is_initialized(&self) -> bool { + if self.outputs_count.is_none() { + return false; + } + if self.inputs_count.is_none() { + return false; + } + for v in &self.coinjoin_request { + if !v.is_initialized() { + 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.outputs_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 16 => { + self.inputs_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 26 => { + self.coin_name = ::std::option::Option::Some(is.read_string()?); + }, + 32 => { + self.version = ::std::option::Option::Some(is.read_uint32()?); + }, + 40 => { + self.lock_time = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.expiry = ::std::option::Option::Some(is.read_uint32()?); + }, + 56 => { + self.overwintered = ::std::option::Option::Some(is.read_bool()?); + }, + 64 => { + self.version_group_id = ::std::option::Option::Some(is.read_uint32()?); + }, + 72 => { + self.timestamp = ::std::option::Option::Some(is.read_uint32()?); + }, + 80 => { + self.branch_id = ::std::option::Option::Some(is.read_uint32()?); + }, + 88 => { + self.amount_unit = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 96 => { + self.decred_staking_ticket = ::std::option::Option::Some(is.read_bool()?); + }, + 104 => { + self.serialize = ::std::option::Option::Some(is.read_bool()?); + }, + 114 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.coinjoin_request)?; + }, + 120 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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.outputs_count { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.inputs_count { + my_size += ::protobuf::rt::uint32_size(2, v); + } + if let Some(v) = self.coin_name.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.version { + my_size += ::protobuf::rt::uint32_size(4, v); + } + if let Some(v) = self.lock_time { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.expiry { + my_size += ::protobuf::rt::uint32_size(6, v); + } + if let Some(v) = self.overwintered { + my_size += 1 + 1; + } + if let Some(v) = self.version_group_id { + my_size += ::protobuf::rt::uint32_size(8, v); + } + if let Some(v) = self.timestamp { + my_size += ::protobuf::rt::uint32_size(9, v); + } + if let Some(v) = self.branch_id { + my_size += ::protobuf::rt::uint32_size(10, v); + } + if let Some(v) = self.amount_unit { + my_size += ::protobuf::rt::int32_size(11, v.value()); + } + if let Some(v) = self.decred_staking_ticket { + my_size += 1 + 1; + } + if let Some(v) = self.serialize { + my_size += 1 + 1; + } + if let Some(v) = self.coinjoin_request.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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.outputs_count { + os.write_uint32(1, v)?; + } + if let Some(v) = self.inputs_count { + os.write_uint32(2, v)?; + } + if let Some(v) = self.coin_name.as_ref() { + os.write_string(3, v)?; + } + if let Some(v) = self.version { + os.write_uint32(4, v)?; + } + if let Some(v) = self.lock_time { + os.write_uint32(5, v)?; + } + if let Some(v) = self.expiry { + os.write_uint32(6, v)?; + } + if let Some(v) = self.overwintered { + os.write_bool(7, v)?; + } + if let Some(v) = self.version_group_id { + os.write_uint32(8, v)?; + } + if let Some(v) = self.timestamp { + os.write_uint32(9, v)?; + } + if let Some(v) = self.branch_id { + os.write_uint32(10, v)?; + } + if let Some(v) = self.amount_unit { + os.write_enum(11, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.decred_staking_ticket { + os.write_bool(12, v)?; + } + if let Some(v) = self.serialize { + os.write_bool(13, v)?; + } + if let Some(v) = self.coinjoin_request.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(14, v, os)?; + } + if let Some(v) = self.chunkify { + os.write_bool(15, 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() -> SignTx { + SignTx::new() + } + + fn clear(&mut self) { + self.outputs_count = ::std::option::Option::None; + self.inputs_count = ::std::option::Option::None; + self.coin_name = ::std::option::Option::None; + self.version = ::std::option::Option::None; + self.lock_time = ::std::option::Option::None; + self.expiry = ::std::option::Option::None; + self.overwintered = ::std::option::Option::None; + self.version_group_id = ::std::option::Option::None; + self.timestamp = ::std::option::Option::None; + self.branch_id = ::std::option::Option::None; + self.amount_unit = ::std::option::Option::None; + self.decred_staking_ticket = ::std::option::Option::None; + self.serialize = ::std::option::Option::None; + self.coinjoin_request.clear(); + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static SignTx { + static instance: SignTx = SignTx { + outputs_count: ::std::option::Option::None, + inputs_count: ::std::option::Option::None, + coin_name: ::std::option::Option::None, + version: ::std::option::Option::None, + lock_time: ::std::option::Option::None, + expiry: ::std::option::Option::None, + overwintered: ::std::option::Option::None, + version_group_id: ::std::option::Option::None, + timestamp: ::std::option::Option::None, + branch_id: ::std::option::Option::None, + amount_unit: ::std::option::Option::None, + decred_staking_ticket: ::std::option::Option::None, + serialize: ::std::option::Option::None, + coinjoin_request: ::protobuf::MessageField::none(), + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SignTx { + 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("SignTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SignTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SignTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `SignTx` +pub mod sign_tx { + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.SignTx.CoinJoinRequest) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct CoinJoinRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.CoinJoinRequest.fee_rate) + pub fee_rate: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.CoinJoinRequest.no_fee_threshold) + pub no_fee_threshold: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.CoinJoinRequest.min_registrable_amount) + pub min_registrable_amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.CoinJoinRequest.mask_public_key) + pub mask_public_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.SignTx.CoinJoinRequest.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.SignTx.CoinJoinRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a CoinJoinRequest { + fn default() -> &'a CoinJoinRequest { + ::default_instance() + } + } + + impl CoinJoinRequest { + pub fn new() -> CoinJoinRequest { + ::std::default::Default::default() + } + + // required uint32 fee_rate = 1; + + pub fn fee_rate(&self) -> u32 { + self.fee_rate.unwrap_or(0) + } + + pub fn clear_fee_rate(&mut self) { + self.fee_rate = ::std::option::Option::None; + } + + pub fn has_fee_rate(&self) -> bool { + self.fee_rate.is_some() + } + + // Param is passed by value, moved + pub fn set_fee_rate(&mut self, v: u32) { + self.fee_rate = ::std::option::Option::Some(v); + } + + // required uint64 no_fee_threshold = 2; + + pub fn no_fee_threshold(&self) -> u64 { + self.no_fee_threshold.unwrap_or(0) + } + + pub fn clear_no_fee_threshold(&mut self) { + self.no_fee_threshold = ::std::option::Option::None; + } + + pub fn has_no_fee_threshold(&self) -> bool { + self.no_fee_threshold.is_some() + } + + // Param is passed by value, moved + pub fn set_no_fee_threshold(&mut self, v: u64) { + self.no_fee_threshold = ::std::option::Option::Some(v); + } + + // required uint64 min_registrable_amount = 3; + + pub fn min_registrable_amount(&self) -> u64 { + self.min_registrable_amount.unwrap_or(0) + } + + pub fn clear_min_registrable_amount(&mut self) { + self.min_registrable_amount = ::std::option::Option::None; + } + + pub fn has_min_registrable_amount(&self) -> bool { + self.min_registrable_amount.is_some() + } + + // Param is passed by value, moved + pub fn set_min_registrable_amount(&mut self, v: u64) { + self.min_registrable_amount = ::std::option::Option::Some(v); + } + + // required bytes mask_public_key = 4; + + pub fn mask_public_key(&self) -> &[u8] { + match self.mask_public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_mask_public_key(&mut self) { + self.mask_public_key = ::std::option::Option::None; + } + + pub fn has_mask_public_key(&self) -> bool { + self.mask_public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_mask_public_key(&mut self, v: ::std::vec::Vec) { + self.mask_public_key = ::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_mask_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.mask_public_key.is_none() { + self.mask_public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.mask_public_key.as_mut().unwrap() + } + + // Take field + pub fn take_mask_public_key(&mut self) -> ::std::vec::Vec { + self.mask_public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes signature = 5; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) 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::<_, _>( + "fee_rate", + |m: &CoinJoinRequest| { &m.fee_rate }, + |m: &mut CoinJoinRequest| { &mut m.fee_rate }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "no_fee_threshold", + |m: &CoinJoinRequest| { &m.no_fee_threshold }, + |m: &mut CoinJoinRequest| { &mut m.no_fee_threshold }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "min_registrable_amount", + |m: &CoinJoinRequest| { &m.min_registrable_amount }, + |m: &mut CoinJoinRequest| { &mut m.min_registrable_amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "mask_public_key", + |m: &CoinJoinRequest| { &m.mask_public_key }, + |m: &mut CoinJoinRequest| { &mut m.mask_public_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &CoinJoinRequest| { &m.signature }, + |m: &mut CoinJoinRequest| { &mut m.signature }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SignTx.CoinJoinRequest", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for CoinJoinRequest { + const NAME: &'static str = "CoinJoinRequest"; + + fn is_initialized(&self) -> bool { + if self.fee_rate.is_none() { + return false; + } + if self.no_fee_threshold.is_none() { + return false; + } + if self.min_registrable_amount.is_none() { + return false; + } + if self.mask_public_key.is_none() { + return false; + } + if self.signature.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.fee_rate = ::std::option::Option::Some(is.read_uint32()?); + }, + 16 => { + self.no_fee_threshold = ::std::option::Option::Some(is.read_uint64()?); + }, + 24 => { + self.min_registrable_amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 34 => { + self.mask_public_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 42 => { + self.signature = ::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.fee_rate { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.no_fee_threshold { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.min_registrable_amount { + my_size += ::protobuf::rt::uint64_size(3, v); + } + if let Some(v) = self.mask_public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.signature.as_ref() { + my_size += ::protobuf::rt::bytes_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.fee_rate { + os.write_uint32(1, v)?; + } + if let Some(v) = self.no_fee_threshold { + os.write_uint64(2, v)?; + } + if let Some(v) = self.min_registrable_amount { + os.write_uint64(3, v)?; + } + if let Some(v) = self.mask_public_key.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.signature.as_ref() { + os.write_bytes(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() -> CoinJoinRequest { + CoinJoinRequest::new() + } + + fn clear(&mut self) { + self.fee_rate = ::std::option::Option::None; + self.no_fee_threshold = ::std::option::Option::None; + self.min_registrable_amount = ::std::option::Option::None; + self.mask_public_key = ::std::option::Option::None; + self.signature = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CoinJoinRequest { + static instance: CoinJoinRequest = CoinJoinRequest { + fee_rate: ::std::option::Option::None, + no_fee_threshold: ::std::option::Option::None, + min_registrable_amount: ::std::option::Option::None, + mask_public_key: ::std::option::Option::None, + signature: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for CoinJoinRequest { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("SignTx.CoinJoinRequest").unwrap()).clone() + } + } + + impl ::std::fmt::Display for CoinJoinRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for CoinJoinRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TxRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxRequest.request_type) + pub request_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxRequest.details) + pub details: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxRequest.serialized) + pub serialized: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TxRequest { + fn default() -> &'a TxRequest { + ::default_instance() + } +} + +impl TxRequest { + pub fn new() -> TxRequest { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.bitcoin.TxRequest.RequestType request_type = 1; + + pub fn request_type(&self) -> tx_request::RequestType { + match self.request_type { + Some(e) => e.enum_value_or(tx_request::RequestType::TXINPUT), + None => tx_request::RequestType::TXINPUT, + } + } + + pub fn clear_request_type(&mut self) { + self.request_type = ::std::option::Option::None; + } + + pub fn has_request_type(&self) -> bool { + self.request_type.is_some() + } + + // Param is passed by value, moved + pub fn set_request_type(&mut self, v: tx_request::RequestType) { + self.request_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "request_type", + |m: &TxRequest| { &m.request_type }, + |m: &mut TxRequest| { &mut m.request_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, tx_request::TxRequestDetailsType>( + "details", + |m: &TxRequest| { &m.details }, + |m: &mut TxRequest| { &mut m.details }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, tx_request::TxRequestSerializedType>( + "serialized", + |m: &TxRequest| { &m.serialized }, + |m: &mut TxRequest| { &mut m.serialized }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TxRequest { + const NAME: &'static str = "TxRequest"; + + 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 { + 8 => { + self.request_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.details)?; + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.serialized)?; + }, + 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.request_type { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + if let Some(v) = self.details.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.serialized.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.request_type { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.details.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + if let Some(v) = self.serialized.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + 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() -> TxRequest { + TxRequest::new() + } + + fn clear(&mut self) { + self.request_type = ::std::option::Option::None; + self.details.clear(); + self.serialized.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxRequest { + static instance: TxRequest = TxRequest { + request_type: ::std::option::Option::None, + details: ::protobuf::MessageField::none(), + serialized: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TxRequest { + 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("TxRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TxRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `TxRequest` +pub mod tx_request { + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxRequest.TxRequestDetailsType) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TxRequestDetailsType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxRequest.TxRequestDetailsType.request_index) + pub request_index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxRequest.TxRequestDetailsType.tx_hash) + pub tx_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxRequest.TxRequestDetailsType.extra_data_len) + pub extra_data_len: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxRequest.TxRequestDetailsType.extra_data_offset) + pub extra_data_offset: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxRequest.TxRequestDetailsType.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TxRequestDetailsType { + fn default() -> &'a TxRequestDetailsType { + ::default_instance() + } + } + + impl TxRequestDetailsType { + pub fn new() -> TxRequestDetailsType { + ::std::default::Default::default() + } + + // optional uint32 request_index = 1; + + pub fn request_index(&self) -> u32 { + self.request_index.unwrap_or(0) + } + + pub fn clear_request_index(&mut self) { + self.request_index = ::std::option::Option::None; + } + + pub fn has_request_index(&self) -> bool { + self.request_index.is_some() + } + + // Param is passed by value, moved + pub fn set_request_index(&mut self, v: u32) { + self.request_index = ::std::option::Option::Some(v); + } + + // optional bytes tx_hash = 2; + + pub fn tx_hash(&self) -> &[u8] { + match self.tx_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_tx_hash(&mut self) { + self.tx_hash = ::std::option::Option::None; + } + + pub fn has_tx_hash(&self) -> bool { + self.tx_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_tx_hash(&mut self, v: ::std::vec::Vec) { + self.tx_hash = ::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_tx_hash(&mut self) -> &mut ::std::vec::Vec { + if self.tx_hash.is_none() { + self.tx_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.tx_hash.as_mut().unwrap() + } + + // Take field + pub fn take_tx_hash(&mut self) -> ::std::vec::Vec { + self.tx_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 extra_data_len = 3; + + pub fn extra_data_len(&self) -> u32 { + self.extra_data_len.unwrap_or(0) + } + + pub fn clear_extra_data_len(&mut self) { + self.extra_data_len = ::std::option::Option::None; + } + + pub fn has_extra_data_len(&self) -> bool { + self.extra_data_len.is_some() + } + + // Param is passed by value, moved + pub fn set_extra_data_len(&mut self, v: u32) { + self.extra_data_len = ::std::option::Option::Some(v); + } + + // optional uint32 extra_data_offset = 4; + + pub fn extra_data_offset(&self) -> u32 { + self.extra_data_offset.unwrap_or(0) + } + + pub fn clear_extra_data_offset(&mut self) { + self.extra_data_offset = ::std::option::Option::None; + } + + pub fn has_extra_data_offset(&self) -> bool { + self.extra_data_offset.is_some() + } + + // Param is passed by value, moved + pub fn set_extra_data_offset(&mut self, v: u32) { + self.extra_data_offset = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "request_index", + |m: &TxRequestDetailsType| { &m.request_index }, + |m: &mut TxRequestDetailsType| { &mut m.request_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "tx_hash", + |m: &TxRequestDetailsType| { &m.tx_hash }, + |m: &mut TxRequestDetailsType| { &mut m.tx_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "extra_data_len", + |m: &TxRequestDetailsType| { &m.extra_data_len }, + |m: &mut TxRequestDetailsType| { &mut m.extra_data_len }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "extra_data_offset", + |m: &TxRequestDetailsType| { &m.extra_data_offset }, + |m: &mut TxRequestDetailsType| { &mut m.extra_data_offset }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxRequest.TxRequestDetailsType", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TxRequestDetailsType { + const NAME: &'static str = "TxRequestDetailsType"; + + 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 { + 8 => { + self.request_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 18 => { + self.tx_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.extra_data_len = ::std::option::Option::Some(is.read_uint32()?); + }, + 32 => { + self.extra_data_offset = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.request_index { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.tx_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.extra_data_len { + my_size += ::protobuf::rt::uint32_size(3, v); + } + if let Some(v) = self.extra_data_offset { + my_size += ::protobuf::rt::uint32_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.request_index { + os.write_uint32(1, v)?; + } + if let Some(v) = self.tx_hash.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.extra_data_len { + os.write_uint32(3, v)?; + } + if let Some(v) = self.extra_data_offset { + os.write_uint32(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() -> TxRequestDetailsType { + TxRequestDetailsType::new() + } + + fn clear(&mut self) { + self.request_index = ::std::option::Option::None; + self.tx_hash = ::std::option::Option::None; + self.extra_data_len = ::std::option::Option::None; + self.extra_data_offset = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxRequestDetailsType { + static instance: TxRequestDetailsType = TxRequestDetailsType { + request_index: ::std::option::Option::None, + tx_hash: ::std::option::Option::None, + extra_data_len: ::std::option::Option::None, + extra_data_offset: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TxRequestDetailsType { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TxRequest.TxRequestDetailsType").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TxRequestDetailsType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TxRequestDetailsType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxRequest.TxRequestSerializedType) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TxRequestSerializedType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxRequest.TxRequestSerializedType.signature_index) + pub signature_index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxRequest.TxRequestSerializedType.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxRequest.TxRequestSerializedType.serialized_tx) + pub serialized_tx: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxRequest.TxRequestSerializedType.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TxRequestSerializedType { + fn default() -> &'a TxRequestSerializedType { + ::default_instance() + } + } + + impl TxRequestSerializedType { + pub fn new() -> TxRequestSerializedType { + ::std::default::Default::default() + } + + // optional uint32 signature_index = 1; + + pub fn signature_index(&self) -> u32 { + self.signature_index.unwrap_or(0) + } + + pub fn clear_signature_index(&mut self) { + self.signature_index = ::std::option::Option::None; + } + + pub fn has_signature_index(&self) -> bool { + self.signature_index.is_some() + } + + // Param is passed by value, moved + pub fn set_signature_index(&mut self, v: u32) { + self.signature_index = ::std::option::Option::Some(v); + } + + // optional bytes signature = 2; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes serialized_tx = 3; + + pub fn serialized_tx(&self) -> &[u8] { + match self.serialized_tx.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_serialized_tx(&mut self) { + self.serialized_tx = ::std::option::Option::None; + } + + pub fn has_serialized_tx(&self) -> bool { + self.serialized_tx.is_some() + } + + // Param is passed by value, moved + pub fn set_serialized_tx(&mut self, v: ::std::vec::Vec) { + self.serialized_tx = ::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_serialized_tx(&mut self) -> &mut ::std::vec::Vec { + if self.serialized_tx.is_none() { + self.serialized_tx = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.serialized_tx.as_mut().unwrap() + } + + // Take field + pub fn take_serialized_tx(&mut self) -> ::std::vec::Vec { + self.serialized_tx.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature_index", + |m: &TxRequestSerializedType| { &m.signature_index }, + |m: &mut TxRequestSerializedType| { &mut m.signature_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &TxRequestSerializedType| { &m.signature }, + |m: &mut TxRequestSerializedType| { &mut m.signature }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "serialized_tx", + |m: &TxRequestSerializedType| { &m.serialized_tx }, + |m: &mut TxRequestSerializedType| { &mut m.serialized_tx }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxRequest.TxRequestSerializedType", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TxRequestSerializedType { + const NAME: &'static str = "TxRequestSerializedType"; + + 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 { + 8 => { + self.signature_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 18 => { + self.signature = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.serialized_tx = ::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.signature_index { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.serialized_tx.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &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.signature_index { + os.write_uint32(1, v)?; + } + if let Some(v) = self.signature.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.serialized_tx.as_ref() { + os.write_bytes(3, 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() -> TxRequestSerializedType { + TxRequestSerializedType::new() + } + + fn clear(&mut self) { + self.signature_index = ::std::option::Option::None; + self.signature = ::std::option::Option::None; + self.serialized_tx = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxRequestSerializedType { + static instance: TxRequestSerializedType = TxRequestSerializedType { + signature_index: ::std::option::Option::None, + signature: ::std::option::Option::None, + serialized_tx: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TxRequestSerializedType { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TxRequest.TxRequestSerializedType").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TxRequestSerializedType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TxRequestSerializedType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.bitcoin.TxRequest.RequestType) + pub enum RequestType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.TxRequest.RequestType.TXINPUT) + TXINPUT = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.TxRequest.RequestType.TXOUTPUT) + TXOUTPUT = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.TxRequest.RequestType.TXMETA) + TXMETA = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.TxRequest.RequestType.TXFINISHED) + TXFINISHED = 3, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.TxRequest.RequestType.TXEXTRADATA) + TXEXTRADATA = 4, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.TxRequest.RequestType.TXORIGINPUT) + TXORIGINPUT = 5, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.TxRequest.RequestType.TXORIGOUTPUT) + TXORIGOUTPUT = 6, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.TxRequest.RequestType.TXPAYMENTREQ) + TXPAYMENTREQ = 7, + } + + impl ::protobuf::Enum for RequestType { + const NAME: &'static str = "RequestType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(RequestType::TXINPUT), + 1 => ::std::option::Option::Some(RequestType::TXOUTPUT), + 2 => ::std::option::Option::Some(RequestType::TXMETA), + 3 => ::std::option::Option::Some(RequestType::TXFINISHED), + 4 => ::std::option::Option::Some(RequestType::TXEXTRADATA), + 5 => ::std::option::Option::Some(RequestType::TXORIGINPUT), + 6 => ::std::option::Option::Some(RequestType::TXORIGOUTPUT), + 7 => ::std::option::Option::Some(RequestType::TXPAYMENTREQ), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "TXINPUT" => ::std::option::Option::Some(RequestType::TXINPUT), + "TXOUTPUT" => ::std::option::Option::Some(RequestType::TXOUTPUT), + "TXMETA" => ::std::option::Option::Some(RequestType::TXMETA), + "TXFINISHED" => ::std::option::Option::Some(RequestType::TXFINISHED), + "TXEXTRADATA" => ::std::option::Option::Some(RequestType::TXEXTRADATA), + "TXORIGINPUT" => ::std::option::Option::Some(RequestType::TXORIGINPUT), + "TXORIGOUTPUT" => ::std::option::Option::Some(RequestType::TXORIGOUTPUT), + "TXPAYMENTREQ" => ::std::option::Option::Some(RequestType::TXPAYMENTREQ), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [RequestType] = &[ + RequestType::TXINPUT, + RequestType::TXOUTPUT, + RequestType::TXMETA, + RequestType::TXFINISHED, + RequestType::TXEXTRADATA, + RequestType::TXORIGINPUT, + RequestType::TXORIGOUTPUT, + RequestType::TXPAYMENTREQ, + ]; + } + + impl ::protobuf::EnumFull for RequestType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("TxRequest.RequestType").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 RequestType { + fn default() -> Self { + RequestType::TXINPUT + } + } + + impl RequestType { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("TxRequest.RequestType") + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TxAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.tx) + pub tx: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TxAck { + fn default() -> &'a TxAck { + ::default_instance() + } +} + +impl TxAck { + pub fn new() -> TxAck { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, tx_ack::TransactionType>( + "tx", + |m: &TxAck| { &m.tx }, + |m: &mut TxAck| { &mut m.tx }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TxAck { + const NAME: &'static str = "TxAck"; + + fn is_initialized(&self) -> bool { + for v in &self.tx { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.tx)?; + }, + 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.tx.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.tx.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + 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() -> TxAck { + TxAck::new() + } + + fn clear(&mut self) { + self.tx.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxAck { + static instance: TxAck = TxAck { + tx: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TxAck { + 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("TxAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TxAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `TxAck` +pub mod tx_ack { + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAck.TransactionType) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TransactionType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.version) + pub version: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.inputs) + pub inputs: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.bin_outputs) + pub bin_outputs: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.lock_time) + pub lock_time: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.outputs) + pub outputs: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.inputs_cnt) + pub inputs_cnt: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.outputs_cnt) + pub outputs_cnt: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.extra_data) + pub extra_data: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.extra_data_len) + pub extra_data_len: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.expiry) + pub expiry: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.overwintered) + pub overwintered: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.version_group_id) + pub version_group_id: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.timestamp) + pub timestamp: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.branch_id) + pub branch_id: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAck.TransactionType.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TransactionType { + fn default() -> &'a TransactionType { + ::default_instance() + } + } + + impl TransactionType { + pub fn new() -> TransactionType { + ::std::default::Default::default() + } + + // optional uint32 version = 1; + + pub fn version(&self) -> u32 { + self.version.unwrap_or(0) + } + + pub fn clear_version(&mut self) { + self.version = ::std::option::Option::None; + } + + pub fn has_version(&self) -> bool { + self.version.is_some() + } + + // Param is passed by value, moved + pub fn set_version(&mut self, v: u32) { + self.version = ::std::option::Option::Some(v); + } + + // optional uint32 lock_time = 4; + + pub fn lock_time(&self) -> u32 { + self.lock_time.unwrap_or(0) + } + + pub fn clear_lock_time(&mut self) { + self.lock_time = ::std::option::Option::None; + } + + pub fn has_lock_time(&self) -> bool { + self.lock_time.is_some() + } + + // Param is passed by value, moved + pub fn set_lock_time(&mut self, v: u32) { + self.lock_time = ::std::option::Option::Some(v); + } + + // optional uint32 inputs_cnt = 6; + + pub fn inputs_cnt(&self) -> u32 { + self.inputs_cnt.unwrap_or(0) + } + + pub fn clear_inputs_cnt(&mut self) { + self.inputs_cnt = ::std::option::Option::None; + } + + pub fn has_inputs_cnt(&self) -> bool { + self.inputs_cnt.is_some() + } + + // Param is passed by value, moved + pub fn set_inputs_cnt(&mut self, v: u32) { + self.inputs_cnt = ::std::option::Option::Some(v); + } + + // optional uint32 outputs_cnt = 7; + + pub fn outputs_cnt(&self) -> u32 { + self.outputs_cnt.unwrap_or(0) + } + + pub fn clear_outputs_cnt(&mut self) { + self.outputs_cnt = ::std::option::Option::None; + } + + pub fn has_outputs_cnt(&self) -> bool { + self.outputs_cnt.is_some() + } + + // Param is passed by value, moved + pub fn set_outputs_cnt(&mut self, v: u32) { + self.outputs_cnt = ::std::option::Option::Some(v); + } + + // optional bytes extra_data = 8; + + pub fn extra_data(&self) -> &[u8] { + match self.extra_data.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_extra_data(&mut self) { + self.extra_data = ::std::option::Option::None; + } + + pub fn has_extra_data(&self) -> bool { + self.extra_data.is_some() + } + + // Param is passed by value, moved + pub fn set_extra_data(&mut self, v: ::std::vec::Vec) { + self.extra_data = ::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_extra_data(&mut self) -> &mut ::std::vec::Vec { + if self.extra_data.is_none() { + self.extra_data = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.extra_data.as_mut().unwrap() + } + + // Take field + pub fn take_extra_data(&mut self) -> ::std::vec::Vec { + self.extra_data.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 extra_data_len = 9; + + pub fn extra_data_len(&self) -> u32 { + self.extra_data_len.unwrap_or(0) + } + + pub fn clear_extra_data_len(&mut self) { + self.extra_data_len = ::std::option::Option::None; + } + + pub fn has_extra_data_len(&self) -> bool { + self.extra_data_len.is_some() + } + + // Param is passed by value, moved + pub fn set_extra_data_len(&mut self, v: u32) { + self.extra_data_len = ::std::option::Option::Some(v); + } + + // optional uint32 expiry = 10; + + pub fn expiry(&self) -> u32 { + self.expiry.unwrap_or(0) + } + + pub fn clear_expiry(&mut self) { + self.expiry = ::std::option::Option::None; + } + + pub fn has_expiry(&self) -> bool { + self.expiry.is_some() + } + + // Param is passed by value, moved + pub fn set_expiry(&mut self, v: u32) { + self.expiry = ::std::option::Option::Some(v); + } + + // optional bool overwintered = 11; + + pub fn overwintered(&self) -> bool { + self.overwintered.unwrap_or(false) + } + + pub fn clear_overwintered(&mut self) { + self.overwintered = ::std::option::Option::None; + } + + pub fn has_overwintered(&self) -> bool { + self.overwintered.is_some() + } + + // Param is passed by value, moved + pub fn set_overwintered(&mut self, v: bool) { + self.overwintered = ::std::option::Option::Some(v); + } + + // optional uint32 version_group_id = 12; + + pub fn version_group_id(&self) -> u32 { + self.version_group_id.unwrap_or(0) + } + + pub fn clear_version_group_id(&mut self) { + self.version_group_id = ::std::option::Option::None; + } + + pub fn has_version_group_id(&self) -> bool { + self.version_group_id.is_some() + } + + // Param is passed by value, moved + pub fn set_version_group_id(&mut self, v: u32) { + self.version_group_id = ::std::option::Option::Some(v); + } + + // optional uint32 timestamp = 13; + + pub fn timestamp(&self) -> u32 { + self.timestamp.unwrap_or(0) + } + + pub fn clear_timestamp(&mut self) { + self.timestamp = ::std::option::Option::None; + } + + pub fn has_timestamp(&self) -> bool { + self.timestamp.is_some() + } + + // Param is passed by value, moved + pub fn set_timestamp(&mut self, v: u32) { + self.timestamp = ::std::option::Option::Some(v); + } + + // optional uint32 branch_id = 14; + + pub fn branch_id(&self) -> u32 { + self.branch_id.unwrap_or(0) + } + + pub fn clear_branch_id(&mut self) { + self.branch_id = ::std::option::Option::None; + } + + pub fn has_branch_id(&self) -> bool { + self.branch_id.is_some() + } + + // Param is passed by value, moved + pub fn set_branch_id(&mut self, v: u32) { + self.branch_id = ::std::option::Option::Some(v); + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(14); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "version", + |m: &TransactionType| { &m.version }, + |m: &mut TransactionType| { &mut m.version }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "inputs", + |m: &TransactionType| { &m.inputs }, + |m: &mut TransactionType| { &mut m.inputs }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "bin_outputs", + |m: &TransactionType| { &m.bin_outputs }, + |m: &mut TransactionType| { &mut m.bin_outputs }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "lock_time", + |m: &TransactionType| { &m.lock_time }, + |m: &mut TransactionType| { &mut m.lock_time }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "outputs", + |m: &TransactionType| { &m.outputs }, + |m: &mut TransactionType| { &mut m.outputs }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "inputs_cnt", + |m: &TransactionType| { &m.inputs_cnt }, + |m: &mut TransactionType| { &mut m.inputs_cnt }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "outputs_cnt", + |m: &TransactionType| { &m.outputs_cnt }, + |m: &mut TransactionType| { &mut m.outputs_cnt }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "extra_data", + |m: &TransactionType| { &m.extra_data }, + |m: &mut TransactionType| { &mut m.extra_data }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "extra_data_len", + |m: &TransactionType| { &m.extra_data_len }, + |m: &mut TransactionType| { &mut m.extra_data_len }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "expiry", + |m: &TransactionType| { &m.expiry }, + |m: &mut TransactionType| { &mut m.expiry }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "overwintered", + |m: &TransactionType| { &m.overwintered }, + |m: &mut TransactionType| { &mut m.overwintered }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "version_group_id", + |m: &TransactionType| { &m.version_group_id }, + |m: &mut TransactionType| { &mut m.version_group_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "timestamp", + |m: &TransactionType| { &m.timestamp }, + |m: &mut TransactionType| { &mut m.timestamp }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "branch_id", + |m: &TransactionType| { &m.branch_id }, + |m: &mut TransactionType| { &mut m.branch_id }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAck.TransactionType", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TransactionType { + const NAME: &'static str = "TransactionType"; + + fn is_initialized(&self) -> bool { + for v in &self.inputs { + if !v.is_initialized() { + return false; + } + }; + for v in &self.bin_outputs { + 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::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 8 => { + self.version = ::std::option::Option::Some(is.read_uint32()?); + }, + 18 => { + self.inputs.push(is.read_message()?); + }, + 26 => { + self.bin_outputs.push(is.read_message()?); + }, + 32 => { + self.lock_time = ::std::option::Option::Some(is.read_uint32()?); + }, + 42 => { + self.outputs.push(is.read_message()?); + }, + 48 => { + self.inputs_cnt = ::std::option::Option::Some(is.read_uint32()?); + }, + 56 => { + self.outputs_cnt = ::std::option::Option::Some(is.read_uint32()?); + }, + 66 => { + self.extra_data = ::std::option::Option::Some(is.read_bytes()?); + }, + 72 => { + self.extra_data_len = ::std::option::Option::Some(is.read_uint32()?); + }, + 80 => { + self.expiry = ::std::option::Option::Some(is.read_uint32()?); + }, + 88 => { + self.overwintered = ::std::option::Option::Some(is.read_bool()?); + }, + 96 => { + self.version_group_id = ::std::option::Option::Some(is.read_uint32()?); + }, + 104 => { + self.timestamp = ::std::option::Option::Some(is.read_uint32()?); + }, + 112 => { + self.branch_id = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.version { + my_size += ::protobuf::rt::uint32_size(1, v); + } + for value in &self.inputs { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + for value in &self.bin_outputs { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + if let Some(v) = self.lock_time { + my_size += ::protobuf::rt::uint32_size(4, v); + } + for value in &self.outputs { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + if let Some(v) = self.inputs_cnt { + my_size += ::protobuf::rt::uint32_size(6, v); + } + if let Some(v) = self.outputs_cnt { + my_size += ::protobuf::rt::uint32_size(7, v); + } + if let Some(v) = self.extra_data.as_ref() { + my_size += ::protobuf::rt::bytes_size(8, &v); + } + if let Some(v) = self.extra_data_len { + my_size += ::protobuf::rt::uint32_size(9, v); + } + if let Some(v) = self.expiry { + my_size += ::protobuf::rt::uint32_size(10, v); + } + if let Some(v) = self.overwintered { + my_size += 1 + 1; + } + if let Some(v) = self.version_group_id { + my_size += ::protobuf::rt::uint32_size(12, v); + } + if let Some(v) = self.timestamp { + my_size += ::protobuf::rt::uint32_size(13, v); + } + if let Some(v) = self.branch_id { + my_size += ::protobuf::rt::uint32_size(14, 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.version { + os.write_uint32(1, v)?; + } + for v in &self.inputs { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + }; + for v in &self.bin_outputs { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + }; + if let Some(v) = self.lock_time { + os.write_uint32(4, v)?; + } + for v in &self.outputs { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + }; + if let Some(v) = self.inputs_cnt { + os.write_uint32(6, v)?; + } + if let Some(v) = self.outputs_cnt { + os.write_uint32(7, v)?; + } + if let Some(v) = self.extra_data.as_ref() { + os.write_bytes(8, v)?; + } + if let Some(v) = self.extra_data_len { + os.write_uint32(9, v)?; + } + if let Some(v) = self.expiry { + os.write_uint32(10, v)?; + } + if let Some(v) = self.overwintered { + os.write_bool(11, v)?; + } + if let Some(v) = self.version_group_id { + os.write_uint32(12, v)?; + } + if let Some(v) = self.timestamp { + os.write_uint32(13, v)?; + } + if let Some(v) = self.branch_id { + os.write_uint32(14, 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() -> TransactionType { + TransactionType::new() + } + + fn clear(&mut self) { + self.version = ::std::option::Option::None; + self.inputs.clear(); + self.bin_outputs.clear(); + self.lock_time = ::std::option::Option::None; + self.outputs.clear(); + self.inputs_cnt = ::std::option::Option::None; + self.outputs_cnt = ::std::option::Option::None; + self.extra_data = ::std::option::Option::None; + self.extra_data_len = ::std::option::Option::None; + self.expiry = ::std::option::Option::None; + self.overwintered = ::std::option::Option::None; + self.version_group_id = ::std::option::Option::None; + self.timestamp = ::std::option::Option::None; + self.branch_id = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TransactionType { + static instance: TransactionType = TransactionType { + version: ::std::option::Option::None, + inputs: ::std::vec::Vec::new(), + bin_outputs: ::std::vec::Vec::new(), + lock_time: ::std::option::Option::None, + outputs: ::std::vec::Vec::new(), + inputs_cnt: ::std::option::Option::None, + outputs_cnt: ::std::option::Option::None, + extra_data: ::std::option::Option::None, + extra_data_len: ::std::option::Option::None, + expiry: ::std::option::Option::None, + overwintered: ::std::option::Option::None, + version_group_id: ::std::option::Option::None, + timestamp: ::std::option::Option::None, + branch_id: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TransactionType { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TxAck.TransactionType").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TransactionType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TransactionType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + /// Nested message and enums of message `TransactionType` + pub mod transaction_type { + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TxInputType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.prev_hash) + pub prev_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.prev_index) + pub prev_index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.script_sig) + pub script_sig: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.sequence) + pub sequence: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.script_type) + pub script_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.multisig) + pub multisig: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.decred_tree) + pub decred_tree: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.witness) + pub witness: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.ownership_proof) + pub ownership_proof: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.commitment_data) + pub commitment_data: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.orig_hash) + pub orig_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.orig_index) + pub orig_index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.decred_staking_spend) + pub decred_staking_spend: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.script_pubkey) + pub script_pubkey: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.coinjoin_flags) + pub coinjoin_flags: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TxInputType { + fn default() -> &'a TxInputType { + ::default_instance() + } + } + + impl TxInputType { + pub fn new() -> TxInputType { + ::std::default::Default::default() + } + + // required bytes prev_hash = 2; + + pub fn prev_hash(&self) -> &[u8] { + match self.prev_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_prev_hash(&mut self) { + self.prev_hash = ::std::option::Option::None; + } + + pub fn has_prev_hash(&self) -> bool { + self.prev_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_hash(&mut self, v: ::std::vec::Vec) { + self.prev_hash = ::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_prev_hash(&mut self) -> &mut ::std::vec::Vec { + if self.prev_hash.is_none() { + self.prev_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.prev_hash.as_mut().unwrap() + } + + // Take field + pub fn take_prev_hash(&mut self) -> ::std::vec::Vec { + self.prev_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint32 prev_index = 3; + + pub fn prev_index(&self) -> u32 { + self.prev_index.unwrap_or(0) + } + + pub fn clear_prev_index(&mut self) { + self.prev_index = ::std::option::Option::None; + } + + pub fn has_prev_index(&self) -> bool { + self.prev_index.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_index(&mut self, v: u32) { + self.prev_index = ::std::option::Option::Some(v); + } + + // optional bytes script_sig = 4; + + pub fn script_sig(&self) -> &[u8] { + match self.script_sig.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_script_sig(&mut self) { + self.script_sig = ::std::option::Option::None; + } + + pub fn has_script_sig(&self) -> bool { + self.script_sig.is_some() + } + + // Param is passed by value, moved + pub fn set_script_sig(&mut self, v: ::std::vec::Vec) { + self.script_sig = ::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_script_sig(&mut self) -> &mut ::std::vec::Vec { + if self.script_sig.is_none() { + self.script_sig = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.script_sig.as_mut().unwrap() + } + + // Take field + pub fn take_script_sig(&mut self) -> ::std::vec::Vec { + self.script_sig.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 sequence = 5; + + pub fn sequence(&self) -> u32 { + self.sequence.unwrap_or(4294967295u32) + } + + pub fn clear_sequence(&mut self) { + self.sequence = ::std::option::Option::None; + } + + pub fn has_sequence(&self) -> bool { + self.sequence.is_some() + } + + // Param is passed by value, moved + pub fn set_sequence(&mut self, v: u32) { + self.sequence = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.bitcoin.InputScriptType script_type = 6; + + pub fn script_type(&self) -> super::super::InputScriptType { + match self.script_type { + Some(e) => e.enum_value_or(super::super::InputScriptType::SPENDADDRESS), + None => super::super::InputScriptType::SPENDADDRESS, + } + } + + pub fn clear_script_type(&mut self) { + self.script_type = ::std::option::Option::None; + } + + pub fn has_script_type(&self) -> bool { + self.script_type.is_some() + } + + // Param is passed by value, moved + pub fn set_script_type(&mut self, v: super::super::InputScriptType) { + self.script_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional uint64 amount = 8; + + pub fn amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + // optional uint32 decred_tree = 9; + + pub fn decred_tree(&self) -> u32 { + self.decred_tree.unwrap_or(0) + } + + pub fn clear_decred_tree(&mut self) { + self.decred_tree = ::std::option::Option::None; + } + + pub fn has_decred_tree(&self) -> bool { + self.decred_tree.is_some() + } + + // Param is passed by value, moved + pub fn set_decred_tree(&mut self, v: u32) { + self.decred_tree = ::std::option::Option::Some(v); + } + + // optional bytes witness = 13; + + pub fn witness(&self) -> &[u8] { + match self.witness.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_witness(&mut self) { + self.witness = ::std::option::Option::None; + } + + pub fn has_witness(&self) -> bool { + self.witness.is_some() + } + + // Param is passed by value, moved + pub fn set_witness(&mut self, v: ::std::vec::Vec) { + self.witness = ::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_witness(&mut self) -> &mut ::std::vec::Vec { + if self.witness.is_none() { + self.witness = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.witness.as_mut().unwrap() + } + + // Take field + pub fn take_witness(&mut self) -> ::std::vec::Vec { + self.witness.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes ownership_proof = 14; + + pub fn ownership_proof(&self) -> &[u8] { + match self.ownership_proof.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_ownership_proof(&mut self) { + self.ownership_proof = ::std::option::Option::None; + } + + pub fn has_ownership_proof(&self) -> bool { + self.ownership_proof.is_some() + } + + // Param is passed by value, moved + pub fn set_ownership_proof(&mut self, v: ::std::vec::Vec) { + self.ownership_proof = ::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_ownership_proof(&mut self) -> &mut ::std::vec::Vec { + if self.ownership_proof.is_none() { + self.ownership_proof = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.ownership_proof.as_mut().unwrap() + } + + // Take field + pub fn take_ownership_proof(&mut self) -> ::std::vec::Vec { + self.ownership_proof.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes commitment_data = 15; + + pub fn commitment_data(&self) -> &[u8] { + match self.commitment_data.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_commitment_data(&mut self) { + self.commitment_data = ::std::option::Option::None; + } + + pub fn has_commitment_data(&self) -> bool { + self.commitment_data.is_some() + } + + // Param is passed by value, moved + pub fn set_commitment_data(&mut self, v: ::std::vec::Vec) { + self.commitment_data = ::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_commitment_data(&mut self) -> &mut ::std::vec::Vec { + if self.commitment_data.is_none() { + self.commitment_data = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.commitment_data.as_mut().unwrap() + } + + // Take field + pub fn take_commitment_data(&mut self) -> ::std::vec::Vec { + self.commitment_data.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes orig_hash = 16; + + pub fn orig_hash(&self) -> &[u8] { + match self.orig_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_orig_hash(&mut self) { + self.orig_hash = ::std::option::Option::None; + } + + pub fn has_orig_hash(&self) -> bool { + self.orig_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_orig_hash(&mut self, v: ::std::vec::Vec) { + self.orig_hash = ::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_orig_hash(&mut self) -> &mut ::std::vec::Vec { + if self.orig_hash.is_none() { + self.orig_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.orig_hash.as_mut().unwrap() + } + + // Take field + pub fn take_orig_hash(&mut self) -> ::std::vec::Vec { + self.orig_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 orig_index = 17; + + pub fn orig_index(&self) -> u32 { + self.orig_index.unwrap_or(0) + } + + pub fn clear_orig_index(&mut self) { + self.orig_index = ::std::option::Option::None; + } + + pub fn has_orig_index(&self) -> bool { + self.orig_index.is_some() + } + + // Param is passed by value, moved + pub fn set_orig_index(&mut self, v: u32) { + self.orig_index = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.bitcoin.DecredStakingSpendType decred_staking_spend = 18; + + pub fn decred_staking_spend(&self) -> super::super::DecredStakingSpendType { + match self.decred_staking_spend { + Some(e) => e.enum_value_or(super::super::DecredStakingSpendType::SSGen), + None => super::super::DecredStakingSpendType::SSGen, + } + } + + pub fn clear_decred_staking_spend(&mut self) { + self.decred_staking_spend = ::std::option::Option::None; + } + + pub fn has_decred_staking_spend(&self) -> bool { + self.decred_staking_spend.is_some() + } + + // Param is passed by value, moved + pub fn set_decred_staking_spend(&mut self, v: super::super::DecredStakingSpendType) { + self.decred_staking_spend = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bytes script_pubkey = 19; + + pub fn script_pubkey(&self) -> &[u8] { + match self.script_pubkey.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_script_pubkey(&mut self) { + self.script_pubkey = ::std::option::Option::None; + } + + pub fn has_script_pubkey(&self) -> bool { + self.script_pubkey.is_some() + } + + // Param is passed by value, moved + pub fn set_script_pubkey(&mut self, v: ::std::vec::Vec) { + self.script_pubkey = ::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_script_pubkey(&mut self) -> &mut ::std::vec::Vec { + if self.script_pubkey.is_none() { + self.script_pubkey = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.script_pubkey.as_mut().unwrap() + } + + // Take field + pub fn take_script_pubkey(&mut self) -> ::std::vec::Vec { + self.script_pubkey.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 coinjoin_flags = 20; + + pub fn coinjoin_flags(&self) -> u32 { + self.coinjoin_flags.unwrap_or(0u32) + } + + pub fn clear_coinjoin_flags(&mut self) { + self.coinjoin_flags = ::std::option::Option::None; + } + + pub fn has_coinjoin_flags(&self) -> bool { + self.coinjoin_flags.is_some() + } + + // Param is passed by value, moved + pub fn set_coinjoin_flags(&mut self, v: u32) { + self.coinjoin_flags = ::std::option::Option::Some(v); + } + + pub(in super::super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(17); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &TxInputType| { &m.address_n }, + |m: &mut TxInputType| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "prev_hash", + |m: &TxInputType| { &m.prev_hash }, + |m: &mut TxInputType| { &mut m.prev_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "prev_index", + |m: &TxInputType| { &m.prev_index }, + |m: &mut TxInputType| { &mut m.prev_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_sig", + |m: &TxInputType| { &m.script_sig }, + |m: &mut TxInputType| { &mut m.script_sig }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sequence", + |m: &TxInputType| { &m.sequence }, + |m: &mut TxInputType| { &mut m.sequence }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_type", + |m: &TxInputType| { &m.script_type }, + |m: &mut TxInputType| { &mut m.script_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::super::MultisigRedeemScriptType>( + "multisig", + |m: &TxInputType| { &m.multisig }, + |m: &mut TxInputType| { &mut m.multisig }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &TxInputType| { &m.amount }, + |m: &mut TxInputType| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "decred_tree", + |m: &TxInputType| { &m.decred_tree }, + |m: &mut TxInputType| { &mut m.decred_tree }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "witness", + |m: &TxInputType| { &m.witness }, + |m: &mut TxInputType| { &mut m.witness }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ownership_proof", + |m: &TxInputType| { &m.ownership_proof }, + |m: &mut TxInputType| { &mut m.ownership_proof }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "commitment_data", + |m: &TxInputType| { &m.commitment_data }, + |m: &mut TxInputType| { &mut m.commitment_data }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "orig_hash", + |m: &TxInputType| { &m.orig_hash }, + |m: &mut TxInputType| { &mut m.orig_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "orig_index", + |m: &TxInputType| { &m.orig_index }, + |m: &mut TxInputType| { &mut m.orig_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "decred_staking_spend", + |m: &TxInputType| { &m.decred_staking_spend }, + |m: &mut TxInputType| { &mut m.decred_staking_spend }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_pubkey", + |m: &TxInputType| { &m.script_pubkey }, + |m: &mut TxInputType| { &mut m.script_pubkey }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "coinjoin_flags", + |m: &TxInputType| { &m.coinjoin_flags }, + |m: &mut TxInputType| { &mut m.coinjoin_flags }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAck.TransactionType.TxInputType", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TxInputType { + const NAME: &'static str = "TxInputType"; + + fn is_initialized(&self) -> bool { + if self.prev_hash.is_none() { + return false; + } + if self.prev_index.is_none() { + return false; + } + for v in &self.multisig { + if !v.is_initialized() { + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.prev_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.prev_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 34 => { + self.script_sig = ::std::option::Option::Some(is.read_bytes()?); + }, + 40 => { + self.sequence = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.script_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 58 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.multisig)?; + }, + 64 => { + self.amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 72 => { + self.decred_tree = ::std::option::Option::Some(is.read_uint32()?); + }, + 106 => { + self.witness = ::std::option::Option::Some(is.read_bytes()?); + }, + 114 => { + self.ownership_proof = ::std::option::Option::Some(is.read_bytes()?); + }, + 122 => { + self.commitment_data = ::std::option::Option::Some(is.read_bytes()?); + }, + 130 => { + self.orig_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 136 => { + self.orig_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 144 => { + self.decred_staking_spend = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 154 => { + self.script_pubkey = ::std::option::Option::Some(is.read_bytes()?); + }, + 160 => { + self.coinjoin_flags = ::std::option::Option::Some(is.read_uint32()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.prev_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.prev_index { + my_size += ::protobuf::rt::uint32_size(3, v); + } + if let Some(v) = self.script_sig.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.sequence { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.script_type { + my_size += ::protobuf::rt::int32_size(6, v.value()); + } + if let Some(v) = self.multisig.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.amount { + my_size += ::protobuf::rt::uint64_size(8, v); + } + if let Some(v) = self.decred_tree { + my_size += ::protobuf::rt::uint32_size(9, v); + } + if let Some(v) = self.witness.as_ref() { + my_size += ::protobuf::rt::bytes_size(13, &v); + } + if let Some(v) = self.ownership_proof.as_ref() { + my_size += ::protobuf::rt::bytes_size(14, &v); + } + if let Some(v) = self.commitment_data.as_ref() { + my_size += ::protobuf::rt::bytes_size(15, &v); + } + if let Some(v) = self.orig_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(16, &v); + } + if let Some(v) = self.orig_index { + my_size += ::protobuf::rt::uint32_size(17, v); + } + if let Some(v) = self.decred_staking_spend { + my_size += ::protobuf::rt::int32_size(18, v.value()); + } + if let Some(v) = self.script_pubkey.as_ref() { + my_size += ::protobuf::rt::bytes_size(19, &v); + } + if let Some(v) = self.coinjoin_flags { + my_size += ::protobuf::rt::uint32_size(20, 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.prev_hash.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.prev_index { + os.write_uint32(3, v)?; + } + if let Some(v) = self.script_sig.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.sequence { + os.write_uint32(5, v)?; + } + if let Some(v) = self.script_type { + os.write_enum(6, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.multisig.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(7, v, os)?; + } + if let Some(v) = self.amount { + os.write_uint64(8, v)?; + } + if let Some(v) = self.decred_tree { + os.write_uint32(9, v)?; + } + if let Some(v) = self.witness.as_ref() { + os.write_bytes(13, v)?; + } + if let Some(v) = self.ownership_proof.as_ref() { + os.write_bytes(14, v)?; + } + if let Some(v) = self.commitment_data.as_ref() { + os.write_bytes(15, v)?; + } + if let Some(v) = self.orig_hash.as_ref() { + os.write_bytes(16, v)?; + } + if let Some(v) = self.orig_index { + os.write_uint32(17, v)?; + } + if let Some(v) = self.decred_staking_spend { + os.write_enum(18, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.script_pubkey.as_ref() { + os.write_bytes(19, v)?; + } + if let Some(v) = self.coinjoin_flags { + os.write_uint32(20, 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() -> TxInputType { + TxInputType::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.prev_hash = ::std::option::Option::None; + self.prev_index = ::std::option::Option::None; + self.script_sig = ::std::option::Option::None; + self.sequence = ::std::option::Option::None; + self.script_type = ::std::option::Option::None; + self.multisig.clear(); + self.amount = ::std::option::Option::None; + self.decred_tree = ::std::option::Option::None; + self.witness = ::std::option::Option::None; + self.ownership_proof = ::std::option::Option::None; + self.commitment_data = ::std::option::Option::None; + self.orig_hash = ::std::option::Option::None; + self.orig_index = ::std::option::Option::None; + self.decred_staking_spend = ::std::option::Option::None; + self.script_pubkey = ::std::option::Option::None; + self.coinjoin_flags = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxInputType { + static instance: TxInputType = TxInputType { + address_n: ::std::vec::Vec::new(), + prev_hash: ::std::option::Option::None, + prev_index: ::std::option::Option::None, + script_sig: ::std::option::Option::None, + sequence: ::std::option::Option::None, + script_type: ::std::option::Option::None, + multisig: ::protobuf::MessageField::none(), + amount: ::std::option::Option::None, + decred_tree: ::std::option::Option::None, + witness: ::std::option::Option::None, + ownership_proof: ::std::option::Option::None, + commitment_data: ::std::option::Option::None, + orig_hash: ::std::option::Option::None, + orig_index: ::std::option::Option::None, + decred_staking_spend: ::std::option::Option::None, + script_pubkey: ::std::option::Option::None, + coinjoin_flags: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TxInputType { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::super::file_descriptor().message_by_package_relative_name("TxAck.TransactionType.TxInputType").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TxInputType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TxInputType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputBinType) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TxOutputBinType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputBinType.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputBinType.script_pubkey) + pub script_pubkey: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputBinType.decred_script_version) + pub decred_script_version: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputBinType.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TxOutputBinType { + fn default() -> &'a TxOutputBinType { + ::default_instance() + } + } + + impl TxOutputBinType { + pub fn new() -> TxOutputBinType { + ::std::default::Default::default() + } + + // required uint64 amount = 1; + + pub fn amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + // required bytes script_pubkey = 2; + + pub fn script_pubkey(&self) -> &[u8] { + match self.script_pubkey.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_script_pubkey(&mut self) { + self.script_pubkey = ::std::option::Option::None; + } + + pub fn has_script_pubkey(&self) -> bool { + self.script_pubkey.is_some() + } + + // Param is passed by value, moved + pub fn set_script_pubkey(&mut self, v: ::std::vec::Vec) { + self.script_pubkey = ::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_script_pubkey(&mut self) -> &mut ::std::vec::Vec { + if self.script_pubkey.is_none() { + self.script_pubkey = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.script_pubkey.as_mut().unwrap() + } + + // Take field + pub fn take_script_pubkey(&mut self) -> ::std::vec::Vec { + self.script_pubkey.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 decred_script_version = 3; + + pub fn decred_script_version(&self) -> u32 { + self.decred_script_version.unwrap_or(0) + } + + pub fn clear_decred_script_version(&mut self) { + self.decred_script_version = ::std::option::Option::None; + } + + pub fn has_decred_script_version(&self) -> bool { + self.decred_script_version.is_some() + } + + // Param is passed by value, moved + pub fn set_decred_script_version(&mut self, v: u32) { + self.decred_script_version = ::std::option::Option::Some(v); + } + + pub(in super::super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &TxOutputBinType| { &m.amount }, + |m: &mut TxOutputBinType| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_pubkey", + |m: &TxOutputBinType| { &m.script_pubkey }, + |m: &mut TxOutputBinType| { &mut m.script_pubkey }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "decred_script_version", + |m: &TxOutputBinType| { &m.decred_script_version }, + |m: &mut TxOutputBinType| { &mut m.decred_script_version }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAck.TransactionType.TxOutputBinType", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TxOutputBinType { + const NAME: &'static str = "TxOutputBinType"; + + fn is_initialized(&self) -> bool { + if self.amount.is_none() { + return false; + } + if self.script_pubkey.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.amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 18 => { + self.script_pubkey = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.decred_script_version = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.amount { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.script_pubkey.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.decred_script_version { + my_size += ::protobuf::rt::uint32_size(3, 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.amount { + os.write_uint64(1, v)?; + } + if let Some(v) = self.script_pubkey.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.decred_script_version { + os.write_uint32(3, 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() -> TxOutputBinType { + TxOutputBinType::new() + } + + fn clear(&mut self) { + self.amount = ::std::option::Option::None; + self.script_pubkey = ::std::option::Option::None; + self.decred_script_version = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxOutputBinType { + static instance: TxOutputBinType = TxOutputBinType { + amount: ::std::option::Option::None, + script_pubkey: ::std::option::Option::None, + decred_script_version: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TxOutputBinType { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::super::file_descriptor().message_by_package_relative_name("TxAck.TransactionType.TxOutputBinType").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TxOutputBinType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TxOutputBinType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputType) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TxOutputType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputType.address) + pub address: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputType.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputType.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputType.script_type) + pub script_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputType.multisig) + pub multisig: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputType.op_return_data) + pub op_return_data: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputType.orig_hash) + pub orig_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputType.orig_index) + pub orig_index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputType.payment_req_index) + pub payment_req_index: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputType.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TxOutputType { + fn default() -> &'a TxOutputType { + ::default_instance() + } + } + + impl TxOutputType { + pub fn new() -> TxOutputType { + ::std::default::Default::default() + } + + // optional string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required uint64 amount = 3; + + pub fn amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.bitcoin.OutputScriptType script_type = 4; + + pub fn script_type(&self) -> super::super::OutputScriptType { + match self.script_type { + Some(e) => e.enum_value_or(super::super::OutputScriptType::PAYTOADDRESS), + None => super::super::OutputScriptType::PAYTOADDRESS, + } + } + + pub fn clear_script_type(&mut self) { + self.script_type = ::std::option::Option::None; + } + + pub fn has_script_type(&self) -> bool { + self.script_type.is_some() + } + + // Param is passed by value, moved + pub fn set_script_type(&mut self, v: super::super::OutputScriptType) { + self.script_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bytes op_return_data = 6; + + pub fn op_return_data(&self) -> &[u8] { + match self.op_return_data.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_op_return_data(&mut self) { + self.op_return_data = ::std::option::Option::None; + } + + pub fn has_op_return_data(&self) -> bool { + self.op_return_data.is_some() + } + + // Param is passed by value, moved + pub fn set_op_return_data(&mut self, v: ::std::vec::Vec) { + self.op_return_data = ::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_op_return_data(&mut self) -> &mut ::std::vec::Vec { + if self.op_return_data.is_none() { + self.op_return_data = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.op_return_data.as_mut().unwrap() + } + + // Take field + pub fn take_op_return_data(&mut self) -> ::std::vec::Vec { + self.op_return_data.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes orig_hash = 10; + + pub fn orig_hash(&self) -> &[u8] { + match self.orig_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_orig_hash(&mut self) { + self.orig_hash = ::std::option::Option::None; + } + + pub fn has_orig_hash(&self) -> bool { + self.orig_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_orig_hash(&mut self, v: ::std::vec::Vec) { + self.orig_hash = ::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_orig_hash(&mut self) -> &mut ::std::vec::Vec { + if self.orig_hash.is_none() { + self.orig_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.orig_hash.as_mut().unwrap() + } + + // Take field + pub fn take_orig_hash(&mut self) -> ::std::vec::Vec { + self.orig_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 orig_index = 11; + + pub fn orig_index(&self) -> u32 { + self.orig_index.unwrap_or(0) + } + + pub fn clear_orig_index(&mut self) { + self.orig_index = ::std::option::Option::None; + } + + pub fn has_orig_index(&self) -> bool { + self.orig_index.is_some() + } + + // Param is passed by value, moved + pub fn set_orig_index(&mut self, v: u32) { + self.orig_index = ::std::option::Option::Some(v); + } + + // optional uint32 payment_req_index = 12; + + pub fn payment_req_index(&self) -> u32 { + self.payment_req_index.unwrap_or(0) + } + + pub fn clear_payment_req_index(&mut self) { + self.payment_req_index = ::std::option::Option::None; + } + + pub fn has_payment_req_index(&self) -> bool { + self.payment_req_index.is_some() + } + + // Param is passed by value, moved + pub fn set_payment_req_index(&mut self, v: u32) { + self.payment_req_index = ::std::option::Option::Some(v); + } + + pub(in super::super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(9); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &TxOutputType| { &m.address }, + |m: &mut TxOutputType| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &TxOutputType| { &m.address_n }, + |m: &mut TxOutputType| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &TxOutputType| { &m.amount }, + |m: &mut TxOutputType| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_type", + |m: &TxOutputType| { &m.script_type }, + |m: &mut TxOutputType| { &mut m.script_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::super::MultisigRedeemScriptType>( + "multisig", + |m: &TxOutputType| { &m.multisig }, + |m: &mut TxOutputType| { &mut m.multisig }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "op_return_data", + |m: &TxOutputType| { &m.op_return_data }, + |m: &mut TxOutputType| { &mut m.op_return_data }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "orig_hash", + |m: &TxOutputType| { &m.orig_hash }, + |m: &mut TxOutputType| { &mut m.orig_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "orig_index", + |m: &TxOutputType| { &m.orig_index }, + |m: &mut TxOutputType| { &mut m.orig_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "payment_req_index", + |m: &TxOutputType| { &m.payment_req_index }, + |m: &mut TxOutputType| { &mut m.payment_req_index }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAck.TransactionType.TxOutputType", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TxOutputType { + const NAME: &'static str = "TxOutputType"; + + fn is_initialized(&self) -> bool { + if self.amount.is_none() { + return false; + } + for v in &self.multisig { + if !v.is_initialized() { + 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_string()?); + }, + 18 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 16 => { + self.address_n.push(is.read_uint32()?); + }, + 24 => { + self.amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 32 => { + self.script_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 42 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.multisig)?; + }, + 50 => { + self.op_return_data = ::std::option::Option::Some(is.read_bytes()?); + }, + 82 => { + self.orig_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 88 => { + self.orig_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 96 => { + self.payment_req_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 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::string_size(1, &v); + } + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(2, *value); + }; + if let Some(v) = self.amount { + my_size += ::protobuf::rt::uint64_size(3, v); + } + if let Some(v) = self.script_type { + my_size += ::protobuf::rt::int32_size(4, v.value()); + } + if let Some(v) = self.multisig.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.op_return_data.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &v); + } + if let Some(v) = self.orig_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(10, &v); + } + if let Some(v) = self.orig_index { + my_size += ::protobuf::rt::uint32_size(11, v); + } + if let Some(v) = self.payment_req_index { + my_size += ::protobuf::rt::uint32_size(12, 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_string(1, v)?; + } + for v in &self.address_n { + os.write_uint32(2, *v)?; + }; + if let Some(v) = self.amount { + os.write_uint64(3, v)?; + } + if let Some(v) = self.script_type { + os.write_enum(4, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.multisig.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + } + if let Some(v) = self.op_return_data.as_ref() { + os.write_bytes(6, v)?; + } + if let Some(v) = self.orig_hash.as_ref() { + os.write_bytes(10, v)?; + } + if let Some(v) = self.orig_index { + os.write_uint32(11, v)?; + } + if let Some(v) = self.payment_req_index { + os.write_uint32(12, 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() -> TxOutputType { + TxOutputType::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.address_n.clear(); + self.amount = ::std::option::Option::None; + self.script_type = ::std::option::Option::None; + self.multisig.clear(); + self.op_return_data = ::std::option::Option::None; + self.orig_hash = ::std::option::Option::None; + self.orig_index = ::std::option::Option::None; + self.payment_req_index = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxOutputType { + static instance: TxOutputType = TxOutputType { + address: ::std::option::Option::None, + address_n: ::std::vec::Vec::new(), + amount: ::std::option::Option::None, + script_type: ::std::option::Option::None, + multisig: ::protobuf::MessageField::none(), + op_return_data: ::std::option::Option::None, + orig_hash: ::std::option::Option::None, + orig_index: ::std::option::Option::None, + payment_req_index: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TxOutputType { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::super::file_descriptor().message_by_package_relative_name("TxAck.TransactionType.TxOutputType").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TxOutputType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TxOutputType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxInput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TxInput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.prev_hash) + pub prev_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.prev_index) + pub prev_index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.script_sig) + pub script_sig: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.sequence) + pub sequence: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.script_type) + pub script_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.multisig) + pub multisig: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.decred_tree) + pub decred_tree: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.witness) + pub witness: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.ownership_proof) + pub ownership_proof: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.commitment_data) + pub commitment_data: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.orig_hash) + pub orig_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.orig_index) + pub orig_index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.decred_staking_spend) + pub decred_staking_spend: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.script_pubkey) + pub script_pubkey: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxInput.coinjoin_flags) + pub coinjoin_flags: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxInput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TxInput { + fn default() -> &'a TxInput { + ::default_instance() + } +} + +impl TxInput { + pub fn new() -> TxInput { + ::std::default::Default::default() + } + + // required bytes prev_hash = 2; + + pub fn prev_hash(&self) -> &[u8] { + match self.prev_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_prev_hash(&mut self) { + self.prev_hash = ::std::option::Option::None; + } + + pub fn has_prev_hash(&self) -> bool { + self.prev_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_hash(&mut self, v: ::std::vec::Vec) { + self.prev_hash = ::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_prev_hash(&mut self) -> &mut ::std::vec::Vec { + if self.prev_hash.is_none() { + self.prev_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.prev_hash.as_mut().unwrap() + } + + // Take field + pub fn take_prev_hash(&mut self) -> ::std::vec::Vec { + self.prev_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint32 prev_index = 3; + + pub fn prev_index(&self) -> u32 { + self.prev_index.unwrap_or(0) + } + + pub fn clear_prev_index(&mut self) { + self.prev_index = ::std::option::Option::None; + } + + pub fn has_prev_index(&self) -> bool { + self.prev_index.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_index(&mut self, v: u32) { + self.prev_index = ::std::option::Option::Some(v); + } + + // optional bytes script_sig = 4; + + pub fn script_sig(&self) -> &[u8] { + match self.script_sig.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_script_sig(&mut self) { + self.script_sig = ::std::option::Option::None; + } + + pub fn has_script_sig(&self) -> bool { + self.script_sig.is_some() + } + + // Param is passed by value, moved + pub fn set_script_sig(&mut self, v: ::std::vec::Vec) { + self.script_sig = ::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_script_sig(&mut self) -> &mut ::std::vec::Vec { + if self.script_sig.is_none() { + self.script_sig = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.script_sig.as_mut().unwrap() + } + + // Take field + pub fn take_script_sig(&mut self) -> ::std::vec::Vec { + self.script_sig.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 sequence = 5; + + pub fn sequence(&self) -> u32 { + self.sequence.unwrap_or(4294967295u32) + } + + pub fn clear_sequence(&mut self) { + self.sequence = ::std::option::Option::None; + } + + pub fn has_sequence(&self) -> bool { + self.sequence.is_some() + } + + // Param is passed by value, moved + pub fn set_sequence(&mut self, v: u32) { + self.sequence = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.bitcoin.InputScriptType script_type = 6; + + pub fn script_type(&self) -> InputScriptType { + match self.script_type { + Some(e) => e.enum_value_or(InputScriptType::SPENDADDRESS), + None => InputScriptType::SPENDADDRESS, + } + } + + pub fn clear_script_type(&mut self) { + self.script_type = ::std::option::Option::None; + } + + pub fn has_script_type(&self) -> bool { + self.script_type.is_some() + } + + // Param is passed by value, moved + pub fn set_script_type(&mut self, v: InputScriptType) { + self.script_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // required uint64 amount = 8; + + pub fn amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + // optional uint32 decred_tree = 9; + + pub fn decred_tree(&self) -> u32 { + self.decred_tree.unwrap_or(0) + } + + pub fn clear_decred_tree(&mut self) { + self.decred_tree = ::std::option::Option::None; + } + + pub fn has_decred_tree(&self) -> bool { + self.decred_tree.is_some() + } + + // Param is passed by value, moved + pub fn set_decred_tree(&mut self, v: u32) { + self.decred_tree = ::std::option::Option::Some(v); + } + + // optional bytes witness = 13; + + pub fn witness(&self) -> &[u8] { + match self.witness.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_witness(&mut self) { + self.witness = ::std::option::Option::None; + } + + pub fn has_witness(&self) -> bool { + self.witness.is_some() + } + + // Param is passed by value, moved + pub fn set_witness(&mut self, v: ::std::vec::Vec) { + self.witness = ::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_witness(&mut self) -> &mut ::std::vec::Vec { + if self.witness.is_none() { + self.witness = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.witness.as_mut().unwrap() + } + + // Take field + pub fn take_witness(&mut self) -> ::std::vec::Vec { + self.witness.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes ownership_proof = 14; + + pub fn ownership_proof(&self) -> &[u8] { + match self.ownership_proof.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_ownership_proof(&mut self) { + self.ownership_proof = ::std::option::Option::None; + } + + pub fn has_ownership_proof(&self) -> bool { + self.ownership_proof.is_some() + } + + // Param is passed by value, moved + pub fn set_ownership_proof(&mut self, v: ::std::vec::Vec) { + self.ownership_proof = ::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_ownership_proof(&mut self) -> &mut ::std::vec::Vec { + if self.ownership_proof.is_none() { + self.ownership_proof = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.ownership_proof.as_mut().unwrap() + } + + // Take field + pub fn take_ownership_proof(&mut self) -> ::std::vec::Vec { + self.ownership_proof.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes commitment_data = 15; + + pub fn commitment_data(&self) -> &[u8] { + match self.commitment_data.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_commitment_data(&mut self) { + self.commitment_data = ::std::option::Option::None; + } + + pub fn has_commitment_data(&self) -> bool { + self.commitment_data.is_some() + } + + // Param is passed by value, moved + pub fn set_commitment_data(&mut self, v: ::std::vec::Vec) { + self.commitment_data = ::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_commitment_data(&mut self) -> &mut ::std::vec::Vec { + if self.commitment_data.is_none() { + self.commitment_data = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.commitment_data.as_mut().unwrap() + } + + // Take field + pub fn take_commitment_data(&mut self) -> ::std::vec::Vec { + self.commitment_data.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes orig_hash = 16; + + pub fn orig_hash(&self) -> &[u8] { + match self.orig_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_orig_hash(&mut self) { + self.orig_hash = ::std::option::Option::None; + } + + pub fn has_orig_hash(&self) -> bool { + self.orig_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_orig_hash(&mut self, v: ::std::vec::Vec) { + self.orig_hash = ::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_orig_hash(&mut self) -> &mut ::std::vec::Vec { + if self.orig_hash.is_none() { + self.orig_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.orig_hash.as_mut().unwrap() + } + + // Take field + pub fn take_orig_hash(&mut self) -> ::std::vec::Vec { + self.orig_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 orig_index = 17; + + pub fn orig_index(&self) -> u32 { + self.orig_index.unwrap_or(0) + } + + pub fn clear_orig_index(&mut self) { + self.orig_index = ::std::option::Option::None; + } + + pub fn has_orig_index(&self) -> bool { + self.orig_index.is_some() + } + + // Param is passed by value, moved + pub fn set_orig_index(&mut self, v: u32) { + self.orig_index = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.bitcoin.DecredStakingSpendType decred_staking_spend = 18; + + pub fn decred_staking_spend(&self) -> DecredStakingSpendType { + match self.decred_staking_spend { + Some(e) => e.enum_value_or(DecredStakingSpendType::SSGen), + None => DecredStakingSpendType::SSGen, + } + } + + pub fn clear_decred_staking_spend(&mut self) { + self.decred_staking_spend = ::std::option::Option::None; + } + + pub fn has_decred_staking_spend(&self) -> bool { + self.decred_staking_spend.is_some() + } + + // Param is passed by value, moved + pub fn set_decred_staking_spend(&mut self, v: DecredStakingSpendType) { + self.decred_staking_spend = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bytes script_pubkey = 19; + + pub fn script_pubkey(&self) -> &[u8] { + match self.script_pubkey.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_script_pubkey(&mut self) { + self.script_pubkey = ::std::option::Option::None; + } + + pub fn has_script_pubkey(&self) -> bool { + self.script_pubkey.is_some() + } + + // Param is passed by value, moved + pub fn set_script_pubkey(&mut self, v: ::std::vec::Vec) { + self.script_pubkey = ::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_script_pubkey(&mut self) -> &mut ::std::vec::Vec { + if self.script_pubkey.is_none() { + self.script_pubkey = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.script_pubkey.as_mut().unwrap() + } + + // Take field + pub fn take_script_pubkey(&mut self) -> ::std::vec::Vec { + self.script_pubkey.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 coinjoin_flags = 20; + + pub fn coinjoin_flags(&self) -> u32 { + self.coinjoin_flags.unwrap_or(0u32) + } + + pub fn clear_coinjoin_flags(&mut self) { + self.coinjoin_flags = ::std::option::Option::None; + } + + pub fn has_coinjoin_flags(&self) -> bool { + self.coinjoin_flags.is_some() + } + + // Param is passed by value, moved + pub fn set_coinjoin_flags(&mut self, v: u32) { + self.coinjoin_flags = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(17); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &TxInput| { &m.address_n }, + |m: &mut TxInput| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "prev_hash", + |m: &TxInput| { &m.prev_hash }, + |m: &mut TxInput| { &mut m.prev_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "prev_index", + |m: &TxInput| { &m.prev_index }, + |m: &mut TxInput| { &mut m.prev_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_sig", + |m: &TxInput| { &m.script_sig }, + |m: &mut TxInput| { &mut m.script_sig }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sequence", + |m: &TxInput| { &m.sequence }, + |m: &mut TxInput| { &mut m.sequence }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_type", + |m: &TxInput| { &m.script_type }, + |m: &mut TxInput| { &mut m.script_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, MultisigRedeemScriptType>( + "multisig", + |m: &TxInput| { &m.multisig }, + |m: &mut TxInput| { &mut m.multisig }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &TxInput| { &m.amount }, + |m: &mut TxInput| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "decred_tree", + |m: &TxInput| { &m.decred_tree }, + |m: &mut TxInput| { &mut m.decred_tree }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "witness", + |m: &TxInput| { &m.witness }, + |m: &mut TxInput| { &mut m.witness }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ownership_proof", + |m: &TxInput| { &m.ownership_proof }, + |m: &mut TxInput| { &mut m.ownership_proof }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "commitment_data", + |m: &TxInput| { &m.commitment_data }, + |m: &mut TxInput| { &mut m.commitment_data }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "orig_hash", + |m: &TxInput| { &m.orig_hash }, + |m: &mut TxInput| { &mut m.orig_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "orig_index", + |m: &TxInput| { &m.orig_index }, + |m: &mut TxInput| { &mut m.orig_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "decred_staking_spend", + |m: &TxInput| { &m.decred_staking_spend }, + |m: &mut TxInput| { &mut m.decred_staking_spend }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_pubkey", + |m: &TxInput| { &m.script_pubkey }, + |m: &mut TxInput| { &mut m.script_pubkey }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "coinjoin_flags", + |m: &TxInput| { &m.coinjoin_flags }, + |m: &mut TxInput| { &mut m.coinjoin_flags }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxInput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TxInput { + const NAME: &'static str = "TxInput"; + + fn is_initialized(&self) -> bool { + if self.prev_hash.is_none() { + return false; + } + if self.prev_index.is_none() { + return false; + } + if self.amount.is_none() { + return false; + } + for v in &self.multisig { + if !v.is_initialized() { + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.prev_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.prev_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 34 => { + self.script_sig = ::std::option::Option::Some(is.read_bytes()?); + }, + 40 => { + self.sequence = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.script_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 58 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.multisig)?; + }, + 64 => { + self.amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 72 => { + self.decred_tree = ::std::option::Option::Some(is.read_uint32()?); + }, + 106 => { + self.witness = ::std::option::Option::Some(is.read_bytes()?); + }, + 114 => { + self.ownership_proof = ::std::option::Option::Some(is.read_bytes()?); + }, + 122 => { + self.commitment_data = ::std::option::Option::Some(is.read_bytes()?); + }, + 130 => { + self.orig_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 136 => { + self.orig_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 144 => { + self.decred_staking_spend = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 154 => { + self.script_pubkey = ::std::option::Option::Some(is.read_bytes()?); + }, + 160 => { + self.coinjoin_flags = ::std::option::Option::Some(is.read_uint32()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.prev_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.prev_index { + my_size += ::protobuf::rt::uint32_size(3, v); + } + if let Some(v) = self.script_sig.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.sequence { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.script_type { + my_size += ::protobuf::rt::int32_size(6, v.value()); + } + if let Some(v) = self.multisig.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.amount { + my_size += ::protobuf::rt::uint64_size(8, v); + } + if let Some(v) = self.decred_tree { + my_size += ::protobuf::rt::uint32_size(9, v); + } + if let Some(v) = self.witness.as_ref() { + my_size += ::protobuf::rt::bytes_size(13, &v); + } + if let Some(v) = self.ownership_proof.as_ref() { + my_size += ::protobuf::rt::bytes_size(14, &v); + } + if let Some(v) = self.commitment_data.as_ref() { + my_size += ::protobuf::rt::bytes_size(15, &v); + } + if let Some(v) = self.orig_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(16, &v); + } + if let Some(v) = self.orig_index { + my_size += ::protobuf::rt::uint32_size(17, v); + } + if let Some(v) = self.decred_staking_spend { + my_size += ::protobuf::rt::int32_size(18, v.value()); + } + if let Some(v) = self.script_pubkey.as_ref() { + my_size += ::protobuf::rt::bytes_size(19, &v); + } + if let Some(v) = self.coinjoin_flags { + my_size += ::protobuf::rt::uint32_size(20, 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.prev_hash.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.prev_index { + os.write_uint32(3, v)?; + } + if let Some(v) = self.script_sig.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.sequence { + os.write_uint32(5, v)?; + } + if let Some(v) = self.script_type { + os.write_enum(6, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.multisig.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(7, v, os)?; + } + if let Some(v) = self.amount { + os.write_uint64(8, v)?; + } + if let Some(v) = self.decred_tree { + os.write_uint32(9, v)?; + } + if let Some(v) = self.witness.as_ref() { + os.write_bytes(13, v)?; + } + if let Some(v) = self.ownership_proof.as_ref() { + os.write_bytes(14, v)?; + } + if let Some(v) = self.commitment_data.as_ref() { + os.write_bytes(15, v)?; + } + if let Some(v) = self.orig_hash.as_ref() { + os.write_bytes(16, v)?; + } + if let Some(v) = self.orig_index { + os.write_uint32(17, v)?; + } + if let Some(v) = self.decred_staking_spend { + os.write_enum(18, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.script_pubkey.as_ref() { + os.write_bytes(19, v)?; + } + if let Some(v) = self.coinjoin_flags { + os.write_uint32(20, 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() -> TxInput { + TxInput::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.prev_hash = ::std::option::Option::None; + self.prev_index = ::std::option::Option::None; + self.script_sig = ::std::option::Option::None; + self.sequence = ::std::option::Option::None; + self.script_type = ::std::option::Option::None; + self.multisig.clear(); + self.amount = ::std::option::Option::None; + self.decred_tree = ::std::option::Option::None; + self.witness = ::std::option::Option::None; + self.ownership_proof = ::std::option::Option::None; + self.commitment_data = ::std::option::Option::None; + self.orig_hash = ::std::option::Option::None; + self.orig_index = ::std::option::Option::None; + self.decred_staking_spend = ::std::option::Option::None; + self.script_pubkey = ::std::option::Option::None; + self.coinjoin_flags = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxInput { + static instance: TxInput = TxInput { + address_n: ::std::vec::Vec::new(), + prev_hash: ::std::option::Option::None, + prev_index: ::std::option::Option::None, + script_sig: ::std::option::Option::None, + sequence: ::std::option::Option::None, + script_type: ::std::option::Option::None, + multisig: ::protobuf::MessageField::none(), + amount: ::std::option::Option::None, + decred_tree: ::std::option::Option::None, + witness: ::std::option::Option::None, + ownership_proof: ::std::option::Option::None, + commitment_data: ::std::option::Option::None, + orig_hash: ::std::option::Option::None, + orig_index: ::std::option::Option::None, + decred_staking_spend: ::std::option::Option::None, + script_pubkey: ::std::option::Option::None, + coinjoin_flags: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TxInput { + 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("TxInput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TxInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxInput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxOutput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TxOutput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxOutput.address) + pub address: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxOutput.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxOutput.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxOutput.script_type) + pub script_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxOutput.multisig) + pub multisig: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxOutput.op_return_data) + pub op_return_data: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxOutput.orig_hash) + pub orig_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxOutput.orig_index) + pub orig_index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxOutput.payment_req_index) + pub payment_req_index: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxOutput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TxOutput { + fn default() -> &'a TxOutput { + ::default_instance() + } +} + +impl TxOutput { + pub fn new() -> TxOutput { + ::std::default::Default::default() + } + + // optional string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required uint64 amount = 3; + + pub fn amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.bitcoin.OutputScriptType script_type = 4; + + pub fn script_type(&self) -> OutputScriptType { + match self.script_type { + Some(e) => e.enum_value_or(OutputScriptType::PAYTOADDRESS), + None => OutputScriptType::PAYTOADDRESS, + } + } + + pub fn clear_script_type(&mut self) { + self.script_type = ::std::option::Option::None; + } + + pub fn has_script_type(&self) -> bool { + self.script_type.is_some() + } + + // Param is passed by value, moved + pub fn set_script_type(&mut self, v: OutputScriptType) { + self.script_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bytes op_return_data = 6; + + pub fn op_return_data(&self) -> &[u8] { + match self.op_return_data.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_op_return_data(&mut self) { + self.op_return_data = ::std::option::Option::None; + } + + pub fn has_op_return_data(&self) -> bool { + self.op_return_data.is_some() + } + + // Param is passed by value, moved + pub fn set_op_return_data(&mut self, v: ::std::vec::Vec) { + self.op_return_data = ::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_op_return_data(&mut self) -> &mut ::std::vec::Vec { + if self.op_return_data.is_none() { + self.op_return_data = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.op_return_data.as_mut().unwrap() + } + + // Take field + pub fn take_op_return_data(&mut self) -> ::std::vec::Vec { + self.op_return_data.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes orig_hash = 10; + + pub fn orig_hash(&self) -> &[u8] { + match self.orig_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_orig_hash(&mut self) { + self.orig_hash = ::std::option::Option::None; + } + + pub fn has_orig_hash(&self) -> bool { + self.orig_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_orig_hash(&mut self, v: ::std::vec::Vec) { + self.orig_hash = ::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_orig_hash(&mut self) -> &mut ::std::vec::Vec { + if self.orig_hash.is_none() { + self.orig_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.orig_hash.as_mut().unwrap() + } + + // Take field + pub fn take_orig_hash(&mut self) -> ::std::vec::Vec { + self.orig_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 orig_index = 11; + + pub fn orig_index(&self) -> u32 { + self.orig_index.unwrap_or(0) + } + + pub fn clear_orig_index(&mut self) { + self.orig_index = ::std::option::Option::None; + } + + pub fn has_orig_index(&self) -> bool { + self.orig_index.is_some() + } + + // Param is passed by value, moved + pub fn set_orig_index(&mut self, v: u32) { + self.orig_index = ::std::option::Option::Some(v); + } + + // optional uint32 payment_req_index = 12; + + pub fn payment_req_index(&self) -> u32 { + self.payment_req_index.unwrap_or(0) + } + + pub fn clear_payment_req_index(&mut self) { + self.payment_req_index = ::std::option::Option::None; + } + + pub fn has_payment_req_index(&self) -> bool { + self.payment_req_index.is_some() + } + + // Param is passed by value, moved + pub fn set_payment_req_index(&mut self, v: u32) { + self.payment_req_index = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(9); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &TxOutput| { &m.address }, + |m: &mut TxOutput| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &TxOutput| { &m.address_n }, + |m: &mut TxOutput| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &TxOutput| { &m.amount }, + |m: &mut TxOutput| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_type", + |m: &TxOutput| { &m.script_type }, + |m: &mut TxOutput| { &mut m.script_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, MultisigRedeemScriptType>( + "multisig", + |m: &TxOutput| { &m.multisig }, + |m: &mut TxOutput| { &mut m.multisig }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "op_return_data", + |m: &TxOutput| { &m.op_return_data }, + |m: &mut TxOutput| { &mut m.op_return_data }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "orig_hash", + |m: &TxOutput| { &m.orig_hash }, + |m: &mut TxOutput| { &mut m.orig_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "orig_index", + |m: &TxOutput| { &m.orig_index }, + |m: &mut TxOutput| { &mut m.orig_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "payment_req_index", + |m: &TxOutput| { &m.payment_req_index }, + |m: &mut TxOutput| { &mut m.payment_req_index }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxOutput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TxOutput { + const NAME: &'static str = "TxOutput"; + + fn is_initialized(&self) -> bool { + if self.amount.is_none() { + return false; + } + for v in &self.multisig { + if !v.is_initialized() { + 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_string()?); + }, + 18 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 16 => { + self.address_n.push(is.read_uint32()?); + }, + 24 => { + self.amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 32 => { + self.script_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 42 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.multisig)?; + }, + 50 => { + self.op_return_data = ::std::option::Option::Some(is.read_bytes()?); + }, + 82 => { + self.orig_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 88 => { + self.orig_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 96 => { + self.payment_req_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 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::string_size(1, &v); + } + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(2, *value); + }; + if let Some(v) = self.amount { + my_size += ::protobuf::rt::uint64_size(3, v); + } + if let Some(v) = self.script_type { + my_size += ::protobuf::rt::int32_size(4, v.value()); + } + if let Some(v) = self.multisig.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.op_return_data.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &v); + } + if let Some(v) = self.orig_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(10, &v); + } + if let Some(v) = self.orig_index { + my_size += ::protobuf::rt::uint32_size(11, v); + } + if let Some(v) = self.payment_req_index { + my_size += ::protobuf::rt::uint32_size(12, 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_string(1, v)?; + } + for v in &self.address_n { + os.write_uint32(2, *v)?; + }; + if let Some(v) = self.amount { + os.write_uint64(3, v)?; + } + if let Some(v) = self.script_type { + os.write_enum(4, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.multisig.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + } + if let Some(v) = self.op_return_data.as_ref() { + os.write_bytes(6, v)?; + } + if let Some(v) = self.orig_hash.as_ref() { + os.write_bytes(10, v)?; + } + if let Some(v) = self.orig_index { + os.write_uint32(11, v)?; + } + if let Some(v) = self.payment_req_index { + os.write_uint32(12, 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() -> TxOutput { + TxOutput::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.address_n.clear(); + self.amount = ::std::option::Option::None; + self.script_type = ::std::option::Option::None; + self.multisig.clear(); + self.op_return_data = ::std::option::Option::None; + self.orig_hash = ::std::option::Option::None; + self.orig_index = ::std::option::Option::None; + self.payment_req_index = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxOutput { + static instance: TxOutput = TxOutput { + address: ::std::option::Option::None, + address_n: ::std::vec::Vec::new(), + amount: ::std::option::Option::None, + script_type: ::std::option::Option::None, + multisig: ::protobuf::MessageField::none(), + op_return_data: ::std::option::Option::None, + orig_hash: ::std::option::Option::None, + orig_index: ::std::option::Option::None, + payment_req_index: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TxOutput { + 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("TxOutput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TxOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxOutput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.PrevTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct PrevTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevTx.version) + pub version: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevTx.lock_time) + pub lock_time: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevTx.inputs_count) + pub inputs_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevTx.outputs_count) + pub outputs_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevTx.extra_data_len) + pub extra_data_len: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevTx.expiry) + pub expiry: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevTx.version_group_id) + pub version_group_id: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevTx.timestamp) + pub timestamp: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevTx.branch_id) + pub branch_id: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.PrevTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a PrevTx { + fn default() -> &'a PrevTx { + ::default_instance() + } +} + +impl PrevTx { + pub fn new() -> PrevTx { + ::std::default::Default::default() + } + + // required uint32 version = 1; + + pub fn version(&self) -> u32 { + self.version.unwrap_or(0) + } + + pub fn clear_version(&mut self) { + self.version = ::std::option::Option::None; + } + + pub fn has_version(&self) -> bool { + self.version.is_some() + } + + // Param is passed by value, moved + pub fn set_version(&mut self, v: u32) { + self.version = ::std::option::Option::Some(v); + } + + // required uint32 lock_time = 4; + + pub fn lock_time(&self) -> u32 { + self.lock_time.unwrap_or(0) + } + + pub fn clear_lock_time(&mut self) { + self.lock_time = ::std::option::Option::None; + } + + pub fn has_lock_time(&self) -> bool { + self.lock_time.is_some() + } + + // Param is passed by value, moved + pub fn set_lock_time(&mut self, v: u32) { + self.lock_time = ::std::option::Option::Some(v); + } + + // required uint32 inputs_count = 6; + + pub fn inputs_count(&self) -> u32 { + self.inputs_count.unwrap_or(0) + } + + pub fn clear_inputs_count(&mut self) { + self.inputs_count = ::std::option::Option::None; + } + + pub fn has_inputs_count(&self) -> bool { + self.inputs_count.is_some() + } + + // Param is passed by value, moved + pub fn set_inputs_count(&mut self, v: u32) { + self.inputs_count = ::std::option::Option::Some(v); + } + + // required uint32 outputs_count = 7; + + pub fn outputs_count(&self) -> u32 { + self.outputs_count.unwrap_or(0) + } + + pub fn clear_outputs_count(&mut self) { + self.outputs_count = ::std::option::Option::None; + } + + pub fn has_outputs_count(&self) -> bool { + self.outputs_count.is_some() + } + + // Param is passed by value, moved + pub fn set_outputs_count(&mut self, v: u32) { + self.outputs_count = ::std::option::Option::Some(v); + } + + // optional uint32 extra_data_len = 9; + + pub fn extra_data_len(&self) -> u32 { + self.extra_data_len.unwrap_or(0u32) + } + + pub fn clear_extra_data_len(&mut self) { + self.extra_data_len = ::std::option::Option::None; + } + + pub fn has_extra_data_len(&self) -> bool { + self.extra_data_len.is_some() + } + + // Param is passed by value, moved + pub fn set_extra_data_len(&mut self, v: u32) { + self.extra_data_len = ::std::option::Option::Some(v); + } + + // optional uint32 expiry = 10; + + pub fn expiry(&self) -> u32 { + self.expiry.unwrap_or(0) + } + + pub fn clear_expiry(&mut self) { + self.expiry = ::std::option::Option::None; + } + + pub fn has_expiry(&self) -> bool { + self.expiry.is_some() + } + + // Param is passed by value, moved + pub fn set_expiry(&mut self, v: u32) { + self.expiry = ::std::option::Option::Some(v); + } + + // optional uint32 version_group_id = 12; + + pub fn version_group_id(&self) -> u32 { + self.version_group_id.unwrap_or(0) + } + + pub fn clear_version_group_id(&mut self) { + self.version_group_id = ::std::option::Option::None; + } + + pub fn has_version_group_id(&self) -> bool { + self.version_group_id.is_some() + } + + // Param is passed by value, moved + pub fn set_version_group_id(&mut self, v: u32) { + self.version_group_id = ::std::option::Option::Some(v); + } + + // optional uint32 timestamp = 13; + + pub fn timestamp(&self) -> u32 { + self.timestamp.unwrap_or(0) + } + + pub fn clear_timestamp(&mut self) { + self.timestamp = ::std::option::Option::None; + } + + pub fn has_timestamp(&self) -> bool { + self.timestamp.is_some() + } + + // Param is passed by value, moved + pub fn set_timestamp(&mut self, v: u32) { + self.timestamp = ::std::option::Option::Some(v); + } + + // optional uint32 branch_id = 14; + + pub fn branch_id(&self) -> u32 { + self.branch_id.unwrap_or(0) + } + + pub fn clear_branch_id(&mut self) { + self.branch_id = ::std::option::Option::None; + } + + pub fn has_branch_id(&self) -> bool { + self.branch_id.is_some() + } + + // Param is passed by value, moved + pub fn set_branch_id(&mut self, v: u32) { + self.branch_id = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(9); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "version", + |m: &PrevTx| { &m.version }, + |m: &mut PrevTx| { &mut m.version }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "lock_time", + |m: &PrevTx| { &m.lock_time }, + |m: &mut PrevTx| { &mut m.lock_time }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "inputs_count", + |m: &PrevTx| { &m.inputs_count }, + |m: &mut PrevTx| { &mut m.inputs_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "outputs_count", + |m: &PrevTx| { &m.outputs_count }, + |m: &mut PrevTx| { &mut m.outputs_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "extra_data_len", + |m: &PrevTx| { &m.extra_data_len }, + |m: &mut PrevTx| { &mut m.extra_data_len }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "expiry", + |m: &PrevTx| { &m.expiry }, + |m: &mut PrevTx| { &mut m.expiry }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "version_group_id", + |m: &PrevTx| { &m.version_group_id }, + |m: &mut PrevTx| { &mut m.version_group_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "timestamp", + |m: &PrevTx| { &m.timestamp }, + |m: &mut PrevTx| { &mut m.timestamp }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "branch_id", + |m: &PrevTx| { &m.branch_id }, + |m: &mut PrevTx| { &mut m.branch_id }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "PrevTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for PrevTx { + const NAME: &'static str = "PrevTx"; + + fn is_initialized(&self) -> bool { + if self.version.is_none() { + return false; + } + if self.lock_time.is_none() { + return false; + } + if self.inputs_count.is_none() { + return false; + } + if self.outputs_count.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.version = ::std::option::Option::Some(is.read_uint32()?); + }, + 32 => { + self.lock_time = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.inputs_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 56 => { + self.outputs_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 72 => { + self.extra_data_len = ::std::option::Option::Some(is.read_uint32()?); + }, + 80 => { + self.expiry = ::std::option::Option::Some(is.read_uint32()?); + }, + 96 => { + self.version_group_id = ::std::option::Option::Some(is.read_uint32()?); + }, + 104 => { + self.timestamp = ::std::option::Option::Some(is.read_uint32()?); + }, + 112 => { + self.branch_id = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.version { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.lock_time { + my_size += ::protobuf::rt::uint32_size(4, v); + } + if let Some(v) = self.inputs_count { + my_size += ::protobuf::rt::uint32_size(6, v); + } + if let Some(v) = self.outputs_count { + my_size += ::protobuf::rt::uint32_size(7, v); + } + if let Some(v) = self.extra_data_len { + my_size += ::protobuf::rt::uint32_size(9, v); + } + if let Some(v) = self.expiry { + my_size += ::protobuf::rt::uint32_size(10, v); + } + if let Some(v) = self.version_group_id { + my_size += ::protobuf::rt::uint32_size(12, v); + } + if let Some(v) = self.timestamp { + my_size += ::protobuf::rt::uint32_size(13, v); + } + if let Some(v) = self.branch_id { + my_size += ::protobuf::rt::uint32_size(14, 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.version { + os.write_uint32(1, v)?; + } + if let Some(v) = self.lock_time { + os.write_uint32(4, v)?; + } + if let Some(v) = self.inputs_count { + os.write_uint32(6, v)?; + } + if let Some(v) = self.outputs_count { + os.write_uint32(7, v)?; + } + if let Some(v) = self.extra_data_len { + os.write_uint32(9, v)?; + } + if let Some(v) = self.expiry { + os.write_uint32(10, v)?; + } + if let Some(v) = self.version_group_id { + os.write_uint32(12, v)?; + } + if let Some(v) = self.timestamp { + os.write_uint32(13, v)?; + } + if let Some(v) = self.branch_id { + os.write_uint32(14, 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() -> PrevTx { + PrevTx::new() + } + + fn clear(&mut self) { + self.version = ::std::option::Option::None; + self.lock_time = ::std::option::Option::None; + self.inputs_count = ::std::option::Option::None; + self.outputs_count = ::std::option::Option::None; + self.extra_data_len = ::std::option::Option::None; + self.expiry = ::std::option::Option::None; + self.version_group_id = ::std::option::Option::None; + self.timestamp = ::std::option::Option::None; + self.branch_id = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static PrevTx { + static instance: PrevTx = PrevTx { + version: ::std::option::Option::None, + lock_time: ::std::option::Option::None, + inputs_count: ::std::option::Option::None, + outputs_count: ::std::option::Option::None, + extra_data_len: ::std::option::Option::None, + expiry: ::std::option::Option::None, + version_group_id: ::std::option::Option::None, + timestamp: ::std::option::Option::None, + branch_id: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for PrevTx { + 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("PrevTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for PrevTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PrevTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.PrevInput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct PrevInput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevInput.prev_hash) + pub prev_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevInput.prev_index) + pub prev_index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevInput.script_sig) + pub script_sig: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevInput.sequence) + pub sequence: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevInput.decred_tree) + pub decred_tree: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.PrevInput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a PrevInput { + fn default() -> &'a PrevInput { + ::default_instance() + } +} + +impl PrevInput { + pub fn new() -> PrevInput { + ::std::default::Default::default() + } + + // required bytes prev_hash = 2; + + pub fn prev_hash(&self) -> &[u8] { + match self.prev_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_prev_hash(&mut self) { + self.prev_hash = ::std::option::Option::None; + } + + pub fn has_prev_hash(&self) -> bool { + self.prev_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_hash(&mut self, v: ::std::vec::Vec) { + self.prev_hash = ::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_prev_hash(&mut self) -> &mut ::std::vec::Vec { + if self.prev_hash.is_none() { + self.prev_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.prev_hash.as_mut().unwrap() + } + + // Take field + pub fn take_prev_hash(&mut self) -> ::std::vec::Vec { + self.prev_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint32 prev_index = 3; + + pub fn prev_index(&self) -> u32 { + self.prev_index.unwrap_or(0) + } + + pub fn clear_prev_index(&mut self) { + self.prev_index = ::std::option::Option::None; + } + + pub fn has_prev_index(&self) -> bool { + self.prev_index.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_index(&mut self, v: u32) { + self.prev_index = ::std::option::Option::Some(v); + } + + // required bytes script_sig = 4; + + pub fn script_sig(&self) -> &[u8] { + match self.script_sig.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_script_sig(&mut self) { + self.script_sig = ::std::option::Option::None; + } + + pub fn has_script_sig(&self) -> bool { + self.script_sig.is_some() + } + + // Param is passed by value, moved + pub fn set_script_sig(&mut self, v: ::std::vec::Vec) { + self.script_sig = ::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_script_sig(&mut self) -> &mut ::std::vec::Vec { + if self.script_sig.is_none() { + self.script_sig = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.script_sig.as_mut().unwrap() + } + + // Take field + pub fn take_script_sig(&mut self) -> ::std::vec::Vec { + self.script_sig.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint32 sequence = 5; + + pub fn sequence(&self) -> u32 { + self.sequence.unwrap_or(0) + } + + pub fn clear_sequence(&mut self) { + self.sequence = ::std::option::Option::None; + } + + pub fn has_sequence(&self) -> bool { + self.sequence.is_some() + } + + // Param is passed by value, moved + pub fn set_sequence(&mut self, v: u32) { + self.sequence = ::std::option::Option::Some(v); + } + + // optional uint32 decred_tree = 9; + + pub fn decred_tree(&self) -> u32 { + self.decred_tree.unwrap_or(0) + } + + pub fn clear_decred_tree(&mut self) { + self.decred_tree = ::std::option::Option::None; + } + + pub fn has_decred_tree(&self) -> bool { + self.decred_tree.is_some() + } + + // Param is passed by value, moved + pub fn set_decred_tree(&mut self, v: u32) { + self.decred_tree = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "prev_hash", + |m: &PrevInput| { &m.prev_hash }, + |m: &mut PrevInput| { &mut m.prev_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "prev_index", + |m: &PrevInput| { &m.prev_index }, + |m: &mut PrevInput| { &mut m.prev_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_sig", + |m: &PrevInput| { &m.script_sig }, + |m: &mut PrevInput| { &mut m.script_sig }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sequence", + |m: &PrevInput| { &m.sequence }, + |m: &mut PrevInput| { &mut m.sequence }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "decred_tree", + |m: &PrevInput| { &m.decred_tree }, + |m: &mut PrevInput| { &mut m.decred_tree }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "PrevInput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for PrevInput { + const NAME: &'static str = "PrevInput"; + + fn is_initialized(&self) -> bool { + if self.prev_hash.is_none() { + return false; + } + if self.prev_index.is_none() { + return false; + } + if self.script_sig.is_none() { + return false; + } + if self.sequence.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 { + 18 => { + self.prev_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.prev_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 34 => { + self.script_sig = ::std::option::Option::Some(is.read_bytes()?); + }, + 40 => { + self.sequence = ::std::option::Option::Some(is.read_uint32()?); + }, + 72 => { + self.decred_tree = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.prev_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.prev_index { + my_size += ::protobuf::rt::uint32_size(3, v); + } + if let Some(v) = self.script_sig.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.sequence { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.decred_tree { + my_size += ::protobuf::rt::uint32_size(9, 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.prev_hash.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.prev_index { + os.write_uint32(3, v)?; + } + if let Some(v) = self.script_sig.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.sequence { + os.write_uint32(5, v)?; + } + if let Some(v) = self.decred_tree { + os.write_uint32(9, 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() -> PrevInput { + PrevInput::new() + } + + fn clear(&mut self) { + self.prev_hash = ::std::option::Option::None; + self.prev_index = ::std::option::Option::None; + self.script_sig = ::std::option::Option::None; + self.sequence = ::std::option::Option::None; + self.decred_tree = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static PrevInput { + static instance: PrevInput = PrevInput { + prev_hash: ::std::option::Option::None, + prev_index: ::std::option::Option::None, + script_sig: ::std::option::Option::None, + sequence: ::std::option::Option::None, + decred_tree: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for PrevInput { + 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("PrevInput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for PrevInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PrevInput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.PrevOutput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct PrevOutput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevOutput.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevOutput.script_pubkey) + pub script_pubkey: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.PrevOutput.decred_script_version) + pub decred_script_version: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.PrevOutput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a PrevOutput { + fn default() -> &'a PrevOutput { + ::default_instance() + } +} + +impl PrevOutput { + pub fn new() -> PrevOutput { + ::std::default::Default::default() + } + + // required uint64 amount = 1; + + pub fn amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + // required bytes script_pubkey = 2; + + pub fn script_pubkey(&self) -> &[u8] { + match self.script_pubkey.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_script_pubkey(&mut self) { + self.script_pubkey = ::std::option::Option::None; + } + + pub fn has_script_pubkey(&self) -> bool { + self.script_pubkey.is_some() + } + + // Param is passed by value, moved + pub fn set_script_pubkey(&mut self, v: ::std::vec::Vec) { + self.script_pubkey = ::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_script_pubkey(&mut self) -> &mut ::std::vec::Vec { + if self.script_pubkey.is_none() { + self.script_pubkey = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.script_pubkey.as_mut().unwrap() + } + + // Take field + pub fn take_script_pubkey(&mut self) -> ::std::vec::Vec { + self.script_pubkey.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 decred_script_version = 3; + + pub fn decred_script_version(&self) -> u32 { + self.decred_script_version.unwrap_or(0) + } + + pub fn clear_decred_script_version(&mut self) { + self.decred_script_version = ::std::option::Option::None; + } + + pub fn has_decred_script_version(&self) -> bool { + self.decred_script_version.is_some() + } + + // Param is passed by value, moved + pub fn set_decred_script_version(&mut self, v: u32) { + self.decred_script_version = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &PrevOutput| { &m.amount }, + |m: &mut PrevOutput| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_pubkey", + |m: &PrevOutput| { &m.script_pubkey }, + |m: &mut PrevOutput| { &mut m.script_pubkey }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "decred_script_version", + |m: &PrevOutput| { &m.decred_script_version }, + |m: &mut PrevOutput| { &mut m.decred_script_version }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "PrevOutput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for PrevOutput { + const NAME: &'static str = "PrevOutput"; + + fn is_initialized(&self) -> bool { + if self.amount.is_none() { + return false; + } + if self.script_pubkey.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.amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 18 => { + self.script_pubkey = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.decred_script_version = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.amount { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.script_pubkey.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.decred_script_version { + my_size += ::protobuf::rt::uint32_size(3, 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.amount { + os.write_uint64(1, v)?; + } + if let Some(v) = self.script_pubkey.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.decred_script_version { + os.write_uint32(3, 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() -> PrevOutput { + PrevOutput::new() + } + + fn clear(&mut self) { + self.amount = ::std::option::Option::None; + self.script_pubkey = ::std::option::Option::None; + self.decred_script_version = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static PrevOutput { + static instance: PrevOutput = PrevOutput { + amount: ::std::option::Option::None, + script_pubkey: ::std::option::Option::None, + decred_script_version: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for PrevOutput { + 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("PrevOutput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for PrevOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PrevOutput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAckPaymentRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TxAckPaymentRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.nonce) + pub nonce: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.recipient_name) + pub recipient_name: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.memos) + pub memos: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TxAckPaymentRequest { + fn default() -> &'a TxAckPaymentRequest { + ::default_instance() + } +} + +impl TxAckPaymentRequest { + pub fn new() -> TxAckPaymentRequest { + ::std::default::Default::default() + } + + // optional bytes nonce = 1; + + pub fn nonce(&self) -> &[u8] { + match self.nonce.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_nonce(&mut self) { + self.nonce = ::std::option::Option::None; + } + + pub fn has_nonce(&self) -> bool { + self.nonce.is_some() + } + + // Param is passed by value, moved + pub fn set_nonce(&mut self, v: ::std::vec::Vec) { + self.nonce = ::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_nonce(&mut self) -> &mut ::std::vec::Vec { + if self.nonce.is_none() { + self.nonce = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.nonce.as_mut().unwrap() + } + + // Take field + pub fn take_nonce(&mut self) -> ::std::vec::Vec { + self.nonce.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required string recipient_name = 2; + + pub fn recipient_name(&self) -> &str { + match self.recipient_name.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_recipient_name(&mut self) { + self.recipient_name = ::std::option::Option::None; + } + + pub fn has_recipient_name(&self) -> bool { + self.recipient_name.is_some() + } + + // Param is passed by value, moved + pub fn set_recipient_name(&mut self, v: ::std::string::String) { + self.recipient_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_recipient_name(&mut self) -> &mut ::std::string::String { + if self.recipient_name.is_none() { + self.recipient_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.recipient_name.as_mut().unwrap() + } + + // Take field + pub fn take_recipient_name(&mut self) -> ::std::string::String { + self.recipient_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint64 amount = 4; + + pub fn amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + // required bytes signature = 5; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::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::<_, _>( + "nonce", + |m: &TxAckPaymentRequest| { &m.nonce }, + |m: &mut TxAckPaymentRequest| { &mut m.nonce }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "recipient_name", + |m: &TxAckPaymentRequest| { &m.recipient_name }, + |m: &mut TxAckPaymentRequest| { &mut m.recipient_name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "memos", + |m: &TxAckPaymentRequest| { &m.memos }, + |m: &mut TxAckPaymentRequest| { &mut m.memos }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &TxAckPaymentRequest| { &m.amount }, + |m: &mut TxAckPaymentRequest| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &TxAckPaymentRequest| { &m.signature }, + |m: &mut TxAckPaymentRequest| { &mut m.signature }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAckPaymentRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TxAckPaymentRequest { + const NAME: &'static str = "TxAckPaymentRequest"; + + fn is_initialized(&self) -> bool { + if self.recipient_name.is_none() { + return false; + } + if self.signature.is_none() { + return false; + } + for v in &self.memos { + if !v.is_initialized() { + 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.nonce = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.recipient_name = ::std::option::Option::Some(is.read_string()?); + }, + 26 => { + self.memos.push(is.read_message()?); + }, + 32 => { + self.amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 42 => { + self.signature = ::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.nonce.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.recipient_name.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + for value in &self.memos { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + if let Some(v) = self.amount { + my_size += ::protobuf::rt::uint64_size(4, v); + } + if let Some(v) = self.signature.as_ref() { + my_size += ::protobuf::rt::bytes_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.nonce.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.recipient_name.as_ref() { + os.write_string(2, v)?; + } + for v in &self.memos { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + }; + if let Some(v) = self.amount { + os.write_uint64(4, v)?; + } + if let Some(v) = self.signature.as_ref() { + os.write_bytes(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() -> TxAckPaymentRequest { + TxAckPaymentRequest::new() + } + + fn clear(&mut self) { + self.nonce = ::std::option::Option::None; + self.recipient_name = ::std::option::Option::None; + self.memos.clear(); + self.amount = ::std::option::Option::None; + self.signature = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxAckPaymentRequest { + static instance: TxAckPaymentRequest = TxAckPaymentRequest { + nonce: ::std::option::Option::None, + recipient_name: ::std::option::Option::None, + memos: ::std::vec::Vec::new(), + amount: ::std::option::Option::None, + signature: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TxAckPaymentRequest { + 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("TxAckPaymentRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TxAckPaymentRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxAckPaymentRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `TxAckPaymentRequest` +pub mod tx_ack_payment_request { + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAckPaymentRequest.PaymentRequestMemo) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct PaymentRequestMemo { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.PaymentRequestMemo.text_memo) + pub text_memo: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.PaymentRequestMemo.refund_memo) + pub refund_memo: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.PaymentRequestMemo.coin_purchase_memo) + pub coin_purchase_memo: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.PaymentRequestMemo.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a PaymentRequestMemo { + fn default() -> &'a PaymentRequestMemo { + ::default_instance() + } + } + + impl PaymentRequestMemo { + pub fn new() -> PaymentRequestMemo { + ::std::default::Default::default() + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, TextMemo>( + "text_memo", + |m: &PaymentRequestMemo| { &m.text_memo }, + |m: &mut PaymentRequestMemo| { &mut m.text_memo }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, RefundMemo>( + "refund_memo", + |m: &PaymentRequestMemo| { &m.refund_memo }, + |m: &mut PaymentRequestMemo| { &mut m.refund_memo }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, CoinPurchaseMemo>( + "coin_purchase_memo", + |m: &PaymentRequestMemo| { &m.coin_purchase_memo }, + |m: &mut PaymentRequestMemo| { &mut m.coin_purchase_memo }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAckPaymentRequest.PaymentRequestMemo", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for PaymentRequestMemo { + const NAME: &'static str = "PaymentRequestMemo"; + + fn is_initialized(&self) -> bool { + for v in &self.text_memo { + if !v.is_initialized() { + return false; + } + }; + for v in &self.refund_memo { + if !v.is_initialized() { + return false; + } + }; + for v in &self.coin_purchase_memo { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.text_memo)?; + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.refund_memo)?; + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.coin_purchase_memo)?; + }, + 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.text_memo.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.refund_memo.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.coin_purchase_memo.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.text_memo.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.refund_memo.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + if let Some(v) = self.coin_purchase_memo.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + 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() -> PaymentRequestMemo { + PaymentRequestMemo::new() + } + + fn clear(&mut self) { + self.text_memo.clear(); + self.refund_memo.clear(); + self.coin_purchase_memo.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static PaymentRequestMemo { + static instance: PaymentRequestMemo = PaymentRequestMemo { + text_memo: ::protobuf::MessageField::none(), + refund_memo: ::protobuf::MessageField::none(), + coin_purchase_memo: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for PaymentRequestMemo { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TxAckPaymentRequest.PaymentRequestMemo").unwrap()).clone() + } + } + + impl ::std::fmt::Display for PaymentRequestMemo { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for PaymentRequestMemo { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAckPaymentRequest.TextMemo) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TextMemo { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.TextMemo.text) + pub text: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.TextMemo.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TextMemo { + fn default() -> &'a TextMemo { + ::default_instance() + } + } + + impl TextMemo { + pub fn new() -> TextMemo { + ::std::default::Default::default() + } + + // required string text = 1; + + pub fn text(&self) -> &str { + match self.text.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_text(&mut self) { + self.text = ::std::option::Option::None; + } + + pub fn has_text(&self) -> bool { + self.text.is_some() + } + + // Param is passed by value, moved + pub fn set_text(&mut self, v: ::std::string::String) { + self.text = ::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_text(&mut self) -> &mut ::std::string::String { + if self.text.is_none() { + self.text = ::std::option::Option::Some(::std::string::String::new()); + } + self.text.as_mut().unwrap() + } + + // Take field + pub fn take_text(&mut self) -> ::std::string::String { + self.text.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "text", + |m: &TextMemo| { &m.text }, + |m: &mut TextMemo| { &mut m.text }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAckPaymentRequest.TextMemo", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TextMemo { + const NAME: &'static str = "TextMemo"; + + fn is_initialized(&self) -> bool { + if self.text.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.text = ::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.text.as_ref() { + my_size += ::protobuf::rt::string_size(1, &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.text.as_ref() { + os.write_string(1, 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() -> TextMemo { + TextMemo::new() + } + + fn clear(&mut self) { + self.text = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TextMemo { + static instance: TextMemo = TextMemo { + text: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TextMemo { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TxAckPaymentRequest.TextMemo").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TextMemo { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TextMemo { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAckPaymentRequest.RefundMemo) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct RefundMemo { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.RefundMemo.address) + pub address: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.RefundMemo.mac) + pub mac: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.RefundMemo.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a RefundMemo { + fn default() -> &'a RefundMemo { + ::default_instance() + } + } + + impl RefundMemo { + pub fn new() -> RefundMemo { + ::std::default::Default::default() + } + + // required string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required bytes mac = 2; + + pub fn mac(&self) -> &[u8] { + match self.mac.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_mac(&mut self) { + self.mac = ::std::option::Option::None; + } + + pub fn has_mac(&self) -> bool { + self.mac.is_some() + } + + // Param is passed by value, moved + pub fn set_mac(&mut self, v: ::std::vec::Vec) { + self.mac = ::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_mac(&mut self) -> &mut ::std::vec::Vec { + if self.mac.is_none() { + self.mac = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.mac.as_mut().unwrap() + } + + // Take field + pub fn take_mac(&mut self) -> ::std::vec::Vec { + self.mac.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) 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::<_, _>( + "address", + |m: &RefundMemo| { &m.address }, + |m: &mut RefundMemo| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "mac", + |m: &RefundMemo| { &m.mac }, + |m: &mut RefundMemo| { &mut m.mac }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAckPaymentRequest.RefundMemo", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for RefundMemo { + const NAME: &'static str = "RefundMemo"; + + fn is_initialized(&self) -> bool { + if self.address.is_none() { + return false; + } + if self.mac.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_string()?); + }, + 18 => { + self.mac = ::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.address.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.mac.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.address.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.mac.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() -> RefundMemo { + RefundMemo::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.mac = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static RefundMemo { + static instance: RefundMemo = RefundMemo { + address: ::std::option::Option::None, + mac: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for RefundMemo { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TxAckPaymentRequest.RefundMemo").unwrap()).clone() + } + } + + impl ::std::fmt::Display for RefundMemo { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for RefundMemo { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAckPaymentRequest.CoinPurchaseMemo) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct CoinPurchaseMemo { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.CoinPurchaseMemo.coin_type) + pub coin_type: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.CoinPurchaseMemo.amount) + pub amount: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.CoinPurchaseMemo.address) + pub address: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.CoinPurchaseMemo.mac) + pub mac: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAckPaymentRequest.CoinPurchaseMemo.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a CoinPurchaseMemo { + fn default() -> &'a CoinPurchaseMemo { + ::default_instance() + } + } + + impl CoinPurchaseMemo { + pub fn new() -> CoinPurchaseMemo { + ::std::default::Default::default() + } + + // required uint32 coin_type = 1; + + pub fn coin_type(&self) -> u32 { + self.coin_type.unwrap_or(0) + } + + pub fn clear_coin_type(&mut self) { + self.coin_type = ::std::option::Option::None; + } + + pub fn has_coin_type(&self) -> bool { + self.coin_type.is_some() + } + + // Param is passed by value, moved + pub fn set_coin_type(&mut self, v: u32) { + self.coin_type = ::std::option::Option::Some(v); + } + + // required string amount = 2; + + pub fn amount(&self) -> &str { + match self.amount.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: ::std::string::String) { + self.amount = ::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_amount(&mut self) -> &mut ::std::string::String { + if self.amount.is_none() { + self.amount = ::std::option::Option::Some(::std::string::String::new()); + } + self.amount.as_mut().unwrap() + } + + // Take field + pub fn take_amount(&mut self) -> ::std::string::String { + self.amount.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required string address = 3; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required bytes mac = 4; + + pub fn mac(&self) -> &[u8] { + match self.mac.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_mac(&mut self) { + self.mac = ::std::option::Option::None; + } + + pub fn has_mac(&self) -> bool { + self.mac.is_some() + } + + // Param is passed by value, moved + pub fn set_mac(&mut self, v: ::std::vec::Vec) { + self.mac = ::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_mac(&mut self) -> &mut ::std::vec::Vec { + if self.mac.is_none() { + self.mac = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.mac.as_mut().unwrap() + } + + // Take field + pub fn take_mac(&mut self) -> ::std::vec::Vec { + self.mac.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) 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::<_, _>( + "coin_type", + |m: &CoinPurchaseMemo| { &m.coin_type }, + |m: &mut CoinPurchaseMemo| { &mut m.coin_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &CoinPurchaseMemo| { &m.amount }, + |m: &mut CoinPurchaseMemo| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &CoinPurchaseMemo| { &m.address }, + |m: &mut CoinPurchaseMemo| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "mac", + |m: &CoinPurchaseMemo| { &m.mac }, + |m: &mut CoinPurchaseMemo| { &mut m.mac }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAckPaymentRequest.CoinPurchaseMemo", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for CoinPurchaseMemo { + const NAME: &'static str = "CoinPurchaseMemo"; + + fn is_initialized(&self) -> bool { + if self.coin_type.is_none() { + return false; + } + if self.amount.is_none() { + return false; + } + if self.address.is_none() { + return false; + } + if self.mac.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.coin_type = ::std::option::Option::Some(is.read_uint32()?); + }, + 18 => { + self.amount = ::std::option::Option::Some(is.read_string()?); + }, + 26 => { + self.address = ::std::option::Option::Some(is.read_string()?); + }, + 34 => { + self.mac = ::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.coin_type { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.amount.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.address.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.mac.as_ref() { + my_size += ::protobuf::rt::bytes_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.coin_type { + os.write_uint32(1, v)?; + } + if let Some(v) = self.amount.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.address.as_ref() { + os.write_string(3, v)?; + } + if let Some(v) = self.mac.as_ref() { + os.write_bytes(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() -> CoinPurchaseMemo { + CoinPurchaseMemo::new() + } + + fn clear(&mut self) { + self.coin_type = ::std::option::Option::None; + self.amount = ::std::option::Option::None; + self.address = ::std::option::Option::None; + self.mac = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CoinPurchaseMemo { + static instance: CoinPurchaseMemo = CoinPurchaseMemo { + coin_type: ::std::option::Option::None, + amount: ::std::option::Option::None, + address: ::std::option::Option::None, + mac: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for CoinPurchaseMemo { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TxAckPaymentRequest.CoinPurchaseMemo").unwrap()).clone() + } + } + + impl ::std::fmt::Display for CoinPurchaseMemo { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for CoinPurchaseMemo { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAckInput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TxAckInput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckInput.tx) + pub tx: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAckInput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TxAckInput { + fn default() -> &'a TxAckInput { + ::default_instance() + } +} + +impl TxAckInput { + pub fn new() -> TxAckInput { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, tx_ack_input::TxAckInputWrapper>( + "tx", + |m: &TxAckInput| { &m.tx }, + |m: &mut TxAckInput| { &mut m.tx }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAckInput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TxAckInput { + const NAME: &'static str = "TxAckInput"; + + fn is_initialized(&self) -> bool { + if self.tx.is_none() { + return false; + } + for v in &self.tx { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.tx)?; + }, + 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.tx.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.tx.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + 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() -> TxAckInput { + TxAckInput::new() + } + + fn clear(&mut self) { + self.tx.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxAckInput { + static instance: TxAckInput = TxAckInput { + tx: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TxAckInput { + 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("TxAckInput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TxAckInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxAckInput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `TxAckInput` +pub mod tx_ack_input { + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAckInput.TxAckInputWrapper) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TxAckInputWrapper { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckInput.TxAckInputWrapper.input) + pub input: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAckInput.TxAckInputWrapper.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TxAckInputWrapper { + fn default() -> &'a TxAckInputWrapper { + ::default_instance() + } + } + + impl TxAckInputWrapper { + pub fn new() -> TxAckInputWrapper { + ::std::default::Default::default() + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::TxInput>( + "input", + |m: &TxAckInputWrapper| { &m.input }, + |m: &mut TxAckInputWrapper| { &mut m.input }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAckInput.TxAckInputWrapper", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TxAckInputWrapper { + const NAME: &'static str = "TxAckInputWrapper"; + + fn is_initialized(&self) -> bool { + if self.input.is_none() { + return false; + } + for v in &self.input { + if !v.is_initialized() { + 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 { + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.input)?; + }, + 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.input.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.input.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + 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() -> TxAckInputWrapper { + TxAckInputWrapper::new() + } + + fn clear(&mut self) { + self.input.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxAckInputWrapper { + static instance: TxAckInputWrapper = TxAckInputWrapper { + input: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TxAckInputWrapper { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TxAckInput.TxAckInputWrapper").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TxAckInputWrapper { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TxAckInputWrapper { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAckOutput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TxAckOutput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckOutput.tx) + pub tx: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAckOutput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TxAckOutput { + fn default() -> &'a TxAckOutput { + ::default_instance() + } +} + +impl TxAckOutput { + pub fn new() -> TxAckOutput { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, tx_ack_output::TxAckOutputWrapper>( + "tx", + |m: &TxAckOutput| { &m.tx }, + |m: &mut TxAckOutput| { &mut m.tx }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAckOutput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TxAckOutput { + const NAME: &'static str = "TxAckOutput"; + + fn is_initialized(&self) -> bool { + if self.tx.is_none() { + return false; + } + for v in &self.tx { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.tx)?; + }, + 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.tx.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.tx.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + 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() -> TxAckOutput { + TxAckOutput::new() + } + + fn clear(&mut self) { + self.tx.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxAckOutput { + static instance: TxAckOutput = TxAckOutput { + tx: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TxAckOutput { + 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("TxAckOutput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TxAckOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxAckOutput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `TxAckOutput` +pub mod tx_ack_output { + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAckOutput.TxAckOutputWrapper) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TxAckOutputWrapper { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckOutput.TxAckOutputWrapper.output) + pub output: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAckOutput.TxAckOutputWrapper.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TxAckOutputWrapper { + fn default() -> &'a TxAckOutputWrapper { + ::default_instance() + } + } + + impl TxAckOutputWrapper { + pub fn new() -> TxAckOutputWrapper { + ::std::default::Default::default() + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::TxOutput>( + "output", + |m: &TxAckOutputWrapper| { &m.output }, + |m: &mut TxAckOutputWrapper| { &mut m.output }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAckOutput.TxAckOutputWrapper", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TxAckOutputWrapper { + const NAME: &'static str = "TxAckOutputWrapper"; + + fn is_initialized(&self) -> bool { + if self.output.is_none() { + return false; + } + for v in &self.output { + if !v.is_initialized() { + 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 { + 42 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.output)?; + }, + 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.output.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.output.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + } + 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() -> TxAckOutputWrapper { + TxAckOutputWrapper::new() + } + + fn clear(&mut self) { + self.output.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxAckOutputWrapper { + static instance: TxAckOutputWrapper = TxAckOutputWrapper { + output: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TxAckOutputWrapper { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TxAckOutput.TxAckOutputWrapper").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TxAckOutputWrapper { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TxAckOutputWrapper { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAckPrevMeta) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TxAckPrevMeta { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPrevMeta.tx) + pub tx: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAckPrevMeta.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TxAckPrevMeta { + fn default() -> &'a TxAckPrevMeta { + ::default_instance() + } +} + +impl TxAckPrevMeta { + pub fn new() -> TxAckPrevMeta { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, PrevTx>( + "tx", + |m: &TxAckPrevMeta| { &m.tx }, + |m: &mut TxAckPrevMeta| { &mut m.tx }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAckPrevMeta", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TxAckPrevMeta { + const NAME: &'static str = "TxAckPrevMeta"; + + fn is_initialized(&self) -> bool { + if self.tx.is_none() { + return false; + } + for v in &self.tx { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.tx)?; + }, + 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.tx.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.tx.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + 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() -> TxAckPrevMeta { + TxAckPrevMeta::new() + } + + fn clear(&mut self) { + self.tx.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxAckPrevMeta { + static instance: TxAckPrevMeta = TxAckPrevMeta { + tx: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TxAckPrevMeta { + 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("TxAckPrevMeta").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TxAckPrevMeta { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxAckPrevMeta { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAckPrevInput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TxAckPrevInput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPrevInput.tx) + pub tx: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAckPrevInput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TxAckPrevInput { + fn default() -> &'a TxAckPrevInput { + ::default_instance() + } +} + +impl TxAckPrevInput { + pub fn new() -> TxAckPrevInput { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, tx_ack_prev_input::TxAckPrevInputWrapper>( + "tx", + |m: &TxAckPrevInput| { &m.tx }, + |m: &mut TxAckPrevInput| { &mut m.tx }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAckPrevInput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TxAckPrevInput { + const NAME: &'static str = "TxAckPrevInput"; + + fn is_initialized(&self) -> bool { + if self.tx.is_none() { + return false; + } + for v in &self.tx { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.tx)?; + }, + 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.tx.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.tx.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + 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() -> TxAckPrevInput { + TxAckPrevInput::new() + } + + fn clear(&mut self) { + self.tx.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxAckPrevInput { + static instance: TxAckPrevInput = TxAckPrevInput { + tx: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TxAckPrevInput { + 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("TxAckPrevInput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TxAckPrevInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxAckPrevInput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `TxAckPrevInput` +pub mod tx_ack_prev_input { + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAckPrevInput.TxAckPrevInputWrapper) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TxAckPrevInputWrapper { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPrevInput.TxAckPrevInputWrapper.input) + pub input: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAckPrevInput.TxAckPrevInputWrapper.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TxAckPrevInputWrapper { + fn default() -> &'a TxAckPrevInputWrapper { + ::default_instance() + } + } + + impl TxAckPrevInputWrapper { + pub fn new() -> TxAckPrevInputWrapper { + ::std::default::Default::default() + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::PrevInput>( + "input", + |m: &TxAckPrevInputWrapper| { &m.input }, + |m: &mut TxAckPrevInputWrapper| { &mut m.input }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAckPrevInput.TxAckPrevInputWrapper", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TxAckPrevInputWrapper { + const NAME: &'static str = "TxAckPrevInputWrapper"; + + fn is_initialized(&self) -> bool { + if self.input.is_none() { + return false; + } + for v in &self.input { + if !v.is_initialized() { + 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 { + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.input)?; + }, + 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.input.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.input.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + 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() -> TxAckPrevInputWrapper { + TxAckPrevInputWrapper::new() + } + + fn clear(&mut self) { + self.input.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxAckPrevInputWrapper { + static instance: TxAckPrevInputWrapper = TxAckPrevInputWrapper { + input: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TxAckPrevInputWrapper { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TxAckPrevInput.TxAckPrevInputWrapper").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TxAckPrevInputWrapper { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TxAckPrevInputWrapper { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAckPrevOutput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TxAckPrevOutput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPrevOutput.tx) + pub tx: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAckPrevOutput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TxAckPrevOutput { + fn default() -> &'a TxAckPrevOutput { + ::default_instance() + } +} + +impl TxAckPrevOutput { + pub fn new() -> TxAckPrevOutput { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, tx_ack_prev_output::TxAckPrevOutputWrapper>( + "tx", + |m: &TxAckPrevOutput| { &m.tx }, + |m: &mut TxAckPrevOutput| { &mut m.tx }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAckPrevOutput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TxAckPrevOutput { + const NAME: &'static str = "TxAckPrevOutput"; + + fn is_initialized(&self) -> bool { + if self.tx.is_none() { + return false; + } + for v in &self.tx { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.tx)?; + }, + 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.tx.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.tx.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + 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() -> TxAckPrevOutput { + TxAckPrevOutput::new() + } + + fn clear(&mut self) { + self.tx.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxAckPrevOutput { + static instance: TxAckPrevOutput = TxAckPrevOutput { + tx: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TxAckPrevOutput { + 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("TxAckPrevOutput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TxAckPrevOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxAckPrevOutput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `TxAckPrevOutput` +pub mod tx_ack_prev_output { + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAckPrevOutput.TxAckPrevOutputWrapper) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TxAckPrevOutputWrapper { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPrevOutput.TxAckPrevOutputWrapper.output) + pub output: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAckPrevOutput.TxAckPrevOutputWrapper.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TxAckPrevOutputWrapper { + fn default() -> &'a TxAckPrevOutputWrapper { + ::default_instance() + } + } + + impl TxAckPrevOutputWrapper { + pub fn new() -> TxAckPrevOutputWrapper { + ::std::default::Default::default() + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::PrevOutput>( + "output", + |m: &TxAckPrevOutputWrapper| { &m.output }, + |m: &mut TxAckPrevOutputWrapper| { &mut m.output }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAckPrevOutput.TxAckPrevOutputWrapper", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TxAckPrevOutputWrapper { + const NAME: &'static str = "TxAckPrevOutputWrapper"; + + fn is_initialized(&self) -> bool { + if self.output.is_none() { + return false; + } + for v in &self.output { + if !v.is_initialized() { + 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 { + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.output)?; + }, + 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.output.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.output.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + 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() -> TxAckPrevOutputWrapper { + TxAckPrevOutputWrapper::new() + } + + fn clear(&mut self) { + self.output.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxAckPrevOutputWrapper { + static instance: TxAckPrevOutputWrapper = TxAckPrevOutputWrapper { + output: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TxAckPrevOutputWrapper { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TxAckPrevOutput.TxAckPrevOutputWrapper").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TxAckPrevOutputWrapper { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TxAckPrevOutputWrapper { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAckPrevExtraData) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TxAckPrevExtraData { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPrevExtraData.tx) + pub tx: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAckPrevExtraData.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TxAckPrevExtraData { + fn default() -> &'a TxAckPrevExtraData { + ::default_instance() + } +} + +impl TxAckPrevExtraData { + pub fn new() -> TxAckPrevExtraData { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, tx_ack_prev_extra_data::TxAckPrevExtraDataWrapper>( + "tx", + |m: &TxAckPrevExtraData| { &m.tx }, + |m: &mut TxAckPrevExtraData| { &mut m.tx }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAckPrevExtraData", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TxAckPrevExtraData { + const NAME: &'static str = "TxAckPrevExtraData"; + + fn is_initialized(&self) -> bool { + if self.tx.is_none() { + return false; + } + for v in &self.tx { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.tx)?; + }, + 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.tx.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.tx.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + 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() -> TxAckPrevExtraData { + TxAckPrevExtraData::new() + } + + fn clear(&mut self) { + self.tx.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxAckPrevExtraData { + static instance: TxAckPrevExtraData = TxAckPrevExtraData { + tx: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TxAckPrevExtraData { + 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("TxAckPrevExtraData").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TxAckPrevExtraData { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxAckPrevExtraData { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `TxAckPrevExtraData` +pub mod tx_ack_prev_extra_data { + // @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.TxAckPrevExtraData.TxAckPrevExtraDataWrapper) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TxAckPrevExtraDataWrapper { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.TxAckPrevExtraData.TxAckPrevExtraDataWrapper.extra_data_chunk) + pub extra_data_chunk: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.TxAckPrevExtraData.TxAckPrevExtraDataWrapper.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TxAckPrevExtraDataWrapper { + fn default() -> &'a TxAckPrevExtraDataWrapper { + ::default_instance() + } + } + + impl TxAckPrevExtraDataWrapper { + pub fn new() -> TxAckPrevExtraDataWrapper { + ::std::default::Default::default() + } + + // required bytes extra_data_chunk = 8; + + pub fn extra_data_chunk(&self) -> &[u8] { + match self.extra_data_chunk.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_extra_data_chunk(&mut self) { + self.extra_data_chunk = ::std::option::Option::None; + } + + pub fn has_extra_data_chunk(&self) -> bool { + self.extra_data_chunk.is_some() + } + + // Param is passed by value, moved + pub fn set_extra_data_chunk(&mut self, v: ::std::vec::Vec) { + self.extra_data_chunk = ::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_extra_data_chunk(&mut self) -> &mut ::std::vec::Vec { + if self.extra_data_chunk.is_none() { + self.extra_data_chunk = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.extra_data_chunk.as_mut().unwrap() + } + + // Take field + pub fn take_extra_data_chunk(&mut self) -> ::std::vec::Vec { + self.extra_data_chunk.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "extra_data_chunk", + |m: &TxAckPrevExtraDataWrapper| { &m.extra_data_chunk }, + |m: &mut TxAckPrevExtraDataWrapper| { &mut m.extra_data_chunk }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TxAckPrevExtraData.TxAckPrevExtraDataWrapper", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TxAckPrevExtraDataWrapper { + const NAME: &'static str = "TxAckPrevExtraDataWrapper"; + + fn is_initialized(&self) -> bool { + if self.extra_data_chunk.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 { + 66 => { + self.extra_data_chunk = ::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.extra_data_chunk.as_ref() { + my_size += ::protobuf::rt::bytes_size(8, &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.extra_data_chunk.as_ref() { + os.write_bytes(8, 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() -> TxAckPrevExtraDataWrapper { + TxAckPrevExtraDataWrapper::new() + } + + fn clear(&mut self) { + self.extra_data_chunk = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TxAckPrevExtraDataWrapper { + static instance: TxAckPrevExtraDataWrapper = TxAckPrevExtraDataWrapper { + extra_data_chunk: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TxAckPrevExtraDataWrapper { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TxAckPrevExtraData.TxAckPrevExtraDataWrapper").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TxAckPrevExtraDataWrapper { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TxAckPrevExtraDataWrapper { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.GetOwnershipProof) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct GetOwnershipProof { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetOwnershipProof.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetOwnershipProof.coin_name) + pub coin_name: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetOwnershipProof.script_type) + pub script_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetOwnershipProof.multisig) + pub multisig: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetOwnershipProof.user_confirmation) + pub user_confirmation: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetOwnershipProof.ownership_ids) + pub ownership_ids: ::std::vec::Vec<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.GetOwnershipProof.commitment_data) + pub commitment_data: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.GetOwnershipProof.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a GetOwnershipProof { + fn default() -> &'a GetOwnershipProof { + ::default_instance() + } +} + +impl GetOwnershipProof { + pub fn new() -> GetOwnershipProof { + ::std::default::Default::default() + } + + // optional string coin_name = 2; + + pub fn coin_name(&self) -> &str { + match self.coin_name.as_ref() { + Some(v) => v, + None => "Bitcoin", + } + } + + pub fn clear_coin_name(&mut self) { + self.coin_name = ::std::option::Option::None; + } + + pub fn has_coin_name(&self) -> bool { + self.coin_name.is_some() + } + + // Param is passed by value, moved + pub fn set_coin_name(&mut self, v: ::std::string::String) { + self.coin_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_coin_name(&mut self) -> &mut ::std::string::String { + if self.coin_name.is_none() { + self.coin_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.coin_name.as_mut().unwrap() + } + + // Take field + pub fn take_coin_name(&mut self) -> ::std::string::String { + self.coin_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional .hw.trezor.messages.bitcoin.InputScriptType script_type = 3; + + pub fn script_type(&self) -> InputScriptType { + match self.script_type { + Some(e) => e.enum_value_or(InputScriptType::SPENDWITNESS), + None => InputScriptType::SPENDWITNESS, + } + } + + pub fn clear_script_type(&mut self) { + self.script_type = ::std::option::Option::None; + } + + pub fn has_script_type(&self) -> bool { + self.script_type.is_some() + } + + // Param is passed by value, moved + pub fn set_script_type(&mut self, v: InputScriptType) { + self.script_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bool user_confirmation = 5; + + pub fn user_confirmation(&self) -> bool { + self.user_confirmation.unwrap_or(false) + } + + pub fn clear_user_confirmation(&mut self) { + self.user_confirmation = ::std::option::Option::None; + } + + pub fn has_user_confirmation(&self) -> bool { + self.user_confirmation.is_some() + } + + // Param is passed by value, moved + pub fn set_user_confirmation(&mut self, v: bool) { + self.user_confirmation = ::std::option::Option::Some(v); + } + + // optional bytes commitment_data = 7; + + pub fn commitment_data(&self) -> &[u8] { + match self.commitment_data.as_ref() { + Some(v) => v, + None => b"", + } + } + + pub fn clear_commitment_data(&mut self) { + self.commitment_data = ::std::option::Option::None; + } + + pub fn has_commitment_data(&self) -> bool { + self.commitment_data.is_some() + } + + // Param is passed by value, moved + pub fn set_commitment_data(&mut self, v: ::std::vec::Vec) { + self.commitment_data = ::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_commitment_data(&mut self) -> &mut ::std::vec::Vec { + if self.commitment_data.is_none() { + self.commitment_data = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.commitment_data.as_mut().unwrap() + } + + // Take field + pub fn take_commitment_data(&mut self) -> ::std::vec::Vec { + self.commitment_data.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(7); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &GetOwnershipProof| { &m.address_n }, + |m: &mut GetOwnershipProof| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "coin_name", + |m: &GetOwnershipProof| { &m.coin_name }, + |m: &mut GetOwnershipProof| { &mut m.coin_name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_type", + |m: &GetOwnershipProof| { &m.script_type }, + |m: &mut GetOwnershipProof| { &mut m.script_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, MultisigRedeemScriptType>( + "multisig", + |m: &GetOwnershipProof| { &m.multisig }, + |m: &mut GetOwnershipProof| { &mut m.multisig }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "user_confirmation", + |m: &GetOwnershipProof| { &m.user_confirmation }, + |m: &mut GetOwnershipProof| { &mut m.user_confirmation }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "ownership_ids", + |m: &GetOwnershipProof| { &m.ownership_ids }, + |m: &mut GetOwnershipProof| { &mut m.ownership_ids }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "commitment_data", + |m: &GetOwnershipProof| { &m.commitment_data }, + |m: &mut GetOwnershipProof| { &mut m.commitment_data }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "GetOwnershipProof", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for GetOwnershipProof { + const NAME: &'static str = "GetOwnershipProof"; + + fn is_initialized(&self) -> bool { + for v in &self.multisig { + if !v.is_initialized() { + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.coin_name = ::std::option::Option::Some(is.read_string()?); + }, + 24 => { + self.script_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 34 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.multisig)?; + }, + 40 => { + self.user_confirmation = ::std::option::Option::Some(is.read_bool()?); + }, + 50 => { + self.ownership_ids.push(is.read_bytes()?); + }, + 58 => { + self.commitment_data = ::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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.coin_name.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.script_type { + my_size += ::protobuf::rt::int32_size(3, v.value()); + } + if let Some(v) = self.multisig.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.user_confirmation { + my_size += 1 + 1; + } + for value in &self.ownership_ids { + my_size += ::protobuf::rt::bytes_size(6, &value); + }; + if let Some(v) = self.commitment_data.as_ref() { + my_size += ::protobuf::rt::bytes_size(7, &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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.coin_name.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.script_type { + os.write_enum(3, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.multisig.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + } + if let Some(v) = self.user_confirmation { + os.write_bool(5, v)?; + } + for v in &self.ownership_ids { + os.write_bytes(6, &v)?; + }; + if let Some(v) = self.commitment_data.as_ref() { + os.write_bytes(7, 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() -> GetOwnershipProof { + GetOwnershipProof::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.coin_name = ::std::option::Option::None; + self.script_type = ::std::option::Option::None; + self.multisig.clear(); + self.user_confirmation = ::std::option::Option::None; + self.ownership_ids.clear(); + self.commitment_data = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static GetOwnershipProof { + static instance: GetOwnershipProof = GetOwnershipProof { + address_n: ::std::vec::Vec::new(), + coin_name: ::std::option::Option::None, + script_type: ::std::option::Option::None, + multisig: ::protobuf::MessageField::none(), + user_confirmation: ::std::option::Option::None, + ownership_ids: ::std::vec::Vec::new(), + commitment_data: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for GetOwnershipProof { + 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("GetOwnershipProof").unwrap()).clone() + } +} + +impl ::std::fmt::Display for GetOwnershipProof { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GetOwnershipProof { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.OwnershipProof) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct OwnershipProof { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.OwnershipProof.ownership_proof) + pub ownership_proof: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.OwnershipProof.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.OwnershipProof.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a OwnershipProof { + fn default() -> &'a OwnershipProof { + ::default_instance() + } +} + +impl OwnershipProof { + pub fn new() -> OwnershipProof { + ::std::default::Default::default() + } + + // required bytes ownership_proof = 1; + + pub fn ownership_proof(&self) -> &[u8] { + match self.ownership_proof.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_ownership_proof(&mut self) { + self.ownership_proof = ::std::option::Option::None; + } + + pub fn has_ownership_proof(&self) -> bool { + self.ownership_proof.is_some() + } + + // Param is passed by value, moved + pub fn set_ownership_proof(&mut self, v: ::std::vec::Vec) { + self.ownership_proof = ::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_ownership_proof(&mut self) -> &mut ::std::vec::Vec { + if self.ownership_proof.is_none() { + self.ownership_proof = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.ownership_proof.as_mut().unwrap() + } + + // Take field + pub fn take_ownership_proof(&mut self) -> ::std::vec::Vec { + self.ownership_proof.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes signature = 2; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.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::<_, _>( + "ownership_proof", + |m: &OwnershipProof| { &m.ownership_proof }, + |m: &mut OwnershipProof| { &mut m.ownership_proof }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &OwnershipProof| { &m.signature }, + |m: &mut OwnershipProof| { &mut m.signature }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "OwnershipProof", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for OwnershipProof { + const NAME: &'static str = "OwnershipProof"; + + fn is_initialized(&self) -> bool { + if self.ownership_proof.is_none() { + return false; + } + if self.signature.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.ownership_proof = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.signature = ::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.ownership_proof.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.signature.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.ownership_proof.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.signature.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() -> OwnershipProof { + OwnershipProof::new() + } + + fn clear(&mut self) { + self.ownership_proof = ::std::option::Option::None; + self.signature = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static OwnershipProof { + static instance: OwnershipProof = OwnershipProof { + ownership_proof: ::std::option::Option::None, + signature: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for OwnershipProof { + 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("OwnershipProof").unwrap()).clone() + } +} + +impl ::std::fmt::Display for OwnershipProof { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for OwnershipProof { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bitcoin.AuthorizeCoinJoin) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct AuthorizeCoinJoin { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.AuthorizeCoinJoin.coordinator) + pub coordinator: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.AuthorizeCoinJoin.max_rounds) + pub max_rounds: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.AuthorizeCoinJoin.max_coordinator_fee_rate) + pub max_coordinator_fee_rate: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.AuthorizeCoinJoin.max_fee_per_kvbyte) + pub max_fee_per_kvbyte: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.AuthorizeCoinJoin.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.AuthorizeCoinJoin.coin_name) + pub coin_name: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.AuthorizeCoinJoin.script_type) + pub script_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.bitcoin.AuthorizeCoinJoin.amount_unit) + pub amount_unit: ::std::option::Option<::protobuf::EnumOrUnknown>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bitcoin.AuthorizeCoinJoin.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a AuthorizeCoinJoin { + fn default() -> &'a AuthorizeCoinJoin { + ::default_instance() + } +} + +impl AuthorizeCoinJoin { + pub fn new() -> AuthorizeCoinJoin { + ::std::default::Default::default() + } + + // required string coordinator = 1; + + pub fn coordinator(&self) -> &str { + match self.coordinator.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_coordinator(&mut self) { + self.coordinator = ::std::option::Option::None; + } + + pub fn has_coordinator(&self) -> bool { + self.coordinator.is_some() + } + + // Param is passed by value, moved + pub fn set_coordinator(&mut self, v: ::std::string::String) { + self.coordinator = ::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_coordinator(&mut self) -> &mut ::std::string::String { + if self.coordinator.is_none() { + self.coordinator = ::std::option::Option::Some(::std::string::String::new()); + } + self.coordinator.as_mut().unwrap() + } + + // Take field + pub fn take_coordinator(&mut self) -> ::std::string::String { + self.coordinator.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required uint64 max_rounds = 2; + + pub fn max_rounds(&self) -> u64 { + self.max_rounds.unwrap_or(0) + } + + pub fn clear_max_rounds(&mut self) { + self.max_rounds = ::std::option::Option::None; + } + + pub fn has_max_rounds(&self) -> bool { + self.max_rounds.is_some() + } + + // Param is passed by value, moved + pub fn set_max_rounds(&mut self, v: u64) { + self.max_rounds = ::std::option::Option::Some(v); + } + + // required uint32 max_coordinator_fee_rate = 3; + + pub fn max_coordinator_fee_rate(&self) -> u32 { + self.max_coordinator_fee_rate.unwrap_or(0) + } + + pub fn clear_max_coordinator_fee_rate(&mut self) { + self.max_coordinator_fee_rate = ::std::option::Option::None; + } + + pub fn has_max_coordinator_fee_rate(&self) -> bool { + self.max_coordinator_fee_rate.is_some() + } + + // Param is passed by value, moved + pub fn set_max_coordinator_fee_rate(&mut self, v: u32) { + self.max_coordinator_fee_rate = ::std::option::Option::Some(v); + } + + // required uint32 max_fee_per_kvbyte = 4; + + pub fn max_fee_per_kvbyte(&self) -> u32 { + self.max_fee_per_kvbyte.unwrap_or(0) + } + + pub fn clear_max_fee_per_kvbyte(&mut self) { + self.max_fee_per_kvbyte = ::std::option::Option::None; + } + + pub fn has_max_fee_per_kvbyte(&self) -> bool { + self.max_fee_per_kvbyte.is_some() + } + + // Param is passed by value, moved + pub fn set_max_fee_per_kvbyte(&mut self, v: u32) { + self.max_fee_per_kvbyte = ::std::option::Option::Some(v); + } + + // optional string coin_name = 6; + + pub fn coin_name(&self) -> &str { + match self.coin_name.as_ref() { + Some(v) => v, + None => "Bitcoin", + } + } + + pub fn clear_coin_name(&mut self) { + self.coin_name = ::std::option::Option::None; + } + + pub fn has_coin_name(&self) -> bool { + self.coin_name.is_some() + } + + // Param is passed by value, moved + pub fn set_coin_name(&mut self, v: ::std::string::String) { + self.coin_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_coin_name(&mut self) -> &mut ::std::string::String { + if self.coin_name.is_none() { + self.coin_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.coin_name.as_mut().unwrap() + } + + // Take field + pub fn take_coin_name(&mut self) -> ::std::string::String { + self.coin_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional .hw.trezor.messages.bitcoin.InputScriptType script_type = 7; + + pub fn script_type(&self) -> InputScriptType { + match self.script_type { + Some(e) => e.enum_value_or(InputScriptType::SPENDADDRESS), + None => InputScriptType::SPENDADDRESS, + } + } + + pub fn clear_script_type(&mut self) { + self.script_type = ::std::option::Option::None; + } + + pub fn has_script_type(&self) -> bool { + self.script_type.is_some() + } + + // Param is passed by value, moved + pub fn set_script_type(&mut self, v: InputScriptType) { + self.script_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional .hw.trezor.messages.bitcoin.AmountUnit amount_unit = 8; + + pub fn amount_unit(&self) -> AmountUnit { + match self.amount_unit { + Some(e) => e.enum_value_or(AmountUnit::BITCOIN), + None => AmountUnit::BITCOIN, + } + } + + pub fn clear_amount_unit(&mut self) { + self.amount_unit = ::std::option::Option::None; + } + + pub fn has_amount_unit(&self) -> bool { + self.amount_unit.is_some() + } + + // Param is passed by value, moved + pub fn set_amount_unit(&mut self, v: AmountUnit) { + self.amount_unit = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(8); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "coordinator", + |m: &AuthorizeCoinJoin| { &m.coordinator }, + |m: &mut AuthorizeCoinJoin| { &mut m.coordinator }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "max_rounds", + |m: &AuthorizeCoinJoin| { &m.max_rounds }, + |m: &mut AuthorizeCoinJoin| { &mut m.max_rounds }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "max_coordinator_fee_rate", + |m: &AuthorizeCoinJoin| { &m.max_coordinator_fee_rate }, + |m: &mut AuthorizeCoinJoin| { &mut m.max_coordinator_fee_rate }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "max_fee_per_kvbyte", + |m: &AuthorizeCoinJoin| { &m.max_fee_per_kvbyte }, + |m: &mut AuthorizeCoinJoin| { &mut m.max_fee_per_kvbyte }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &AuthorizeCoinJoin| { &m.address_n }, + |m: &mut AuthorizeCoinJoin| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "coin_name", + |m: &AuthorizeCoinJoin| { &m.coin_name }, + |m: &mut AuthorizeCoinJoin| { &mut m.coin_name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_type", + |m: &AuthorizeCoinJoin| { &m.script_type }, + |m: &mut AuthorizeCoinJoin| { &mut m.script_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount_unit", + |m: &AuthorizeCoinJoin| { &m.amount_unit }, + |m: &mut AuthorizeCoinJoin| { &mut m.amount_unit }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "AuthorizeCoinJoin", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for AuthorizeCoinJoin { + const NAME: &'static str = "AuthorizeCoinJoin"; + + fn is_initialized(&self) -> bool { + if self.coordinator.is_none() { + return false; + } + if self.max_rounds.is_none() { + return false; + } + if self.max_coordinator_fee_rate.is_none() { + return false; + } + if self.max_fee_per_kvbyte.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.coordinator = ::std::option::Option::Some(is.read_string()?); + }, + 16 => { + self.max_rounds = ::std::option::Option::Some(is.read_uint64()?); + }, + 24 => { + self.max_coordinator_fee_rate = ::std::option::Option::Some(is.read_uint32()?); + }, + 32 => { + self.max_fee_per_kvbyte = ::std::option::Option::Some(is.read_uint32()?); + }, + 42 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 40 => { + self.address_n.push(is.read_uint32()?); + }, + 50 => { + self.coin_name = ::std::option::Option::Some(is.read_string()?); + }, + 56 => { + self.script_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 64 => { + self.amount_unit = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 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.coordinator.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.max_rounds { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.max_coordinator_fee_rate { + my_size += ::protobuf::rt::uint32_size(3, v); + } + if let Some(v) = self.max_fee_per_kvbyte { + my_size += ::protobuf::rt::uint32_size(4, v); + } + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(5, *value); + }; + if let Some(v) = self.coin_name.as_ref() { + my_size += ::protobuf::rt::string_size(6, &v); + } + if let Some(v) = self.script_type { + my_size += ::protobuf::rt::int32_size(7, v.value()); + } + if let Some(v) = self.amount_unit { + my_size += ::protobuf::rt::int32_size(8, v.value()); + } + 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.coordinator.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.max_rounds { + os.write_uint64(2, v)?; + } + if let Some(v) = self.max_coordinator_fee_rate { + os.write_uint32(3, v)?; + } + if let Some(v) = self.max_fee_per_kvbyte { + os.write_uint32(4, v)?; + } + for v in &self.address_n { + os.write_uint32(5, *v)?; + }; + if let Some(v) = self.coin_name.as_ref() { + os.write_string(6, v)?; + } + if let Some(v) = self.script_type { + os.write_enum(7, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.amount_unit { + os.write_enum(8, ::protobuf::EnumOrUnknown::value(&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() -> AuthorizeCoinJoin { + AuthorizeCoinJoin::new() + } + + fn clear(&mut self) { + self.coordinator = ::std::option::Option::None; + self.max_rounds = ::std::option::Option::None; + self.max_coordinator_fee_rate = ::std::option::Option::None; + self.max_fee_per_kvbyte = ::std::option::Option::None; + self.address_n.clear(); + self.coin_name = ::std::option::Option::None; + self.script_type = ::std::option::Option::None; + self.amount_unit = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static AuthorizeCoinJoin { + static instance: AuthorizeCoinJoin = AuthorizeCoinJoin { + coordinator: ::std::option::Option::None, + max_rounds: ::std::option::Option::None, + max_coordinator_fee_rate: ::std::option::Option::None, + max_fee_per_kvbyte: ::std::option::Option::None, + address_n: ::std::vec::Vec::new(), + coin_name: ::std::option::Option::None, + script_type: ::std::option::Option::None, + amount_unit: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for AuthorizeCoinJoin { + 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("AuthorizeCoinJoin").unwrap()).clone() + } +} + +impl ::std::fmt::Display for AuthorizeCoinJoin { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for AuthorizeCoinJoin { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.bitcoin.InputScriptType) +pub enum InputScriptType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.InputScriptType.SPENDADDRESS) + SPENDADDRESS = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.InputScriptType.SPENDMULTISIG) + SPENDMULTISIG = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.InputScriptType.EXTERNAL) + EXTERNAL = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.InputScriptType.SPENDWITNESS) + SPENDWITNESS = 3, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.InputScriptType.SPENDP2SHWITNESS) + SPENDP2SHWITNESS = 4, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.InputScriptType.SPENDTAPROOT) + SPENDTAPROOT = 5, +} + +impl ::protobuf::Enum for InputScriptType { + const NAME: &'static str = "InputScriptType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(InputScriptType::SPENDADDRESS), + 1 => ::std::option::Option::Some(InputScriptType::SPENDMULTISIG), + 2 => ::std::option::Option::Some(InputScriptType::EXTERNAL), + 3 => ::std::option::Option::Some(InputScriptType::SPENDWITNESS), + 4 => ::std::option::Option::Some(InputScriptType::SPENDP2SHWITNESS), + 5 => ::std::option::Option::Some(InputScriptType::SPENDTAPROOT), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "SPENDADDRESS" => ::std::option::Option::Some(InputScriptType::SPENDADDRESS), + "SPENDMULTISIG" => ::std::option::Option::Some(InputScriptType::SPENDMULTISIG), + "EXTERNAL" => ::std::option::Option::Some(InputScriptType::EXTERNAL), + "SPENDWITNESS" => ::std::option::Option::Some(InputScriptType::SPENDWITNESS), + "SPENDP2SHWITNESS" => ::std::option::Option::Some(InputScriptType::SPENDP2SHWITNESS), + "SPENDTAPROOT" => ::std::option::Option::Some(InputScriptType::SPENDTAPROOT), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [InputScriptType] = &[ + InputScriptType::SPENDADDRESS, + InputScriptType::SPENDMULTISIG, + InputScriptType::EXTERNAL, + InputScriptType::SPENDWITNESS, + InputScriptType::SPENDP2SHWITNESS, + InputScriptType::SPENDTAPROOT, + ]; +} + +impl ::protobuf::EnumFull for InputScriptType { + 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("InputScriptType").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 InputScriptType { + fn default() -> Self { + InputScriptType::SPENDADDRESS + } +} + +impl InputScriptType { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("InputScriptType") + } +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.bitcoin.OutputScriptType) +pub enum OutputScriptType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.OutputScriptType.PAYTOADDRESS) + PAYTOADDRESS = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.OutputScriptType.PAYTOSCRIPTHASH) + PAYTOSCRIPTHASH = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.OutputScriptType.PAYTOMULTISIG) + PAYTOMULTISIG = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.OutputScriptType.PAYTOOPRETURN) + PAYTOOPRETURN = 3, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.OutputScriptType.PAYTOWITNESS) + PAYTOWITNESS = 4, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.OutputScriptType.PAYTOP2SHWITNESS) + PAYTOP2SHWITNESS = 5, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.OutputScriptType.PAYTOTAPROOT) + PAYTOTAPROOT = 6, +} + +impl ::protobuf::Enum for OutputScriptType { + const NAME: &'static str = "OutputScriptType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(OutputScriptType::PAYTOADDRESS), + 1 => ::std::option::Option::Some(OutputScriptType::PAYTOSCRIPTHASH), + 2 => ::std::option::Option::Some(OutputScriptType::PAYTOMULTISIG), + 3 => ::std::option::Option::Some(OutputScriptType::PAYTOOPRETURN), + 4 => ::std::option::Option::Some(OutputScriptType::PAYTOWITNESS), + 5 => ::std::option::Option::Some(OutputScriptType::PAYTOP2SHWITNESS), + 6 => ::std::option::Option::Some(OutputScriptType::PAYTOTAPROOT), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "PAYTOADDRESS" => ::std::option::Option::Some(OutputScriptType::PAYTOADDRESS), + "PAYTOSCRIPTHASH" => ::std::option::Option::Some(OutputScriptType::PAYTOSCRIPTHASH), + "PAYTOMULTISIG" => ::std::option::Option::Some(OutputScriptType::PAYTOMULTISIG), + "PAYTOOPRETURN" => ::std::option::Option::Some(OutputScriptType::PAYTOOPRETURN), + "PAYTOWITNESS" => ::std::option::Option::Some(OutputScriptType::PAYTOWITNESS), + "PAYTOP2SHWITNESS" => ::std::option::Option::Some(OutputScriptType::PAYTOP2SHWITNESS), + "PAYTOTAPROOT" => ::std::option::Option::Some(OutputScriptType::PAYTOTAPROOT), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [OutputScriptType] = &[ + OutputScriptType::PAYTOADDRESS, + OutputScriptType::PAYTOSCRIPTHASH, + OutputScriptType::PAYTOMULTISIG, + OutputScriptType::PAYTOOPRETURN, + OutputScriptType::PAYTOWITNESS, + OutputScriptType::PAYTOP2SHWITNESS, + OutputScriptType::PAYTOTAPROOT, + ]; +} + +impl ::protobuf::EnumFull for OutputScriptType { + 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("OutputScriptType").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 OutputScriptType { + fn default() -> Self { + OutputScriptType::PAYTOADDRESS + } +} + +impl OutputScriptType { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("OutputScriptType") + } +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.bitcoin.DecredStakingSpendType) +pub enum DecredStakingSpendType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.DecredStakingSpendType.SSGen) + SSGen = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.DecredStakingSpendType.SSRTX) + SSRTX = 1, +} + +impl ::protobuf::Enum for DecredStakingSpendType { + const NAME: &'static str = "DecredStakingSpendType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(DecredStakingSpendType::SSGen), + 1 => ::std::option::Option::Some(DecredStakingSpendType::SSRTX), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "SSGen" => ::std::option::Option::Some(DecredStakingSpendType::SSGen), + "SSRTX" => ::std::option::Option::Some(DecredStakingSpendType::SSRTX), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [DecredStakingSpendType] = &[ + DecredStakingSpendType::SSGen, + DecredStakingSpendType::SSRTX, + ]; +} + +impl ::protobuf::EnumFull for DecredStakingSpendType { + 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("DecredStakingSpendType").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 DecredStakingSpendType { + fn default() -> Self { + DecredStakingSpendType::SSGen + } +} + +impl DecredStakingSpendType { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("DecredStakingSpendType") + } +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.bitcoin.AmountUnit) +pub enum AmountUnit { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.AmountUnit.BITCOIN) + BITCOIN = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.AmountUnit.MILLIBITCOIN) + MILLIBITCOIN = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.AmountUnit.MICROBITCOIN) + MICROBITCOIN = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.AmountUnit.SATOSHI) + SATOSHI = 3, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.bitcoin.AmountUnit.ML) + ML = 4, +} + +impl ::protobuf::Enum for AmountUnit { + const NAME: &'static str = "AmountUnit"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(AmountUnit::BITCOIN), + 1 => ::std::option::Option::Some(AmountUnit::MILLIBITCOIN), + 2 => ::std::option::Option::Some(AmountUnit::MICROBITCOIN), + 3 => ::std::option::Option::Some(AmountUnit::SATOSHI), + 4 => ::std::option::Option::Some(AmountUnit::ML), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "BITCOIN" => ::std::option::Option::Some(AmountUnit::BITCOIN), + "MILLIBITCOIN" => ::std::option::Option::Some(AmountUnit::MILLIBITCOIN), + "MICROBITCOIN" => ::std::option::Option::Some(AmountUnit::MICROBITCOIN), + "SATOSHI" => ::std::option::Option::Some(AmountUnit::SATOSHI), + "ML" => ::std::option::Option::Some(AmountUnit::ML), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [AmountUnit] = &[ + AmountUnit::BITCOIN, + AmountUnit::MILLIBITCOIN, + AmountUnit::MICROBITCOIN, + AmountUnit::SATOSHI, + AmountUnit::ML, + ]; +} + +impl ::protobuf::EnumFull for AmountUnit { + 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("AmountUnit").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 AmountUnit { + fn default() -> Self { + AmountUnit::BITCOIN + } +} + +impl AmountUnit { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("AmountUnit") + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x16messages-bitcoin.proto\x12\x1ahw.trezor.messages.bitcoin\x1a\x0eme\ + ssages.proto\x1a\x15messages-common.proto\"\xeb\x02\n\x18MultisigRedeemS\ + criptType\x12]\n\x07pubkeys\x18\x01\x20\x03(\x0b2C.hw.trezor.messages.bi\ + tcoin.MultisigRedeemScriptType.HDNodePathTypeR\x07pubkeys\x12\x1e\n\nsig\ + natures\x18\x02\x20\x03(\x0cR\nsignatures\x12\x0c\n\x01m\x18\x03\x20\x02\ + (\rR\x01m\x12;\n\x05nodes\x18\x04\x20\x03(\x0b2%.hw.trezor.messages.comm\ + on.HDNodeTypeR\x05nodes\x12\x1b\n\taddress_n\x18\x05\x20\x03(\rR\x08addr\ + essN\x1ah\n\x0eHDNodePathType\x129\n\x04node\x18\x01\x20\x02(\x0b2%.hw.t\ + rezor.messages.common.HDNodeTypeR\x04node\x12\x1b\n\taddress_n\x18\x02\ + \x20\x03(\rR\x08addressN\"\xa6\x02\n\x0cGetPublicKey\x12\x1b\n\taddress_\ + n\x18\x01\x20\x03(\rR\x08addressN\x12(\n\x10ecdsa_curve_name\x18\x02\x20\ + \x01(\tR\x0eecdsaCurveName\x12!\n\x0cshow_display\x18\x03\x20\x01(\x08R\ + \x0bshowDisplay\x12$\n\tcoin_name\x18\x04\x20\x01(\t:\x07BitcoinR\x08coi\ + nName\x12Z\n\x0bscript_type\x18\x05\x20\x01(\x0e2+.hw.trezor.messages.bi\ + tcoin.InputScriptType:\x0cSPENDADDRESSR\nscriptType\x12*\n\x11ignore_xpu\ + b_magic\x18\x06\x20\x01(\x08R\x0fignoreXpubMagic\"\xa5\x01\n\tPublicKey\ + \x129\n\x04node\x18\x01\x20\x02(\x0b2%.hw.trezor.messages.common.HDNodeT\ + ypeR\x04node\x12\x12\n\x04xpub\x18\x02\x20\x02(\tR\x04xpub\x12)\n\x10roo\ + t_fingerprint\x18\x03\x20\x01(\rR\x0frootFingerprint\x12\x1e\n\ndescript\ + or\x18\x04\x20\x01(\tR\ndescriptor\"\xe8\x02\n\nGetAddress\x12\x1b\n\tad\ + dress_n\x18\x01\x20\x03(\rR\x08addressN\x12$\n\tcoin_name\x18\x02\x20\ + \x01(\t:\x07BitcoinR\x08coinName\x12!\n\x0cshow_display\x18\x03\x20\x01(\ + \x08R\x0bshowDisplay\x12P\n\x08multisig\x18\x04\x20\x01(\x0b24.hw.trezor\ + .messages.bitcoin.MultisigRedeemScriptTypeR\x08multisig\x12Z\n\x0bscript\ + _type\x18\x05\x20\x01(\x0e2+.hw.trezor.messages.bitcoin.InputScriptType:\ + \x0cSPENDADDRESSR\nscriptType\x12*\n\x11ignore_xpub_magic\x18\x06\x20\ + \x01(\x08R\x0fignoreXpubMagic\x12\x1a\n\x08chunkify\x18\x07\x20\x01(\x08\ + R\x08chunkify\"5\n\x07Address\x12\x18\n\x07address\x18\x01\x20\x02(\tR\ + \x07address\x12\x10\n\x03mac\x18\x02\x20\x01(\x0cR\x03mac\"\x81\x02\n\ + \x0eGetOwnershipId\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\ + \x12$\n\tcoin_name\x18\x02\x20\x01(\t:\x07BitcoinR\x08coinName\x12P\n\ + \x08multisig\x18\x03\x20\x01(\x0b24.hw.trezor.messages.bitcoin.MultisigR\ + edeemScriptTypeR\x08multisig\x12Z\n\x0bscript_type\x18\x04\x20\x01(\x0e2\ + +.hw.trezor.messages.bitcoin.InputScriptType:\x0cSPENDADDRESSR\nscriptTy\ + pe\"0\n\x0bOwnershipId\x12!\n\x0cownership_id\x18\x01\x20\x02(\x0cR\x0bo\ + wnershipId\"\x88\x02\n\x0bSignMessage\x12\x1b\n\taddress_n\x18\x01\x20\ + \x03(\rR\x08addressN\x12\x18\n\x07message\x18\x02\x20\x02(\x0cR\x07messa\ + ge\x12$\n\tcoin_name\x18\x03\x20\x01(\t:\x07BitcoinR\x08coinName\x12Z\n\ + \x0bscript_type\x18\x04\x20\x01(\x0e2+.hw.trezor.messages.bitcoin.InputS\ + criptType:\x0cSPENDADDRESSR\nscriptType\x12$\n\x0eno_script_type\x18\x05\ + \x20\x01(\x08R\x0cnoScriptType\x12\x1a\n\x08chunkify\x18\x06\x20\x01(\ + \x08R\x08chunkify\"J\n\x10MessageSignature\x12\x18\n\x07address\x18\x01\ + \x20\x02(\tR\x07address\x12\x1c\n\tsignature\x18\x02\x20\x02(\x0cR\tsign\ + ature\"\xa3\x01\n\rVerifyMessage\x12\x18\n\x07address\x18\x01\x20\x02(\t\ + R\x07address\x12\x1c\n\tsignature\x18\x02\x20\x02(\x0cR\tsignature\x12\ + \x18\n\x07message\x18\x03\x20\x02(\x0cR\x07message\x12$\n\tcoin_name\x18\ + \x04\x20\x01(\t:\x07BitcoinR\x08coinName\x12\x1a\n\x08chunkify\x18\x05\ + \x20\x01(\x08R\x08chunkify\"\xd9\x06\n\x06SignTx\x12#\n\routputs_count\ + \x18\x01\x20\x02(\rR\x0coutputsCount\x12!\n\x0cinputs_count\x18\x02\x20\ + \x02(\rR\x0binputsCount\x12$\n\tcoin_name\x18\x03\x20\x01(\t:\x07Bitcoin\ + R\x08coinName\x12\x1b\n\x07version\x18\x04\x20\x01(\r:\x011R\x07version\ + \x12\x1e\n\tlock_time\x18\x05\x20\x01(\r:\x010R\x08lockTime\x12\x16\n\ + \x06expiry\x18\x06\x20\x01(\rR\x06expiry\x12&\n\x0coverwintered\x18\x07\ + \x20\x01(\x08R\x0coverwinteredB\x02\x18\x01\x12(\n\x10version_group_id\ + \x18\x08\x20\x01(\rR\x0eversionGroupId\x12\x1c\n\ttimestamp\x18\t\x20\ + \x01(\rR\ttimestamp\x12\x1b\n\tbranch_id\x18\n\x20\x01(\rR\x08branchId\ + \x12P\n\x0bamount_unit\x18\x0b\x20\x01(\x0e2&.hw.trezor.messages.bitcoin\ + .AmountUnit:\x07BITCOINR\namountUnit\x129\n\x15decred_staking_ticket\x18\ + \x0c\x20\x01(\x08:\x05falseR\x13decredStakingTicket\x12\"\n\tserialize\ + \x18\r\x20\x01(\x08:\x04trueR\tserialize\x12]\n\x10coinjoin_request\x18\ + \x0e\x20\x01(\x0b22.hw.trezor.messages.bitcoin.SignTx.CoinJoinRequestR\ + \x0fcoinjoinRequest\x12\x1a\n\x08chunkify\x18\x0f\x20\x01(\x08R\x08chunk\ + ify\x1a\xd2\x01\n\x0fCoinJoinRequest\x12\x19\n\x08fee_rate\x18\x01\x20\ + \x02(\rR\x07feeRate\x12(\n\x10no_fee_threshold\x18\x02\x20\x02(\x04R\x0e\ + noFeeThreshold\x124\n\x16min_registrable_amount\x18\x03\x20\x02(\x04R\ + \x14minRegistrableAmount\x12&\n\x0fmask_public_key\x18\x04\x20\x02(\x0cR\ + \rmaskPublicKey\x12\x1c\n\tsignature\x18\x05\x20\x02(\x0cR\tsignature\"\ + \xd4\x05\n\tTxRequest\x12T\n\x0crequest_type\x18\x01\x20\x01(\x0e21.hw.t\ + rezor.messages.bitcoin.TxRequest.RequestTypeR\x0brequestType\x12T\n\x07d\ + etails\x18\x02\x20\x01(\x0b2:.hw.trezor.messages.bitcoin.TxRequest.TxReq\ + uestDetailsTypeR\x07details\x12]\n\nserialized\x18\x03\x20\x01(\x0b2=.hw\ + .trezor.messages.bitcoin.TxRequest.TxRequestSerializedTypeR\nserialized\ + \x1a\xa6\x01\n\x14TxRequestDetailsType\x12#\n\rrequest_index\x18\x01\x20\ + \x01(\rR\x0crequestIndex\x12\x17\n\x07tx_hash\x18\x02\x20\x01(\x0cR\x06t\ + xHash\x12$\n\x0eextra_data_len\x18\x03\x20\x01(\rR\x0cextraDataLen\x12*\ + \n\x11extra_data_offset\x18\x04\x20\x01(\rR\x0fextraDataOffset\x1a\x85\ + \x01\n\x17TxRequestSerializedType\x12'\n\x0fsignature_index\x18\x01\x20\ + \x01(\rR\x0esignatureIndex\x12\x1c\n\tsignature\x18\x02\x20\x01(\x0cR\ts\ + ignature\x12#\n\rserialized_tx\x18\x03\x20\x01(\x0cR\x0cserializedTx\"\ + \x8a\x01\n\x0bRequestType\x12\x0b\n\x07TXINPUT\x10\0\x12\x0c\n\x08TXOUTP\ + UT\x10\x01\x12\n\n\x06TXMETA\x10\x02\x12\x0e\n\nTXFINISHED\x10\x03\x12\ + \x0f\n\x0bTXEXTRADATA\x10\x04\x12\x0f\n\x0bTXORIGINPUT\x10\x05\x12\x10\n\ + \x0cTXORIGOUTPUT\x10\x06\x12\x10\n\x0cTXPAYMENTREQ\x10\x07\"\xf4\x0f\n\ + \x05TxAck\x12A\n\x02tx\x18\x01\x20\x01(\x0b21.hw.trezor.messages.bitcoin\ + .TxAck.TransactionTypeR\x02tx\x1a\xa3\x0f\n\x0fTransactionType\x12\x18\n\ + \x07version\x18\x01\x20\x01(\rR\x07version\x12U\n\x06inputs\x18\x02\x20\ + \x03(\x0b2=.hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType\ + R\x06inputs\x12b\n\x0bbin_outputs\x18\x03\x20\x03(\x0b2A.hw.trezor.messa\ + ges.bitcoin.TxAck.TransactionType.TxOutputBinTypeR\nbinOutputs\x12\x1b\n\ + \tlock_time\x18\x04\x20\x01(\rR\x08lockTime\x12X\n\x07outputs\x18\x05\ + \x20\x03(\x0b2>.hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutpu\ + tTypeR\x07outputs\x12\x1d\n\ninputs_cnt\x18\x06\x20\x01(\rR\tinputsCnt\ + \x12\x1f\n\x0boutputs_cnt\x18\x07\x20\x01(\rR\noutputsCnt\x12\x1d\n\next\ + ra_data\x18\x08\x20\x01(\x0cR\textraData\x12$\n\x0eextra_data_len\x18\t\ + \x20\x01(\rR\x0cextraDataLen\x12\x16\n\x06expiry\x18\n\x20\x01(\rR\x06ex\ + piry\x12&\n\x0coverwintered\x18\x0b\x20\x01(\x08R\x0coverwinteredB\x02\ + \x18\x01\x12(\n\x10version_group_id\x18\x0c\x20\x01(\rR\x0eversionGroupI\ + d\x12\x1c\n\ttimestamp\x18\r\x20\x01(\rR\ttimestamp\x12\x1b\n\tbranch_id\ + \x18\x0e\x20\x01(\rR\x08branchId\x1a\xf1\x05\n\x0bTxInputType\x12\x1b\n\ + \taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\x1b\n\tprev_hash\x18\x02\ + \x20\x02(\x0cR\x08prevHash\x12\x1d\n\nprev_index\x18\x03\x20\x02(\rR\tpr\ + evIndex\x12\x1d\n\nscript_sig\x18\x04\x20\x01(\x0cR\tscriptSig\x12&\n\ + \x08sequence\x18\x05\x20\x01(\r:\n4294967295R\x08sequence\x12Z\n\x0bscri\ + pt_type\x18\x06\x20\x01(\x0e2+.hw.trezor.messages.bitcoin.InputScriptTyp\ + e:\x0cSPENDADDRESSR\nscriptType\x12P\n\x08multisig\x18\x07\x20\x01(\x0b2\ + 4.hw.trezor.messages.bitcoin.MultisigRedeemScriptTypeR\x08multisig\x12\ + \x16\n\x06amount\x18\x08\x20\x01(\x04R\x06amount\x12\x1f\n\x0bdecred_tre\ + e\x18\t\x20\x01(\rR\ndecredTree\x12\x18\n\x07witness\x18\r\x20\x01(\x0cR\ + \x07witness\x12'\n\x0fownership_proof\x18\x0e\x20\x01(\x0cR\x0eownership\ + Proof\x12'\n\x0fcommitment_data\x18\x0f\x20\x01(\x0cR\x0ecommitmentData\ + \x12\x1b\n\torig_hash\x18\x10\x20\x01(\x0cR\x08origHash\x12\x1d\n\norig_\ + index\x18\x11\x20\x01(\rR\torigIndex\x12d\n\x14decred_staking_spend\x18\ + \x12\x20\x01(\x0e22.hw.trezor.messages.bitcoin.DecredStakingSpendTypeR\ + \x12decredStakingSpend\x12#\n\rscript_pubkey\x18\x13\x20\x01(\x0cR\x0csc\ + riptPubkey\x12(\n\x0ecoinjoin_flags\x18\x14\x20\x01(\r:\x010R\rcoinjoinF\ + lags\x1a\x82\x01\n\x0fTxOutputBinType\x12\x16\n\x06amount\x18\x01\x20\ + \x02(\x04R\x06amount\x12#\n\rscript_pubkey\x18\x02\x20\x02(\x0cR\x0cscri\ + ptPubkey\x122\n\x15decred_script_version\x18\x03\x20\x01(\rR\x13decredSc\ + riptVersion\x1a\xa0\x03\n\x0cTxOutputType\x12\x18\n\x07address\x18\x01\ + \x20\x01(\tR\x07address\x12\x1b\n\taddress_n\x18\x02\x20\x03(\rR\x08addr\ + essN\x12\x16\n\x06amount\x18\x03\x20\x02(\x04R\x06amount\x12[\n\x0bscrip\ + t_type\x18\x04\x20\x01(\x0e2,.hw.trezor.messages.bitcoin.OutputScriptTyp\ + e:\x0cPAYTOADDRESSR\nscriptType\x12P\n\x08multisig\x18\x05\x20\x01(\x0b2\ + 4.hw.trezor.messages.bitcoin.MultisigRedeemScriptTypeR\x08multisig\x12$\ + \n\x0eop_return_data\x18\x06\x20\x01(\x0cR\x0copReturnData\x12\x1b\n\tor\ + ig_hash\x18\n\x20\x01(\x0cR\x08origHash\x12\x1d\n\norig_index\x18\x0b\ + \x20\x01(\rR\torigIndex\x120\n\x11payment_req_index\x18\x0c\x20\x01(\rR\ + \x0fpaymentReqIndexB\x04\xc8\xf0\x19\x01:\x02\x18\x01\"\xff\x05\n\x07TxI\ + nput\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\x1b\n\tpre\ + v_hash\x18\x02\x20\x02(\x0cR\x08prevHash\x12\x1d\n\nprev_index\x18\x03\ + \x20\x02(\rR\tprevIndex\x12\x1d\n\nscript_sig\x18\x04\x20\x01(\x0cR\tscr\ + iptSig\x12&\n\x08sequence\x18\x05\x20\x01(\r:\n4294967295R\x08sequence\ + \x12Z\n\x0bscript_type\x18\x06\x20\x01(\x0e2+.hw.trezor.messages.bitcoin\ + .InputScriptType:\x0cSPENDADDRESSR\nscriptType\x12P\n\x08multisig\x18\ + \x07\x20\x01(\x0b24.hw.trezor.messages.bitcoin.MultisigRedeemScriptTypeR\ + \x08multisig\x12\x16\n\x06amount\x18\x08\x20\x02(\x04R\x06amount\x12\x1f\ + \n\x0bdecred_tree\x18\t\x20\x01(\rR\ndecredTree\x12\x18\n\x07witness\x18\ + \r\x20\x01(\x0cR\x07witness\x12'\n\x0fownership_proof\x18\x0e\x20\x01(\ + \x0cR\x0eownershipProof\x12'\n\x0fcommitment_data\x18\x0f\x20\x01(\x0cR\ + \x0ecommitmentData\x12\x1b\n\torig_hash\x18\x10\x20\x01(\x0cR\x08origHas\ + h\x12\x1d\n\norig_index\x18\x11\x20\x01(\rR\torigIndex\x12d\n\x14decred_\ + staking_spend\x18\x12\x20\x01(\x0e22.hw.trezor.messages.bitcoin.DecredSt\ + akingSpendTypeR\x12decredStakingSpend\x12#\n\rscript_pubkey\x18\x13\x20\ + \x01(\x0cR\x0cscriptPubkey\x12(\n\x0ecoinjoin_flags\x18\x14\x20\x01(\r:\ + \x010R\rcoinjoinFlagsJ\x04\x08\n\x10\x0bJ\x04\x08\x0b\x10\x0cJ\x04\x08\ + \x0c\x10\r\"\xae\x03\n\x08TxOutput\x12\x18\n\x07address\x18\x01\x20\x01(\ + \tR\x07address\x12\x1b\n\taddress_n\x18\x02\x20\x03(\rR\x08addressN\x12\ + \x16\n\x06amount\x18\x03\x20\x02(\x04R\x06amount\x12[\n\x0bscript_type\ + \x18\x04\x20\x01(\x0e2,.hw.trezor.messages.bitcoin.OutputScriptType:\x0c\ + PAYTOADDRESSR\nscriptType\x12P\n\x08multisig\x18\x05\x20\x01(\x0b24.hw.t\ + rezor.messages.bitcoin.MultisigRedeemScriptTypeR\x08multisig\x12$\n\x0eo\ + p_return_data\x18\x06\x20\x01(\x0cR\x0copReturnData\x12\x1b\n\torig_hash\ + \x18\n\x20\x01(\x0cR\x08origHash\x12\x1d\n\norig_index\x18\x0b\x20\x01(\ + \rR\torigIndex\x120\n\x11payment_req_index\x18\x0c\x20\x01(\rR\x0fpaymen\ + tReqIndexB\x04\xc8\xf0\x19\x01J\x04\x08\x07\x10\x08J\x04\x08\x08\x10\tJ\ + \x04\x08\t\x10\n\"\xcb\x02\n\x06PrevTx\x12\x18\n\x07version\x18\x01\x20\ + \x02(\rR\x07version\x12\x1b\n\tlock_time\x18\x04\x20\x02(\rR\x08lockTime\ + \x12!\n\x0cinputs_count\x18\x06\x20\x02(\rR\x0binputsCount\x12#\n\routpu\ + ts_count\x18\x07\x20\x02(\rR\x0coutputsCount\x12'\n\x0eextra_data_len\ + \x18\t\x20\x01(\r:\x010R\x0cextraDataLen\x12\x16\n\x06expiry\x18\n\x20\ + \x01(\rR\x06expiry\x12(\n\x10version_group_id\x18\x0c\x20\x01(\rR\x0ever\ + sionGroupId\x12\x1c\n\ttimestamp\x18\r\x20\x01(\rR\ttimestamp\x12\x1b\n\ + \tbranch_id\x18\x0e\x20\x01(\rR\x08branchIdJ\x04\x08\x02\x10\x03J\x04\ + \x08\x03\x10\x04J\x04\x08\x05\x10\x06J\x04\x08\x08\x10\tJ\x04\x08\x0b\ + \x10\x0c\"\xf7\x01\n\tPrevInput\x12\x1b\n\tprev_hash\x18\x02\x20\x02(\ + \x0cR\x08prevHash\x12\x1d\n\nprev_index\x18\x03\x20\x02(\rR\tprevIndex\ + \x12\x1d\n\nscript_sig\x18\x04\x20\x02(\x0cR\tscriptSig\x12\x1a\n\x08seq\ + uence\x18\x05\x20\x02(\rR\x08sequence\x12\x1f\n\x0bdecred_tree\x18\t\x20\ + \x01(\rR\ndecredTreeJ\x04\x08\x01\x10\x02J\x04\x08\x06\x10\x07J\x04\x08\ + \x07\x10\x08J\x04\x08\x08\x10\tJ\x04\x08\n\x10\x0bJ\x04\x08\x0b\x10\x0cJ\ + \x04\x08\x0c\x10\rJ\x04\x08\r\x10\x0eJ\x04\x08\x0e\x10\x0fJ\x04\x08\x0f\ + \x10\x10J\x04\x08\x10\x10\x11J\x04\x08\x11\x10\x12J\x04\x08\x12\x10\x13J\ + \x04\x08\x13\x10\x14\"}\n\nPrevOutput\x12\x16\n\x06amount\x18\x01\x20\ + \x02(\x04R\x06amount\x12#\n\rscript_pubkey\x18\x02\x20\x02(\x0cR\x0cscri\ + ptPubkey\x122\n\x15decred_script_version\x18\x03\x20\x01(\rR\x13decredSc\ + riptVersion\"\xf2\x05\n\x13TxAckPaymentRequest\x12\x14\n\x05nonce\x18\ + \x01\x20\x01(\x0cR\x05nonce\x12%\n\x0erecipient_name\x18\x02\x20\x02(\tR\ + \rrecipientName\x12X\n\x05memos\x18\x03\x20\x03(\x0b2B.hw.trezor.message\ + s.bitcoin.TxAckPaymentRequest.PaymentRequestMemoR\x05memos\x12\x16\n\x06\ + amount\x18\x04\x20\x01(\x04R\x06amount\x12\x1c\n\tsignature\x18\x05\x20\ + \x02(\x0cR\tsignature\x1a\xb8\x02\n\x12PaymentRequestMemo\x12U\n\ttext_m\ + emo\x18\x01\x20\x01(\x0b28.hw.trezor.messages.bitcoin.TxAckPaymentReques\ + t.TextMemoR\x08textMemo\x12[\n\x0brefund_memo\x18\x02\x20\x01(\x0b2:.hw.\ + trezor.messages.bitcoin.TxAckPaymentRequest.RefundMemoR\nrefundMemo\x12n\ + \n\x12coin_purchase_memo\x18\x03\x20\x01(\x0b2@.hw.trezor.messages.bitco\ + in.TxAckPaymentRequest.CoinPurchaseMemoR\x10coinPurchaseMemo\x1a\x1e\n\ + \x08TextMemo\x12\x12\n\x04text\x18\x01\x20\x02(\tR\x04text\x1a8\n\nRefun\ + dMemo\x12\x18\n\x07address\x18\x01\x20\x02(\tR\x07address\x12\x10\n\x03m\ + ac\x18\x02\x20\x02(\x0cR\x03mac\x1as\n\x10CoinPurchaseMemo\x12\x1b\n\tco\ + in_type\x18\x01\x20\x02(\rR\x08coinType\x12\x16\n\x06amount\x18\x02\x20\ + \x02(\tR\x06amount\x12\x18\n\x07address\x18\x03\x20\x02(\tR\x07address\ + \x12\x10\n\x03mac\x18\x04\x20\x02(\x0cR\x03mac:\x04\x88\xb2\x19\x01\"\ + \xac\x01\n\nTxAckInput\x12H\n\x02tx\x18\x01\x20\x02(\x0b28.hw.trezor.mes\ + sages.bitcoin.TxAckInput.TxAckInputWrapperR\x02tx\x1aN\n\x11TxAckInputWr\ + apper\x129\n\x05input\x18\x02\x20\x02(\x0b2#.hw.trezor.messages.bitcoin.\ + TxInputR\x05input:\x04\x90\xb2\x19\x16\"\xb3\x01\n\x0bTxAckOutput\x12J\n\ + \x02tx\x18\x01\x20\x02(\x0b2:.hw.trezor.messages.bitcoin.TxAckOutput.TxA\ + ckOutputWrapperR\x02tx\x1aR\n\x12TxAckOutputWrapper\x12<\n\x06output\x18\ + \x05\x20\x02(\x0b2$.hw.trezor.messages.bitcoin.TxOutputR\x06output:\x04\ + \x90\xb2\x19\x16\"I\n\rTxAckPrevMeta\x122\n\x02tx\x18\x01\x20\x02(\x0b2\ + \".hw.trezor.messages.bitcoin.PrevTxR\x02tx:\x04\x90\xb2\x19\x16\"\xbe\ + \x01\n\x0eTxAckPrevInput\x12P\n\x02tx\x18\x01\x20\x02(\x0b2@.hw.trezor.m\ + essages.bitcoin.TxAckPrevInput.TxAckPrevInputWrapperR\x02tx\x1aT\n\x15Tx\ + AckPrevInputWrapper\x12;\n\x05input\x18\x02\x20\x02(\x0b2%.hw.trezor.mes\ + sages.bitcoin.PrevInputR\x05input:\x04\x90\xb2\x19\x16\"\xc5\x01\n\x0fTx\ + AckPrevOutput\x12R\n\x02tx\x18\x01\x20\x02(\x0b2B.hw.trezor.messages.bit\ + coin.TxAckPrevOutput.TxAckPrevOutputWrapperR\x02tx\x1aX\n\x16TxAckPrevOu\ + tputWrapper\x12>\n\x06output\x18\x03\x20\x02(\x0b2&.hw.trezor.messages.b\ + itcoin.PrevOutputR\x06output:\x04\x90\xb2\x19\x16\"\xbb\x01\n\x12TxAckPr\ + evExtraData\x12X\n\x02tx\x18\x01\x20\x02(\x0b2H.hw.trezor.messages.bitco\ + in.TxAckPrevExtraData.TxAckPrevExtraDataWrapperR\x02tx\x1aE\n\x19TxAckPr\ + evExtraDataWrapper\x12(\n\x10extra_data_chunk\x18\x08\x20\x02(\x0cR\x0ee\ + xtraDataChunk:\x04\x90\xb2\x19\x16\"\x88\x03\n\x11GetOwnershipProof\x12\ + \x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12$\n\tcoin_name\x18\ + \x02\x20\x01(\t:\x07BitcoinR\x08coinName\x12Z\n\x0bscript_type\x18\x03\ + \x20\x01(\x0e2+.hw.trezor.messages.bitcoin.InputScriptType:\x0cSPENDWITN\ + ESSR\nscriptType\x12P\n\x08multisig\x18\x04\x20\x01(\x0b24.hw.trezor.mes\ + sages.bitcoin.MultisigRedeemScriptTypeR\x08multisig\x122\n\x11user_confi\ + rmation\x18\x05\x20\x01(\x08:\x05falseR\x10userConfirmation\x12#\n\rowne\ + rship_ids\x18\x06\x20\x03(\x0cR\x0cownershipIds\x12)\n\x0fcommitment_dat\ + a\x18\x07\x20\x01(\x0c:\0R\x0ecommitmentData\"W\n\x0eOwnershipProof\x12'\ + \n\x0fownership_proof\x18\x01\x20\x02(\x0cR\x0eownershipProof\x12\x1c\n\ + \tsignature\x18\x02\x20\x02(\x0cR\tsignature\"\xab\x03\n\x11AuthorizeCoi\ + nJoin\x12\x20\n\x0bcoordinator\x18\x01\x20\x02(\tR\x0bcoordinator\x12\ + \x1d\n\nmax_rounds\x18\x02\x20\x02(\x04R\tmaxRounds\x127\n\x18max_coordi\ + nator_fee_rate\x18\x03\x20\x02(\rR\x15maxCoordinatorFeeRate\x12+\n\x12ma\ + x_fee_per_kvbyte\x18\x04\x20\x02(\rR\x0fmaxFeePerKvbyte\x12\x1b\n\taddre\ + ss_n\x18\x05\x20\x03(\rR\x08addressN\x12$\n\tcoin_name\x18\x06\x20\x01(\ + \t:\x07BitcoinR\x08coinName\x12Z\n\x0bscript_type\x18\x07\x20\x01(\x0e2+\ + .hw.trezor.messages.bitcoin.InputScriptType:\x0cSPENDADDRESSR\nscriptTyp\ + e\x12P\n\x0bamount_unit\x18\x08\x20\x01(\x0e2&.hw.trezor.messages.bitcoi\ + n.AmountUnit:\x07BITCOINR\namountUnit*~\n\x0fInputScriptType\x12\x10\n\ + \x0cSPENDADDRESS\x10\0\x12\x11\n\rSPENDMULTISIG\x10\x01\x12\x0c\n\x08EXT\ + ERNAL\x10\x02\x12\x10\n\x0cSPENDWITNESS\x10\x03\x12\x14\n\x10SPENDP2SHWI\ + TNESS\x10\x04\x12\x10\n\x0cSPENDTAPROOT\x10\x05*\x99\x01\n\x10OutputScri\ + ptType\x12\x10\n\x0cPAYTOADDRESS\x10\0\x12\x13\n\x0fPAYTOSCRIPTHASH\x10\ + \x01\x12\x11\n\rPAYTOMULTISIG\x10\x02\x12\x11\n\rPAYTOOPRETURN\x10\x03\ + \x12\x10\n\x0cPAYTOWITNESS\x10\x04\x12\x14\n\x10PAYTOP2SHWITNESS\x10\x05\ + \x12\x10\n\x0cPAYTOTAPROOT\x10\x06*.\n\x16DecredStakingSpendType\x12\t\n\ + \x05SSGen\x10\0\x12\t\n\x05SSRTX\x10\x01*R\n\nAmountUnit\x12\x0b\n\x07BI\ + TCOIN\x10\0\x12\x10\n\x0cMILLIBITCOIN\x10\x01\x12\x10\n\x0cMICROBITCOIN\ + \x10\x02\x12\x0b\n\x07SATOSHI\x10\x03\x12\x06\n\x02ML\x10\x04B?\n#com.sa\ + toshilabs.trezor.lib.protobufB\x14TrezorMessageBitcoin\x80\xa6\x1d\x01\ +"; + +/// `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(2); + deps.push(super::messages::file_descriptor().clone()); + deps.push(super::messages_common::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(45); + messages.push(MultisigRedeemScriptType::generated_message_descriptor_data()); + messages.push(GetPublicKey::generated_message_descriptor_data()); + messages.push(PublicKey::generated_message_descriptor_data()); + messages.push(GetAddress::generated_message_descriptor_data()); + messages.push(Address::generated_message_descriptor_data()); + messages.push(GetOwnershipId::generated_message_descriptor_data()); + messages.push(OwnershipId::generated_message_descriptor_data()); + messages.push(SignMessage::generated_message_descriptor_data()); + messages.push(MessageSignature::generated_message_descriptor_data()); + messages.push(VerifyMessage::generated_message_descriptor_data()); + messages.push(SignTx::generated_message_descriptor_data()); + messages.push(TxRequest::generated_message_descriptor_data()); + messages.push(TxAck::generated_message_descriptor_data()); + messages.push(TxInput::generated_message_descriptor_data()); + messages.push(TxOutput::generated_message_descriptor_data()); + messages.push(PrevTx::generated_message_descriptor_data()); + messages.push(PrevInput::generated_message_descriptor_data()); + messages.push(PrevOutput::generated_message_descriptor_data()); + messages.push(TxAckPaymentRequest::generated_message_descriptor_data()); + messages.push(TxAckInput::generated_message_descriptor_data()); + messages.push(TxAckOutput::generated_message_descriptor_data()); + messages.push(TxAckPrevMeta::generated_message_descriptor_data()); + messages.push(TxAckPrevInput::generated_message_descriptor_data()); + messages.push(TxAckPrevOutput::generated_message_descriptor_data()); + messages.push(TxAckPrevExtraData::generated_message_descriptor_data()); + messages.push(GetOwnershipProof::generated_message_descriptor_data()); + messages.push(OwnershipProof::generated_message_descriptor_data()); + messages.push(AuthorizeCoinJoin::generated_message_descriptor_data()); + messages.push(multisig_redeem_script_type::HDNodePathType::generated_message_descriptor_data()); + messages.push(sign_tx::CoinJoinRequest::generated_message_descriptor_data()); + messages.push(tx_request::TxRequestDetailsType::generated_message_descriptor_data()); + messages.push(tx_request::TxRequestSerializedType::generated_message_descriptor_data()); + messages.push(tx_ack::TransactionType::generated_message_descriptor_data()); + messages.push(tx_ack::transaction_type::TxInputType::generated_message_descriptor_data()); + messages.push(tx_ack::transaction_type::TxOutputBinType::generated_message_descriptor_data()); + messages.push(tx_ack::transaction_type::TxOutputType::generated_message_descriptor_data()); + messages.push(tx_ack_payment_request::PaymentRequestMemo::generated_message_descriptor_data()); + messages.push(tx_ack_payment_request::TextMemo::generated_message_descriptor_data()); + messages.push(tx_ack_payment_request::RefundMemo::generated_message_descriptor_data()); + messages.push(tx_ack_payment_request::CoinPurchaseMemo::generated_message_descriptor_data()); + messages.push(tx_ack_input::TxAckInputWrapper::generated_message_descriptor_data()); + messages.push(tx_ack_output::TxAckOutputWrapper::generated_message_descriptor_data()); + messages.push(tx_ack_prev_input::TxAckPrevInputWrapper::generated_message_descriptor_data()); + messages.push(tx_ack_prev_output::TxAckPrevOutputWrapper::generated_message_descriptor_data()); + messages.push(tx_ack_prev_extra_data::TxAckPrevExtraDataWrapper::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(5); + enums.push(InputScriptType::generated_enum_descriptor_data()); + enums.push(OutputScriptType::generated_enum_descriptor_data()); + enums.push(DecredStakingSpendType::generated_enum_descriptor_data()); + enums.push(AmountUnit::generated_enum_descriptor_data()); + enums.push(tx_request::RequestType::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_bootloader.rs b/wallet/trezor-client/src/protos/generated/messages_bootloader.rs new file mode 100644 index 0000000000..c8614be41a --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_bootloader.rs @@ -0,0 +1,767 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-bootloader.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.bootloader.FirmwareErase) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct FirmwareErase { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bootloader.FirmwareErase.length) + pub length: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bootloader.FirmwareErase.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a FirmwareErase { + fn default() -> &'a FirmwareErase { + ::default_instance() + } +} + +impl FirmwareErase { + pub fn new() -> FirmwareErase { + ::std::default::Default::default() + } + + // optional uint32 length = 1; + + pub fn length(&self) -> u32 { + self.length.unwrap_or(0) + } + + pub fn clear_length(&mut self) { + self.length = ::std::option::Option::None; + } + + pub fn has_length(&self) -> bool { + self.length.is_some() + } + + // Param is passed by value, moved + pub fn set_length(&mut self, v: u32) { + self.length = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "length", + |m: &FirmwareErase| { &m.length }, + |m: &mut FirmwareErase| { &mut m.length }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "FirmwareErase", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for FirmwareErase { + const NAME: &'static str = "FirmwareErase"; + + 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 { + 8 => { + self.length = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.length { + my_size += ::protobuf::rt::uint32_size(1, 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.length { + os.write_uint32(1, 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() -> FirmwareErase { + FirmwareErase::new() + } + + fn clear(&mut self) { + self.length = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static FirmwareErase { + static instance: FirmwareErase = FirmwareErase { + length: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for FirmwareErase { + 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("FirmwareErase").unwrap()).clone() + } +} + +impl ::std::fmt::Display for FirmwareErase { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for FirmwareErase { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bootloader.FirmwareRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct FirmwareRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bootloader.FirmwareRequest.offset) + pub offset: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.bootloader.FirmwareRequest.length) + pub length: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bootloader.FirmwareRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a FirmwareRequest { + fn default() -> &'a FirmwareRequest { + ::default_instance() + } +} + +impl FirmwareRequest { + pub fn new() -> FirmwareRequest { + ::std::default::Default::default() + } + + // required uint32 offset = 1; + + pub fn offset(&self) -> u32 { + self.offset.unwrap_or(0) + } + + pub fn clear_offset(&mut self) { + self.offset = ::std::option::Option::None; + } + + pub fn has_offset(&self) -> bool { + self.offset.is_some() + } + + // Param is passed by value, moved + pub fn set_offset(&mut self, v: u32) { + self.offset = ::std::option::Option::Some(v); + } + + // required uint32 length = 2; + + pub fn length(&self) -> u32 { + self.length.unwrap_or(0) + } + + pub fn clear_length(&mut self) { + self.length = ::std::option::Option::None; + } + + pub fn has_length(&self) -> bool { + self.length.is_some() + } + + // Param is passed by value, moved + pub fn set_length(&mut self, v: u32) { + self.length = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "offset", + |m: &FirmwareRequest| { &m.offset }, + |m: &mut FirmwareRequest| { &mut m.offset }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "length", + |m: &FirmwareRequest| { &m.length }, + |m: &mut FirmwareRequest| { &mut m.length }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "FirmwareRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for FirmwareRequest { + const NAME: &'static str = "FirmwareRequest"; + + fn is_initialized(&self) -> bool { + if self.offset.is_none() { + return false; + } + if self.length.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.offset = ::std::option::Option::Some(is.read_uint32()?); + }, + 16 => { + self.length = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.offset { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.length { + my_size += ::protobuf::rt::uint32_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.offset { + os.write_uint32(1, v)?; + } + if let Some(v) = self.length { + os.write_uint32(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() -> FirmwareRequest { + FirmwareRequest::new() + } + + fn clear(&mut self) { + self.offset = ::std::option::Option::None; + self.length = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static FirmwareRequest { + static instance: FirmwareRequest = FirmwareRequest { + offset: ::std::option::Option::None, + length: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for FirmwareRequest { + 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("FirmwareRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for FirmwareRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for FirmwareRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bootloader.FirmwareUpload) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct FirmwareUpload { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bootloader.FirmwareUpload.payload) + pub payload: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.bootloader.FirmwareUpload.hash) + pub hash: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bootloader.FirmwareUpload.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a FirmwareUpload { + fn default() -> &'a FirmwareUpload { + ::default_instance() + } +} + +impl FirmwareUpload { + pub fn new() -> FirmwareUpload { + ::std::default::Default::default() + } + + // required bytes payload = 1; + + pub fn payload(&self) -> &[u8] { + match self.payload.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_payload(&mut self) { + self.payload = ::std::option::Option::None; + } + + pub fn has_payload(&self) -> bool { + self.payload.is_some() + } + + // Param is passed by value, moved + pub fn set_payload(&mut self, v: ::std::vec::Vec) { + self.payload = ::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_payload(&mut self) -> &mut ::std::vec::Vec { + if self.payload.is_none() { + self.payload = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.payload.as_mut().unwrap() + } + + // Take field + pub fn take_payload(&mut self) -> ::std::vec::Vec { + self.payload.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes hash = 2; + + pub fn hash(&self) -> &[u8] { + match self.hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_hash(&mut self) { + self.hash = ::std::option::Option::None; + } + + pub fn has_hash(&self) -> bool { + self.hash.is_some() + } + + // Param is passed by value, moved + pub fn set_hash(&mut self, v: ::std::vec::Vec) { + self.hash = ::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_hash(&mut self) -> &mut ::std::vec::Vec { + if self.hash.is_none() { + self.hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.hash.as_mut().unwrap() + } + + // Take field + pub fn take_hash(&mut self) -> ::std::vec::Vec { + self.hash.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::<_, _>( + "payload", + |m: &FirmwareUpload| { &m.payload }, + |m: &mut FirmwareUpload| { &mut m.payload }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "hash", + |m: &FirmwareUpload| { &m.hash }, + |m: &mut FirmwareUpload| { &mut m.hash }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "FirmwareUpload", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for FirmwareUpload { + const NAME: &'static str = "FirmwareUpload"; + + fn is_initialized(&self) -> bool { + if self.payload.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.payload = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.hash = ::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.payload.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.hash.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.payload.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.hash.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() -> FirmwareUpload { + FirmwareUpload::new() + } + + fn clear(&mut self) { + self.payload = ::std::option::Option::None; + self.hash = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static FirmwareUpload { + static instance: FirmwareUpload = FirmwareUpload { + payload: ::std::option::Option::None, + hash: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for FirmwareUpload { + 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("FirmwareUpload").unwrap()).clone() + } +} + +impl ::std::fmt::Display for FirmwareUpload { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for FirmwareUpload { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.bootloader.ProdTestT1) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct ProdTestT1 { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.bootloader.ProdTestT1.payload) + pub payload: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.bootloader.ProdTestT1.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a ProdTestT1 { + fn default() -> &'a ProdTestT1 { + ::default_instance() + } +} + +impl ProdTestT1 { + pub fn new() -> ProdTestT1 { + ::std::default::Default::default() + } + + // optional bytes payload = 1; + + pub fn payload(&self) -> &[u8] { + match self.payload.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_payload(&mut self) { + self.payload = ::std::option::Option::None; + } + + pub fn has_payload(&self) -> bool { + self.payload.is_some() + } + + // Param is passed by value, moved + pub fn set_payload(&mut self, v: ::std::vec::Vec) { + self.payload = ::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_payload(&mut self) -> &mut ::std::vec::Vec { + if self.payload.is_none() { + self.payload = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.payload.as_mut().unwrap() + } + + // Take field + pub fn take_payload(&mut self) -> ::std::vec::Vec { + self.payload.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "payload", + |m: &ProdTestT1| { &m.payload }, + |m: &mut ProdTestT1| { &mut m.payload }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "ProdTestT1", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for ProdTestT1 { + const NAME: &'static str = "ProdTestT1"; + + 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.payload = ::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.payload.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.payload.as_ref() { + os.write_bytes(1, 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() -> ProdTestT1 { + ProdTestT1::new() + } + + fn clear(&mut self) { + self.payload = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static ProdTestT1 { + static instance: ProdTestT1 = ProdTestT1 { + payload: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for ProdTestT1 { + 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("ProdTestT1").unwrap()).clone() + } +} + +impl ::std::fmt::Display for ProdTestT1 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ProdTestT1 { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x19messages-bootloader.proto\x12\x1dhw.trezor.messages.bootloader\"'\ + \n\rFirmwareErase\x12\x16\n\x06length\x18\x01\x20\x01(\rR\x06length\"A\n\ + \x0fFirmwareRequest\x12\x16\n\x06offset\x18\x01\x20\x02(\rR\x06offset\ + \x12\x16\n\x06length\x18\x02\x20\x02(\rR\x06length\">\n\x0eFirmwareUploa\ + d\x12\x18\n\x07payload\x18\x01\x20\x02(\x0cR\x07payload\x12\x12\n\x04has\ + h\x18\x02\x20\x01(\x0cR\x04hash\"&\n\nProdTestT1\x12\x18\n\x07payload\ + \x18\x01\x20\x01(\x0cR\x07payloadB>\n#com.satoshilabs.trezor.lib.protobu\ + fB\x17TrezorMessageBootloader\ +"; + +/// `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(4); + messages.push(FirmwareErase::generated_message_descriptor_data()); + messages.push(FirmwareRequest::generated_message_descriptor_data()); + messages.push(FirmwareUpload::generated_message_descriptor_data()); + messages.push(ProdTestT1::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_cardano.rs b/wallet/trezor-client/src/protos/generated/messages_cardano.rs new file mode 100644 index 0000000000..eebc579b05 --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_cardano.rs @@ -0,0 +1,10240 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-cardano.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoBlockchainPointerType) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoBlockchainPointerType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoBlockchainPointerType.block_index) + pub block_index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoBlockchainPointerType.tx_index) + pub tx_index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoBlockchainPointerType.certificate_index) + pub certificate_index: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoBlockchainPointerType.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoBlockchainPointerType { + fn default() -> &'a CardanoBlockchainPointerType { + ::default_instance() + } +} + +impl CardanoBlockchainPointerType { + pub fn new() -> CardanoBlockchainPointerType { + ::std::default::Default::default() + } + + // required uint32 block_index = 1; + + pub fn block_index(&self) -> u32 { + self.block_index.unwrap_or(0) + } + + pub fn clear_block_index(&mut self) { + self.block_index = ::std::option::Option::None; + } + + pub fn has_block_index(&self) -> bool { + self.block_index.is_some() + } + + // Param is passed by value, moved + pub fn set_block_index(&mut self, v: u32) { + self.block_index = ::std::option::Option::Some(v); + } + + // required uint32 tx_index = 2; + + pub fn tx_index(&self) -> u32 { + self.tx_index.unwrap_or(0) + } + + pub fn clear_tx_index(&mut self) { + self.tx_index = ::std::option::Option::None; + } + + pub fn has_tx_index(&self) -> bool { + self.tx_index.is_some() + } + + // Param is passed by value, moved + pub fn set_tx_index(&mut self, v: u32) { + self.tx_index = ::std::option::Option::Some(v); + } + + // required uint32 certificate_index = 3; + + pub fn certificate_index(&self) -> u32 { + self.certificate_index.unwrap_or(0) + } + + pub fn clear_certificate_index(&mut self) { + self.certificate_index = ::std::option::Option::None; + } + + pub fn has_certificate_index(&self) -> bool { + self.certificate_index.is_some() + } + + // Param is passed by value, moved + pub fn set_certificate_index(&mut self, v: u32) { + self.certificate_index = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "block_index", + |m: &CardanoBlockchainPointerType| { &m.block_index }, + |m: &mut CardanoBlockchainPointerType| { &mut m.block_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "tx_index", + |m: &CardanoBlockchainPointerType| { &m.tx_index }, + |m: &mut CardanoBlockchainPointerType| { &mut m.tx_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "certificate_index", + |m: &CardanoBlockchainPointerType| { &m.certificate_index }, + |m: &mut CardanoBlockchainPointerType| { &mut m.certificate_index }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoBlockchainPointerType", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoBlockchainPointerType { + const NAME: &'static str = "CardanoBlockchainPointerType"; + + fn is_initialized(&self) -> bool { + if self.block_index.is_none() { + return false; + } + if self.tx_index.is_none() { + return false; + } + if self.certificate_index.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.block_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 16 => { + self.tx_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 24 => { + self.certificate_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.block_index { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.tx_index { + my_size += ::protobuf::rt::uint32_size(2, v); + } + if let Some(v) = self.certificate_index { + my_size += ::protobuf::rt::uint32_size(3, 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.block_index { + os.write_uint32(1, v)?; + } + if let Some(v) = self.tx_index { + os.write_uint32(2, v)?; + } + if let Some(v) = self.certificate_index { + os.write_uint32(3, 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() -> CardanoBlockchainPointerType { + CardanoBlockchainPointerType::new() + } + + fn clear(&mut self) { + self.block_index = ::std::option::Option::None; + self.tx_index = ::std::option::Option::None; + self.certificate_index = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoBlockchainPointerType { + static instance: CardanoBlockchainPointerType = CardanoBlockchainPointerType { + block_index: ::std::option::Option::None, + tx_index: ::std::option::Option::None, + certificate_index: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoBlockchainPointerType { + 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("CardanoBlockchainPointerType").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoBlockchainPointerType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoBlockchainPointerType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoNativeScript) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoNativeScript { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoNativeScript.type) + pub type_: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoNativeScript.scripts) + pub scripts: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoNativeScript.key_hash) + pub key_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoNativeScript.key_path) + pub key_path: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoNativeScript.required_signatures_count) + pub required_signatures_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoNativeScript.invalid_before) + pub invalid_before: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoNativeScript.invalid_hereafter) + pub invalid_hereafter: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoNativeScript.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoNativeScript { + fn default() -> &'a CardanoNativeScript { + ::default_instance() + } +} + +impl CardanoNativeScript { + pub fn new() -> CardanoNativeScript { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.cardano.CardanoNativeScriptType type = 1; + + pub fn type_(&self) -> CardanoNativeScriptType { + match self.type_ { + Some(e) => e.enum_value_or(CardanoNativeScriptType::PUB_KEY), + None => CardanoNativeScriptType::PUB_KEY, + } + } + + pub fn clear_type_(&mut self) { + self.type_ = ::std::option::Option::None; + } + + pub fn has_type(&self) -> bool { + self.type_.is_some() + } + + // Param is passed by value, moved + pub fn set_type(&mut self, v: CardanoNativeScriptType) { + self.type_ = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bytes key_hash = 3; + + pub fn key_hash(&self) -> &[u8] { + match self.key_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_key_hash(&mut self) { + self.key_hash = ::std::option::Option::None; + } + + pub fn has_key_hash(&self) -> bool { + self.key_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_key_hash(&mut self, v: ::std::vec::Vec) { + self.key_hash = ::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_key_hash(&mut self) -> &mut ::std::vec::Vec { + if self.key_hash.is_none() { + self.key_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.key_hash.as_mut().unwrap() + } + + // Take field + pub fn take_key_hash(&mut self) -> ::std::vec::Vec { + self.key_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 required_signatures_count = 5; + + pub fn required_signatures_count(&self) -> u32 { + self.required_signatures_count.unwrap_or(0) + } + + pub fn clear_required_signatures_count(&mut self) { + self.required_signatures_count = ::std::option::Option::None; + } + + pub fn has_required_signatures_count(&self) -> bool { + self.required_signatures_count.is_some() + } + + // Param is passed by value, moved + pub fn set_required_signatures_count(&mut self, v: u32) { + self.required_signatures_count = ::std::option::Option::Some(v); + } + + // optional uint64 invalid_before = 6; + + pub fn invalid_before(&self) -> u64 { + self.invalid_before.unwrap_or(0) + } + + pub fn clear_invalid_before(&mut self) { + self.invalid_before = ::std::option::Option::None; + } + + pub fn has_invalid_before(&self) -> bool { + self.invalid_before.is_some() + } + + // Param is passed by value, moved + pub fn set_invalid_before(&mut self, v: u64) { + self.invalid_before = ::std::option::Option::Some(v); + } + + // optional uint64 invalid_hereafter = 7; + + pub fn invalid_hereafter(&self) -> u64 { + self.invalid_hereafter.unwrap_or(0) + } + + pub fn clear_invalid_hereafter(&mut self) { + self.invalid_hereafter = ::std::option::Option::None; + } + + pub fn has_invalid_hereafter(&self) -> bool { + self.invalid_hereafter.is_some() + } + + // Param is passed by value, moved + pub fn set_invalid_hereafter(&mut self, v: u64) { + self.invalid_hereafter = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(7); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "type", + |m: &CardanoNativeScript| { &m.type_ }, + |m: &mut CardanoNativeScript| { &mut m.type_ }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "scripts", + |m: &CardanoNativeScript| { &m.scripts }, + |m: &mut CardanoNativeScript| { &mut m.scripts }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "key_hash", + |m: &CardanoNativeScript| { &m.key_hash }, + |m: &mut CardanoNativeScript| { &mut m.key_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "key_path", + |m: &CardanoNativeScript| { &m.key_path }, + |m: &mut CardanoNativeScript| { &mut m.key_path }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "required_signatures_count", + |m: &CardanoNativeScript| { &m.required_signatures_count }, + |m: &mut CardanoNativeScript| { &mut m.required_signatures_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "invalid_before", + |m: &CardanoNativeScript| { &m.invalid_before }, + |m: &mut CardanoNativeScript| { &mut m.invalid_before }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "invalid_hereafter", + |m: &CardanoNativeScript| { &m.invalid_hereafter }, + |m: &mut CardanoNativeScript| { &mut m.invalid_hereafter }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoNativeScript", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoNativeScript { + const NAME: &'static str = "CardanoNativeScript"; + + fn is_initialized(&self) -> bool { + if self.type_.is_none() { + return false; + } + for v in &self.scripts { + if !v.is_initialized() { + 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.type_ = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 18 => { + self.scripts.push(is.read_message()?); + }, + 26 => { + self.key_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + is.read_repeated_packed_uint32_into(&mut self.key_path)?; + }, + 32 => { + self.key_path.push(is.read_uint32()?); + }, + 40 => { + self.required_signatures_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.invalid_before = ::std::option::Option::Some(is.read_uint64()?); + }, + 56 => { + self.invalid_hereafter = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.type_ { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + for value in &self.scripts { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + if let Some(v) = self.key_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + for value in &self.key_path { + my_size += ::protobuf::rt::uint32_size(4, *value); + }; + if let Some(v) = self.required_signatures_count { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.invalid_before { + my_size += ::protobuf::rt::uint64_size(6, v); + } + if let Some(v) = self.invalid_hereafter { + my_size += ::protobuf::rt::uint64_size(7, 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.type_ { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + for v in &self.scripts { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + }; + if let Some(v) = self.key_hash.as_ref() { + os.write_bytes(3, v)?; + } + for v in &self.key_path { + os.write_uint32(4, *v)?; + }; + if let Some(v) = self.required_signatures_count { + os.write_uint32(5, v)?; + } + if let Some(v) = self.invalid_before { + os.write_uint64(6, v)?; + } + if let Some(v) = self.invalid_hereafter { + os.write_uint64(7, 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() -> CardanoNativeScript { + CardanoNativeScript::new() + } + + fn clear(&mut self) { + self.type_ = ::std::option::Option::None; + self.scripts.clear(); + self.key_hash = ::std::option::Option::None; + self.key_path.clear(); + self.required_signatures_count = ::std::option::Option::None; + self.invalid_before = ::std::option::Option::None; + self.invalid_hereafter = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoNativeScript { + static instance: CardanoNativeScript = CardanoNativeScript { + type_: ::std::option::Option::None, + scripts: ::std::vec::Vec::new(), + key_hash: ::std::option::Option::None, + key_path: ::std::vec::Vec::new(), + required_signatures_count: ::std::option::Option::None, + invalid_before: ::std::option::Option::None, + invalid_hereafter: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoNativeScript { + 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("CardanoNativeScript").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoNativeScript { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoNativeScript { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoGetNativeScriptHash) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoGetNativeScriptHash { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoGetNativeScriptHash.script) + pub script: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoGetNativeScriptHash.display_format) + pub display_format: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoGetNativeScriptHash.derivation_type) + pub derivation_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoGetNativeScriptHash.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoGetNativeScriptHash { + fn default() -> &'a CardanoGetNativeScriptHash { + ::default_instance() + } +} + +impl CardanoGetNativeScriptHash { + pub fn new() -> CardanoGetNativeScriptHash { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.cardano.CardanoNativeScriptHashDisplayFormat display_format = 2; + + pub fn display_format(&self) -> CardanoNativeScriptHashDisplayFormat { + match self.display_format { + Some(e) => e.enum_value_or(CardanoNativeScriptHashDisplayFormat::HIDE), + None => CardanoNativeScriptHashDisplayFormat::HIDE, + } + } + + pub fn clear_display_format(&mut self) { + self.display_format = ::std::option::Option::None; + } + + pub fn has_display_format(&self) -> bool { + self.display_format.is_some() + } + + // Param is passed by value, moved + pub fn set_display_format(&mut self, v: CardanoNativeScriptHashDisplayFormat) { + self.display_format = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // required .hw.trezor.messages.cardano.CardanoDerivationType derivation_type = 3; + + pub fn derivation_type(&self) -> CardanoDerivationType { + match self.derivation_type { + Some(e) => e.enum_value_or(CardanoDerivationType::LEDGER), + None => CardanoDerivationType::LEDGER, + } + } + + pub fn clear_derivation_type(&mut self) { + self.derivation_type = ::std::option::Option::None; + } + + pub fn has_derivation_type(&self) -> bool { + self.derivation_type.is_some() + } + + // Param is passed by value, moved + pub fn set_derivation_type(&mut self, v: CardanoDerivationType) { + self.derivation_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, CardanoNativeScript>( + "script", + |m: &CardanoGetNativeScriptHash| { &m.script }, + |m: &mut CardanoGetNativeScriptHash| { &mut m.script }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "display_format", + |m: &CardanoGetNativeScriptHash| { &m.display_format }, + |m: &mut CardanoGetNativeScriptHash| { &mut m.display_format }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "derivation_type", + |m: &CardanoGetNativeScriptHash| { &m.derivation_type }, + |m: &mut CardanoGetNativeScriptHash| { &mut m.derivation_type }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoGetNativeScriptHash", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoGetNativeScriptHash { + const NAME: &'static str = "CardanoGetNativeScriptHash"; + + fn is_initialized(&self) -> bool { + if self.script.is_none() { + return false; + } + if self.display_format.is_none() { + return false; + } + if self.derivation_type.is_none() { + return false; + } + for v in &self.script { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.script)?; + }, + 16 => { + self.display_format = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 24 => { + self.derivation_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 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.script.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.display_format { + my_size += ::protobuf::rt::int32_size(2, v.value()); + } + if let Some(v) = self.derivation_type { + my_size += ::protobuf::rt::int32_size(3, v.value()); + } + 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.script.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.display_format { + os.write_enum(2, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.derivation_type { + os.write_enum(3, ::protobuf::EnumOrUnknown::value(&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() -> CardanoGetNativeScriptHash { + CardanoGetNativeScriptHash::new() + } + + fn clear(&mut self) { + self.script.clear(); + self.display_format = ::std::option::Option::None; + self.derivation_type = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoGetNativeScriptHash { + static instance: CardanoGetNativeScriptHash = CardanoGetNativeScriptHash { + script: ::protobuf::MessageField::none(), + display_format: ::std::option::Option::None, + derivation_type: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoGetNativeScriptHash { + 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("CardanoGetNativeScriptHash").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoGetNativeScriptHash { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoGetNativeScriptHash { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoNativeScriptHash) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoNativeScriptHash { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoNativeScriptHash.script_hash) + pub script_hash: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoNativeScriptHash.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoNativeScriptHash { + fn default() -> &'a CardanoNativeScriptHash { + ::default_instance() + } +} + +impl CardanoNativeScriptHash { + pub fn new() -> CardanoNativeScriptHash { + ::std::default::Default::default() + } + + // required bytes script_hash = 1; + + pub fn script_hash(&self) -> &[u8] { + match self.script_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_script_hash(&mut self) { + self.script_hash = ::std::option::Option::None; + } + + pub fn has_script_hash(&self) -> bool { + self.script_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_script_hash(&mut self, v: ::std::vec::Vec) { + self.script_hash = ::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_script_hash(&mut self) -> &mut ::std::vec::Vec { + if self.script_hash.is_none() { + self.script_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.script_hash.as_mut().unwrap() + } + + // Take field + pub fn take_script_hash(&mut self) -> ::std::vec::Vec { + self.script_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_hash", + |m: &CardanoNativeScriptHash| { &m.script_hash }, + |m: &mut CardanoNativeScriptHash| { &mut m.script_hash }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoNativeScriptHash", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoNativeScriptHash { + const NAME: &'static str = "CardanoNativeScriptHash"; + + fn is_initialized(&self) -> bool { + if self.script_hash.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.script_hash = ::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.script_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.script_hash.as_ref() { + os.write_bytes(1, 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() -> CardanoNativeScriptHash { + CardanoNativeScriptHash::new() + } + + fn clear(&mut self) { + self.script_hash = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoNativeScriptHash { + static instance: CardanoNativeScriptHash = CardanoNativeScriptHash { + script_hash: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoNativeScriptHash { + 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("CardanoNativeScriptHash").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoNativeScriptHash { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoNativeScriptHash { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoAddressParametersType) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoAddressParametersType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoAddressParametersType.address_type) + pub address_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoAddressParametersType.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoAddressParametersType.address_n_staking) + pub address_n_staking: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoAddressParametersType.staking_key_hash) + pub staking_key_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoAddressParametersType.certificate_pointer) + pub certificate_pointer: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoAddressParametersType.script_payment_hash) + pub script_payment_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoAddressParametersType.script_staking_hash) + pub script_staking_hash: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoAddressParametersType.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoAddressParametersType { + fn default() -> &'a CardanoAddressParametersType { + ::default_instance() + } +} + +impl CardanoAddressParametersType { + pub fn new() -> CardanoAddressParametersType { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.cardano.CardanoAddressType address_type = 1; + + pub fn address_type(&self) -> CardanoAddressType { + match self.address_type { + Some(e) => e.enum_value_or(CardanoAddressType::BASE), + None => CardanoAddressType::BASE, + } + } + + pub fn clear_address_type(&mut self) { + self.address_type = ::std::option::Option::None; + } + + pub fn has_address_type(&self) -> bool { + self.address_type.is_some() + } + + // Param is passed by value, moved + pub fn set_address_type(&mut self, v: CardanoAddressType) { + self.address_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bytes staking_key_hash = 4; + + pub fn staking_key_hash(&self) -> &[u8] { + match self.staking_key_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_staking_key_hash(&mut self) { + self.staking_key_hash = ::std::option::Option::None; + } + + pub fn has_staking_key_hash(&self) -> bool { + self.staking_key_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_staking_key_hash(&mut self, v: ::std::vec::Vec) { + self.staking_key_hash = ::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_staking_key_hash(&mut self) -> &mut ::std::vec::Vec { + if self.staking_key_hash.is_none() { + self.staking_key_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.staking_key_hash.as_mut().unwrap() + } + + // Take field + pub fn take_staking_key_hash(&mut self) -> ::std::vec::Vec { + self.staking_key_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes script_payment_hash = 6; + + pub fn script_payment_hash(&self) -> &[u8] { + match self.script_payment_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_script_payment_hash(&mut self) { + self.script_payment_hash = ::std::option::Option::None; + } + + pub fn has_script_payment_hash(&self) -> bool { + self.script_payment_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_script_payment_hash(&mut self, v: ::std::vec::Vec) { + self.script_payment_hash = ::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_script_payment_hash(&mut self) -> &mut ::std::vec::Vec { + if self.script_payment_hash.is_none() { + self.script_payment_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.script_payment_hash.as_mut().unwrap() + } + + // Take field + pub fn take_script_payment_hash(&mut self) -> ::std::vec::Vec { + self.script_payment_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes script_staking_hash = 7; + + pub fn script_staking_hash(&self) -> &[u8] { + match self.script_staking_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_script_staking_hash(&mut self) { + self.script_staking_hash = ::std::option::Option::None; + } + + pub fn has_script_staking_hash(&self) -> bool { + self.script_staking_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_script_staking_hash(&mut self, v: ::std::vec::Vec) { + self.script_staking_hash = ::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_script_staking_hash(&mut self) -> &mut ::std::vec::Vec { + if self.script_staking_hash.is_none() { + self.script_staking_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.script_staking_hash.as_mut().unwrap() + } + + // Take field + pub fn take_script_staking_hash(&mut self) -> ::std::vec::Vec { + self.script_staking_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(7); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address_type", + |m: &CardanoAddressParametersType| { &m.address_type }, + |m: &mut CardanoAddressParametersType| { &mut m.address_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &CardanoAddressParametersType| { &m.address_n }, + |m: &mut CardanoAddressParametersType| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n_staking", + |m: &CardanoAddressParametersType| { &m.address_n_staking }, + |m: &mut CardanoAddressParametersType| { &mut m.address_n_staking }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "staking_key_hash", + |m: &CardanoAddressParametersType| { &m.staking_key_hash }, + |m: &mut CardanoAddressParametersType| { &mut m.staking_key_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, CardanoBlockchainPointerType>( + "certificate_pointer", + |m: &CardanoAddressParametersType| { &m.certificate_pointer }, + |m: &mut CardanoAddressParametersType| { &mut m.certificate_pointer }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_payment_hash", + |m: &CardanoAddressParametersType| { &m.script_payment_hash }, + |m: &mut CardanoAddressParametersType| { &mut m.script_payment_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_staking_hash", + |m: &CardanoAddressParametersType| { &m.script_staking_hash }, + |m: &mut CardanoAddressParametersType| { &mut m.script_staking_hash }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoAddressParametersType", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoAddressParametersType { + const NAME: &'static str = "CardanoAddressParametersType"; + + fn is_initialized(&self) -> bool { + if self.address_type.is_none() { + return false; + } + for v in &self.certificate_pointer { + if !v.is_initialized() { + 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.address_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 18 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 16 => { + self.address_n.push(is.read_uint32()?); + }, + 26 => { + is.read_repeated_packed_uint32_into(&mut self.address_n_staking)?; + }, + 24 => { + self.address_n_staking.push(is.read_uint32()?); + }, + 34 => { + self.staking_key_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 42 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.certificate_pointer)?; + }, + 50 => { + self.script_payment_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 58 => { + self.script_staking_hash = ::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.address_type { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(2, *value); + }; + for value in &self.address_n_staking { + my_size += ::protobuf::rt::uint32_size(3, *value); + }; + if let Some(v) = self.staking_key_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.certificate_pointer.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.script_payment_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &v); + } + if let Some(v) = self.script_staking_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(7, &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_type { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + for v in &self.address_n { + os.write_uint32(2, *v)?; + }; + for v in &self.address_n_staking { + os.write_uint32(3, *v)?; + }; + if let Some(v) = self.staking_key_hash.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.certificate_pointer.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + } + if let Some(v) = self.script_payment_hash.as_ref() { + os.write_bytes(6, v)?; + } + if let Some(v) = self.script_staking_hash.as_ref() { + os.write_bytes(7, 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() -> CardanoAddressParametersType { + CardanoAddressParametersType::new() + } + + fn clear(&mut self) { + self.address_type = ::std::option::Option::None; + self.address_n.clear(); + self.address_n_staking.clear(); + self.staking_key_hash = ::std::option::Option::None; + self.certificate_pointer.clear(); + self.script_payment_hash = ::std::option::Option::None; + self.script_staking_hash = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoAddressParametersType { + static instance: CardanoAddressParametersType = CardanoAddressParametersType { + address_type: ::std::option::Option::None, + address_n: ::std::vec::Vec::new(), + address_n_staking: ::std::vec::Vec::new(), + staking_key_hash: ::std::option::Option::None, + certificate_pointer: ::protobuf::MessageField::none(), + script_payment_hash: ::std::option::Option::None, + script_staking_hash: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoAddressParametersType { + 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("CardanoAddressParametersType").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoAddressParametersType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoAddressParametersType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoGetAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoGetAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoGetAddress.show_display) + pub show_display: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoGetAddress.protocol_magic) + pub protocol_magic: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoGetAddress.network_id) + pub network_id: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoGetAddress.address_parameters) + pub address_parameters: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoGetAddress.derivation_type) + pub derivation_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoGetAddress.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoGetAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoGetAddress { + fn default() -> &'a CardanoGetAddress { + ::default_instance() + } +} + +impl CardanoGetAddress { + pub fn new() -> CardanoGetAddress { + ::std::default::Default::default() + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + // required uint32 protocol_magic = 3; + + pub fn protocol_magic(&self) -> u32 { + self.protocol_magic.unwrap_or(0) + } + + pub fn clear_protocol_magic(&mut self) { + self.protocol_magic = ::std::option::Option::None; + } + + pub fn has_protocol_magic(&self) -> bool { + self.protocol_magic.is_some() + } + + // Param is passed by value, moved + pub fn set_protocol_magic(&mut self, v: u32) { + self.protocol_magic = ::std::option::Option::Some(v); + } + + // required uint32 network_id = 4; + + pub fn network_id(&self) -> u32 { + self.network_id.unwrap_or(0) + } + + pub fn clear_network_id(&mut self) { + self.network_id = ::std::option::Option::None; + } + + pub fn has_network_id(&self) -> bool { + self.network_id.is_some() + } + + // Param is passed by value, moved + pub fn set_network_id(&mut self, v: u32) { + self.network_id = ::std::option::Option::Some(v); + } + + // required .hw.trezor.messages.cardano.CardanoDerivationType derivation_type = 6; + + pub fn derivation_type(&self) -> CardanoDerivationType { + match self.derivation_type { + Some(e) => e.enum_value_or(CardanoDerivationType::LEDGER), + None => CardanoDerivationType::LEDGER, + } + } + + pub fn clear_derivation_type(&mut self) { + self.derivation_type = ::std::option::Option::None; + } + + pub fn has_derivation_type(&self) -> bool { + self.derivation_type.is_some() + } + + // Param is passed by value, moved + pub fn set_derivation_type(&mut self, v: CardanoDerivationType) { + self.derivation_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bool chunkify = 7; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &CardanoGetAddress| { &m.show_display }, + |m: &mut CardanoGetAddress| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "protocol_magic", + |m: &CardanoGetAddress| { &m.protocol_magic }, + |m: &mut CardanoGetAddress| { &mut m.protocol_magic }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "network_id", + |m: &CardanoGetAddress| { &m.network_id }, + |m: &mut CardanoGetAddress| { &mut m.network_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, CardanoAddressParametersType>( + "address_parameters", + |m: &CardanoGetAddress| { &m.address_parameters }, + |m: &mut CardanoGetAddress| { &mut m.address_parameters }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "derivation_type", + |m: &CardanoGetAddress| { &m.derivation_type }, + |m: &mut CardanoGetAddress| { &mut m.derivation_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &CardanoGetAddress| { &m.chunkify }, + |m: &mut CardanoGetAddress| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoGetAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoGetAddress { + const NAME: &'static str = "CardanoGetAddress"; + + fn is_initialized(&self) -> bool { + if self.protocol_magic.is_none() { + return false; + } + if self.network_id.is_none() { + return false; + } + if self.address_parameters.is_none() { + return false; + } + if self.derivation_type.is_none() { + return false; + } + for v in &self.address_parameters { + if !v.is_initialized() { + 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 { + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 24 => { + self.protocol_magic = ::std::option::Option::Some(is.read_uint32()?); + }, + 32 => { + self.network_id = ::std::option::Option::Some(is.read_uint32()?); + }, + 42 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.address_parameters)?; + }, + 48 => { + self.derivation_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 56 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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.show_display { + my_size += 1 + 1; + } + if let Some(v) = self.protocol_magic { + my_size += ::protobuf::rt::uint32_size(3, v); + } + if let Some(v) = self.network_id { + my_size += ::protobuf::rt::uint32_size(4, v); + } + if let Some(v) = self.address_parameters.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.derivation_type { + my_size += ::protobuf::rt::int32_size(6, v.value()); + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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.show_display { + os.write_bool(2, v)?; + } + if let Some(v) = self.protocol_magic { + os.write_uint32(3, v)?; + } + if let Some(v) = self.network_id { + os.write_uint32(4, v)?; + } + if let Some(v) = self.address_parameters.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + } + if let Some(v) = self.derivation_type { + os.write_enum(6, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.chunkify { + os.write_bool(7, 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() -> CardanoGetAddress { + CardanoGetAddress::new() + } + + fn clear(&mut self) { + self.show_display = ::std::option::Option::None; + self.protocol_magic = ::std::option::Option::None; + self.network_id = ::std::option::Option::None; + self.address_parameters.clear(); + self.derivation_type = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoGetAddress { + static instance: CardanoGetAddress = CardanoGetAddress { + show_display: ::std::option::Option::None, + protocol_magic: ::std::option::Option::None, + network_id: ::std::option::Option::None, + address_parameters: ::protobuf::MessageField::none(), + derivation_type: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoGetAddress { + 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("CardanoGetAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoGetAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoGetAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoAddress.address) + pub address: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoAddress { + fn default() -> &'a CardanoAddress { + ::default_instance() + } +} + +impl CardanoAddress { + pub fn new() -> CardanoAddress { + ::std::default::Default::default() + } + + // required string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &CardanoAddress| { &m.address }, + |m: &mut CardanoAddress| { &mut m.address }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoAddress { + const NAME: &'static str = "CardanoAddress"; + + fn is_initialized(&self) -> bool { + if self.address.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_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::string_size(1, &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_string(1, 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() -> CardanoAddress { + CardanoAddress::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoAddress { + static instance: CardanoAddress = CardanoAddress { + address: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoAddress { + 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("CardanoAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoGetPublicKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoGetPublicKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoGetPublicKey.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoGetPublicKey.show_display) + pub show_display: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoGetPublicKey.derivation_type) + pub derivation_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoGetPublicKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoGetPublicKey { + fn default() -> &'a CardanoGetPublicKey { + ::default_instance() + } +} + +impl CardanoGetPublicKey { + pub fn new() -> CardanoGetPublicKey { + ::std::default::Default::default() + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + // required .hw.trezor.messages.cardano.CardanoDerivationType derivation_type = 3; + + pub fn derivation_type(&self) -> CardanoDerivationType { + match self.derivation_type { + Some(e) => e.enum_value_or(CardanoDerivationType::LEDGER), + None => CardanoDerivationType::LEDGER, + } + } + + pub fn clear_derivation_type(&mut self) { + self.derivation_type = ::std::option::Option::None; + } + + pub fn has_derivation_type(&self) -> bool { + self.derivation_type.is_some() + } + + // Param is passed by value, moved + pub fn set_derivation_type(&mut self, v: CardanoDerivationType) { + self.derivation_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &CardanoGetPublicKey| { &m.address_n }, + |m: &mut CardanoGetPublicKey| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &CardanoGetPublicKey| { &m.show_display }, + |m: &mut CardanoGetPublicKey| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "derivation_type", + |m: &CardanoGetPublicKey| { &m.derivation_type }, + |m: &mut CardanoGetPublicKey| { &mut m.derivation_type }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoGetPublicKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoGetPublicKey { + const NAME: &'static str = "CardanoGetPublicKey"; + + fn is_initialized(&self) -> bool { + if self.derivation_type.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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 24 => { + self.derivation_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + if let Some(v) = self.derivation_type { + my_size += ::protobuf::rt::int32_size(3, v.value()); + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.show_display { + os.write_bool(2, v)?; + } + if let Some(v) = self.derivation_type { + os.write_enum(3, ::protobuf::EnumOrUnknown::value(&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() -> CardanoGetPublicKey { + CardanoGetPublicKey::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.show_display = ::std::option::Option::None; + self.derivation_type = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoGetPublicKey { + static instance: CardanoGetPublicKey = CardanoGetPublicKey { + address_n: ::std::vec::Vec::new(), + show_display: ::std::option::Option::None, + derivation_type: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoGetPublicKey { + 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("CardanoGetPublicKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoGetPublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoGetPublicKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoPublicKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoPublicKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPublicKey.xpub) + pub xpub: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPublicKey.node) + pub node: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoPublicKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoPublicKey { + fn default() -> &'a CardanoPublicKey { + ::default_instance() + } +} + +impl CardanoPublicKey { + pub fn new() -> CardanoPublicKey { + ::std::default::Default::default() + } + + // required string xpub = 1; + + pub fn xpub(&self) -> &str { + match self.xpub.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_xpub(&mut self) { + self.xpub = ::std::option::Option::None; + } + + pub fn has_xpub(&self) -> bool { + self.xpub.is_some() + } + + // Param is passed by value, moved + pub fn set_xpub(&mut self, v: ::std::string::String) { + self.xpub = ::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_xpub(&mut self) -> &mut ::std::string::String { + if self.xpub.is_none() { + self.xpub = ::std::option::Option::Some(::std::string::String::new()); + } + self.xpub.as_mut().unwrap() + } + + // Take field + pub fn take_xpub(&mut self) -> ::std::string::String { + self.xpub.take().unwrap_or_else(|| ::std::string::String::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::<_, _>( + "xpub", + |m: &CardanoPublicKey| { &m.xpub }, + |m: &mut CardanoPublicKey| { &mut m.xpub }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::messages_common::HDNodeType>( + "node", + |m: &CardanoPublicKey| { &m.node }, + |m: &mut CardanoPublicKey| { &mut m.node }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoPublicKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoPublicKey { + const NAME: &'static str = "CardanoPublicKey"; + + fn is_initialized(&self) -> bool { + if self.xpub.is_none() { + return false; + } + if self.node.is_none() { + return false; + } + for v in &self.node { + if !v.is_initialized() { + 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.xpub = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.node)?; + }, + 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.xpub.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.node.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.xpub.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.node.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + 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() -> CardanoPublicKey { + CardanoPublicKey::new() + } + + fn clear(&mut self) { + self.xpub = ::std::option::Option::None; + self.node.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoPublicKey { + static instance: CardanoPublicKey = CardanoPublicKey { + xpub: ::std::option::Option::None, + node: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoPublicKey { + 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("CardanoPublicKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoPublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoPublicKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoSignTxInit) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoSignTxInit { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.signing_mode) + pub signing_mode: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.protocol_magic) + pub protocol_magic: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.network_id) + pub network_id: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.inputs_count) + pub inputs_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.outputs_count) + pub outputs_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.fee) + pub fee: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.ttl) + pub ttl: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.certificates_count) + pub certificates_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.withdrawals_count) + pub withdrawals_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.has_auxiliary_data) + pub has_auxiliary_data: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.validity_interval_start) + pub validity_interval_start: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.witness_requests_count) + pub witness_requests_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.minting_asset_groups_count) + pub minting_asset_groups_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.derivation_type) + pub derivation_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.include_network_id) + pub include_network_id: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.script_data_hash) + pub script_data_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.collateral_inputs_count) + pub collateral_inputs_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.required_signers_count) + pub required_signers_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.has_collateral_return) + pub has_collateral_return: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.total_collateral) + pub total_collateral: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.reference_inputs_count) + pub reference_inputs_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoSignTxInit.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoSignTxInit.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoSignTxInit { + fn default() -> &'a CardanoSignTxInit { + ::default_instance() + } +} + +impl CardanoSignTxInit { + pub fn new() -> CardanoSignTxInit { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.cardano.CardanoTxSigningMode signing_mode = 1; + + pub fn signing_mode(&self) -> CardanoTxSigningMode { + match self.signing_mode { + Some(e) => e.enum_value_or(CardanoTxSigningMode::ORDINARY_TRANSACTION), + None => CardanoTxSigningMode::ORDINARY_TRANSACTION, + } + } + + pub fn clear_signing_mode(&mut self) { + self.signing_mode = ::std::option::Option::None; + } + + pub fn has_signing_mode(&self) -> bool { + self.signing_mode.is_some() + } + + // Param is passed by value, moved + pub fn set_signing_mode(&mut self, v: CardanoTxSigningMode) { + self.signing_mode = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // required uint32 protocol_magic = 2; + + pub fn protocol_magic(&self) -> u32 { + self.protocol_magic.unwrap_or(0) + } + + pub fn clear_protocol_magic(&mut self) { + self.protocol_magic = ::std::option::Option::None; + } + + pub fn has_protocol_magic(&self) -> bool { + self.protocol_magic.is_some() + } + + // Param is passed by value, moved + pub fn set_protocol_magic(&mut self, v: u32) { + self.protocol_magic = ::std::option::Option::Some(v); + } + + // required uint32 network_id = 3; + + pub fn network_id(&self) -> u32 { + self.network_id.unwrap_or(0) + } + + pub fn clear_network_id(&mut self) { + self.network_id = ::std::option::Option::None; + } + + pub fn has_network_id(&self) -> bool { + self.network_id.is_some() + } + + // Param is passed by value, moved + pub fn set_network_id(&mut self, v: u32) { + self.network_id = ::std::option::Option::Some(v); + } + + // required uint32 inputs_count = 4; + + pub fn inputs_count(&self) -> u32 { + self.inputs_count.unwrap_or(0) + } + + pub fn clear_inputs_count(&mut self) { + self.inputs_count = ::std::option::Option::None; + } + + pub fn has_inputs_count(&self) -> bool { + self.inputs_count.is_some() + } + + // Param is passed by value, moved + pub fn set_inputs_count(&mut self, v: u32) { + self.inputs_count = ::std::option::Option::Some(v); + } + + // required uint32 outputs_count = 5; + + pub fn outputs_count(&self) -> u32 { + self.outputs_count.unwrap_or(0) + } + + pub fn clear_outputs_count(&mut self) { + self.outputs_count = ::std::option::Option::None; + } + + pub fn has_outputs_count(&self) -> bool { + self.outputs_count.is_some() + } + + // Param is passed by value, moved + pub fn set_outputs_count(&mut self, v: u32) { + self.outputs_count = ::std::option::Option::Some(v); + } + + // required uint64 fee = 6; + + pub fn fee(&self) -> u64 { + self.fee.unwrap_or(0) + } + + pub fn clear_fee(&mut self) { + self.fee = ::std::option::Option::None; + } + + pub fn has_fee(&self) -> bool { + self.fee.is_some() + } + + // Param is passed by value, moved + pub fn set_fee(&mut self, v: u64) { + self.fee = ::std::option::Option::Some(v); + } + + // optional uint64 ttl = 7; + + pub fn ttl(&self) -> u64 { + self.ttl.unwrap_or(0) + } + + pub fn clear_ttl(&mut self) { + self.ttl = ::std::option::Option::None; + } + + pub fn has_ttl(&self) -> bool { + self.ttl.is_some() + } + + // Param is passed by value, moved + pub fn set_ttl(&mut self, v: u64) { + self.ttl = ::std::option::Option::Some(v); + } + + // required uint32 certificates_count = 8; + + pub fn certificates_count(&self) -> u32 { + self.certificates_count.unwrap_or(0) + } + + pub fn clear_certificates_count(&mut self) { + self.certificates_count = ::std::option::Option::None; + } + + pub fn has_certificates_count(&self) -> bool { + self.certificates_count.is_some() + } + + // Param is passed by value, moved + pub fn set_certificates_count(&mut self, v: u32) { + self.certificates_count = ::std::option::Option::Some(v); + } + + // required uint32 withdrawals_count = 9; + + pub fn withdrawals_count(&self) -> u32 { + self.withdrawals_count.unwrap_or(0) + } + + pub fn clear_withdrawals_count(&mut self) { + self.withdrawals_count = ::std::option::Option::None; + } + + pub fn has_withdrawals_count(&self) -> bool { + self.withdrawals_count.is_some() + } + + // Param is passed by value, moved + pub fn set_withdrawals_count(&mut self, v: u32) { + self.withdrawals_count = ::std::option::Option::Some(v); + } + + // required bool has_auxiliary_data = 10; + + pub fn has_auxiliary_data(&self) -> bool { + self.has_auxiliary_data.unwrap_or(false) + } + + pub fn clear_has_auxiliary_data(&mut self) { + self.has_auxiliary_data = ::std::option::Option::None; + } + + pub fn has_has_auxiliary_data(&self) -> bool { + self.has_auxiliary_data.is_some() + } + + // Param is passed by value, moved + pub fn set_has_auxiliary_data(&mut self, v: bool) { + self.has_auxiliary_data = ::std::option::Option::Some(v); + } + + // optional uint64 validity_interval_start = 11; + + pub fn validity_interval_start(&self) -> u64 { + self.validity_interval_start.unwrap_or(0) + } + + pub fn clear_validity_interval_start(&mut self) { + self.validity_interval_start = ::std::option::Option::None; + } + + pub fn has_validity_interval_start(&self) -> bool { + self.validity_interval_start.is_some() + } + + // Param is passed by value, moved + pub fn set_validity_interval_start(&mut self, v: u64) { + self.validity_interval_start = ::std::option::Option::Some(v); + } + + // required uint32 witness_requests_count = 12; + + pub fn witness_requests_count(&self) -> u32 { + self.witness_requests_count.unwrap_or(0) + } + + pub fn clear_witness_requests_count(&mut self) { + self.witness_requests_count = ::std::option::Option::None; + } + + pub fn has_witness_requests_count(&self) -> bool { + self.witness_requests_count.is_some() + } + + // Param is passed by value, moved + pub fn set_witness_requests_count(&mut self, v: u32) { + self.witness_requests_count = ::std::option::Option::Some(v); + } + + // required uint32 minting_asset_groups_count = 13; + + pub fn minting_asset_groups_count(&self) -> u32 { + self.minting_asset_groups_count.unwrap_or(0) + } + + pub fn clear_minting_asset_groups_count(&mut self) { + self.minting_asset_groups_count = ::std::option::Option::None; + } + + pub fn has_minting_asset_groups_count(&self) -> bool { + self.minting_asset_groups_count.is_some() + } + + // Param is passed by value, moved + pub fn set_minting_asset_groups_count(&mut self, v: u32) { + self.minting_asset_groups_count = ::std::option::Option::Some(v); + } + + // required .hw.trezor.messages.cardano.CardanoDerivationType derivation_type = 14; + + pub fn derivation_type(&self) -> CardanoDerivationType { + match self.derivation_type { + Some(e) => e.enum_value_or(CardanoDerivationType::LEDGER), + None => CardanoDerivationType::LEDGER, + } + } + + pub fn clear_derivation_type(&mut self) { + self.derivation_type = ::std::option::Option::None; + } + + pub fn has_derivation_type(&self) -> bool { + self.derivation_type.is_some() + } + + // Param is passed by value, moved + pub fn set_derivation_type(&mut self, v: CardanoDerivationType) { + self.derivation_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bool include_network_id = 15; + + pub fn include_network_id(&self) -> bool { + self.include_network_id.unwrap_or(false) + } + + pub fn clear_include_network_id(&mut self) { + self.include_network_id = ::std::option::Option::None; + } + + pub fn has_include_network_id(&self) -> bool { + self.include_network_id.is_some() + } + + // Param is passed by value, moved + pub fn set_include_network_id(&mut self, v: bool) { + self.include_network_id = ::std::option::Option::Some(v); + } + + // optional bytes script_data_hash = 16; + + pub fn script_data_hash(&self) -> &[u8] { + match self.script_data_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_script_data_hash(&mut self) { + self.script_data_hash = ::std::option::Option::None; + } + + pub fn has_script_data_hash(&self) -> bool { + self.script_data_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_script_data_hash(&mut self, v: ::std::vec::Vec) { + self.script_data_hash = ::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_script_data_hash(&mut self) -> &mut ::std::vec::Vec { + if self.script_data_hash.is_none() { + self.script_data_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.script_data_hash.as_mut().unwrap() + } + + // Take field + pub fn take_script_data_hash(&mut self) -> ::std::vec::Vec { + self.script_data_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint32 collateral_inputs_count = 17; + + pub fn collateral_inputs_count(&self) -> u32 { + self.collateral_inputs_count.unwrap_or(0) + } + + pub fn clear_collateral_inputs_count(&mut self) { + self.collateral_inputs_count = ::std::option::Option::None; + } + + pub fn has_collateral_inputs_count(&self) -> bool { + self.collateral_inputs_count.is_some() + } + + // Param is passed by value, moved + pub fn set_collateral_inputs_count(&mut self, v: u32) { + self.collateral_inputs_count = ::std::option::Option::Some(v); + } + + // required uint32 required_signers_count = 18; + + pub fn required_signers_count(&self) -> u32 { + self.required_signers_count.unwrap_or(0) + } + + pub fn clear_required_signers_count(&mut self) { + self.required_signers_count = ::std::option::Option::None; + } + + pub fn has_required_signers_count(&self) -> bool { + self.required_signers_count.is_some() + } + + // Param is passed by value, moved + pub fn set_required_signers_count(&mut self, v: u32) { + self.required_signers_count = ::std::option::Option::Some(v); + } + + // optional bool has_collateral_return = 19; + + pub fn has_collateral_return(&self) -> bool { + self.has_collateral_return.unwrap_or(false) + } + + pub fn clear_has_collateral_return(&mut self) { + self.has_collateral_return = ::std::option::Option::None; + } + + pub fn has_has_collateral_return(&self) -> bool { + self.has_collateral_return.is_some() + } + + // Param is passed by value, moved + pub fn set_has_collateral_return(&mut self, v: bool) { + self.has_collateral_return = ::std::option::Option::Some(v); + } + + // optional uint64 total_collateral = 20; + + pub fn total_collateral(&self) -> u64 { + self.total_collateral.unwrap_or(0) + } + + pub fn clear_total_collateral(&mut self) { + self.total_collateral = ::std::option::Option::None; + } + + pub fn has_total_collateral(&self) -> bool { + self.total_collateral.is_some() + } + + // Param is passed by value, moved + pub fn set_total_collateral(&mut self, v: u64) { + self.total_collateral = ::std::option::Option::Some(v); + } + + // optional uint32 reference_inputs_count = 21; + + pub fn reference_inputs_count(&self) -> u32 { + self.reference_inputs_count.unwrap_or(0u32) + } + + pub fn clear_reference_inputs_count(&mut self) { + self.reference_inputs_count = ::std::option::Option::None; + } + + pub fn has_reference_inputs_count(&self) -> bool { + self.reference_inputs_count.is_some() + } + + // Param is passed by value, moved + pub fn set_reference_inputs_count(&mut self, v: u32) { + self.reference_inputs_count = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 22; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(22); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signing_mode", + |m: &CardanoSignTxInit| { &m.signing_mode }, + |m: &mut CardanoSignTxInit| { &mut m.signing_mode }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "protocol_magic", + |m: &CardanoSignTxInit| { &m.protocol_magic }, + |m: &mut CardanoSignTxInit| { &mut m.protocol_magic }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "network_id", + |m: &CardanoSignTxInit| { &m.network_id }, + |m: &mut CardanoSignTxInit| { &mut m.network_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "inputs_count", + |m: &CardanoSignTxInit| { &m.inputs_count }, + |m: &mut CardanoSignTxInit| { &mut m.inputs_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "outputs_count", + |m: &CardanoSignTxInit| { &m.outputs_count }, + |m: &mut CardanoSignTxInit| { &mut m.outputs_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fee", + |m: &CardanoSignTxInit| { &m.fee }, + |m: &mut CardanoSignTxInit| { &mut m.fee }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ttl", + |m: &CardanoSignTxInit| { &m.ttl }, + |m: &mut CardanoSignTxInit| { &mut m.ttl }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "certificates_count", + |m: &CardanoSignTxInit| { &m.certificates_count }, + |m: &mut CardanoSignTxInit| { &mut m.certificates_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "withdrawals_count", + |m: &CardanoSignTxInit| { &m.withdrawals_count }, + |m: &mut CardanoSignTxInit| { &mut m.withdrawals_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "has_auxiliary_data", + |m: &CardanoSignTxInit| { &m.has_auxiliary_data }, + |m: &mut CardanoSignTxInit| { &mut m.has_auxiliary_data }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "validity_interval_start", + |m: &CardanoSignTxInit| { &m.validity_interval_start }, + |m: &mut CardanoSignTxInit| { &mut m.validity_interval_start }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "witness_requests_count", + |m: &CardanoSignTxInit| { &m.witness_requests_count }, + |m: &mut CardanoSignTxInit| { &mut m.witness_requests_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "minting_asset_groups_count", + |m: &CardanoSignTxInit| { &m.minting_asset_groups_count }, + |m: &mut CardanoSignTxInit| { &mut m.minting_asset_groups_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "derivation_type", + |m: &CardanoSignTxInit| { &m.derivation_type }, + |m: &mut CardanoSignTxInit| { &mut m.derivation_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "include_network_id", + |m: &CardanoSignTxInit| { &m.include_network_id }, + |m: &mut CardanoSignTxInit| { &mut m.include_network_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_data_hash", + |m: &CardanoSignTxInit| { &m.script_data_hash }, + |m: &mut CardanoSignTxInit| { &mut m.script_data_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "collateral_inputs_count", + |m: &CardanoSignTxInit| { &m.collateral_inputs_count }, + |m: &mut CardanoSignTxInit| { &mut m.collateral_inputs_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "required_signers_count", + |m: &CardanoSignTxInit| { &m.required_signers_count }, + |m: &mut CardanoSignTxInit| { &mut m.required_signers_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "has_collateral_return", + |m: &CardanoSignTxInit| { &m.has_collateral_return }, + |m: &mut CardanoSignTxInit| { &mut m.has_collateral_return }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "total_collateral", + |m: &CardanoSignTxInit| { &m.total_collateral }, + |m: &mut CardanoSignTxInit| { &mut m.total_collateral }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "reference_inputs_count", + |m: &CardanoSignTxInit| { &m.reference_inputs_count }, + |m: &mut CardanoSignTxInit| { &mut m.reference_inputs_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &CardanoSignTxInit| { &m.chunkify }, + |m: &mut CardanoSignTxInit| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoSignTxInit", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoSignTxInit { + const NAME: &'static str = "CardanoSignTxInit"; + + fn is_initialized(&self) -> bool { + if self.signing_mode.is_none() { + return false; + } + if self.protocol_magic.is_none() { + return false; + } + if self.network_id.is_none() { + return false; + } + if self.inputs_count.is_none() { + return false; + } + if self.outputs_count.is_none() { + return false; + } + if self.fee.is_none() { + return false; + } + if self.certificates_count.is_none() { + return false; + } + if self.withdrawals_count.is_none() { + return false; + } + if self.has_auxiliary_data.is_none() { + return false; + } + if self.witness_requests_count.is_none() { + return false; + } + if self.minting_asset_groups_count.is_none() { + return false; + } + if self.derivation_type.is_none() { + return false; + } + if self.collateral_inputs_count.is_none() { + return false; + } + if self.required_signers_count.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.signing_mode = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 16 => { + self.protocol_magic = ::std::option::Option::Some(is.read_uint32()?); + }, + 24 => { + self.network_id = ::std::option::Option::Some(is.read_uint32()?); + }, + 32 => { + self.inputs_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 40 => { + self.outputs_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.fee = ::std::option::Option::Some(is.read_uint64()?); + }, + 56 => { + self.ttl = ::std::option::Option::Some(is.read_uint64()?); + }, + 64 => { + self.certificates_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 72 => { + self.withdrawals_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 80 => { + self.has_auxiliary_data = ::std::option::Option::Some(is.read_bool()?); + }, + 88 => { + self.validity_interval_start = ::std::option::Option::Some(is.read_uint64()?); + }, + 96 => { + self.witness_requests_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 104 => { + self.minting_asset_groups_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 112 => { + self.derivation_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 120 => { + self.include_network_id = ::std::option::Option::Some(is.read_bool()?); + }, + 130 => { + self.script_data_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 136 => { + self.collateral_inputs_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 144 => { + self.required_signers_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 152 => { + self.has_collateral_return = ::std::option::Option::Some(is.read_bool()?); + }, + 160 => { + self.total_collateral = ::std::option::Option::Some(is.read_uint64()?); + }, + 168 => { + self.reference_inputs_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 176 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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.signing_mode { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + if let Some(v) = self.protocol_magic { + my_size += ::protobuf::rt::uint32_size(2, v); + } + if let Some(v) = self.network_id { + my_size += ::protobuf::rt::uint32_size(3, v); + } + if let Some(v) = self.inputs_count { + my_size += ::protobuf::rt::uint32_size(4, v); + } + if let Some(v) = self.outputs_count { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.fee { + my_size += ::protobuf::rt::uint64_size(6, v); + } + if let Some(v) = self.ttl { + my_size += ::protobuf::rt::uint64_size(7, v); + } + if let Some(v) = self.certificates_count { + my_size += ::protobuf::rt::uint32_size(8, v); + } + if let Some(v) = self.withdrawals_count { + my_size += ::protobuf::rt::uint32_size(9, v); + } + if let Some(v) = self.has_auxiliary_data { + my_size += 1 + 1; + } + if let Some(v) = self.validity_interval_start { + my_size += ::protobuf::rt::uint64_size(11, v); + } + if let Some(v) = self.witness_requests_count { + my_size += ::protobuf::rt::uint32_size(12, v); + } + if let Some(v) = self.minting_asset_groups_count { + my_size += ::protobuf::rt::uint32_size(13, v); + } + if let Some(v) = self.derivation_type { + my_size += ::protobuf::rt::int32_size(14, v.value()); + } + if let Some(v) = self.include_network_id { + my_size += 1 + 1; + } + if let Some(v) = self.script_data_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(16, &v); + } + if let Some(v) = self.collateral_inputs_count { + my_size += ::protobuf::rt::uint32_size(17, v); + } + if let Some(v) = self.required_signers_count { + my_size += ::protobuf::rt::uint32_size(18, v); + } + if let Some(v) = self.has_collateral_return { + my_size += 2 + 1; + } + if let Some(v) = self.total_collateral { + my_size += ::protobuf::rt::uint64_size(20, v); + } + if let Some(v) = self.reference_inputs_count { + my_size += ::protobuf::rt::uint32_size(21, v); + } + if let Some(v) = self.chunkify { + my_size += 2 + 1; + } + 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.signing_mode { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.protocol_magic { + os.write_uint32(2, v)?; + } + if let Some(v) = self.network_id { + os.write_uint32(3, v)?; + } + if let Some(v) = self.inputs_count { + os.write_uint32(4, v)?; + } + if let Some(v) = self.outputs_count { + os.write_uint32(5, v)?; + } + if let Some(v) = self.fee { + os.write_uint64(6, v)?; + } + if let Some(v) = self.ttl { + os.write_uint64(7, v)?; + } + if let Some(v) = self.certificates_count { + os.write_uint32(8, v)?; + } + if let Some(v) = self.withdrawals_count { + os.write_uint32(9, v)?; + } + if let Some(v) = self.has_auxiliary_data { + os.write_bool(10, v)?; + } + if let Some(v) = self.validity_interval_start { + os.write_uint64(11, v)?; + } + if let Some(v) = self.witness_requests_count { + os.write_uint32(12, v)?; + } + if let Some(v) = self.minting_asset_groups_count { + os.write_uint32(13, v)?; + } + if let Some(v) = self.derivation_type { + os.write_enum(14, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.include_network_id { + os.write_bool(15, v)?; + } + if let Some(v) = self.script_data_hash.as_ref() { + os.write_bytes(16, v)?; + } + if let Some(v) = self.collateral_inputs_count { + os.write_uint32(17, v)?; + } + if let Some(v) = self.required_signers_count { + os.write_uint32(18, v)?; + } + if let Some(v) = self.has_collateral_return { + os.write_bool(19, v)?; + } + if let Some(v) = self.total_collateral { + os.write_uint64(20, v)?; + } + if let Some(v) = self.reference_inputs_count { + os.write_uint32(21, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(22, 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() -> CardanoSignTxInit { + CardanoSignTxInit::new() + } + + fn clear(&mut self) { + self.signing_mode = ::std::option::Option::None; + self.protocol_magic = ::std::option::Option::None; + self.network_id = ::std::option::Option::None; + self.inputs_count = ::std::option::Option::None; + self.outputs_count = ::std::option::Option::None; + self.fee = ::std::option::Option::None; + self.ttl = ::std::option::Option::None; + self.certificates_count = ::std::option::Option::None; + self.withdrawals_count = ::std::option::Option::None; + self.has_auxiliary_data = ::std::option::Option::None; + self.validity_interval_start = ::std::option::Option::None; + self.witness_requests_count = ::std::option::Option::None; + self.minting_asset_groups_count = ::std::option::Option::None; + self.derivation_type = ::std::option::Option::None; + self.include_network_id = ::std::option::Option::None; + self.script_data_hash = ::std::option::Option::None; + self.collateral_inputs_count = ::std::option::Option::None; + self.required_signers_count = ::std::option::Option::None; + self.has_collateral_return = ::std::option::Option::None; + self.total_collateral = ::std::option::Option::None; + self.reference_inputs_count = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoSignTxInit { + static instance: CardanoSignTxInit = CardanoSignTxInit { + signing_mode: ::std::option::Option::None, + protocol_magic: ::std::option::Option::None, + network_id: ::std::option::Option::None, + inputs_count: ::std::option::Option::None, + outputs_count: ::std::option::Option::None, + fee: ::std::option::Option::None, + ttl: ::std::option::Option::None, + certificates_count: ::std::option::Option::None, + withdrawals_count: ::std::option::Option::None, + has_auxiliary_data: ::std::option::Option::None, + validity_interval_start: ::std::option::Option::None, + witness_requests_count: ::std::option::Option::None, + minting_asset_groups_count: ::std::option::Option::None, + derivation_type: ::std::option::Option::None, + include_network_id: ::std::option::Option::None, + script_data_hash: ::std::option::Option::None, + collateral_inputs_count: ::std::option::Option::None, + required_signers_count: ::std::option::Option::None, + has_collateral_return: ::std::option::Option::None, + total_collateral: ::std::option::Option::None, + reference_inputs_count: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoSignTxInit { + 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("CardanoSignTxInit").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoSignTxInit { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoSignTxInit { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxInput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxInput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxInput.prev_hash) + pub prev_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxInput.prev_index) + pub prev_index: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxInput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxInput { + fn default() -> &'a CardanoTxInput { + ::default_instance() + } +} + +impl CardanoTxInput { + pub fn new() -> CardanoTxInput { + ::std::default::Default::default() + } + + // required bytes prev_hash = 1; + + pub fn prev_hash(&self) -> &[u8] { + match self.prev_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_prev_hash(&mut self) { + self.prev_hash = ::std::option::Option::None; + } + + pub fn has_prev_hash(&self) -> bool { + self.prev_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_hash(&mut self, v: ::std::vec::Vec) { + self.prev_hash = ::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_prev_hash(&mut self) -> &mut ::std::vec::Vec { + if self.prev_hash.is_none() { + self.prev_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.prev_hash.as_mut().unwrap() + } + + // Take field + pub fn take_prev_hash(&mut self) -> ::std::vec::Vec { + self.prev_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint32 prev_index = 2; + + pub fn prev_index(&self) -> u32 { + self.prev_index.unwrap_or(0) + } + + pub fn clear_prev_index(&mut self) { + self.prev_index = ::std::option::Option::None; + } + + pub fn has_prev_index(&self) -> bool { + self.prev_index.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_index(&mut self, v: u32) { + self.prev_index = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "prev_hash", + |m: &CardanoTxInput| { &m.prev_hash }, + |m: &mut CardanoTxInput| { &mut m.prev_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "prev_index", + |m: &CardanoTxInput| { &m.prev_index }, + |m: &mut CardanoTxInput| { &mut m.prev_index }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxInput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxInput { + const NAME: &'static str = "CardanoTxInput"; + + fn is_initialized(&self) -> bool { + if self.prev_hash.is_none() { + return false; + } + if self.prev_index.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.prev_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 16 => { + self.prev_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.prev_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.prev_index { + my_size += ::protobuf::rt::uint32_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.prev_hash.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.prev_index { + os.write_uint32(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() -> CardanoTxInput { + CardanoTxInput::new() + } + + fn clear(&mut self) { + self.prev_hash = ::std::option::Option::None; + self.prev_index = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxInput { + static instance: CardanoTxInput = CardanoTxInput { + prev_hash: ::std::option::Option::None, + prev_index: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxInput { + 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("CardanoTxInput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxInput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxOutput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxOutput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxOutput.address) + pub address: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxOutput.address_parameters) + pub address_parameters: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxOutput.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxOutput.asset_groups_count) + pub asset_groups_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxOutput.datum_hash) + pub datum_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxOutput.format) + pub format: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxOutput.inline_datum_size) + pub inline_datum_size: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxOutput.reference_script_size) + pub reference_script_size: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxOutput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxOutput { + fn default() -> &'a CardanoTxOutput { + ::default_instance() + } +} + +impl CardanoTxOutput { + pub fn new() -> CardanoTxOutput { + ::std::default::Default::default() + } + + // optional string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required uint64 amount = 3; + + pub fn amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + // required uint32 asset_groups_count = 4; + + pub fn asset_groups_count(&self) -> u32 { + self.asset_groups_count.unwrap_or(0) + } + + pub fn clear_asset_groups_count(&mut self) { + self.asset_groups_count = ::std::option::Option::None; + } + + pub fn has_asset_groups_count(&self) -> bool { + self.asset_groups_count.is_some() + } + + // Param is passed by value, moved + pub fn set_asset_groups_count(&mut self, v: u32) { + self.asset_groups_count = ::std::option::Option::Some(v); + } + + // optional bytes datum_hash = 5; + + pub fn datum_hash(&self) -> &[u8] { + match self.datum_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_datum_hash(&mut self) { + self.datum_hash = ::std::option::Option::None; + } + + pub fn has_datum_hash(&self) -> bool { + self.datum_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_datum_hash(&mut self, v: ::std::vec::Vec) { + self.datum_hash = ::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_datum_hash(&mut self) -> &mut ::std::vec::Vec { + if self.datum_hash.is_none() { + self.datum_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.datum_hash.as_mut().unwrap() + } + + // Take field + pub fn take_datum_hash(&mut self) -> ::std::vec::Vec { + self.datum_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional .hw.trezor.messages.cardano.CardanoTxOutputSerializationFormat format = 6; + + pub fn format(&self) -> CardanoTxOutputSerializationFormat { + match self.format { + Some(e) => e.enum_value_or(CardanoTxOutputSerializationFormat::ARRAY_LEGACY), + None => CardanoTxOutputSerializationFormat::ARRAY_LEGACY, + } + } + + pub fn clear_format(&mut self) { + self.format = ::std::option::Option::None; + } + + pub fn has_format(&self) -> bool { + self.format.is_some() + } + + // Param is passed by value, moved + pub fn set_format(&mut self, v: CardanoTxOutputSerializationFormat) { + self.format = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional uint32 inline_datum_size = 7; + + pub fn inline_datum_size(&self) -> u32 { + self.inline_datum_size.unwrap_or(0u32) + } + + pub fn clear_inline_datum_size(&mut self) { + self.inline_datum_size = ::std::option::Option::None; + } + + pub fn has_inline_datum_size(&self) -> bool { + self.inline_datum_size.is_some() + } + + // Param is passed by value, moved + pub fn set_inline_datum_size(&mut self, v: u32) { + self.inline_datum_size = ::std::option::Option::Some(v); + } + + // optional uint32 reference_script_size = 8; + + pub fn reference_script_size(&self) -> u32 { + self.reference_script_size.unwrap_or(0u32) + } + + pub fn clear_reference_script_size(&mut self) { + self.reference_script_size = ::std::option::Option::None; + } + + pub fn has_reference_script_size(&self) -> bool { + self.reference_script_size.is_some() + } + + // Param is passed by value, moved + pub fn set_reference_script_size(&mut self, v: u32) { + self.reference_script_size = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(8); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &CardanoTxOutput| { &m.address }, + |m: &mut CardanoTxOutput| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, CardanoAddressParametersType>( + "address_parameters", + |m: &CardanoTxOutput| { &m.address_parameters }, + |m: &mut CardanoTxOutput| { &mut m.address_parameters }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &CardanoTxOutput| { &m.amount }, + |m: &mut CardanoTxOutput| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "asset_groups_count", + |m: &CardanoTxOutput| { &m.asset_groups_count }, + |m: &mut CardanoTxOutput| { &mut m.asset_groups_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "datum_hash", + |m: &CardanoTxOutput| { &m.datum_hash }, + |m: &mut CardanoTxOutput| { &mut m.datum_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "format", + |m: &CardanoTxOutput| { &m.format }, + |m: &mut CardanoTxOutput| { &mut m.format }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "inline_datum_size", + |m: &CardanoTxOutput| { &m.inline_datum_size }, + |m: &mut CardanoTxOutput| { &mut m.inline_datum_size }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "reference_script_size", + |m: &CardanoTxOutput| { &m.reference_script_size }, + |m: &mut CardanoTxOutput| { &mut m.reference_script_size }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxOutput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxOutput { + const NAME: &'static str = "CardanoTxOutput"; + + fn is_initialized(&self) -> bool { + if self.amount.is_none() { + return false; + } + if self.asset_groups_count.is_none() { + return false; + } + for v in &self.address_parameters { + if !v.is_initialized() { + 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_string()?); + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.address_parameters)?; + }, + 24 => { + self.amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 32 => { + self.asset_groups_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 42 => { + self.datum_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 48 => { + self.format = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 56 => { + self.inline_datum_size = ::std::option::Option::Some(is.read_uint32()?); + }, + 64 => { + self.reference_script_size = ::std::option::Option::Some(is.read_uint32()?); + }, + 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::string_size(1, &v); + } + if let Some(v) = self.address_parameters.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.amount { + my_size += ::protobuf::rt::uint64_size(3, v); + } + if let Some(v) = self.asset_groups_count { + my_size += ::protobuf::rt::uint32_size(4, v); + } + if let Some(v) = self.datum_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(5, &v); + } + if let Some(v) = self.format { + my_size += ::protobuf::rt::int32_size(6, v.value()); + } + if let Some(v) = self.inline_datum_size { + my_size += ::protobuf::rt::uint32_size(7, v); + } + if let Some(v) = self.reference_script_size { + my_size += ::protobuf::rt::uint32_size(8, 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_string(1, v)?; + } + if let Some(v) = self.address_parameters.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + if let Some(v) = self.amount { + os.write_uint64(3, v)?; + } + if let Some(v) = self.asset_groups_count { + os.write_uint32(4, v)?; + } + if let Some(v) = self.datum_hash.as_ref() { + os.write_bytes(5, v)?; + } + if let Some(v) = self.format { + os.write_enum(6, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.inline_datum_size { + os.write_uint32(7, v)?; + } + if let Some(v) = self.reference_script_size { + os.write_uint32(8, 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() -> CardanoTxOutput { + CardanoTxOutput::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.address_parameters.clear(); + self.amount = ::std::option::Option::None; + self.asset_groups_count = ::std::option::Option::None; + self.datum_hash = ::std::option::Option::None; + self.format = ::std::option::Option::None; + self.inline_datum_size = ::std::option::Option::None; + self.reference_script_size = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxOutput { + static instance: CardanoTxOutput = CardanoTxOutput { + address: ::std::option::Option::None, + address_parameters: ::protobuf::MessageField::none(), + amount: ::std::option::Option::None, + asset_groups_count: ::std::option::Option::None, + datum_hash: ::std::option::Option::None, + format: ::std::option::Option::None, + inline_datum_size: ::std::option::Option::None, + reference_script_size: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxOutput { + 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("CardanoTxOutput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxOutput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoAssetGroup) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoAssetGroup { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoAssetGroup.policy_id) + pub policy_id: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoAssetGroup.tokens_count) + pub tokens_count: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoAssetGroup.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoAssetGroup { + fn default() -> &'a CardanoAssetGroup { + ::default_instance() + } +} + +impl CardanoAssetGroup { + pub fn new() -> CardanoAssetGroup { + ::std::default::Default::default() + } + + // required bytes policy_id = 1; + + pub fn policy_id(&self) -> &[u8] { + match self.policy_id.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_policy_id(&mut self) { + self.policy_id = ::std::option::Option::None; + } + + pub fn has_policy_id(&self) -> bool { + self.policy_id.is_some() + } + + // Param is passed by value, moved + pub fn set_policy_id(&mut self, v: ::std::vec::Vec) { + self.policy_id = ::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_policy_id(&mut self) -> &mut ::std::vec::Vec { + if self.policy_id.is_none() { + self.policy_id = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.policy_id.as_mut().unwrap() + } + + // Take field + pub fn take_policy_id(&mut self) -> ::std::vec::Vec { + self.policy_id.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint32 tokens_count = 2; + + pub fn tokens_count(&self) -> u32 { + self.tokens_count.unwrap_or(0) + } + + pub fn clear_tokens_count(&mut self) { + self.tokens_count = ::std::option::Option::None; + } + + pub fn has_tokens_count(&self) -> bool { + self.tokens_count.is_some() + } + + // Param is passed by value, moved + pub fn set_tokens_count(&mut self, v: u32) { + self.tokens_count = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "policy_id", + |m: &CardanoAssetGroup| { &m.policy_id }, + |m: &mut CardanoAssetGroup| { &mut m.policy_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "tokens_count", + |m: &CardanoAssetGroup| { &m.tokens_count }, + |m: &mut CardanoAssetGroup| { &mut m.tokens_count }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoAssetGroup", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoAssetGroup { + const NAME: &'static str = "CardanoAssetGroup"; + + fn is_initialized(&self) -> bool { + if self.policy_id.is_none() { + return false; + } + if self.tokens_count.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.policy_id = ::std::option::Option::Some(is.read_bytes()?); + }, + 16 => { + self.tokens_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.policy_id.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.tokens_count { + my_size += ::protobuf::rt::uint32_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.policy_id.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.tokens_count { + os.write_uint32(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() -> CardanoAssetGroup { + CardanoAssetGroup::new() + } + + fn clear(&mut self) { + self.policy_id = ::std::option::Option::None; + self.tokens_count = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoAssetGroup { + static instance: CardanoAssetGroup = CardanoAssetGroup { + policy_id: ::std::option::Option::None, + tokens_count: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoAssetGroup { + 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("CardanoAssetGroup").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoAssetGroup { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoAssetGroup { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoToken) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoToken { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoToken.asset_name_bytes) + pub asset_name_bytes: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoToken.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoToken.mint_amount) + pub mint_amount: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoToken.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoToken { + fn default() -> &'a CardanoToken { + ::default_instance() + } +} + +impl CardanoToken { + pub fn new() -> CardanoToken { + ::std::default::Default::default() + } + + // required bytes asset_name_bytes = 1; + + pub fn asset_name_bytes(&self) -> &[u8] { + match self.asset_name_bytes.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_asset_name_bytes(&mut self) { + self.asset_name_bytes = ::std::option::Option::None; + } + + pub fn has_asset_name_bytes(&self) -> bool { + self.asset_name_bytes.is_some() + } + + // Param is passed by value, moved + pub fn set_asset_name_bytes(&mut self, v: ::std::vec::Vec) { + self.asset_name_bytes = ::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_asset_name_bytes(&mut self) -> &mut ::std::vec::Vec { + if self.asset_name_bytes.is_none() { + self.asset_name_bytes = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.asset_name_bytes.as_mut().unwrap() + } + + // Take field + pub fn take_asset_name_bytes(&mut self) -> ::std::vec::Vec { + self.asset_name_bytes.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint64 amount = 2; + + pub fn amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + // optional sint64 mint_amount = 3; + + pub fn mint_amount(&self) -> i64 { + self.mint_amount.unwrap_or(0) + } + + pub fn clear_mint_amount(&mut self) { + self.mint_amount = ::std::option::Option::None; + } + + pub fn has_mint_amount(&self) -> bool { + self.mint_amount.is_some() + } + + // Param is passed by value, moved + pub fn set_mint_amount(&mut self, v: i64) { + self.mint_amount = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "asset_name_bytes", + |m: &CardanoToken| { &m.asset_name_bytes }, + |m: &mut CardanoToken| { &mut m.asset_name_bytes }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &CardanoToken| { &m.amount }, + |m: &mut CardanoToken| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "mint_amount", + |m: &CardanoToken| { &m.mint_amount }, + |m: &mut CardanoToken| { &mut m.mint_amount }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoToken", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoToken { + const NAME: &'static str = "CardanoToken"; + + fn is_initialized(&self) -> bool { + if self.asset_name_bytes.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.asset_name_bytes = ::std::option::Option::Some(is.read_bytes()?); + }, + 16 => { + self.amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 24 => { + self.mint_amount = ::std::option::Option::Some(is.read_sint64()?); + }, + 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.asset_name_bytes.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.amount { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.mint_amount { + my_size += ::protobuf::rt::sint64_size(3, 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.asset_name_bytes.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.amount { + os.write_uint64(2, v)?; + } + if let Some(v) = self.mint_amount { + os.write_sint64(3, 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() -> CardanoToken { + CardanoToken::new() + } + + fn clear(&mut self) { + self.asset_name_bytes = ::std::option::Option::None; + self.amount = ::std::option::Option::None; + self.mint_amount = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoToken { + static instance: CardanoToken = CardanoToken { + asset_name_bytes: ::std::option::Option::None, + amount: ::std::option::Option::None, + mint_amount: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoToken { + 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("CardanoToken").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoToken { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoToken { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxInlineDatumChunk) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxInlineDatumChunk { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxInlineDatumChunk.data) + pub data: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxInlineDatumChunk.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxInlineDatumChunk { + fn default() -> &'a CardanoTxInlineDatumChunk { + ::default_instance() + } +} + +impl CardanoTxInlineDatumChunk { + pub fn new() -> CardanoTxInlineDatumChunk { + ::std::default::Default::default() + } + + // required bytes data = 1; + + pub fn data(&self) -> &[u8] { + match self.data.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_data(&mut self) { + self.data = ::std::option::Option::None; + } + + pub fn has_data(&self) -> bool { + self.data.is_some() + } + + // Param is passed by value, moved + pub fn set_data(&mut self, v: ::std::vec::Vec) { + self.data = ::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_data(&mut self) -> &mut ::std::vec::Vec { + if self.data.is_none() { + self.data = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.data.as_mut().unwrap() + } + + // Take field + pub fn take_data(&mut self) -> ::std::vec::Vec { + self.data.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data", + |m: &CardanoTxInlineDatumChunk| { &m.data }, + |m: &mut CardanoTxInlineDatumChunk| { &mut m.data }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxInlineDatumChunk", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxInlineDatumChunk { + const NAME: &'static str = "CardanoTxInlineDatumChunk"; + + fn is_initialized(&self) -> bool { + if self.data.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.data = ::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.data.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.data.as_ref() { + os.write_bytes(1, 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() -> CardanoTxInlineDatumChunk { + CardanoTxInlineDatumChunk::new() + } + + fn clear(&mut self) { + self.data = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxInlineDatumChunk { + static instance: CardanoTxInlineDatumChunk = CardanoTxInlineDatumChunk { + data: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxInlineDatumChunk { + 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("CardanoTxInlineDatumChunk").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxInlineDatumChunk { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxInlineDatumChunk { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxReferenceScriptChunk) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxReferenceScriptChunk { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxReferenceScriptChunk.data) + pub data: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxReferenceScriptChunk.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxReferenceScriptChunk { + fn default() -> &'a CardanoTxReferenceScriptChunk { + ::default_instance() + } +} + +impl CardanoTxReferenceScriptChunk { + pub fn new() -> CardanoTxReferenceScriptChunk { + ::std::default::Default::default() + } + + // required bytes data = 1; + + pub fn data(&self) -> &[u8] { + match self.data.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_data(&mut self) { + self.data = ::std::option::Option::None; + } + + pub fn has_data(&self) -> bool { + self.data.is_some() + } + + // Param is passed by value, moved + pub fn set_data(&mut self, v: ::std::vec::Vec) { + self.data = ::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_data(&mut self) -> &mut ::std::vec::Vec { + if self.data.is_none() { + self.data = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.data.as_mut().unwrap() + } + + // Take field + pub fn take_data(&mut self) -> ::std::vec::Vec { + self.data.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data", + |m: &CardanoTxReferenceScriptChunk| { &m.data }, + |m: &mut CardanoTxReferenceScriptChunk| { &mut m.data }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxReferenceScriptChunk", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxReferenceScriptChunk { + const NAME: &'static str = "CardanoTxReferenceScriptChunk"; + + fn is_initialized(&self) -> bool { + if self.data.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.data = ::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.data.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.data.as_ref() { + os.write_bytes(1, 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() -> CardanoTxReferenceScriptChunk { + CardanoTxReferenceScriptChunk::new() + } + + fn clear(&mut self) { + self.data = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxReferenceScriptChunk { + static instance: CardanoTxReferenceScriptChunk = CardanoTxReferenceScriptChunk { + data: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxReferenceScriptChunk { + 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("CardanoTxReferenceScriptChunk").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxReferenceScriptChunk { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxReferenceScriptChunk { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoPoolOwner) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoPoolOwner { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolOwner.staking_key_path) + pub staking_key_path: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolOwner.staking_key_hash) + pub staking_key_hash: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoPoolOwner.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoPoolOwner { + fn default() -> &'a CardanoPoolOwner { + ::default_instance() + } +} + +impl CardanoPoolOwner { + pub fn new() -> CardanoPoolOwner { + ::std::default::Default::default() + } + + // optional bytes staking_key_hash = 2; + + pub fn staking_key_hash(&self) -> &[u8] { + match self.staking_key_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_staking_key_hash(&mut self) { + self.staking_key_hash = ::std::option::Option::None; + } + + pub fn has_staking_key_hash(&self) -> bool { + self.staking_key_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_staking_key_hash(&mut self, v: ::std::vec::Vec) { + self.staking_key_hash = ::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_staking_key_hash(&mut self) -> &mut ::std::vec::Vec { + if self.staking_key_hash.is_none() { + self.staking_key_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.staking_key_hash.as_mut().unwrap() + } + + // Take field + pub fn take_staking_key_hash(&mut self) -> ::std::vec::Vec { + self.staking_key_hash.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_vec_simpler_accessor::<_, _>( + "staking_key_path", + |m: &CardanoPoolOwner| { &m.staking_key_path }, + |m: &mut CardanoPoolOwner| { &mut m.staking_key_path }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "staking_key_hash", + |m: &CardanoPoolOwner| { &m.staking_key_hash }, + |m: &mut CardanoPoolOwner| { &mut m.staking_key_hash }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoPoolOwner", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoPoolOwner { + const NAME: &'static str = "CardanoPoolOwner"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.staking_key_path)?; + }, + 8 => { + self.staking_key_path.push(is.read_uint32()?); + }, + 18 => { + self.staking_key_hash = ::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; + for value in &self.staking_key_path { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.staking_key_hash.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<()> { + for v in &self.staking_key_path { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.staking_key_hash.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() -> CardanoPoolOwner { + CardanoPoolOwner::new() + } + + fn clear(&mut self) { + self.staking_key_path.clear(); + self.staking_key_hash = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoPoolOwner { + static instance: CardanoPoolOwner = CardanoPoolOwner { + staking_key_path: ::std::vec::Vec::new(), + staking_key_hash: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoPoolOwner { + 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("CardanoPoolOwner").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoPoolOwner { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoPoolOwner { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoPoolRelayParameters) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoPoolRelayParameters { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolRelayParameters.type) + pub type_: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolRelayParameters.ipv4_address) + pub ipv4_address: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolRelayParameters.ipv6_address) + pub ipv6_address: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolRelayParameters.host_name) + pub host_name: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolRelayParameters.port) + pub port: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoPoolRelayParameters.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoPoolRelayParameters { + fn default() -> &'a CardanoPoolRelayParameters { + ::default_instance() + } +} + +impl CardanoPoolRelayParameters { + pub fn new() -> CardanoPoolRelayParameters { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.cardano.CardanoPoolRelayType type = 1; + + pub fn type_(&self) -> CardanoPoolRelayType { + match self.type_ { + Some(e) => e.enum_value_or(CardanoPoolRelayType::SINGLE_HOST_IP), + None => CardanoPoolRelayType::SINGLE_HOST_IP, + } + } + + pub fn clear_type_(&mut self) { + self.type_ = ::std::option::Option::None; + } + + pub fn has_type(&self) -> bool { + self.type_.is_some() + } + + // Param is passed by value, moved + pub fn set_type(&mut self, v: CardanoPoolRelayType) { + self.type_ = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bytes ipv4_address = 2; + + pub fn ipv4_address(&self) -> &[u8] { + match self.ipv4_address.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_ipv4_address(&mut self) { + self.ipv4_address = ::std::option::Option::None; + } + + pub fn has_ipv4_address(&self) -> bool { + self.ipv4_address.is_some() + } + + // Param is passed by value, moved + pub fn set_ipv4_address(&mut self, v: ::std::vec::Vec) { + self.ipv4_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_ipv4_address(&mut self) -> &mut ::std::vec::Vec { + if self.ipv4_address.is_none() { + self.ipv4_address = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.ipv4_address.as_mut().unwrap() + } + + // Take field + pub fn take_ipv4_address(&mut self) -> ::std::vec::Vec { + self.ipv4_address.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes ipv6_address = 3; + + pub fn ipv6_address(&self) -> &[u8] { + match self.ipv6_address.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_ipv6_address(&mut self) { + self.ipv6_address = ::std::option::Option::None; + } + + pub fn has_ipv6_address(&self) -> bool { + self.ipv6_address.is_some() + } + + // Param is passed by value, moved + pub fn set_ipv6_address(&mut self, v: ::std::vec::Vec) { + self.ipv6_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_ipv6_address(&mut self) -> &mut ::std::vec::Vec { + if self.ipv6_address.is_none() { + self.ipv6_address = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.ipv6_address.as_mut().unwrap() + } + + // Take field + pub fn take_ipv6_address(&mut self) -> ::std::vec::Vec { + self.ipv6_address.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional string host_name = 4; + + pub fn host_name(&self) -> &str { + match self.host_name.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_host_name(&mut self) { + self.host_name = ::std::option::Option::None; + } + + pub fn has_host_name(&self) -> bool { + self.host_name.is_some() + } + + // Param is passed by value, moved + pub fn set_host_name(&mut self, v: ::std::string::String) { + self.host_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_host_name(&mut self) -> &mut ::std::string::String { + if self.host_name.is_none() { + self.host_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.host_name.as_mut().unwrap() + } + + // Take field + pub fn take_host_name(&mut self) -> ::std::string::String { + self.host_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint32 port = 5; + + pub fn port(&self) -> u32 { + self.port.unwrap_or(0) + } + + pub fn clear_port(&mut self) { + self.port = ::std::option::Option::None; + } + + pub fn has_port(&self) -> bool { + self.port.is_some() + } + + // Param is passed by value, moved + pub fn set_port(&mut self, v: u32) { + self.port = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "type", + |m: &CardanoPoolRelayParameters| { &m.type_ }, + |m: &mut CardanoPoolRelayParameters| { &mut m.type_ }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ipv4_address", + |m: &CardanoPoolRelayParameters| { &m.ipv4_address }, + |m: &mut CardanoPoolRelayParameters| { &mut m.ipv4_address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ipv6_address", + |m: &CardanoPoolRelayParameters| { &m.ipv6_address }, + |m: &mut CardanoPoolRelayParameters| { &mut m.ipv6_address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "host_name", + |m: &CardanoPoolRelayParameters| { &m.host_name }, + |m: &mut CardanoPoolRelayParameters| { &mut m.host_name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "port", + |m: &CardanoPoolRelayParameters| { &m.port }, + |m: &mut CardanoPoolRelayParameters| { &mut m.port }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoPoolRelayParameters", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoPoolRelayParameters { + const NAME: &'static str = "CardanoPoolRelayParameters"; + + fn is_initialized(&self) -> bool { + if self.type_.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.type_ = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 18 => { + self.ipv4_address = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.ipv6_address = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.host_name = ::std::option::Option::Some(is.read_string()?); + }, + 40 => { + self.port = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.type_ { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + if let Some(v) = self.ipv4_address.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.ipv6_address.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.host_name.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(v) = self.port { + my_size += ::protobuf::rt::uint32_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.type_ { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.ipv4_address.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.ipv6_address.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.host_name.as_ref() { + os.write_string(4, v)?; + } + if let Some(v) = self.port { + os.write_uint32(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() -> CardanoPoolRelayParameters { + CardanoPoolRelayParameters::new() + } + + fn clear(&mut self) { + self.type_ = ::std::option::Option::None; + self.ipv4_address = ::std::option::Option::None; + self.ipv6_address = ::std::option::Option::None; + self.host_name = ::std::option::Option::None; + self.port = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoPoolRelayParameters { + static instance: CardanoPoolRelayParameters = CardanoPoolRelayParameters { + type_: ::std::option::Option::None, + ipv4_address: ::std::option::Option::None, + ipv6_address: ::std::option::Option::None, + host_name: ::std::option::Option::None, + port: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoPoolRelayParameters { + 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("CardanoPoolRelayParameters").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoPoolRelayParameters { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoPoolRelayParameters { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoPoolMetadataType) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoPoolMetadataType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolMetadataType.url) + pub url: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolMetadataType.hash) + pub hash: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoPoolMetadataType.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoPoolMetadataType { + fn default() -> &'a CardanoPoolMetadataType { + ::default_instance() + } +} + +impl CardanoPoolMetadataType { + pub fn new() -> CardanoPoolMetadataType { + ::std::default::Default::default() + } + + // required string url = 1; + + pub fn url(&self) -> &str { + match self.url.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_url(&mut self) { + self.url = ::std::option::Option::None; + } + + pub fn has_url(&self) -> bool { + self.url.is_some() + } + + // Param is passed by value, moved + pub fn set_url(&mut self, v: ::std::string::String) { + self.url = ::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_url(&mut self) -> &mut ::std::string::String { + if self.url.is_none() { + self.url = ::std::option::Option::Some(::std::string::String::new()); + } + self.url.as_mut().unwrap() + } + + // Take field + pub fn take_url(&mut self) -> ::std::string::String { + self.url.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required bytes hash = 2; + + pub fn hash(&self) -> &[u8] { + match self.hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_hash(&mut self) { + self.hash = ::std::option::Option::None; + } + + pub fn has_hash(&self) -> bool { + self.hash.is_some() + } + + // Param is passed by value, moved + pub fn set_hash(&mut self, v: ::std::vec::Vec) { + self.hash = ::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_hash(&mut self) -> &mut ::std::vec::Vec { + if self.hash.is_none() { + self.hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.hash.as_mut().unwrap() + } + + // Take field + pub fn take_hash(&mut self) -> ::std::vec::Vec { + self.hash.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::<_, _>( + "url", + |m: &CardanoPoolMetadataType| { &m.url }, + |m: &mut CardanoPoolMetadataType| { &mut m.url }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "hash", + |m: &CardanoPoolMetadataType| { &m.hash }, + |m: &mut CardanoPoolMetadataType| { &mut m.hash }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoPoolMetadataType", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoPoolMetadataType { + const NAME: &'static str = "CardanoPoolMetadataType"; + + fn is_initialized(&self) -> bool { + if self.url.is_none() { + return false; + } + if self.hash.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.url = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.hash = ::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.url.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.hash.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.url.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.hash.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() -> CardanoPoolMetadataType { + CardanoPoolMetadataType::new() + } + + fn clear(&mut self) { + self.url = ::std::option::Option::None; + self.hash = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoPoolMetadataType { + static instance: CardanoPoolMetadataType = CardanoPoolMetadataType { + url: ::std::option::Option::None, + hash: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoPoolMetadataType { + 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("CardanoPoolMetadataType").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoPoolMetadataType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoPoolMetadataType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoPoolParametersType) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoPoolParametersType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolParametersType.pool_id) + pub pool_id: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolParametersType.vrf_key_hash) + pub vrf_key_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolParametersType.pledge) + pub pledge: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolParametersType.cost) + pub cost: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolParametersType.margin_numerator) + pub margin_numerator: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolParametersType.margin_denominator) + pub margin_denominator: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolParametersType.reward_account) + pub reward_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolParametersType.metadata) + pub metadata: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolParametersType.owners_count) + pub owners_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoPoolParametersType.relays_count) + pub relays_count: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoPoolParametersType.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoPoolParametersType { + fn default() -> &'a CardanoPoolParametersType { + ::default_instance() + } +} + +impl CardanoPoolParametersType { + pub fn new() -> CardanoPoolParametersType { + ::std::default::Default::default() + } + + // required bytes pool_id = 1; + + pub fn pool_id(&self) -> &[u8] { + match self.pool_id.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_pool_id(&mut self) { + self.pool_id = ::std::option::Option::None; + } + + pub fn has_pool_id(&self) -> bool { + self.pool_id.is_some() + } + + // Param is passed by value, moved + pub fn set_pool_id(&mut self, v: ::std::vec::Vec) { + self.pool_id = ::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_pool_id(&mut self) -> &mut ::std::vec::Vec { + if self.pool_id.is_none() { + self.pool_id = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.pool_id.as_mut().unwrap() + } + + // Take field + pub fn take_pool_id(&mut self) -> ::std::vec::Vec { + self.pool_id.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes vrf_key_hash = 2; + + pub fn vrf_key_hash(&self) -> &[u8] { + match self.vrf_key_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_vrf_key_hash(&mut self) { + self.vrf_key_hash = ::std::option::Option::None; + } + + pub fn has_vrf_key_hash(&self) -> bool { + self.vrf_key_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_vrf_key_hash(&mut self, v: ::std::vec::Vec) { + self.vrf_key_hash = ::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_vrf_key_hash(&mut self) -> &mut ::std::vec::Vec { + if self.vrf_key_hash.is_none() { + self.vrf_key_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.vrf_key_hash.as_mut().unwrap() + } + + // Take field + pub fn take_vrf_key_hash(&mut self) -> ::std::vec::Vec { + self.vrf_key_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint64 pledge = 3; + + pub fn pledge(&self) -> u64 { + self.pledge.unwrap_or(0) + } + + pub fn clear_pledge(&mut self) { + self.pledge = ::std::option::Option::None; + } + + pub fn has_pledge(&self) -> bool { + self.pledge.is_some() + } + + // Param is passed by value, moved + pub fn set_pledge(&mut self, v: u64) { + self.pledge = ::std::option::Option::Some(v); + } + + // required uint64 cost = 4; + + pub fn cost(&self) -> u64 { + self.cost.unwrap_or(0) + } + + pub fn clear_cost(&mut self) { + self.cost = ::std::option::Option::None; + } + + pub fn has_cost(&self) -> bool { + self.cost.is_some() + } + + // Param is passed by value, moved + pub fn set_cost(&mut self, v: u64) { + self.cost = ::std::option::Option::Some(v); + } + + // required uint64 margin_numerator = 5; + + pub fn margin_numerator(&self) -> u64 { + self.margin_numerator.unwrap_or(0) + } + + pub fn clear_margin_numerator(&mut self) { + self.margin_numerator = ::std::option::Option::None; + } + + pub fn has_margin_numerator(&self) -> bool { + self.margin_numerator.is_some() + } + + // Param is passed by value, moved + pub fn set_margin_numerator(&mut self, v: u64) { + self.margin_numerator = ::std::option::Option::Some(v); + } + + // required uint64 margin_denominator = 6; + + pub fn margin_denominator(&self) -> u64 { + self.margin_denominator.unwrap_or(0) + } + + pub fn clear_margin_denominator(&mut self) { + self.margin_denominator = ::std::option::Option::None; + } + + pub fn has_margin_denominator(&self) -> bool { + self.margin_denominator.is_some() + } + + // Param is passed by value, moved + pub fn set_margin_denominator(&mut self, v: u64) { + self.margin_denominator = ::std::option::Option::Some(v); + } + + // required string reward_account = 7; + + pub fn reward_account(&self) -> &str { + match self.reward_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_reward_account(&mut self) { + self.reward_account = ::std::option::Option::None; + } + + pub fn has_reward_account(&self) -> bool { + self.reward_account.is_some() + } + + // Param is passed by value, moved + pub fn set_reward_account(&mut self, v: ::std::string::String) { + self.reward_account = ::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_reward_account(&mut self) -> &mut ::std::string::String { + if self.reward_account.is_none() { + self.reward_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.reward_account.as_mut().unwrap() + } + + // Take field + pub fn take_reward_account(&mut self) -> ::std::string::String { + self.reward_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required uint32 owners_count = 11; + + pub fn owners_count(&self) -> u32 { + self.owners_count.unwrap_or(0) + } + + pub fn clear_owners_count(&mut self) { + self.owners_count = ::std::option::Option::None; + } + + pub fn has_owners_count(&self) -> bool { + self.owners_count.is_some() + } + + // Param is passed by value, moved + pub fn set_owners_count(&mut self, v: u32) { + self.owners_count = ::std::option::Option::Some(v); + } + + // required uint32 relays_count = 12; + + pub fn relays_count(&self) -> u32 { + self.relays_count.unwrap_or(0) + } + + pub fn clear_relays_count(&mut self) { + self.relays_count = ::std::option::Option::None; + } + + pub fn has_relays_count(&self) -> bool { + self.relays_count.is_some() + } + + // Param is passed by value, moved + pub fn set_relays_count(&mut self, v: u32) { + self.relays_count = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(10); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pool_id", + |m: &CardanoPoolParametersType| { &m.pool_id }, + |m: &mut CardanoPoolParametersType| { &mut m.pool_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "vrf_key_hash", + |m: &CardanoPoolParametersType| { &m.vrf_key_hash }, + |m: &mut CardanoPoolParametersType| { &mut m.vrf_key_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pledge", + |m: &CardanoPoolParametersType| { &m.pledge }, + |m: &mut CardanoPoolParametersType| { &mut m.pledge }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "cost", + |m: &CardanoPoolParametersType| { &m.cost }, + |m: &mut CardanoPoolParametersType| { &mut m.cost }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "margin_numerator", + |m: &CardanoPoolParametersType| { &m.margin_numerator }, + |m: &mut CardanoPoolParametersType| { &mut m.margin_numerator }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "margin_denominator", + |m: &CardanoPoolParametersType| { &m.margin_denominator }, + |m: &mut CardanoPoolParametersType| { &mut m.margin_denominator }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "reward_account", + |m: &CardanoPoolParametersType| { &m.reward_account }, + |m: &mut CardanoPoolParametersType| { &mut m.reward_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, CardanoPoolMetadataType>( + "metadata", + |m: &CardanoPoolParametersType| { &m.metadata }, + |m: &mut CardanoPoolParametersType| { &mut m.metadata }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "owners_count", + |m: &CardanoPoolParametersType| { &m.owners_count }, + |m: &mut CardanoPoolParametersType| { &mut m.owners_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "relays_count", + |m: &CardanoPoolParametersType| { &m.relays_count }, + |m: &mut CardanoPoolParametersType| { &mut m.relays_count }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoPoolParametersType", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoPoolParametersType { + const NAME: &'static str = "CardanoPoolParametersType"; + + fn is_initialized(&self) -> bool { + if self.pool_id.is_none() { + return false; + } + if self.vrf_key_hash.is_none() { + return false; + } + if self.pledge.is_none() { + return false; + } + if self.cost.is_none() { + return false; + } + if self.margin_numerator.is_none() { + return false; + } + if self.margin_denominator.is_none() { + return false; + } + if self.reward_account.is_none() { + return false; + } + if self.owners_count.is_none() { + return false; + } + if self.relays_count.is_none() { + return false; + } + for v in &self.metadata { + if !v.is_initialized() { + 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.pool_id = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.vrf_key_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.pledge = ::std::option::Option::Some(is.read_uint64()?); + }, + 32 => { + self.cost = ::std::option::Option::Some(is.read_uint64()?); + }, + 40 => { + self.margin_numerator = ::std::option::Option::Some(is.read_uint64()?); + }, + 48 => { + self.margin_denominator = ::std::option::Option::Some(is.read_uint64()?); + }, + 58 => { + self.reward_account = ::std::option::Option::Some(is.read_string()?); + }, + 82 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.metadata)?; + }, + 88 => { + self.owners_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 96 => { + self.relays_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.pool_id.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.vrf_key_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.pledge { + my_size += ::protobuf::rt::uint64_size(3, v); + } + if let Some(v) = self.cost { + my_size += ::protobuf::rt::uint64_size(4, v); + } + if let Some(v) = self.margin_numerator { + my_size += ::protobuf::rt::uint64_size(5, v); + } + if let Some(v) = self.margin_denominator { + my_size += ::protobuf::rt::uint64_size(6, v); + } + if let Some(v) = self.reward_account.as_ref() { + my_size += ::protobuf::rt::string_size(7, &v); + } + if let Some(v) = self.metadata.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.owners_count { + my_size += ::protobuf::rt::uint32_size(11, v); + } + if let Some(v) = self.relays_count { + my_size += ::protobuf::rt::uint32_size(12, 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.pool_id.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.vrf_key_hash.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.pledge { + os.write_uint64(3, v)?; + } + if let Some(v) = self.cost { + os.write_uint64(4, v)?; + } + if let Some(v) = self.margin_numerator { + os.write_uint64(5, v)?; + } + if let Some(v) = self.margin_denominator { + os.write_uint64(6, v)?; + } + if let Some(v) = self.reward_account.as_ref() { + os.write_string(7, v)?; + } + if let Some(v) = self.metadata.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(10, v, os)?; + } + if let Some(v) = self.owners_count { + os.write_uint32(11, v)?; + } + if let Some(v) = self.relays_count { + os.write_uint32(12, 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() -> CardanoPoolParametersType { + CardanoPoolParametersType::new() + } + + fn clear(&mut self) { + self.pool_id = ::std::option::Option::None; + self.vrf_key_hash = ::std::option::Option::None; + self.pledge = ::std::option::Option::None; + self.cost = ::std::option::Option::None; + self.margin_numerator = ::std::option::Option::None; + self.margin_denominator = ::std::option::Option::None; + self.reward_account = ::std::option::Option::None; + self.metadata.clear(); + self.owners_count = ::std::option::Option::None; + self.relays_count = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoPoolParametersType { + static instance: CardanoPoolParametersType = CardanoPoolParametersType { + pool_id: ::std::option::Option::None, + vrf_key_hash: ::std::option::Option::None, + pledge: ::std::option::Option::None, + cost: ::std::option::Option::None, + margin_numerator: ::std::option::Option::None, + margin_denominator: ::std::option::Option::None, + reward_account: ::std::option::Option::None, + metadata: ::protobuf::MessageField::none(), + owners_count: ::std::option::Option::None, + relays_count: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoPoolParametersType { + 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("CardanoPoolParametersType").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoPoolParametersType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoPoolParametersType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxCertificate) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxCertificate { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxCertificate.type) + pub type_: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxCertificate.path) + pub path: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxCertificate.pool) + pub pool: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxCertificate.pool_parameters) + pub pool_parameters: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxCertificate.script_hash) + pub script_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxCertificate.key_hash) + pub key_hash: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxCertificate.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxCertificate { + fn default() -> &'a CardanoTxCertificate { + ::default_instance() + } +} + +impl CardanoTxCertificate { + pub fn new() -> CardanoTxCertificate { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.cardano.CardanoCertificateType type = 1; + + pub fn type_(&self) -> CardanoCertificateType { + match self.type_ { + Some(e) => e.enum_value_or(CardanoCertificateType::STAKE_REGISTRATION), + None => CardanoCertificateType::STAKE_REGISTRATION, + } + } + + pub fn clear_type_(&mut self) { + self.type_ = ::std::option::Option::None; + } + + pub fn has_type(&self) -> bool { + self.type_.is_some() + } + + // Param is passed by value, moved + pub fn set_type(&mut self, v: CardanoCertificateType) { + self.type_ = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bytes pool = 3; + + pub fn pool(&self) -> &[u8] { + match self.pool.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_pool(&mut self) { + self.pool = ::std::option::Option::None; + } + + pub fn has_pool(&self) -> bool { + self.pool.is_some() + } + + // Param is passed by value, moved + pub fn set_pool(&mut self, v: ::std::vec::Vec) { + self.pool = ::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_pool(&mut self) -> &mut ::std::vec::Vec { + if self.pool.is_none() { + self.pool = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.pool.as_mut().unwrap() + } + + // Take field + pub fn take_pool(&mut self) -> ::std::vec::Vec { + self.pool.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes script_hash = 5; + + pub fn script_hash(&self) -> &[u8] { + match self.script_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_script_hash(&mut self) { + self.script_hash = ::std::option::Option::None; + } + + pub fn has_script_hash(&self) -> bool { + self.script_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_script_hash(&mut self, v: ::std::vec::Vec) { + self.script_hash = ::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_script_hash(&mut self) -> &mut ::std::vec::Vec { + if self.script_hash.is_none() { + self.script_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.script_hash.as_mut().unwrap() + } + + // Take field + pub fn take_script_hash(&mut self) -> ::std::vec::Vec { + self.script_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes key_hash = 6; + + pub fn key_hash(&self) -> &[u8] { + match self.key_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_key_hash(&mut self) { + self.key_hash = ::std::option::Option::None; + } + + pub fn has_key_hash(&self) -> bool { + self.key_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_key_hash(&mut self, v: ::std::vec::Vec) { + self.key_hash = ::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_key_hash(&mut self) -> &mut ::std::vec::Vec { + if self.key_hash.is_none() { + self.key_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.key_hash.as_mut().unwrap() + } + + // Take field + pub fn take_key_hash(&mut self) -> ::std::vec::Vec { + self.key_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "type", + |m: &CardanoTxCertificate| { &m.type_ }, + |m: &mut CardanoTxCertificate| { &mut m.type_ }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "path", + |m: &CardanoTxCertificate| { &m.path }, + |m: &mut CardanoTxCertificate| { &mut m.path }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pool", + |m: &CardanoTxCertificate| { &m.pool }, + |m: &mut CardanoTxCertificate| { &mut m.pool }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, CardanoPoolParametersType>( + "pool_parameters", + |m: &CardanoTxCertificate| { &m.pool_parameters }, + |m: &mut CardanoTxCertificate| { &mut m.pool_parameters }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_hash", + |m: &CardanoTxCertificate| { &m.script_hash }, + |m: &mut CardanoTxCertificate| { &mut m.script_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "key_hash", + |m: &CardanoTxCertificate| { &m.key_hash }, + |m: &mut CardanoTxCertificate| { &mut m.key_hash }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxCertificate", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxCertificate { + const NAME: &'static str = "CardanoTxCertificate"; + + fn is_initialized(&self) -> bool { + if self.type_.is_none() { + return false; + } + for v in &self.pool_parameters { + if !v.is_initialized() { + 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.type_ = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 18 => { + is.read_repeated_packed_uint32_into(&mut self.path)?; + }, + 16 => { + self.path.push(is.read_uint32()?); + }, + 26 => { + self.pool = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.pool_parameters)?; + }, + 42 => { + self.script_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 50 => { + self.key_hash = ::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.type_ { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + for value in &self.path { + my_size += ::protobuf::rt::uint32_size(2, *value); + }; + if let Some(v) = self.pool.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.pool_parameters.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.script_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(5, &v); + } + if let Some(v) = self.key_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &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.type_ { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + for v in &self.path { + os.write_uint32(2, *v)?; + }; + if let Some(v) = self.pool.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.pool_parameters.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + } + if let Some(v) = self.script_hash.as_ref() { + os.write_bytes(5, v)?; + } + if let Some(v) = self.key_hash.as_ref() { + os.write_bytes(6, 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() -> CardanoTxCertificate { + CardanoTxCertificate::new() + } + + fn clear(&mut self) { + self.type_ = ::std::option::Option::None; + self.path.clear(); + self.pool = ::std::option::Option::None; + self.pool_parameters.clear(); + self.script_hash = ::std::option::Option::None; + self.key_hash = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxCertificate { + static instance: CardanoTxCertificate = CardanoTxCertificate { + type_: ::std::option::Option::None, + path: ::std::vec::Vec::new(), + pool: ::std::option::Option::None, + pool_parameters: ::protobuf::MessageField::none(), + script_hash: ::std::option::Option::None, + key_hash: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxCertificate { + 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("CardanoTxCertificate").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxCertificate { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxCertificate { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxWithdrawal) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxWithdrawal { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxWithdrawal.path) + pub path: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxWithdrawal.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxWithdrawal.script_hash) + pub script_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxWithdrawal.key_hash) + pub key_hash: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxWithdrawal.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxWithdrawal { + fn default() -> &'a CardanoTxWithdrawal { + ::default_instance() + } +} + +impl CardanoTxWithdrawal { + pub fn new() -> CardanoTxWithdrawal { + ::std::default::Default::default() + } + + // required uint64 amount = 2; + + pub fn amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + // optional bytes script_hash = 3; + + pub fn script_hash(&self) -> &[u8] { + match self.script_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_script_hash(&mut self) { + self.script_hash = ::std::option::Option::None; + } + + pub fn has_script_hash(&self) -> bool { + self.script_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_script_hash(&mut self, v: ::std::vec::Vec) { + self.script_hash = ::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_script_hash(&mut self) -> &mut ::std::vec::Vec { + if self.script_hash.is_none() { + self.script_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.script_hash.as_mut().unwrap() + } + + // Take field + pub fn take_script_hash(&mut self) -> ::std::vec::Vec { + self.script_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes key_hash = 4; + + pub fn key_hash(&self) -> &[u8] { + match self.key_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_key_hash(&mut self) { + self.key_hash = ::std::option::Option::None; + } + + pub fn has_key_hash(&self) -> bool { + self.key_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_key_hash(&mut self, v: ::std::vec::Vec) { + self.key_hash = ::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_key_hash(&mut self) -> &mut ::std::vec::Vec { + if self.key_hash.is_none() { + self.key_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.key_hash.as_mut().unwrap() + } + + // Take field + pub fn take_key_hash(&mut self) -> ::std::vec::Vec { + self.key_hash.take().unwrap_or_else(|| ::std::vec::Vec::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_vec_simpler_accessor::<_, _>( + "path", + |m: &CardanoTxWithdrawal| { &m.path }, + |m: &mut CardanoTxWithdrawal| { &mut m.path }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &CardanoTxWithdrawal| { &m.amount }, + |m: &mut CardanoTxWithdrawal| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script_hash", + |m: &CardanoTxWithdrawal| { &m.script_hash }, + |m: &mut CardanoTxWithdrawal| { &mut m.script_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "key_hash", + |m: &CardanoTxWithdrawal| { &m.key_hash }, + |m: &mut CardanoTxWithdrawal| { &mut m.key_hash }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxWithdrawal", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxWithdrawal { + const NAME: &'static str = "CardanoTxWithdrawal"; + + fn is_initialized(&self) -> bool { + if self.amount.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 => { + is.read_repeated_packed_uint32_into(&mut self.path)?; + }, + 8 => { + self.path.push(is.read_uint32()?); + }, + 16 => { + self.amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 26 => { + self.script_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.key_hash = ::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; + for value in &self.path { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.amount { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.script_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.key_hash.as_ref() { + my_size += ::protobuf::rt::bytes_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<()> { + for v in &self.path { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.amount { + os.write_uint64(2, v)?; + } + if let Some(v) = self.script_hash.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.key_hash.as_ref() { + os.write_bytes(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() -> CardanoTxWithdrawal { + CardanoTxWithdrawal::new() + } + + fn clear(&mut self) { + self.path.clear(); + self.amount = ::std::option::Option::None; + self.script_hash = ::std::option::Option::None; + self.key_hash = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxWithdrawal { + static instance: CardanoTxWithdrawal = CardanoTxWithdrawal { + path: ::std::vec::Vec::new(), + amount: ::std::option::Option::None, + script_hash: ::std::option::Option::None, + key_hash: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxWithdrawal { + 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("CardanoTxWithdrawal").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxWithdrawal { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxWithdrawal { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoCVoteRegistrationDelegation) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoCVoteRegistrationDelegation { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoCVoteRegistrationDelegation.vote_public_key) + pub vote_public_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoCVoteRegistrationDelegation.weight) + pub weight: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoCVoteRegistrationDelegation.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoCVoteRegistrationDelegation { + fn default() -> &'a CardanoCVoteRegistrationDelegation { + ::default_instance() + } +} + +impl CardanoCVoteRegistrationDelegation { + pub fn new() -> CardanoCVoteRegistrationDelegation { + ::std::default::Default::default() + } + + // required bytes vote_public_key = 1; + + pub fn vote_public_key(&self) -> &[u8] { + match self.vote_public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_vote_public_key(&mut self) { + self.vote_public_key = ::std::option::Option::None; + } + + pub fn has_vote_public_key(&self) -> bool { + self.vote_public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_vote_public_key(&mut self, v: ::std::vec::Vec) { + self.vote_public_key = ::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_vote_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.vote_public_key.is_none() { + self.vote_public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.vote_public_key.as_mut().unwrap() + } + + // Take field + pub fn take_vote_public_key(&mut self) -> ::std::vec::Vec { + self.vote_public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint32 weight = 2; + + pub fn weight(&self) -> u32 { + self.weight.unwrap_or(0) + } + + pub fn clear_weight(&mut self) { + self.weight = ::std::option::Option::None; + } + + pub fn has_weight(&self) -> bool { + self.weight.is_some() + } + + // Param is passed by value, moved + pub fn set_weight(&mut self, v: u32) { + self.weight = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "vote_public_key", + |m: &CardanoCVoteRegistrationDelegation| { &m.vote_public_key }, + |m: &mut CardanoCVoteRegistrationDelegation| { &mut m.vote_public_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "weight", + |m: &CardanoCVoteRegistrationDelegation| { &m.weight }, + |m: &mut CardanoCVoteRegistrationDelegation| { &mut m.weight }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoCVoteRegistrationDelegation", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoCVoteRegistrationDelegation { + const NAME: &'static str = "CardanoCVoteRegistrationDelegation"; + + fn is_initialized(&self) -> bool { + if self.vote_public_key.is_none() { + return false; + } + if self.weight.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.vote_public_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 16 => { + self.weight = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.vote_public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.weight { + my_size += ::protobuf::rt::uint32_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.vote_public_key.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.weight { + os.write_uint32(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() -> CardanoCVoteRegistrationDelegation { + CardanoCVoteRegistrationDelegation::new() + } + + fn clear(&mut self) { + self.vote_public_key = ::std::option::Option::None; + self.weight = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoCVoteRegistrationDelegation { + static instance: CardanoCVoteRegistrationDelegation = CardanoCVoteRegistrationDelegation { + vote_public_key: ::std::option::Option::None, + weight: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoCVoteRegistrationDelegation { + 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("CardanoCVoteRegistrationDelegation").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoCVoteRegistrationDelegation { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoCVoteRegistrationDelegation { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoCVoteRegistrationParametersType) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoCVoteRegistrationParametersType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoCVoteRegistrationParametersType.vote_public_key) + pub vote_public_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoCVoteRegistrationParametersType.staking_path) + pub staking_path: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoCVoteRegistrationParametersType.payment_address_parameters) + pub payment_address_parameters: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoCVoteRegistrationParametersType.nonce) + pub nonce: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoCVoteRegistrationParametersType.format) + pub format: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoCVoteRegistrationParametersType.delegations) + pub delegations: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoCVoteRegistrationParametersType.voting_purpose) + pub voting_purpose: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoCVoteRegistrationParametersType.payment_address) + pub payment_address: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoCVoteRegistrationParametersType.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoCVoteRegistrationParametersType { + fn default() -> &'a CardanoCVoteRegistrationParametersType { + ::default_instance() + } +} + +impl CardanoCVoteRegistrationParametersType { + pub fn new() -> CardanoCVoteRegistrationParametersType { + ::std::default::Default::default() + } + + // optional bytes vote_public_key = 1; + + pub fn vote_public_key(&self) -> &[u8] { + match self.vote_public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_vote_public_key(&mut self) { + self.vote_public_key = ::std::option::Option::None; + } + + pub fn has_vote_public_key(&self) -> bool { + self.vote_public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_vote_public_key(&mut self, v: ::std::vec::Vec) { + self.vote_public_key = ::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_vote_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.vote_public_key.is_none() { + self.vote_public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.vote_public_key.as_mut().unwrap() + } + + // Take field + pub fn take_vote_public_key(&mut self) -> ::std::vec::Vec { + self.vote_public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint64 nonce = 4; + + pub fn nonce(&self) -> u64 { + self.nonce.unwrap_or(0) + } + + pub fn clear_nonce(&mut self) { + self.nonce = ::std::option::Option::None; + } + + pub fn has_nonce(&self) -> bool { + self.nonce.is_some() + } + + // Param is passed by value, moved + pub fn set_nonce(&mut self, v: u64) { + self.nonce = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.cardano.CardanoCVoteRegistrationFormat format = 5; + + pub fn format(&self) -> CardanoCVoteRegistrationFormat { + match self.format { + Some(e) => e.enum_value_or(CardanoCVoteRegistrationFormat::CIP15), + None => CardanoCVoteRegistrationFormat::CIP15, + } + } + + pub fn clear_format(&mut self) { + self.format = ::std::option::Option::None; + } + + pub fn has_format(&self) -> bool { + self.format.is_some() + } + + // Param is passed by value, moved + pub fn set_format(&mut self, v: CardanoCVoteRegistrationFormat) { + self.format = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional uint64 voting_purpose = 7; + + pub fn voting_purpose(&self) -> u64 { + self.voting_purpose.unwrap_or(0) + } + + pub fn clear_voting_purpose(&mut self) { + self.voting_purpose = ::std::option::Option::None; + } + + pub fn has_voting_purpose(&self) -> bool { + self.voting_purpose.is_some() + } + + // Param is passed by value, moved + pub fn set_voting_purpose(&mut self, v: u64) { + self.voting_purpose = ::std::option::Option::Some(v); + } + + // optional string payment_address = 8; + + pub fn payment_address(&self) -> &str { + match self.payment_address.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_payment_address(&mut self) { + self.payment_address = ::std::option::Option::None; + } + + pub fn has_payment_address(&self) -> bool { + self.payment_address.is_some() + } + + // Param is passed by value, moved + pub fn set_payment_address(&mut self, v: ::std::string::String) { + self.payment_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_payment_address(&mut self) -> &mut ::std::string::String { + if self.payment_address.is_none() { + self.payment_address = ::std::option::Option::Some(::std::string::String::new()); + } + self.payment_address.as_mut().unwrap() + } + + // Take field + pub fn take_payment_address(&mut self) -> ::std::string::String { + self.payment_address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(8); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "vote_public_key", + |m: &CardanoCVoteRegistrationParametersType| { &m.vote_public_key }, + |m: &mut CardanoCVoteRegistrationParametersType| { &mut m.vote_public_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "staking_path", + |m: &CardanoCVoteRegistrationParametersType| { &m.staking_path }, + |m: &mut CardanoCVoteRegistrationParametersType| { &mut m.staking_path }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, CardanoAddressParametersType>( + "payment_address_parameters", + |m: &CardanoCVoteRegistrationParametersType| { &m.payment_address_parameters }, + |m: &mut CardanoCVoteRegistrationParametersType| { &mut m.payment_address_parameters }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "nonce", + |m: &CardanoCVoteRegistrationParametersType| { &m.nonce }, + |m: &mut CardanoCVoteRegistrationParametersType| { &mut m.nonce }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "format", + |m: &CardanoCVoteRegistrationParametersType| { &m.format }, + |m: &mut CardanoCVoteRegistrationParametersType| { &mut m.format }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "delegations", + |m: &CardanoCVoteRegistrationParametersType| { &m.delegations }, + |m: &mut CardanoCVoteRegistrationParametersType| { &mut m.delegations }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "voting_purpose", + |m: &CardanoCVoteRegistrationParametersType| { &m.voting_purpose }, + |m: &mut CardanoCVoteRegistrationParametersType| { &mut m.voting_purpose }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "payment_address", + |m: &CardanoCVoteRegistrationParametersType| { &m.payment_address }, + |m: &mut CardanoCVoteRegistrationParametersType| { &mut m.payment_address }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoCVoteRegistrationParametersType", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoCVoteRegistrationParametersType { + const NAME: &'static str = "CardanoCVoteRegistrationParametersType"; + + fn is_initialized(&self) -> bool { + if self.nonce.is_none() { + return false; + } + for v in &self.payment_address_parameters { + if !v.is_initialized() { + return false; + } + }; + for v in &self.delegations { + if !v.is_initialized() { + 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.vote_public_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + is.read_repeated_packed_uint32_into(&mut self.staking_path)?; + }, + 16 => { + self.staking_path.push(is.read_uint32()?); + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.payment_address_parameters)?; + }, + 32 => { + self.nonce = ::std::option::Option::Some(is.read_uint64()?); + }, + 40 => { + self.format = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 50 => { + self.delegations.push(is.read_message()?); + }, + 56 => { + self.voting_purpose = ::std::option::Option::Some(is.read_uint64()?); + }, + 66 => { + self.payment_address = ::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.vote_public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + for value in &self.staking_path { + my_size += ::protobuf::rt::uint32_size(2, *value); + }; + if let Some(v) = self.payment_address_parameters.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.nonce { + my_size += ::protobuf::rt::uint64_size(4, v); + } + if let Some(v) = self.format { + my_size += ::protobuf::rt::int32_size(5, v.value()); + } + for value in &self.delegations { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + if let Some(v) = self.voting_purpose { + my_size += ::protobuf::rt::uint64_size(7, v); + } + if let Some(v) = self.payment_address.as_ref() { + my_size += ::protobuf::rt::string_size(8, &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.vote_public_key.as_ref() { + os.write_bytes(1, v)?; + } + for v in &self.staking_path { + os.write_uint32(2, *v)?; + }; + if let Some(v) = self.payment_address_parameters.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.nonce { + os.write_uint64(4, v)?; + } + if let Some(v) = self.format { + os.write_enum(5, ::protobuf::EnumOrUnknown::value(&v))?; + } + for v in &self.delegations { + ::protobuf::rt::write_message_field_with_cached_size(6, v, os)?; + }; + if let Some(v) = self.voting_purpose { + os.write_uint64(7, v)?; + } + if let Some(v) = self.payment_address.as_ref() { + os.write_string(8, 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() -> CardanoCVoteRegistrationParametersType { + CardanoCVoteRegistrationParametersType::new() + } + + fn clear(&mut self) { + self.vote_public_key = ::std::option::Option::None; + self.staking_path.clear(); + self.payment_address_parameters.clear(); + self.nonce = ::std::option::Option::None; + self.format = ::std::option::Option::None; + self.delegations.clear(); + self.voting_purpose = ::std::option::Option::None; + self.payment_address = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoCVoteRegistrationParametersType { + static instance: CardanoCVoteRegistrationParametersType = CardanoCVoteRegistrationParametersType { + vote_public_key: ::std::option::Option::None, + staking_path: ::std::vec::Vec::new(), + payment_address_parameters: ::protobuf::MessageField::none(), + nonce: ::std::option::Option::None, + format: ::std::option::Option::None, + delegations: ::std::vec::Vec::new(), + voting_purpose: ::std::option::Option::None, + payment_address: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoCVoteRegistrationParametersType { + 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("CardanoCVoteRegistrationParametersType").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoCVoteRegistrationParametersType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoCVoteRegistrationParametersType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxAuxiliaryData) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxAuxiliaryData { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxAuxiliaryData.cvote_registration_parameters) + pub cvote_registration_parameters: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxAuxiliaryData.hash) + pub hash: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxAuxiliaryData.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxAuxiliaryData { + fn default() -> &'a CardanoTxAuxiliaryData { + ::default_instance() + } +} + +impl CardanoTxAuxiliaryData { + pub fn new() -> CardanoTxAuxiliaryData { + ::std::default::Default::default() + } + + // optional bytes hash = 2; + + pub fn hash(&self) -> &[u8] { + match self.hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_hash(&mut self) { + self.hash = ::std::option::Option::None; + } + + pub fn has_hash(&self) -> bool { + self.hash.is_some() + } + + // Param is passed by value, moved + pub fn set_hash(&mut self, v: ::std::vec::Vec) { + self.hash = ::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_hash(&mut self) -> &mut ::std::vec::Vec { + if self.hash.is_none() { + self.hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.hash.as_mut().unwrap() + } + + // Take field + pub fn take_hash(&mut self) -> ::std::vec::Vec { + self.hash.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_message_field_accessor::<_, CardanoCVoteRegistrationParametersType>( + "cvote_registration_parameters", + |m: &CardanoTxAuxiliaryData| { &m.cvote_registration_parameters }, + |m: &mut CardanoTxAuxiliaryData| { &mut m.cvote_registration_parameters }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "hash", + |m: &CardanoTxAuxiliaryData| { &m.hash }, + |m: &mut CardanoTxAuxiliaryData| { &mut m.hash }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxAuxiliaryData", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxAuxiliaryData { + const NAME: &'static str = "CardanoTxAuxiliaryData"; + + fn is_initialized(&self) -> bool { + for v in &self.cvote_registration_parameters { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.cvote_registration_parameters)?; + }, + 18 => { + self.hash = ::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.cvote_registration_parameters.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.hash.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.cvote_registration_parameters.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.hash.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() -> CardanoTxAuxiliaryData { + CardanoTxAuxiliaryData::new() + } + + fn clear(&mut self) { + self.cvote_registration_parameters.clear(); + self.hash = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxAuxiliaryData { + static instance: CardanoTxAuxiliaryData = CardanoTxAuxiliaryData { + cvote_registration_parameters: ::protobuf::MessageField::none(), + hash: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxAuxiliaryData { + 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("CardanoTxAuxiliaryData").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxAuxiliaryData { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxAuxiliaryData { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxMint) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxMint { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxMint.asset_groups_count) + pub asset_groups_count: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxMint.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxMint { + fn default() -> &'a CardanoTxMint { + ::default_instance() + } +} + +impl CardanoTxMint { + pub fn new() -> CardanoTxMint { + ::std::default::Default::default() + } + + // required uint32 asset_groups_count = 1; + + pub fn asset_groups_count(&self) -> u32 { + self.asset_groups_count.unwrap_or(0) + } + + pub fn clear_asset_groups_count(&mut self) { + self.asset_groups_count = ::std::option::Option::None; + } + + pub fn has_asset_groups_count(&self) -> bool { + self.asset_groups_count.is_some() + } + + // Param is passed by value, moved + pub fn set_asset_groups_count(&mut self, v: u32) { + self.asset_groups_count = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "asset_groups_count", + |m: &CardanoTxMint| { &m.asset_groups_count }, + |m: &mut CardanoTxMint| { &mut m.asset_groups_count }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxMint", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxMint { + const NAME: &'static str = "CardanoTxMint"; + + fn is_initialized(&self) -> bool { + if self.asset_groups_count.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.asset_groups_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.asset_groups_count { + my_size += ::protobuf::rt::uint32_size(1, 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.asset_groups_count { + os.write_uint32(1, 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() -> CardanoTxMint { + CardanoTxMint::new() + } + + fn clear(&mut self) { + self.asset_groups_count = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxMint { + static instance: CardanoTxMint = CardanoTxMint { + asset_groups_count: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxMint { + 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("CardanoTxMint").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxMint { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxMint { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxCollateralInput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxCollateralInput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxCollateralInput.prev_hash) + pub prev_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxCollateralInput.prev_index) + pub prev_index: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxCollateralInput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxCollateralInput { + fn default() -> &'a CardanoTxCollateralInput { + ::default_instance() + } +} + +impl CardanoTxCollateralInput { + pub fn new() -> CardanoTxCollateralInput { + ::std::default::Default::default() + } + + // required bytes prev_hash = 1; + + pub fn prev_hash(&self) -> &[u8] { + match self.prev_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_prev_hash(&mut self) { + self.prev_hash = ::std::option::Option::None; + } + + pub fn has_prev_hash(&self) -> bool { + self.prev_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_hash(&mut self, v: ::std::vec::Vec) { + self.prev_hash = ::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_prev_hash(&mut self) -> &mut ::std::vec::Vec { + if self.prev_hash.is_none() { + self.prev_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.prev_hash.as_mut().unwrap() + } + + // Take field + pub fn take_prev_hash(&mut self) -> ::std::vec::Vec { + self.prev_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint32 prev_index = 2; + + pub fn prev_index(&self) -> u32 { + self.prev_index.unwrap_or(0) + } + + pub fn clear_prev_index(&mut self) { + self.prev_index = ::std::option::Option::None; + } + + pub fn has_prev_index(&self) -> bool { + self.prev_index.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_index(&mut self, v: u32) { + self.prev_index = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "prev_hash", + |m: &CardanoTxCollateralInput| { &m.prev_hash }, + |m: &mut CardanoTxCollateralInput| { &mut m.prev_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "prev_index", + |m: &CardanoTxCollateralInput| { &m.prev_index }, + |m: &mut CardanoTxCollateralInput| { &mut m.prev_index }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxCollateralInput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxCollateralInput { + const NAME: &'static str = "CardanoTxCollateralInput"; + + fn is_initialized(&self) -> bool { + if self.prev_hash.is_none() { + return false; + } + if self.prev_index.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.prev_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 16 => { + self.prev_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.prev_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.prev_index { + my_size += ::protobuf::rt::uint32_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.prev_hash.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.prev_index { + os.write_uint32(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() -> CardanoTxCollateralInput { + CardanoTxCollateralInput::new() + } + + fn clear(&mut self) { + self.prev_hash = ::std::option::Option::None; + self.prev_index = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxCollateralInput { + static instance: CardanoTxCollateralInput = CardanoTxCollateralInput { + prev_hash: ::std::option::Option::None, + prev_index: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxCollateralInput { + 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("CardanoTxCollateralInput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxCollateralInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxCollateralInput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxRequiredSigner) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxRequiredSigner { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxRequiredSigner.key_hash) + pub key_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxRequiredSigner.key_path) + pub key_path: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxRequiredSigner.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxRequiredSigner { + fn default() -> &'a CardanoTxRequiredSigner { + ::default_instance() + } +} + +impl CardanoTxRequiredSigner { + pub fn new() -> CardanoTxRequiredSigner { + ::std::default::Default::default() + } + + // optional bytes key_hash = 1; + + pub fn key_hash(&self) -> &[u8] { + match self.key_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_key_hash(&mut self) { + self.key_hash = ::std::option::Option::None; + } + + pub fn has_key_hash(&self) -> bool { + self.key_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_key_hash(&mut self, v: ::std::vec::Vec) { + self.key_hash = ::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_key_hash(&mut self) -> &mut ::std::vec::Vec { + if self.key_hash.is_none() { + self.key_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.key_hash.as_mut().unwrap() + } + + // Take field + pub fn take_key_hash(&mut self) -> ::std::vec::Vec { + self.key_hash.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::<_, _>( + "key_hash", + |m: &CardanoTxRequiredSigner| { &m.key_hash }, + |m: &mut CardanoTxRequiredSigner| { &mut m.key_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "key_path", + |m: &CardanoTxRequiredSigner| { &m.key_path }, + |m: &mut CardanoTxRequiredSigner| { &mut m.key_path }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxRequiredSigner", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxRequiredSigner { + const NAME: &'static str = "CardanoTxRequiredSigner"; + + 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.key_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + is.read_repeated_packed_uint32_into(&mut self.key_path)?; + }, + 16 => { + self.key_path.push(is.read_uint32()?); + }, + 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.key_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + for value in &self.key_path { + my_size += ::protobuf::rt::uint32_size(2, *value); + }; + 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.key_hash.as_ref() { + os.write_bytes(1, v)?; + } + for v in &self.key_path { + os.write_uint32(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() -> CardanoTxRequiredSigner { + CardanoTxRequiredSigner::new() + } + + fn clear(&mut self) { + self.key_hash = ::std::option::Option::None; + self.key_path.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxRequiredSigner { + static instance: CardanoTxRequiredSigner = CardanoTxRequiredSigner { + key_hash: ::std::option::Option::None, + key_path: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxRequiredSigner { + 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("CardanoTxRequiredSigner").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxRequiredSigner { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxRequiredSigner { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxReferenceInput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxReferenceInput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxReferenceInput.prev_hash) + pub prev_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxReferenceInput.prev_index) + pub prev_index: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxReferenceInput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxReferenceInput { + fn default() -> &'a CardanoTxReferenceInput { + ::default_instance() + } +} + +impl CardanoTxReferenceInput { + pub fn new() -> CardanoTxReferenceInput { + ::std::default::Default::default() + } + + // required bytes prev_hash = 1; + + pub fn prev_hash(&self) -> &[u8] { + match self.prev_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_prev_hash(&mut self) { + self.prev_hash = ::std::option::Option::None; + } + + pub fn has_prev_hash(&self) -> bool { + self.prev_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_hash(&mut self, v: ::std::vec::Vec) { + self.prev_hash = ::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_prev_hash(&mut self) -> &mut ::std::vec::Vec { + if self.prev_hash.is_none() { + self.prev_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.prev_hash.as_mut().unwrap() + } + + // Take field + pub fn take_prev_hash(&mut self) -> ::std::vec::Vec { + self.prev_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint32 prev_index = 2; + + pub fn prev_index(&self) -> u32 { + self.prev_index.unwrap_or(0) + } + + pub fn clear_prev_index(&mut self) { + self.prev_index = ::std::option::Option::None; + } + + pub fn has_prev_index(&self) -> bool { + self.prev_index.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_index(&mut self, v: u32) { + self.prev_index = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "prev_hash", + |m: &CardanoTxReferenceInput| { &m.prev_hash }, + |m: &mut CardanoTxReferenceInput| { &mut m.prev_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "prev_index", + |m: &CardanoTxReferenceInput| { &m.prev_index }, + |m: &mut CardanoTxReferenceInput| { &mut m.prev_index }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxReferenceInput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxReferenceInput { + const NAME: &'static str = "CardanoTxReferenceInput"; + + fn is_initialized(&self) -> bool { + if self.prev_hash.is_none() { + return false; + } + if self.prev_index.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.prev_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 16 => { + self.prev_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.prev_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.prev_index { + my_size += ::protobuf::rt::uint32_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.prev_hash.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.prev_index { + os.write_uint32(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() -> CardanoTxReferenceInput { + CardanoTxReferenceInput::new() + } + + fn clear(&mut self) { + self.prev_hash = ::std::option::Option::None; + self.prev_index = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxReferenceInput { + static instance: CardanoTxReferenceInput = CardanoTxReferenceInput { + prev_hash: ::std::option::Option::None, + prev_index: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxReferenceInput { + 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("CardanoTxReferenceInput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxReferenceInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxReferenceInput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxItemAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxItemAck { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxItemAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxItemAck { + fn default() -> &'a CardanoTxItemAck { + ::default_instance() + } +} + +impl CardanoTxItemAck { + pub fn new() -> CardanoTxItemAck { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxItemAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxItemAck { + const NAME: &'static str = "CardanoTxItemAck"; + + 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 { + 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; + 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<()> { + 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() -> CardanoTxItemAck { + CardanoTxItemAck::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxItemAck { + static instance: CardanoTxItemAck = CardanoTxItemAck { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxItemAck { + 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("CardanoTxItemAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxItemAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxItemAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxAuxiliaryDataSupplement) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxAuxiliaryDataSupplement { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxAuxiliaryDataSupplement.type) + pub type_: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxAuxiliaryDataSupplement.auxiliary_data_hash) + pub auxiliary_data_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxAuxiliaryDataSupplement.cvote_registration_signature) + pub cvote_registration_signature: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxAuxiliaryDataSupplement.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxAuxiliaryDataSupplement { + fn default() -> &'a CardanoTxAuxiliaryDataSupplement { + ::default_instance() + } +} + +impl CardanoTxAuxiliaryDataSupplement { + pub fn new() -> CardanoTxAuxiliaryDataSupplement { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.cardano.CardanoTxAuxiliaryDataSupplementType type = 1; + + pub fn type_(&self) -> CardanoTxAuxiliaryDataSupplementType { + match self.type_ { + Some(e) => e.enum_value_or(CardanoTxAuxiliaryDataSupplementType::NONE), + None => CardanoTxAuxiliaryDataSupplementType::NONE, + } + } + + pub fn clear_type_(&mut self) { + self.type_ = ::std::option::Option::None; + } + + pub fn has_type(&self) -> bool { + self.type_.is_some() + } + + // Param is passed by value, moved + pub fn set_type(&mut self, v: CardanoTxAuxiliaryDataSupplementType) { + self.type_ = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bytes auxiliary_data_hash = 2; + + pub fn auxiliary_data_hash(&self) -> &[u8] { + match self.auxiliary_data_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_auxiliary_data_hash(&mut self) { + self.auxiliary_data_hash = ::std::option::Option::None; + } + + pub fn has_auxiliary_data_hash(&self) -> bool { + self.auxiliary_data_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_auxiliary_data_hash(&mut self, v: ::std::vec::Vec) { + self.auxiliary_data_hash = ::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_auxiliary_data_hash(&mut self) -> &mut ::std::vec::Vec { + if self.auxiliary_data_hash.is_none() { + self.auxiliary_data_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.auxiliary_data_hash.as_mut().unwrap() + } + + // Take field + pub fn take_auxiliary_data_hash(&mut self) -> ::std::vec::Vec { + self.auxiliary_data_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes cvote_registration_signature = 3; + + pub fn cvote_registration_signature(&self) -> &[u8] { + match self.cvote_registration_signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_cvote_registration_signature(&mut self) { + self.cvote_registration_signature = ::std::option::Option::None; + } + + pub fn has_cvote_registration_signature(&self) -> bool { + self.cvote_registration_signature.is_some() + } + + // Param is passed by value, moved + pub fn set_cvote_registration_signature(&mut self, v: ::std::vec::Vec) { + self.cvote_registration_signature = ::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_cvote_registration_signature(&mut self) -> &mut ::std::vec::Vec { + if self.cvote_registration_signature.is_none() { + self.cvote_registration_signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.cvote_registration_signature.as_mut().unwrap() + } + + // Take field + pub fn take_cvote_registration_signature(&mut self) -> ::std::vec::Vec { + self.cvote_registration_signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "type", + |m: &CardanoTxAuxiliaryDataSupplement| { &m.type_ }, + |m: &mut CardanoTxAuxiliaryDataSupplement| { &mut m.type_ }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "auxiliary_data_hash", + |m: &CardanoTxAuxiliaryDataSupplement| { &m.auxiliary_data_hash }, + |m: &mut CardanoTxAuxiliaryDataSupplement| { &mut m.auxiliary_data_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "cvote_registration_signature", + |m: &CardanoTxAuxiliaryDataSupplement| { &m.cvote_registration_signature }, + |m: &mut CardanoTxAuxiliaryDataSupplement| { &mut m.cvote_registration_signature }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxAuxiliaryDataSupplement", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxAuxiliaryDataSupplement { + const NAME: &'static str = "CardanoTxAuxiliaryDataSupplement"; + + fn is_initialized(&self) -> bool { + if self.type_.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.type_ = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 18 => { + self.auxiliary_data_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.cvote_registration_signature = ::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.type_ { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + if let Some(v) = self.auxiliary_data_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.cvote_registration_signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &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.type_ { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.auxiliary_data_hash.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.cvote_registration_signature.as_ref() { + os.write_bytes(3, 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() -> CardanoTxAuxiliaryDataSupplement { + CardanoTxAuxiliaryDataSupplement::new() + } + + fn clear(&mut self) { + self.type_ = ::std::option::Option::None; + self.auxiliary_data_hash = ::std::option::Option::None; + self.cvote_registration_signature = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxAuxiliaryDataSupplement { + static instance: CardanoTxAuxiliaryDataSupplement = CardanoTxAuxiliaryDataSupplement { + type_: ::std::option::Option::None, + auxiliary_data_hash: ::std::option::Option::None, + cvote_registration_signature: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxAuxiliaryDataSupplement { + 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("CardanoTxAuxiliaryDataSupplement").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxAuxiliaryDataSupplement { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxAuxiliaryDataSupplement { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxWitnessRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxWitnessRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxWitnessRequest.path) + pub path: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxWitnessRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxWitnessRequest { + fn default() -> &'a CardanoTxWitnessRequest { + ::default_instance() + } +} + +impl CardanoTxWitnessRequest { + pub fn new() -> CardanoTxWitnessRequest { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "path", + |m: &CardanoTxWitnessRequest| { &m.path }, + |m: &mut CardanoTxWitnessRequest| { &mut m.path }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxWitnessRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxWitnessRequest { + const NAME: &'static str = "CardanoTxWitnessRequest"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.path)?; + }, + 8 => { + self.path.push(is.read_uint32()?); + }, + 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; + for value in &self.path { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + 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<()> { + for v in &self.path { + os.write_uint32(1, *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() -> CardanoTxWitnessRequest { + CardanoTxWitnessRequest::new() + } + + fn clear(&mut self) { + self.path.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxWitnessRequest { + static instance: CardanoTxWitnessRequest = CardanoTxWitnessRequest { + path: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxWitnessRequest { + 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("CardanoTxWitnessRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxWitnessRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxWitnessRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxWitnessResponse) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxWitnessResponse { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxWitnessResponse.type) + pub type_: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxWitnessResponse.pub_key) + pub pub_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxWitnessResponse.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxWitnessResponse.chain_code) + pub chain_code: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxWitnessResponse.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxWitnessResponse { + fn default() -> &'a CardanoTxWitnessResponse { + ::default_instance() + } +} + +impl CardanoTxWitnessResponse { + pub fn new() -> CardanoTxWitnessResponse { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.cardano.CardanoTxWitnessType type = 1; + + pub fn type_(&self) -> CardanoTxWitnessType { + match self.type_ { + Some(e) => e.enum_value_or(CardanoTxWitnessType::BYRON_WITNESS), + None => CardanoTxWitnessType::BYRON_WITNESS, + } + } + + pub fn clear_type_(&mut self) { + self.type_ = ::std::option::Option::None; + } + + pub fn has_type(&self) -> bool { + self.type_.is_some() + } + + // Param is passed by value, moved + pub fn set_type(&mut self, v: CardanoTxWitnessType) { + self.type_ = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // required bytes pub_key = 2; + + pub fn pub_key(&self) -> &[u8] { + match self.pub_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_pub_key(&mut self) { + self.pub_key = ::std::option::Option::None; + } + + pub fn has_pub_key(&self) -> bool { + self.pub_key.is_some() + } + + // Param is passed by value, moved + pub fn set_pub_key(&mut self, v: ::std::vec::Vec) { + self.pub_key = ::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_pub_key(&mut self) -> &mut ::std::vec::Vec { + if self.pub_key.is_none() { + self.pub_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.pub_key.as_mut().unwrap() + } + + // Take field + pub fn take_pub_key(&mut self) -> ::std::vec::Vec { + self.pub_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes signature = 3; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes chain_code = 4; + + pub fn chain_code(&self) -> &[u8] { + match self.chain_code.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_chain_code(&mut self) { + self.chain_code = ::std::option::Option::None; + } + + pub fn has_chain_code(&self) -> bool { + self.chain_code.is_some() + } + + // Param is passed by value, moved + pub fn set_chain_code(&mut self, v: ::std::vec::Vec) { + self.chain_code = ::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_chain_code(&mut self) -> &mut ::std::vec::Vec { + if self.chain_code.is_none() { + self.chain_code = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.chain_code.as_mut().unwrap() + } + + // Take field + pub fn take_chain_code(&mut self) -> ::std::vec::Vec { + self.chain_code.take().unwrap_or_else(|| ::std::vec::Vec::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::<_, _>( + "type", + |m: &CardanoTxWitnessResponse| { &m.type_ }, + |m: &mut CardanoTxWitnessResponse| { &mut m.type_ }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pub_key", + |m: &CardanoTxWitnessResponse| { &m.pub_key }, + |m: &mut CardanoTxWitnessResponse| { &mut m.pub_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &CardanoTxWitnessResponse| { &m.signature }, + |m: &mut CardanoTxWitnessResponse| { &mut m.signature }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chain_code", + |m: &CardanoTxWitnessResponse| { &m.chain_code }, + |m: &mut CardanoTxWitnessResponse| { &mut m.chain_code }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxWitnessResponse", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxWitnessResponse { + const NAME: &'static str = "CardanoTxWitnessResponse"; + + fn is_initialized(&self) -> bool { + if self.type_.is_none() { + return false; + } + if self.pub_key.is_none() { + return false; + } + if self.signature.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.type_ = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 18 => { + self.pub_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.signature = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.chain_code = ::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.type_ { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + if let Some(v) = self.pub_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.chain_code.as_ref() { + my_size += ::protobuf::rt::bytes_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.type_ { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.pub_key.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.signature.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.chain_code.as_ref() { + os.write_bytes(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() -> CardanoTxWitnessResponse { + CardanoTxWitnessResponse::new() + } + + fn clear(&mut self) { + self.type_ = ::std::option::Option::None; + self.pub_key = ::std::option::Option::None; + self.signature = ::std::option::Option::None; + self.chain_code = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxWitnessResponse { + static instance: CardanoTxWitnessResponse = CardanoTxWitnessResponse { + type_: ::std::option::Option::None, + pub_key: ::std::option::Option::None, + signature: ::std::option::Option::None, + chain_code: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxWitnessResponse { + 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("CardanoTxWitnessResponse").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxWitnessResponse { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxWitnessResponse { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxHostAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxHostAck { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxHostAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxHostAck { + fn default() -> &'a CardanoTxHostAck { + ::default_instance() + } +} + +impl CardanoTxHostAck { + pub fn new() -> CardanoTxHostAck { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxHostAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxHostAck { + const NAME: &'static str = "CardanoTxHostAck"; + + 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 { + 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; + 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<()> { + 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() -> CardanoTxHostAck { + CardanoTxHostAck::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxHostAck { + static instance: CardanoTxHostAck = CardanoTxHostAck { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxHostAck { + 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("CardanoTxHostAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxHostAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxHostAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoTxBodyHash) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoTxBodyHash { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.cardano.CardanoTxBodyHash.tx_hash) + pub tx_hash: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoTxBodyHash.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoTxBodyHash { + fn default() -> &'a CardanoTxBodyHash { + ::default_instance() + } +} + +impl CardanoTxBodyHash { + pub fn new() -> CardanoTxBodyHash { + ::std::default::Default::default() + } + + // required bytes tx_hash = 1; + + pub fn tx_hash(&self) -> &[u8] { + match self.tx_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_tx_hash(&mut self) { + self.tx_hash = ::std::option::Option::None; + } + + pub fn has_tx_hash(&self) -> bool { + self.tx_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_tx_hash(&mut self, v: ::std::vec::Vec) { + self.tx_hash = ::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_tx_hash(&mut self) -> &mut ::std::vec::Vec { + if self.tx_hash.is_none() { + self.tx_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.tx_hash.as_mut().unwrap() + } + + // Take field + pub fn take_tx_hash(&mut self) -> ::std::vec::Vec { + self.tx_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "tx_hash", + |m: &CardanoTxBodyHash| { &m.tx_hash }, + |m: &mut CardanoTxBodyHash| { &mut m.tx_hash }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoTxBodyHash", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoTxBodyHash { + const NAME: &'static str = "CardanoTxBodyHash"; + + fn is_initialized(&self) -> bool { + if self.tx_hash.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.tx_hash = ::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.tx_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.tx_hash.as_ref() { + os.write_bytes(1, 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() -> CardanoTxBodyHash { + CardanoTxBodyHash::new() + } + + fn clear(&mut self) { + self.tx_hash = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoTxBodyHash { + static instance: CardanoTxBodyHash = CardanoTxBodyHash { + tx_hash: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoTxBodyHash { + 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("CardanoTxBodyHash").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoTxBodyHash { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoTxBodyHash { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.cardano.CardanoSignTxFinished) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CardanoSignTxFinished { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.cardano.CardanoSignTxFinished.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CardanoSignTxFinished { + fn default() -> &'a CardanoSignTxFinished { + ::default_instance() + } +} + +impl CardanoSignTxFinished { + pub fn new() -> CardanoSignTxFinished { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CardanoSignTxFinished", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CardanoSignTxFinished { + const NAME: &'static str = "CardanoSignTxFinished"; + + 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 { + 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; + 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<()> { + 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() -> CardanoSignTxFinished { + CardanoSignTxFinished::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static CardanoSignTxFinished { + static instance: CardanoSignTxFinished = CardanoSignTxFinished { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CardanoSignTxFinished { + 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("CardanoSignTxFinished").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CardanoSignTxFinished { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CardanoSignTxFinished { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.cardano.CardanoDerivationType) +pub enum CardanoDerivationType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoDerivationType.LEDGER) + LEDGER = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoDerivationType.ICARUS) + ICARUS = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoDerivationType.ICARUS_TREZOR) + ICARUS_TREZOR = 2, +} + +impl ::protobuf::Enum for CardanoDerivationType { + const NAME: &'static str = "CardanoDerivationType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(CardanoDerivationType::LEDGER), + 1 => ::std::option::Option::Some(CardanoDerivationType::ICARUS), + 2 => ::std::option::Option::Some(CardanoDerivationType::ICARUS_TREZOR), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "LEDGER" => ::std::option::Option::Some(CardanoDerivationType::LEDGER), + "ICARUS" => ::std::option::Option::Some(CardanoDerivationType::ICARUS), + "ICARUS_TREZOR" => ::std::option::Option::Some(CardanoDerivationType::ICARUS_TREZOR), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [CardanoDerivationType] = &[ + CardanoDerivationType::LEDGER, + CardanoDerivationType::ICARUS, + CardanoDerivationType::ICARUS_TREZOR, + ]; +} + +impl ::protobuf::EnumFull for CardanoDerivationType { + 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("CardanoDerivationType").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 CardanoDerivationType { + fn default() -> Self { + CardanoDerivationType::LEDGER + } +} + +impl CardanoDerivationType { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("CardanoDerivationType") + } +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.cardano.CardanoAddressType) +pub enum CardanoAddressType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoAddressType.BASE) + BASE = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoAddressType.BASE_SCRIPT_KEY) + BASE_SCRIPT_KEY = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoAddressType.BASE_KEY_SCRIPT) + BASE_KEY_SCRIPT = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoAddressType.BASE_SCRIPT_SCRIPT) + BASE_SCRIPT_SCRIPT = 3, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoAddressType.POINTER) + POINTER = 4, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoAddressType.POINTER_SCRIPT) + POINTER_SCRIPT = 5, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoAddressType.ENTERPRISE) + ENTERPRISE = 6, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoAddressType.ENTERPRISE_SCRIPT) + ENTERPRISE_SCRIPT = 7, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoAddressType.BYRON) + BYRON = 8, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoAddressType.REWARD) + REWARD = 14, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoAddressType.REWARD_SCRIPT) + REWARD_SCRIPT = 15, +} + +impl ::protobuf::Enum for CardanoAddressType { + const NAME: &'static str = "CardanoAddressType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(CardanoAddressType::BASE), + 1 => ::std::option::Option::Some(CardanoAddressType::BASE_SCRIPT_KEY), + 2 => ::std::option::Option::Some(CardanoAddressType::BASE_KEY_SCRIPT), + 3 => ::std::option::Option::Some(CardanoAddressType::BASE_SCRIPT_SCRIPT), + 4 => ::std::option::Option::Some(CardanoAddressType::POINTER), + 5 => ::std::option::Option::Some(CardanoAddressType::POINTER_SCRIPT), + 6 => ::std::option::Option::Some(CardanoAddressType::ENTERPRISE), + 7 => ::std::option::Option::Some(CardanoAddressType::ENTERPRISE_SCRIPT), + 8 => ::std::option::Option::Some(CardanoAddressType::BYRON), + 14 => ::std::option::Option::Some(CardanoAddressType::REWARD), + 15 => ::std::option::Option::Some(CardanoAddressType::REWARD_SCRIPT), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "BASE" => ::std::option::Option::Some(CardanoAddressType::BASE), + "BASE_SCRIPT_KEY" => ::std::option::Option::Some(CardanoAddressType::BASE_SCRIPT_KEY), + "BASE_KEY_SCRIPT" => ::std::option::Option::Some(CardanoAddressType::BASE_KEY_SCRIPT), + "BASE_SCRIPT_SCRIPT" => ::std::option::Option::Some(CardanoAddressType::BASE_SCRIPT_SCRIPT), + "POINTER" => ::std::option::Option::Some(CardanoAddressType::POINTER), + "POINTER_SCRIPT" => ::std::option::Option::Some(CardanoAddressType::POINTER_SCRIPT), + "ENTERPRISE" => ::std::option::Option::Some(CardanoAddressType::ENTERPRISE), + "ENTERPRISE_SCRIPT" => ::std::option::Option::Some(CardanoAddressType::ENTERPRISE_SCRIPT), + "BYRON" => ::std::option::Option::Some(CardanoAddressType::BYRON), + "REWARD" => ::std::option::Option::Some(CardanoAddressType::REWARD), + "REWARD_SCRIPT" => ::std::option::Option::Some(CardanoAddressType::REWARD_SCRIPT), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [CardanoAddressType] = &[ + CardanoAddressType::BASE, + CardanoAddressType::BASE_SCRIPT_KEY, + CardanoAddressType::BASE_KEY_SCRIPT, + CardanoAddressType::BASE_SCRIPT_SCRIPT, + CardanoAddressType::POINTER, + CardanoAddressType::POINTER_SCRIPT, + CardanoAddressType::ENTERPRISE, + CardanoAddressType::ENTERPRISE_SCRIPT, + CardanoAddressType::BYRON, + CardanoAddressType::REWARD, + CardanoAddressType::REWARD_SCRIPT, + ]; +} + +impl ::protobuf::EnumFull for CardanoAddressType { + 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("CardanoAddressType").unwrap()).clone() + } + + fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { + let index = match self { + CardanoAddressType::BASE => 0, + CardanoAddressType::BASE_SCRIPT_KEY => 1, + CardanoAddressType::BASE_KEY_SCRIPT => 2, + CardanoAddressType::BASE_SCRIPT_SCRIPT => 3, + CardanoAddressType::POINTER => 4, + CardanoAddressType::POINTER_SCRIPT => 5, + CardanoAddressType::ENTERPRISE => 6, + CardanoAddressType::ENTERPRISE_SCRIPT => 7, + CardanoAddressType::BYRON => 8, + CardanoAddressType::REWARD => 9, + CardanoAddressType::REWARD_SCRIPT => 10, + }; + Self::enum_descriptor().value_by_index(index) + } +} + +impl ::std::default::Default for CardanoAddressType { + fn default() -> Self { + CardanoAddressType::BASE + } +} + +impl CardanoAddressType { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("CardanoAddressType") + } +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.cardano.CardanoNativeScriptType) +pub enum CardanoNativeScriptType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoNativeScriptType.PUB_KEY) + PUB_KEY = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoNativeScriptType.ALL) + ALL = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoNativeScriptType.ANY) + ANY = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoNativeScriptType.N_OF_K) + N_OF_K = 3, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoNativeScriptType.INVALID_BEFORE) + INVALID_BEFORE = 4, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoNativeScriptType.INVALID_HEREAFTER) + INVALID_HEREAFTER = 5, +} + +impl ::protobuf::Enum for CardanoNativeScriptType { + const NAME: &'static str = "CardanoNativeScriptType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(CardanoNativeScriptType::PUB_KEY), + 1 => ::std::option::Option::Some(CardanoNativeScriptType::ALL), + 2 => ::std::option::Option::Some(CardanoNativeScriptType::ANY), + 3 => ::std::option::Option::Some(CardanoNativeScriptType::N_OF_K), + 4 => ::std::option::Option::Some(CardanoNativeScriptType::INVALID_BEFORE), + 5 => ::std::option::Option::Some(CardanoNativeScriptType::INVALID_HEREAFTER), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "PUB_KEY" => ::std::option::Option::Some(CardanoNativeScriptType::PUB_KEY), + "ALL" => ::std::option::Option::Some(CardanoNativeScriptType::ALL), + "ANY" => ::std::option::Option::Some(CardanoNativeScriptType::ANY), + "N_OF_K" => ::std::option::Option::Some(CardanoNativeScriptType::N_OF_K), + "INVALID_BEFORE" => ::std::option::Option::Some(CardanoNativeScriptType::INVALID_BEFORE), + "INVALID_HEREAFTER" => ::std::option::Option::Some(CardanoNativeScriptType::INVALID_HEREAFTER), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [CardanoNativeScriptType] = &[ + CardanoNativeScriptType::PUB_KEY, + CardanoNativeScriptType::ALL, + CardanoNativeScriptType::ANY, + CardanoNativeScriptType::N_OF_K, + CardanoNativeScriptType::INVALID_BEFORE, + CardanoNativeScriptType::INVALID_HEREAFTER, + ]; +} + +impl ::protobuf::EnumFull for CardanoNativeScriptType { + 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("CardanoNativeScriptType").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 CardanoNativeScriptType { + fn default() -> Self { + CardanoNativeScriptType::PUB_KEY + } +} + +impl CardanoNativeScriptType { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("CardanoNativeScriptType") + } +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.cardano.CardanoNativeScriptHashDisplayFormat) +pub enum CardanoNativeScriptHashDisplayFormat { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoNativeScriptHashDisplayFormat.HIDE) + HIDE = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoNativeScriptHashDisplayFormat.BECH32) + BECH32 = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoNativeScriptHashDisplayFormat.POLICY_ID) + POLICY_ID = 2, +} + +impl ::protobuf::Enum for CardanoNativeScriptHashDisplayFormat { + const NAME: &'static str = "CardanoNativeScriptHashDisplayFormat"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(CardanoNativeScriptHashDisplayFormat::HIDE), + 1 => ::std::option::Option::Some(CardanoNativeScriptHashDisplayFormat::BECH32), + 2 => ::std::option::Option::Some(CardanoNativeScriptHashDisplayFormat::POLICY_ID), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "HIDE" => ::std::option::Option::Some(CardanoNativeScriptHashDisplayFormat::HIDE), + "BECH32" => ::std::option::Option::Some(CardanoNativeScriptHashDisplayFormat::BECH32), + "POLICY_ID" => ::std::option::Option::Some(CardanoNativeScriptHashDisplayFormat::POLICY_ID), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [CardanoNativeScriptHashDisplayFormat] = &[ + CardanoNativeScriptHashDisplayFormat::HIDE, + CardanoNativeScriptHashDisplayFormat::BECH32, + CardanoNativeScriptHashDisplayFormat::POLICY_ID, + ]; +} + +impl ::protobuf::EnumFull for CardanoNativeScriptHashDisplayFormat { + 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("CardanoNativeScriptHashDisplayFormat").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 CardanoNativeScriptHashDisplayFormat { + fn default() -> Self { + CardanoNativeScriptHashDisplayFormat::HIDE + } +} + +impl CardanoNativeScriptHashDisplayFormat { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("CardanoNativeScriptHashDisplayFormat") + } +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.cardano.CardanoTxOutputSerializationFormat) +pub enum CardanoTxOutputSerializationFormat { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoTxOutputSerializationFormat.ARRAY_LEGACY) + ARRAY_LEGACY = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoTxOutputSerializationFormat.MAP_BABBAGE) + MAP_BABBAGE = 1, +} + +impl ::protobuf::Enum for CardanoTxOutputSerializationFormat { + const NAME: &'static str = "CardanoTxOutputSerializationFormat"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(CardanoTxOutputSerializationFormat::ARRAY_LEGACY), + 1 => ::std::option::Option::Some(CardanoTxOutputSerializationFormat::MAP_BABBAGE), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "ARRAY_LEGACY" => ::std::option::Option::Some(CardanoTxOutputSerializationFormat::ARRAY_LEGACY), + "MAP_BABBAGE" => ::std::option::Option::Some(CardanoTxOutputSerializationFormat::MAP_BABBAGE), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [CardanoTxOutputSerializationFormat] = &[ + CardanoTxOutputSerializationFormat::ARRAY_LEGACY, + CardanoTxOutputSerializationFormat::MAP_BABBAGE, + ]; +} + +impl ::protobuf::EnumFull for CardanoTxOutputSerializationFormat { + 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("CardanoTxOutputSerializationFormat").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 CardanoTxOutputSerializationFormat { + fn default() -> Self { + CardanoTxOutputSerializationFormat::ARRAY_LEGACY + } +} + +impl CardanoTxOutputSerializationFormat { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("CardanoTxOutputSerializationFormat") + } +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.cardano.CardanoCertificateType) +pub enum CardanoCertificateType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoCertificateType.STAKE_REGISTRATION) + STAKE_REGISTRATION = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoCertificateType.STAKE_DEREGISTRATION) + STAKE_DEREGISTRATION = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoCertificateType.STAKE_DELEGATION) + STAKE_DELEGATION = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoCertificateType.STAKE_POOL_REGISTRATION) + STAKE_POOL_REGISTRATION = 3, +} + +impl ::protobuf::Enum for CardanoCertificateType { + const NAME: &'static str = "CardanoCertificateType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(CardanoCertificateType::STAKE_REGISTRATION), + 1 => ::std::option::Option::Some(CardanoCertificateType::STAKE_DEREGISTRATION), + 2 => ::std::option::Option::Some(CardanoCertificateType::STAKE_DELEGATION), + 3 => ::std::option::Option::Some(CardanoCertificateType::STAKE_POOL_REGISTRATION), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "STAKE_REGISTRATION" => ::std::option::Option::Some(CardanoCertificateType::STAKE_REGISTRATION), + "STAKE_DEREGISTRATION" => ::std::option::Option::Some(CardanoCertificateType::STAKE_DEREGISTRATION), + "STAKE_DELEGATION" => ::std::option::Option::Some(CardanoCertificateType::STAKE_DELEGATION), + "STAKE_POOL_REGISTRATION" => ::std::option::Option::Some(CardanoCertificateType::STAKE_POOL_REGISTRATION), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [CardanoCertificateType] = &[ + CardanoCertificateType::STAKE_REGISTRATION, + CardanoCertificateType::STAKE_DEREGISTRATION, + CardanoCertificateType::STAKE_DELEGATION, + CardanoCertificateType::STAKE_POOL_REGISTRATION, + ]; +} + +impl ::protobuf::EnumFull for CardanoCertificateType { + 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("CardanoCertificateType").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 CardanoCertificateType { + fn default() -> Self { + CardanoCertificateType::STAKE_REGISTRATION + } +} + +impl CardanoCertificateType { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("CardanoCertificateType") + } +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.cardano.CardanoPoolRelayType) +pub enum CardanoPoolRelayType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoPoolRelayType.SINGLE_HOST_IP) + SINGLE_HOST_IP = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoPoolRelayType.SINGLE_HOST_NAME) + SINGLE_HOST_NAME = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoPoolRelayType.MULTIPLE_HOST_NAME) + MULTIPLE_HOST_NAME = 2, +} + +impl ::protobuf::Enum for CardanoPoolRelayType { + const NAME: &'static str = "CardanoPoolRelayType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(CardanoPoolRelayType::SINGLE_HOST_IP), + 1 => ::std::option::Option::Some(CardanoPoolRelayType::SINGLE_HOST_NAME), + 2 => ::std::option::Option::Some(CardanoPoolRelayType::MULTIPLE_HOST_NAME), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "SINGLE_HOST_IP" => ::std::option::Option::Some(CardanoPoolRelayType::SINGLE_HOST_IP), + "SINGLE_HOST_NAME" => ::std::option::Option::Some(CardanoPoolRelayType::SINGLE_HOST_NAME), + "MULTIPLE_HOST_NAME" => ::std::option::Option::Some(CardanoPoolRelayType::MULTIPLE_HOST_NAME), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [CardanoPoolRelayType] = &[ + CardanoPoolRelayType::SINGLE_HOST_IP, + CardanoPoolRelayType::SINGLE_HOST_NAME, + CardanoPoolRelayType::MULTIPLE_HOST_NAME, + ]; +} + +impl ::protobuf::EnumFull for CardanoPoolRelayType { + 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("CardanoPoolRelayType").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 CardanoPoolRelayType { + fn default() -> Self { + CardanoPoolRelayType::SINGLE_HOST_IP + } +} + +impl CardanoPoolRelayType { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("CardanoPoolRelayType") + } +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.cardano.CardanoTxAuxiliaryDataSupplementType) +pub enum CardanoTxAuxiliaryDataSupplementType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoTxAuxiliaryDataSupplementType.NONE) + NONE = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoTxAuxiliaryDataSupplementType.CVOTE_REGISTRATION_SIGNATURE) + CVOTE_REGISTRATION_SIGNATURE = 1, +} + +impl ::protobuf::Enum for CardanoTxAuxiliaryDataSupplementType { + const NAME: &'static str = "CardanoTxAuxiliaryDataSupplementType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(CardanoTxAuxiliaryDataSupplementType::NONE), + 1 => ::std::option::Option::Some(CardanoTxAuxiliaryDataSupplementType::CVOTE_REGISTRATION_SIGNATURE), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "NONE" => ::std::option::Option::Some(CardanoTxAuxiliaryDataSupplementType::NONE), + "CVOTE_REGISTRATION_SIGNATURE" => ::std::option::Option::Some(CardanoTxAuxiliaryDataSupplementType::CVOTE_REGISTRATION_SIGNATURE), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [CardanoTxAuxiliaryDataSupplementType] = &[ + CardanoTxAuxiliaryDataSupplementType::NONE, + CardanoTxAuxiliaryDataSupplementType::CVOTE_REGISTRATION_SIGNATURE, + ]; +} + +impl ::protobuf::EnumFull for CardanoTxAuxiliaryDataSupplementType { + 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("CardanoTxAuxiliaryDataSupplementType").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 CardanoTxAuxiliaryDataSupplementType { + fn default() -> Self { + CardanoTxAuxiliaryDataSupplementType::NONE + } +} + +impl CardanoTxAuxiliaryDataSupplementType { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("CardanoTxAuxiliaryDataSupplementType") + } +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.cardano.CardanoCVoteRegistrationFormat) +pub enum CardanoCVoteRegistrationFormat { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoCVoteRegistrationFormat.CIP15) + CIP15 = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoCVoteRegistrationFormat.CIP36) + CIP36 = 1, +} + +impl ::protobuf::Enum for CardanoCVoteRegistrationFormat { + const NAME: &'static str = "CardanoCVoteRegistrationFormat"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(CardanoCVoteRegistrationFormat::CIP15), + 1 => ::std::option::Option::Some(CardanoCVoteRegistrationFormat::CIP36), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "CIP15" => ::std::option::Option::Some(CardanoCVoteRegistrationFormat::CIP15), + "CIP36" => ::std::option::Option::Some(CardanoCVoteRegistrationFormat::CIP36), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [CardanoCVoteRegistrationFormat] = &[ + CardanoCVoteRegistrationFormat::CIP15, + CardanoCVoteRegistrationFormat::CIP36, + ]; +} + +impl ::protobuf::EnumFull for CardanoCVoteRegistrationFormat { + 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("CardanoCVoteRegistrationFormat").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 CardanoCVoteRegistrationFormat { + fn default() -> Self { + CardanoCVoteRegistrationFormat::CIP15 + } +} + +impl CardanoCVoteRegistrationFormat { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("CardanoCVoteRegistrationFormat") + } +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.cardano.CardanoTxSigningMode) +pub enum CardanoTxSigningMode { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoTxSigningMode.ORDINARY_TRANSACTION) + ORDINARY_TRANSACTION = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoTxSigningMode.POOL_REGISTRATION_AS_OWNER) + POOL_REGISTRATION_AS_OWNER = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoTxSigningMode.MULTISIG_TRANSACTION) + MULTISIG_TRANSACTION = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoTxSigningMode.PLUTUS_TRANSACTION) + PLUTUS_TRANSACTION = 3, +} + +impl ::protobuf::Enum for CardanoTxSigningMode { + const NAME: &'static str = "CardanoTxSigningMode"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(CardanoTxSigningMode::ORDINARY_TRANSACTION), + 1 => ::std::option::Option::Some(CardanoTxSigningMode::POOL_REGISTRATION_AS_OWNER), + 2 => ::std::option::Option::Some(CardanoTxSigningMode::MULTISIG_TRANSACTION), + 3 => ::std::option::Option::Some(CardanoTxSigningMode::PLUTUS_TRANSACTION), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "ORDINARY_TRANSACTION" => ::std::option::Option::Some(CardanoTxSigningMode::ORDINARY_TRANSACTION), + "POOL_REGISTRATION_AS_OWNER" => ::std::option::Option::Some(CardanoTxSigningMode::POOL_REGISTRATION_AS_OWNER), + "MULTISIG_TRANSACTION" => ::std::option::Option::Some(CardanoTxSigningMode::MULTISIG_TRANSACTION), + "PLUTUS_TRANSACTION" => ::std::option::Option::Some(CardanoTxSigningMode::PLUTUS_TRANSACTION), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [CardanoTxSigningMode] = &[ + CardanoTxSigningMode::ORDINARY_TRANSACTION, + CardanoTxSigningMode::POOL_REGISTRATION_AS_OWNER, + CardanoTxSigningMode::MULTISIG_TRANSACTION, + CardanoTxSigningMode::PLUTUS_TRANSACTION, + ]; +} + +impl ::protobuf::EnumFull for CardanoTxSigningMode { + 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("CardanoTxSigningMode").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 CardanoTxSigningMode { + fn default() -> Self { + CardanoTxSigningMode::ORDINARY_TRANSACTION + } +} + +impl CardanoTxSigningMode { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("CardanoTxSigningMode") + } +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.cardano.CardanoTxWitnessType) +pub enum CardanoTxWitnessType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoTxWitnessType.BYRON_WITNESS) + BYRON_WITNESS = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.cardano.CardanoTxWitnessType.SHELLEY_WITNESS) + SHELLEY_WITNESS = 1, +} + +impl ::protobuf::Enum for CardanoTxWitnessType { + const NAME: &'static str = "CardanoTxWitnessType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(CardanoTxWitnessType::BYRON_WITNESS), + 1 => ::std::option::Option::Some(CardanoTxWitnessType::SHELLEY_WITNESS), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "BYRON_WITNESS" => ::std::option::Option::Some(CardanoTxWitnessType::BYRON_WITNESS), + "SHELLEY_WITNESS" => ::std::option::Option::Some(CardanoTxWitnessType::SHELLEY_WITNESS), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [CardanoTxWitnessType] = &[ + CardanoTxWitnessType::BYRON_WITNESS, + CardanoTxWitnessType::SHELLEY_WITNESS, + ]; +} + +impl ::protobuf::EnumFull for CardanoTxWitnessType { + 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("CardanoTxWitnessType").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 CardanoTxWitnessType { + fn default() -> Self { + CardanoTxWitnessType::BYRON_WITNESS + } +} + +impl CardanoTxWitnessType { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("CardanoTxWitnessType") + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x16messages-cardano.proto\x12\x1ahw.trezor.messages.cardano\x1a\x15me\ + ssages-common.proto\"\x87\x01\n\x1cCardanoBlockchainPointerType\x12\x1f\ + \n\x0bblock_index\x18\x01\x20\x02(\rR\nblockIndex\x12\x19\n\x08tx_index\ + \x18\x02\x20\x02(\rR\x07txIndex\x12+\n\x11certificate_index\x18\x03\x20\ + \x02(\rR\x10certificateIndex\"\xef\x02\n\x13CardanoNativeScript\x12G\n\ + \x04type\x18\x01\x20\x02(\x0e23.hw.trezor.messages.cardano.CardanoNative\ + ScriptTypeR\x04type\x12I\n\x07scripts\x18\x02\x20\x03(\x0b2/.hw.trezor.m\ + essages.cardano.CardanoNativeScriptR\x07scripts\x12\x19\n\x08key_hash\ + \x18\x03\x20\x01(\x0cR\x07keyHash\x12\x19\n\x08key_path\x18\x04\x20\x03(\ + \rR\x07keyPath\x12:\n\x19required_signatures_count\x18\x05\x20\x01(\rR\ + \x17requiredSignaturesCount\x12%\n\x0einvalid_before\x18\x06\x20\x01(\ + \x04R\rinvalidBefore\x12+\n\x11invalid_hereafter\x18\x07\x20\x01(\x04R\ + \x10invalidHereafter\"\xaa\x02\n\x1aCardanoGetNativeScriptHash\x12G\n\ + \x06script\x18\x01\x20\x02(\x0b2/.hw.trezor.messages.cardano.CardanoNati\ + veScriptR\x06script\x12g\n\x0edisplay_format\x18\x02\x20\x02(\x0e2@.hw.t\ + rezor.messages.cardano.CardanoNativeScriptHashDisplayFormatR\rdisplayFor\ + mat\x12Z\n\x0fderivation_type\x18\x03\x20\x02(\x0e21.hw.trezor.messages.\ + cardano.CardanoDerivationTypeR\x0ederivationType\":\n\x17CardanoNativeSc\ + riptHash\x12\x1f\n\x0bscript_hash\x18\x01\x20\x02(\x0cR\nscriptHash\"\ + \xaf\x03\n\x1cCardanoAddressParametersType\x12Q\n\x0caddress_type\x18\ + \x01\x20\x02(\x0e2..hw.trezor.messages.cardano.CardanoAddressTypeR\x0bad\ + dressType\x12\x1b\n\taddress_n\x18\x02\x20\x03(\rR\x08addressN\x12*\n\ + \x11address_n_staking\x18\x03\x20\x03(\rR\x0faddressNStaking\x12(\n\x10s\ + taking_key_hash\x18\x04\x20\x01(\x0cR\x0estakingKeyHash\x12i\n\x13certif\ + icate_pointer\x18\x05\x20\x01(\x0b28.hw.trezor.messages.cardano.CardanoB\ + lockchainPointerTypeR\x12certificatePointer\x12.\n\x13script_payment_has\ + h\x18\x06\x20\x01(\x0cR\x11scriptPaymentHash\x12.\n\x13script_staking_ha\ + sh\x18\x07\x20\x01(\x0cR\x11scriptStakingHash\"\xe4\x02\n\x11CardanoGetA\ + ddress\x12(\n\x0cshow_display\x18\x02\x20\x01(\x08:\x05falseR\x0bshowDis\ + play\x12%\n\x0eprotocol_magic\x18\x03\x20\x02(\rR\rprotocolMagic\x12\x1d\ + \n\nnetwork_id\x18\x04\x20\x02(\rR\tnetworkId\x12g\n\x12address_paramete\ + rs\x18\x05\x20\x02(\x0b28.hw.trezor.messages.cardano.CardanoAddressParam\ + etersTypeR\x11addressParameters\x12Z\n\x0fderivation_type\x18\x06\x20\ + \x02(\x0e21.hw.trezor.messages.cardano.CardanoDerivationTypeR\x0ederivat\ + ionType\x12\x1a\n\x08chunkify\x18\x07\x20\x01(\x08R\x08chunkify\"*\n\x0e\ + CardanoAddress\x12\x18\n\x07address\x18\x01\x20\x02(\tR\x07address\"\xb1\ + \x01\n\x13CardanoGetPublicKey\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\ + \x08addressN\x12!\n\x0cshow_display\x18\x02\x20\x01(\x08R\x0bshowDisplay\ + \x12Z\n\x0fderivation_type\x18\x03\x20\x02(\x0e21.hw.trezor.messages.car\ + dano.CardanoDerivationTypeR\x0ederivationType\"a\n\x10CardanoPublicKey\ + \x12\x12\n\x04xpub\x18\x01\x20\x02(\tR\x04xpub\x129\n\x04node\x18\x02\ + \x20\x02(\x0b2%.hw.trezor.messages.common.HDNodeTypeR\x04node\"\xb3\x08\ + \n\x11CardanoSignTxInit\x12S\n\x0csigning_mode\x18\x01\x20\x02(\x0e20.hw\ + .trezor.messages.cardano.CardanoTxSigningModeR\x0bsigningMode\x12%\n\x0e\ + protocol_magic\x18\x02\x20\x02(\rR\rprotocolMagic\x12\x1d\n\nnetwork_id\ + \x18\x03\x20\x02(\rR\tnetworkId\x12!\n\x0cinputs_count\x18\x04\x20\x02(\ + \rR\x0binputsCount\x12#\n\routputs_count\x18\x05\x20\x02(\rR\x0coutputsC\ + ount\x12\x10\n\x03fee\x18\x06\x20\x02(\x04R\x03fee\x12\x10\n\x03ttl\x18\ + \x07\x20\x01(\x04R\x03ttl\x12-\n\x12certificates_count\x18\x08\x20\x02(\ + \rR\x11certificatesCount\x12+\n\x11withdrawals_count\x18\t\x20\x02(\rR\ + \x10withdrawalsCount\x12,\n\x12has_auxiliary_data\x18\n\x20\x02(\x08R\ + \x10hasAuxiliaryData\x126\n\x17validity_interval_start\x18\x0b\x20\x01(\ + \x04R\x15validityIntervalStart\x124\n\x16witness_requests_count\x18\x0c\ + \x20\x02(\rR\x14witnessRequestsCount\x12;\n\x1aminting_asset_groups_coun\ + t\x18\r\x20\x02(\rR\x17mintingAssetGroupsCount\x12Z\n\x0fderivation_type\ + \x18\x0e\x20\x02(\x0e21.hw.trezor.messages.cardano.CardanoDerivationType\ + R\x0ederivationType\x123\n\x12include_network_id\x18\x0f\x20\x01(\x08:\ + \x05falseR\x10includeNetworkId\x12(\n\x10script_data_hash\x18\x10\x20\ + \x01(\x0cR\x0escriptDataHash\x126\n\x17collateral_inputs_count\x18\x11\ + \x20\x02(\rR\x15collateralInputsCount\x124\n\x16required_signers_count\ + \x18\x12\x20\x02(\rR\x14requiredSignersCount\x129\n\x15has_collateral_re\ + turn\x18\x13\x20\x01(\x08:\x05falseR\x13hasCollateralReturn\x12)\n\x10to\ + tal_collateral\x18\x14\x20\x01(\x04R\x0ftotalCollateral\x127\n\x16refere\ + nce_inputs_count\x18\x15\x20\x01(\r:\x010R\x14referenceInputsCount\x12\ + \x1a\n\x08chunkify\x18\x16\x20\x01(\x08R\x08chunkify\"L\n\x0eCardanoTxIn\ + put\x12\x1b\n\tprev_hash\x18\x01\x20\x02(\x0cR\x08prevHash\x12\x1d\n\npr\ + ev_index\x18\x02\x20\x02(\rR\tprevIndex\"\xc5\x03\n\x0fCardanoTxOutput\ + \x12\x18\n\x07address\x18\x01\x20\x01(\tR\x07address\x12g\n\x12address_p\ + arameters\x18\x02\x20\x01(\x0b28.hw.trezor.messages.cardano.CardanoAddre\ + ssParametersTypeR\x11addressParameters\x12\x16\n\x06amount\x18\x03\x20\ + \x02(\x04R\x06amount\x12,\n\x12asset_groups_count\x18\x04\x20\x02(\rR\ + \x10assetGroupsCount\x12\x1d\n\ndatum_hash\x18\x05\x20\x01(\x0cR\tdatumH\ + ash\x12d\n\x06format\x18\x06\x20\x01(\x0e2>.hw.trezor.messages.cardano.C\ + ardanoTxOutputSerializationFormat:\x0cARRAY_LEGACYR\x06format\x12-\n\x11\ + inline_datum_size\x18\x07\x20\x01(\r:\x010R\x0finlineDatumSize\x125\n\ + \x15reference_script_size\x18\x08\x20\x01(\r:\x010R\x13referenceScriptSi\ + ze\"S\n\x11CardanoAssetGroup\x12\x1b\n\tpolicy_id\x18\x01\x20\x02(\x0cR\ + \x08policyId\x12!\n\x0ctokens_count\x18\x02\x20\x02(\rR\x0btokensCount\"\ + q\n\x0cCardanoToken\x12(\n\x10asset_name_bytes\x18\x01\x20\x02(\x0cR\x0e\ + assetNameBytes\x12\x16\n\x06amount\x18\x02\x20\x01(\x04R\x06amount\x12\ + \x1f\n\x0bmint_amount\x18\x03\x20\x01(\x12R\nmintAmount\"/\n\x19CardanoT\ + xInlineDatumChunk\x12\x12\n\x04data\x18\x01\x20\x02(\x0cR\x04data\"3\n\ + \x1dCardanoTxReferenceScriptChunk\x12\x12\n\x04data\x18\x01\x20\x02(\x0c\ + R\x04data\"f\n\x10CardanoPoolOwner\x12(\n\x10staking_key_path\x18\x01\ + \x20\x03(\rR\x0estakingKeyPath\x12(\n\x10staking_key_hash\x18\x02\x20\ + \x01(\x0cR\x0estakingKeyHash\"\xd9\x01\n\x1aCardanoPoolRelayParameters\ + \x12D\n\x04type\x18\x01\x20\x02(\x0e20.hw.trezor.messages.cardano.Cardan\ + oPoolRelayTypeR\x04type\x12!\n\x0cipv4_address\x18\x02\x20\x01(\x0cR\x0b\ + ipv4Address\x12!\n\x0cipv6_address\x18\x03\x20\x01(\x0cR\x0bipv6Address\ + \x12\x1b\n\thost_name\x18\x04\x20\x01(\tR\x08hostName\x12\x12\n\x04port\ + \x18\x05\x20\x01(\rR\x04port\"?\n\x17CardanoPoolMetadataType\x12\x10\n\ + \x03url\x18\x01\x20\x02(\tR\x03url\x12\x12\n\x04hash\x18\x02\x20\x02(\ + \x0cR\x04hash\"\x9a\x03\n\x19CardanoPoolParametersType\x12\x17\n\x07pool\ + _id\x18\x01\x20\x02(\x0cR\x06poolId\x12\x20\n\x0cvrf_key_hash\x18\x02\ + \x20\x02(\x0cR\nvrfKeyHash\x12\x16\n\x06pledge\x18\x03\x20\x02(\x04R\x06\ + pledge\x12\x12\n\x04cost\x18\x04\x20\x02(\x04R\x04cost\x12)\n\x10margin_\ + numerator\x18\x05\x20\x02(\x04R\x0fmarginNumerator\x12-\n\x12margin_deno\ + minator\x18\x06\x20\x02(\x04R\x11marginDenominator\x12%\n\x0ereward_acco\ + unt\x18\x07\x20\x02(\tR\rrewardAccount\x12O\n\x08metadata\x18\n\x20\x01(\ + \x0b23.hw.trezor.messages.cardano.CardanoPoolMetadataTypeR\x08metadata\ + \x12!\n\x0cowners_count\x18\x0b\x20\x02(\rR\x0bownersCount\x12!\n\x0crel\ + ays_count\x18\x0c\x20\x02(\rR\x0brelaysCount\"\xa2\x02\n\x14CardanoTxCer\ + tificate\x12F\n\x04type\x18\x01\x20\x02(\x0e22.hw.trezor.messages.cardan\ + o.CardanoCertificateTypeR\x04type\x12\x12\n\x04path\x18\x02\x20\x03(\rR\ + \x04path\x12\x12\n\x04pool\x18\x03\x20\x01(\x0cR\x04pool\x12^\n\x0fpool_\ + parameters\x18\x04\x20\x01(\x0b25.hw.trezor.messages.cardano.CardanoPool\ + ParametersTypeR\x0epoolParameters\x12\x1f\n\x0bscript_hash\x18\x05\x20\ + \x01(\x0cR\nscriptHash\x12\x19\n\x08key_hash\x18\x06\x20\x01(\x0cR\x07ke\ + yHash\"}\n\x13CardanoTxWithdrawal\x12\x12\n\x04path\x18\x01\x20\x03(\rR\ + \x04path\x12\x16\n\x06amount\x18\x02\x20\x02(\x04R\x06amount\x12\x1f\n\ + \x0bscript_hash\x18\x03\x20\x01(\x0cR\nscriptHash\x12\x19\n\x08key_hash\ + \x18\x04\x20\x01(\x0cR\x07keyHash\"d\n\"CardanoCVoteRegistrationDelegati\ + on\x12&\n\x0fvote_public_key\x18\x01\x20\x02(\x0cR\rvotePublicKey\x12\ + \x16\n\x06weight\x18\x02\x20\x02(\rR\x06weight\"\x8e\x04\n&CardanoCVoteR\ + egistrationParametersType\x12&\n\x0fvote_public_key\x18\x01\x20\x01(\x0c\ + R\rvotePublicKey\x12!\n\x0cstaking_path\x18\x02\x20\x03(\rR\x0bstakingPa\ + th\x12v\n\x1apayment_address_parameters\x18\x03\x20\x01(\x0b28.hw.trezor\ + .messages.cardano.CardanoAddressParametersTypeR\x18paymentAddressParamet\ + ers\x12\x14\n\x05nonce\x18\x04\x20\x02(\x04R\x05nonce\x12Y\n\x06format\ + \x18\x05\x20\x01(\x0e2:.hw.trezor.messages.cardano.CardanoCVoteRegistrat\ + ionFormat:\x05CIP15R\x06format\x12`\n\x0bdelegations\x18\x06\x20\x03(\ + \x0b2>.hw.trezor.messages.cardano.CardanoCVoteRegistrationDelegationR\ + \x0bdelegations\x12%\n\x0evoting_purpose\x18\x07\x20\x01(\x04R\rvotingPu\ + rpose\x12'\n\x0fpayment_address\x18\x08\x20\x01(\tR\x0epaymentAddress\"\ + \xb5\x01\n\x16CardanoTxAuxiliaryData\x12\x86\x01\n\x1dcvote_registration\ + _parameters\x18\x01\x20\x01(\x0b2B.hw.trezor.messages.cardano.CardanoCVo\ + teRegistrationParametersTypeR\x1bcvoteRegistrationParameters\x12\x12\n\ + \x04hash\x18\x02\x20\x01(\x0cR\x04hash\"=\n\rCardanoTxMint\x12,\n\x12ass\ + et_groups_count\x18\x01\x20\x02(\rR\x10assetGroupsCount\"V\n\x18CardanoT\ + xCollateralInput\x12\x1b\n\tprev_hash\x18\x01\x20\x02(\x0cR\x08prevHash\ + \x12\x1d\n\nprev_index\x18\x02\x20\x02(\rR\tprevIndex\"O\n\x17CardanoTxR\ + equiredSigner\x12\x19\n\x08key_hash\x18\x01\x20\x01(\x0cR\x07keyHash\x12\ + \x19\n\x08key_path\x18\x02\x20\x03(\rR\x07keyPath\"U\n\x17CardanoTxRefer\ + enceInput\x12\x1b\n\tprev_hash\x18\x01\x20\x02(\x0cR\x08prevHash\x12\x1d\ + \n\nprev_index\x18\x02\x20\x02(\rR\tprevIndex\"\x12\n\x10CardanoTxItemAc\ + k\"\xea\x01\n\x20CardanoTxAuxiliaryDataSupplement\x12T\n\x04type\x18\x01\ + \x20\x02(\x0e2@.hw.trezor.messages.cardano.CardanoTxAuxiliaryDataSupplem\ + entTypeR\x04type\x12.\n\x13auxiliary_data_hash\x18\x02\x20\x01(\x0cR\x11\ + auxiliaryDataHash\x12@\n\x1ccvote_registration_signature\x18\x03\x20\x01\ + (\x0cR\x1acvoteRegistrationSignature\"-\n\x17CardanoTxWitnessRequest\x12\ + \x12\n\x04path\x18\x01\x20\x03(\rR\x04path\"\xb6\x01\n\x18CardanoTxWitne\ + ssResponse\x12D\n\x04type\x18\x01\x20\x02(\x0e20.hw.trezor.messages.card\ + ano.CardanoTxWitnessTypeR\x04type\x12\x17\n\x07pub_key\x18\x02\x20\x02(\ + \x0cR\x06pubKey\x12\x1c\n\tsignature\x18\x03\x20\x02(\x0cR\tsignature\ + \x12\x1d\n\nchain_code\x18\x04\x20\x01(\x0cR\tchainCode\"\x12\n\x10Carda\ + noTxHostAck\",\n\x11CardanoTxBodyHash\x12\x17\n\x07tx_hash\x18\x01\x20\ + \x02(\x0cR\x06txHash\"\x17\n\x15CardanoSignTxFinished*B\n\x15CardanoDeri\ + vationType\x12\n\n\x06LEDGER\x10\0\x12\n\n\x06ICARUS\x10\x01\x12\x11\n\r\ + ICARUS_TREZOR\x10\x02*\xd2\x01\n\x12CardanoAddressType\x12\x08\n\x04BASE\ + \x10\0\x12\x13\n\x0fBASE_SCRIPT_KEY\x10\x01\x12\x13\n\x0fBASE_KEY_SCRIPT\ + \x10\x02\x12\x16\n\x12BASE_SCRIPT_SCRIPT\x10\x03\x12\x0b\n\x07POINTER\ + \x10\x04\x12\x12\n\x0ePOINTER_SCRIPT\x10\x05\x12\x0e\n\nENTERPRISE\x10\ + \x06\x12\x15\n\x11ENTERPRISE_SCRIPT\x10\x07\x12\t\n\x05BYRON\x10\x08\x12\ + \n\n\x06REWARD\x10\x0e\x12\x11\n\rREWARD_SCRIPT\x10\x0f*o\n\x17CardanoNa\ + tiveScriptType\x12\x0b\n\x07PUB_KEY\x10\0\x12\x07\n\x03ALL\x10\x01\x12\ + \x07\n\x03ANY\x10\x02\x12\n\n\x06N_OF_K\x10\x03\x12\x12\n\x0eINVALID_BEF\ + ORE\x10\x04\x12\x15\n\x11INVALID_HEREAFTER\x10\x05*K\n$CardanoNativeScri\ + ptHashDisplayFormat\x12\x08\n\x04HIDE\x10\0\x12\n\n\x06BECH32\x10\x01\ + \x12\r\n\tPOLICY_ID\x10\x02*G\n\"CardanoTxOutputSerializationFormat\x12\ + \x10\n\x0cARRAY_LEGACY\x10\0\x12\x0f\n\x0bMAP_BABBAGE\x10\x01*}\n\x16Car\ + danoCertificateType\x12\x16\n\x12STAKE_REGISTRATION\x10\0\x12\x18\n\x14S\ + TAKE_DEREGISTRATION\x10\x01\x12\x14\n\x10STAKE_DELEGATION\x10\x02\x12\ + \x1b\n\x17STAKE_POOL_REGISTRATION\x10\x03*X\n\x14CardanoPoolRelayType\ + \x12\x12\n\x0eSINGLE_HOST_IP\x10\0\x12\x14\n\x10SINGLE_HOST_NAME\x10\x01\ + \x12\x16\n\x12MULTIPLE_HOST_NAME\x10\x02*R\n$CardanoTxAuxiliaryDataSuppl\ + ementType\x12\x08\n\x04NONE\x10\0\x12\x20\n\x1cCVOTE_REGISTRATION_SIGNAT\ + URE\x10\x01*6\n\x1eCardanoCVoteRegistrationFormat\x12\t\n\x05CIP15\x10\0\ + \x12\t\n\x05CIP36\x10\x01*\x82\x01\n\x14CardanoTxSigningMode\x12\x18\n\ + \x14ORDINARY_TRANSACTION\x10\0\x12\x1e\n\x1aPOOL_REGISTRATION_AS_OWNER\ + \x10\x01\x12\x18\n\x14MULTISIG_TRANSACTION\x10\x02\x12\x16\n\x12PLUTUS_T\ + RANSACTION\x10\x03*>\n\x14CardanoTxWitnessType\x12\x11\n\rBYRON_WITNESS\ + \x10\0\x12\x13\n\x0fSHELLEY_WITNESS\x10\x01B;\n#com.satoshilabs.trezor.l\ + ib.protobufB\x14TrezorMessageCardano\ +"; + +/// `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(1); + deps.push(super::messages_common::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(36); + messages.push(CardanoBlockchainPointerType::generated_message_descriptor_data()); + messages.push(CardanoNativeScript::generated_message_descriptor_data()); + messages.push(CardanoGetNativeScriptHash::generated_message_descriptor_data()); + messages.push(CardanoNativeScriptHash::generated_message_descriptor_data()); + messages.push(CardanoAddressParametersType::generated_message_descriptor_data()); + messages.push(CardanoGetAddress::generated_message_descriptor_data()); + messages.push(CardanoAddress::generated_message_descriptor_data()); + messages.push(CardanoGetPublicKey::generated_message_descriptor_data()); + messages.push(CardanoPublicKey::generated_message_descriptor_data()); + messages.push(CardanoSignTxInit::generated_message_descriptor_data()); + messages.push(CardanoTxInput::generated_message_descriptor_data()); + messages.push(CardanoTxOutput::generated_message_descriptor_data()); + messages.push(CardanoAssetGroup::generated_message_descriptor_data()); + messages.push(CardanoToken::generated_message_descriptor_data()); + messages.push(CardanoTxInlineDatumChunk::generated_message_descriptor_data()); + messages.push(CardanoTxReferenceScriptChunk::generated_message_descriptor_data()); + messages.push(CardanoPoolOwner::generated_message_descriptor_data()); + messages.push(CardanoPoolRelayParameters::generated_message_descriptor_data()); + messages.push(CardanoPoolMetadataType::generated_message_descriptor_data()); + messages.push(CardanoPoolParametersType::generated_message_descriptor_data()); + messages.push(CardanoTxCertificate::generated_message_descriptor_data()); + messages.push(CardanoTxWithdrawal::generated_message_descriptor_data()); + messages.push(CardanoCVoteRegistrationDelegation::generated_message_descriptor_data()); + messages.push(CardanoCVoteRegistrationParametersType::generated_message_descriptor_data()); + messages.push(CardanoTxAuxiliaryData::generated_message_descriptor_data()); + messages.push(CardanoTxMint::generated_message_descriptor_data()); + messages.push(CardanoTxCollateralInput::generated_message_descriptor_data()); + messages.push(CardanoTxRequiredSigner::generated_message_descriptor_data()); + messages.push(CardanoTxReferenceInput::generated_message_descriptor_data()); + messages.push(CardanoTxItemAck::generated_message_descriptor_data()); + messages.push(CardanoTxAuxiliaryDataSupplement::generated_message_descriptor_data()); + messages.push(CardanoTxWitnessRequest::generated_message_descriptor_data()); + messages.push(CardanoTxWitnessResponse::generated_message_descriptor_data()); + messages.push(CardanoTxHostAck::generated_message_descriptor_data()); + messages.push(CardanoTxBodyHash::generated_message_descriptor_data()); + messages.push(CardanoSignTxFinished::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(11); + enums.push(CardanoDerivationType::generated_enum_descriptor_data()); + enums.push(CardanoAddressType::generated_enum_descriptor_data()); + enums.push(CardanoNativeScriptType::generated_enum_descriptor_data()); + enums.push(CardanoNativeScriptHashDisplayFormat::generated_enum_descriptor_data()); + enums.push(CardanoTxOutputSerializationFormat::generated_enum_descriptor_data()); + enums.push(CardanoCertificateType::generated_enum_descriptor_data()); + enums.push(CardanoPoolRelayType::generated_enum_descriptor_data()); + enums.push(CardanoTxAuxiliaryDataSupplementType::generated_enum_descriptor_data()); + enums.push(CardanoCVoteRegistrationFormat::generated_enum_descriptor_data()); + enums.push(CardanoTxSigningMode::generated_enum_descriptor_data()); + enums.push(CardanoTxWitnessType::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_common.rs b/wallet/trezor-client/src/protos/generated/messages_common.rs new file mode 100644 index 0000000000..49e0f1dfd2 --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_common.rs @@ -0,0 +1,2521 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-common.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.common.Success) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct Success { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.common.Success.message) + pub message: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.common.Success.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Success { + fn default() -> &'a Success { + ::default_instance() + } +} + +impl Success { + pub fn new() -> Success { + ::std::default::Default::default() + } + + // optional string message = 1; + + pub fn message(&self) -> &str { + match self.message.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_message(&mut self) { + self.message = ::std::option::Option::None; + } + + pub fn has_message(&self) -> bool { + self.message.is_some() + } + + // Param is passed by value, moved + pub fn set_message(&mut self, v: ::std::string::String) { + self.message = ::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_message(&mut self) -> &mut ::std::string::String { + if self.message.is_none() { + self.message = ::std::option::Option::Some(::std::string::String::new()); + } + self.message.as_mut().unwrap() + } + + // Take field + pub fn take_message(&mut self) -> ::std::string::String { + self.message.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "message", + |m: &Success| { &m.message }, + |m: &mut Success| { &mut m.message }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Success", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Success { + const NAME: &'static str = "Success"; + + 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.message = ::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.message.as_ref() { + my_size += ::protobuf::rt::string_size(1, &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.message.as_ref() { + os.write_string(1, 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() -> Success { + Success::new() + } + + fn clear(&mut self) { + self.message = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static Success { + static instance: Success = Success { + message: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Success { + 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("Success").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Success { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Success { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.common.Failure) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct Failure { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.common.Failure.code) + pub code: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.common.Failure.message) + pub message: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.common.Failure.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Failure { + fn default() -> &'a Failure { + ::default_instance() + } +} + +impl Failure { + pub fn new() -> Failure { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.common.Failure.FailureType code = 1; + + pub fn code(&self) -> failure::FailureType { + match self.code { + Some(e) => e.enum_value_or(failure::FailureType::Failure_UnexpectedMessage), + None => failure::FailureType::Failure_UnexpectedMessage, + } + } + + pub fn clear_code(&mut self) { + self.code = ::std::option::Option::None; + } + + pub fn has_code(&self) -> bool { + self.code.is_some() + } + + // Param is passed by value, moved + pub fn set_code(&mut self, v: failure::FailureType) { + self.code = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional string message = 2; + + pub fn message(&self) -> &str { + match self.message.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_message(&mut self) { + self.message = ::std::option::Option::None; + } + + pub fn has_message(&self) -> bool { + self.message.is_some() + } + + // Param is passed by value, moved + pub fn set_message(&mut self, v: ::std::string::String) { + self.message = ::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_message(&mut self) -> &mut ::std::string::String { + if self.message.is_none() { + self.message = ::std::option::Option::Some(::std::string::String::new()); + } + self.message.as_mut().unwrap() + } + + // Take field + pub fn take_message(&mut self) -> ::std::string::String { + self.message.take().unwrap_or_else(|| ::std::string::String::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::<_, _>( + "code", + |m: &Failure| { &m.code }, + |m: &mut Failure| { &mut m.code }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "message", + |m: &Failure| { &m.message }, + |m: &mut Failure| { &mut m.message }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Failure", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Failure { + const NAME: &'static str = "Failure"; + + 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 { + 8 => { + self.code = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 18 => { + self.message = ::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.code { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + if let Some(v) = self.message.as_ref() { + my_size += ::protobuf::rt::string_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.code { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.message.as_ref() { + os.write_string(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() -> Failure { + Failure::new() + } + + fn clear(&mut self) { + self.code = ::std::option::Option::None; + self.message = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static Failure { + static instance: Failure = Failure { + code: ::std::option::Option::None, + message: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Failure { + 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("Failure").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Failure { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Failure { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `Failure` +pub mod failure { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.common.Failure.FailureType) + pub enum FailureType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_UnexpectedMessage) + Failure_UnexpectedMessage = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_ButtonExpected) + Failure_ButtonExpected = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_DataError) + Failure_DataError = 3, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_ActionCancelled) + Failure_ActionCancelled = 4, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_PinExpected) + Failure_PinExpected = 5, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_PinCancelled) + Failure_PinCancelled = 6, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_PinInvalid) + Failure_PinInvalid = 7, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_InvalidSignature) + Failure_InvalidSignature = 8, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_ProcessError) + Failure_ProcessError = 9, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_NotEnoughFunds) + Failure_NotEnoughFunds = 10, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_NotInitialized) + Failure_NotInitialized = 11, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_PinMismatch) + Failure_PinMismatch = 12, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_WipeCodeMismatch) + Failure_WipeCodeMismatch = 13, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_InvalidSession) + Failure_InvalidSession = 14, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.Failure.FailureType.Failure_FirmwareError) + Failure_FirmwareError = 99, + } + + impl ::protobuf::Enum for FailureType { + const NAME: &'static str = "FailureType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 1 => ::std::option::Option::Some(FailureType::Failure_UnexpectedMessage), + 2 => ::std::option::Option::Some(FailureType::Failure_ButtonExpected), + 3 => ::std::option::Option::Some(FailureType::Failure_DataError), + 4 => ::std::option::Option::Some(FailureType::Failure_ActionCancelled), + 5 => ::std::option::Option::Some(FailureType::Failure_PinExpected), + 6 => ::std::option::Option::Some(FailureType::Failure_PinCancelled), + 7 => ::std::option::Option::Some(FailureType::Failure_PinInvalid), + 8 => ::std::option::Option::Some(FailureType::Failure_InvalidSignature), + 9 => ::std::option::Option::Some(FailureType::Failure_ProcessError), + 10 => ::std::option::Option::Some(FailureType::Failure_NotEnoughFunds), + 11 => ::std::option::Option::Some(FailureType::Failure_NotInitialized), + 12 => ::std::option::Option::Some(FailureType::Failure_PinMismatch), + 13 => ::std::option::Option::Some(FailureType::Failure_WipeCodeMismatch), + 14 => ::std::option::Option::Some(FailureType::Failure_InvalidSession), + 99 => ::std::option::Option::Some(FailureType::Failure_FirmwareError), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "Failure_UnexpectedMessage" => ::std::option::Option::Some(FailureType::Failure_UnexpectedMessage), + "Failure_ButtonExpected" => ::std::option::Option::Some(FailureType::Failure_ButtonExpected), + "Failure_DataError" => ::std::option::Option::Some(FailureType::Failure_DataError), + "Failure_ActionCancelled" => ::std::option::Option::Some(FailureType::Failure_ActionCancelled), + "Failure_PinExpected" => ::std::option::Option::Some(FailureType::Failure_PinExpected), + "Failure_PinCancelled" => ::std::option::Option::Some(FailureType::Failure_PinCancelled), + "Failure_PinInvalid" => ::std::option::Option::Some(FailureType::Failure_PinInvalid), + "Failure_InvalidSignature" => ::std::option::Option::Some(FailureType::Failure_InvalidSignature), + "Failure_ProcessError" => ::std::option::Option::Some(FailureType::Failure_ProcessError), + "Failure_NotEnoughFunds" => ::std::option::Option::Some(FailureType::Failure_NotEnoughFunds), + "Failure_NotInitialized" => ::std::option::Option::Some(FailureType::Failure_NotInitialized), + "Failure_PinMismatch" => ::std::option::Option::Some(FailureType::Failure_PinMismatch), + "Failure_WipeCodeMismatch" => ::std::option::Option::Some(FailureType::Failure_WipeCodeMismatch), + "Failure_InvalidSession" => ::std::option::Option::Some(FailureType::Failure_InvalidSession), + "Failure_FirmwareError" => ::std::option::Option::Some(FailureType::Failure_FirmwareError), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [FailureType] = &[ + FailureType::Failure_UnexpectedMessage, + FailureType::Failure_ButtonExpected, + FailureType::Failure_DataError, + FailureType::Failure_ActionCancelled, + FailureType::Failure_PinExpected, + FailureType::Failure_PinCancelled, + FailureType::Failure_PinInvalid, + FailureType::Failure_InvalidSignature, + FailureType::Failure_ProcessError, + FailureType::Failure_NotEnoughFunds, + FailureType::Failure_NotInitialized, + FailureType::Failure_PinMismatch, + FailureType::Failure_WipeCodeMismatch, + FailureType::Failure_InvalidSession, + FailureType::Failure_FirmwareError, + ]; + } + + impl ::protobuf::EnumFull for FailureType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("Failure.FailureType").unwrap()).clone() + } + + fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { + let index = match self { + FailureType::Failure_UnexpectedMessage => 0, + FailureType::Failure_ButtonExpected => 1, + FailureType::Failure_DataError => 2, + FailureType::Failure_ActionCancelled => 3, + FailureType::Failure_PinExpected => 4, + FailureType::Failure_PinCancelled => 5, + FailureType::Failure_PinInvalid => 6, + FailureType::Failure_InvalidSignature => 7, + FailureType::Failure_ProcessError => 8, + FailureType::Failure_NotEnoughFunds => 9, + FailureType::Failure_NotInitialized => 10, + FailureType::Failure_PinMismatch => 11, + FailureType::Failure_WipeCodeMismatch => 12, + FailureType::Failure_InvalidSession => 13, + FailureType::Failure_FirmwareError => 14, + }; + Self::enum_descriptor().value_by_index(index) + } + } + + // Note, `Default` is implemented although default value is not 0 + impl ::std::default::Default for FailureType { + fn default() -> Self { + FailureType::Failure_UnexpectedMessage + } + } + + impl FailureType { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("Failure.FailureType") + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.common.ButtonRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct ButtonRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.common.ButtonRequest.code) + pub code: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.common.ButtonRequest.pages) + pub pages: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.common.ButtonRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a ButtonRequest { + fn default() -> &'a ButtonRequest { + ::default_instance() + } +} + +impl ButtonRequest { + pub fn new() -> ButtonRequest { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.common.ButtonRequest.ButtonRequestType code = 1; + + pub fn code(&self) -> button_request::ButtonRequestType { + match self.code { + Some(e) => e.enum_value_or(button_request::ButtonRequestType::ButtonRequest_Other), + None => button_request::ButtonRequestType::ButtonRequest_Other, + } + } + + pub fn clear_code(&mut self) { + self.code = ::std::option::Option::None; + } + + pub fn has_code(&self) -> bool { + self.code.is_some() + } + + // Param is passed by value, moved + pub fn set_code(&mut self, v: button_request::ButtonRequestType) { + self.code = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional uint32 pages = 2; + + pub fn pages(&self) -> u32 { + self.pages.unwrap_or(0) + } + + pub fn clear_pages(&mut self) { + self.pages = ::std::option::Option::None; + } + + pub fn has_pages(&self) -> bool { + self.pages.is_some() + } + + // Param is passed by value, moved + pub fn set_pages(&mut self, v: u32) { + self.pages = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "code", + |m: &ButtonRequest| { &m.code }, + |m: &mut ButtonRequest| { &mut m.code }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pages", + |m: &ButtonRequest| { &m.pages }, + |m: &mut ButtonRequest| { &mut m.pages }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "ButtonRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for ButtonRequest { + const NAME: &'static str = "ButtonRequest"; + + 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 { + 8 => { + self.code = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 16 => { + self.pages = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.code { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + if let Some(v) = self.pages { + my_size += ::protobuf::rt::uint32_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.code { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.pages { + os.write_uint32(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() -> ButtonRequest { + ButtonRequest::new() + } + + fn clear(&mut self) { + self.code = ::std::option::Option::None; + self.pages = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static ButtonRequest { + static instance: ButtonRequest = ButtonRequest { + code: ::std::option::Option::None, + pages: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for ButtonRequest { + 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("ButtonRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for ButtonRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ButtonRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `ButtonRequest` +pub mod button_request { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.common.ButtonRequest.ButtonRequestType) + pub enum ButtonRequestType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_Other) + ButtonRequest_Other = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_FeeOverThreshold) + ButtonRequest_FeeOverThreshold = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_ConfirmOutput) + ButtonRequest_ConfirmOutput = 3, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_ResetDevice) + ButtonRequest_ResetDevice = 4, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_ConfirmWord) + ButtonRequest_ConfirmWord = 5, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_WipeDevice) + ButtonRequest_WipeDevice = 6, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_ProtectCall) + ButtonRequest_ProtectCall = 7, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_SignTx) + ButtonRequest_SignTx = 8, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_FirmwareCheck) + ButtonRequest_FirmwareCheck = 9, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_Address) + ButtonRequest_Address = 10, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_PublicKey) + ButtonRequest_PublicKey = 11, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_MnemonicWordCount) + ButtonRequest_MnemonicWordCount = 12, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_MnemonicInput) + ButtonRequest_MnemonicInput = 13, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType._Deprecated_ButtonRequest_PassphraseType) + _Deprecated_ButtonRequest_PassphraseType = 14, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_UnknownDerivationPath) + ButtonRequest_UnknownDerivationPath = 15, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_RecoveryHomepage) + ButtonRequest_RecoveryHomepage = 16, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_Success) + ButtonRequest_Success = 17, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_Warning) + ButtonRequest_Warning = 18, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_PassphraseEntry) + ButtonRequest_PassphraseEntry = 19, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.ButtonRequest.ButtonRequestType.ButtonRequest_PinEntry) + ButtonRequest_PinEntry = 20, + } + + impl ::protobuf::Enum for ButtonRequestType { + const NAME: &'static str = "ButtonRequestType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 1 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_Other), + 2 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_FeeOverThreshold), + 3 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_ConfirmOutput), + 4 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_ResetDevice), + 5 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_ConfirmWord), + 6 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_WipeDevice), + 7 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_ProtectCall), + 8 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_SignTx), + 9 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_FirmwareCheck), + 10 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_Address), + 11 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_PublicKey), + 12 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_MnemonicWordCount), + 13 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_MnemonicInput), + 14 => ::std::option::Option::Some(ButtonRequestType::_Deprecated_ButtonRequest_PassphraseType), + 15 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_UnknownDerivationPath), + 16 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_RecoveryHomepage), + 17 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_Success), + 18 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_Warning), + 19 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_PassphraseEntry), + 20 => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_PinEntry), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "ButtonRequest_Other" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_Other), + "ButtonRequest_FeeOverThreshold" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_FeeOverThreshold), + "ButtonRequest_ConfirmOutput" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_ConfirmOutput), + "ButtonRequest_ResetDevice" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_ResetDevice), + "ButtonRequest_ConfirmWord" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_ConfirmWord), + "ButtonRequest_WipeDevice" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_WipeDevice), + "ButtonRequest_ProtectCall" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_ProtectCall), + "ButtonRequest_SignTx" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_SignTx), + "ButtonRequest_FirmwareCheck" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_FirmwareCheck), + "ButtonRequest_Address" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_Address), + "ButtonRequest_PublicKey" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_PublicKey), + "ButtonRequest_MnemonicWordCount" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_MnemonicWordCount), + "ButtonRequest_MnemonicInput" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_MnemonicInput), + "_Deprecated_ButtonRequest_PassphraseType" => ::std::option::Option::Some(ButtonRequestType::_Deprecated_ButtonRequest_PassphraseType), + "ButtonRequest_UnknownDerivationPath" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_UnknownDerivationPath), + "ButtonRequest_RecoveryHomepage" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_RecoveryHomepage), + "ButtonRequest_Success" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_Success), + "ButtonRequest_Warning" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_Warning), + "ButtonRequest_PassphraseEntry" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_PassphraseEntry), + "ButtonRequest_PinEntry" => ::std::option::Option::Some(ButtonRequestType::ButtonRequest_PinEntry), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [ButtonRequestType] = &[ + ButtonRequestType::ButtonRequest_Other, + ButtonRequestType::ButtonRequest_FeeOverThreshold, + ButtonRequestType::ButtonRequest_ConfirmOutput, + ButtonRequestType::ButtonRequest_ResetDevice, + ButtonRequestType::ButtonRequest_ConfirmWord, + ButtonRequestType::ButtonRequest_WipeDevice, + ButtonRequestType::ButtonRequest_ProtectCall, + ButtonRequestType::ButtonRequest_SignTx, + ButtonRequestType::ButtonRequest_FirmwareCheck, + ButtonRequestType::ButtonRequest_Address, + ButtonRequestType::ButtonRequest_PublicKey, + ButtonRequestType::ButtonRequest_MnemonicWordCount, + ButtonRequestType::ButtonRequest_MnemonicInput, + ButtonRequestType::_Deprecated_ButtonRequest_PassphraseType, + ButtonRequestType::ButtonRequest_UnknownDerivationPath, + ButtonRequestType::ButtonRequest_RecoveryHomepage, + ButtonRequestType::ButtonRequest_Success, + ButtonRequestType::ButtonRequest_Warning, + ButtonRequestType::ButtonRequest_PassphraseEntry, + ButtonRequestType::ButtonRequest_PinEntry, + ]; + } + + impl ::protobuf::EnumFull for ButtonRequestType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("ButtonRequest.ButtonRequestType").unwrap()).clone() + } + + fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { + let index = match self { + ButtonRequestType::ButtonRequest_Other => 0, + ButtonRequestType::ButtonRequest_FeeOverThreshold => 1, + ButtonRequestType::ButtonRequest_ConfirmOutput => 2, + ButtonRequestType::ButtonRequest_ResetDevice => 3, + ButtonRequestType::ButtonRequest_ConfirmWord => 4, + ButtonRequestType::ButtonRequest_WipeDevice => 5, + ButtonRequestType::ButtonRequest_ProtectCall => 6, + ButtonRequestType::ButtonRequest_SignTx => 7, + ButtonRequestType::ButtonRequest_FirmwareCheck => 8, + ButtonRequestType::ButtonRequest_Address => 9, + ButtonRequestType::ButtonRequest_PublicKey => 10, + ButtonRequestType::ButtonRequest_MnemonicWordCount => 11, + ButtonRequestType::ButtonRequest_MnemonicInput => 12, + ButtonRequestType::_Deprecated_ButtonRequest_PassphraseType => 13, + ButtonRequestType::ButtonRequest_UnknownDerivationPath => 14, + ButtonRequestType::ButtonRequest_RecoveryHomepage => 15, + ButtonRequestType::ButtonRequest_Success => 16, + ButtonRequestType::ButtonRequest_Warning => 17, + ButtonRequestType::ButtonRequest_PassphraseEntry => 18, + ButtonRequestType::ButtonRequest_PinEntry => 19, + }; + Self::enum_descriptor().value_by_index(index) + } + } + + // Note, `Default` is implemented although default value is not 0 + impl ::std::default::Default for ButtonRequestType { + fn default() -> Self { + ButtonRequestType::ButtonRequest_Other + } + } + + impl ButtonRequestType { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("ButtonRequest.ButtonRequestType") + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.common.ButtonAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct ButtonAck { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.common.ButtonAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a ButtonAck { + fn default() -> &'a ButtonAck { + ::default_instance() + } +} + +impl ButtonAck { + pub fn new() -> ButtonAck { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "ButtonAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for ButtonAck { + const NAME: &'static str = "ButtonAck"; + + 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 { + 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; + 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<()> { + 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() -> ButtonAck { + ButtonAck::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static ButtonAck { + static instance: ButtonAck = ButtonAck { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for ButtonAck { + 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("ButtonAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for ButtonAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ButtonAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.common.PinMatrixRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct PinMatrixRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.common.PinMatrixRequest.type) + pub type_: ::std::option::Option<::protobuf::EnumOrUnknown>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.common.PinMatrixRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a PinMatrixRequest { + fn default() -> &'a PinMatrixRequest { + ::default_instance() + } +} + +impl PinMatrixRequest { + pub fn new() -> PinMatrixRequest { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.common.PinMatrixRequest.PinMatrixRequestType type = 1; + + pub fn type_(&self) -> pin_matrix_request::PinMatrixRequestType { + match self.type_ { + Some(e) => e.enum_value_or(pin_matrix_request::PinMatrixRequestType::PinMatrixRequestType_Current), + None => pin_matrix_request::PinMatrixRequestType::PinMatrixRequestType_Current, + } + } + + pub fn clear_type_(&mut self) { + self.type_ = ::std::option::Option::None; + } + + pub fn has_type(&self) -> bool { + self.type_.is_some() + } + + // Param is passed by value, moved + pub fn set_type(&mut self, v: pin_matrix_request::PinMatrixRequestType) { + self.type_ = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "type", + |m: &PinMatrixRequest| { &m.type_ }, + |m: &mut PinMatrixRequest| { &mut m.type_ }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "PinMatrixRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for PinMatrixRequest { + const NAME: &'static str = "PinMatrixRequest"; + + 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 { + 8 => { + self.type_ = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 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.type_ { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + 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.type_ { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&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() -> PinMatrixRequest { + PinMatrixRequest::new() + } + + fn clear(&mut self) { + self.type_ = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static PinMatrixRequest { + static instance: PinMatrixRequest = PinMatrixRequest { + type_: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for PinMatrixRequest { + 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("PinMatrixRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for PinMatrixRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PinMatrixRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `PinMatrixRequest` +pub mod pin_matrix_request { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.common.PinMatrixRequest.PinMatrixRequestType) + pub enum PinMatrixRequestType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.PinMatrixRequest.PinMatrixRequestType.PinMatrixRequestType_Current) + PinMatrixRequestType_Current = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.PinMatrixRequest.PinMatrixRequestType.PinMatrixRequestType_NewFirst) + PinMatrixRequestType_NewFirst = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.PinMatrixRequest.PinMatrixRequestType.PinMatrixRequestType_NewSecond) + PinMatrixRequestType_NewSecond = 3, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.PinMatrixRequest.PinMatrixRequestType.PinMatrixRequestType_WipeCodeFirst) + PinMatrixRequestType_WipeCodeFirst = 4, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.common.PinMatrixRequest.PinMatrixRequestType.PinMatrixRequestType_WipeCodeSecond) + PinMatrixRequestType_WipeCodeSecond = 5, + } + + impl ::protobuf::Enum for PinMatrixRequestType { + const NAME: &'static str = "PinMatrixRequestType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 1 => ::std::option::Option::Some(PinMatrixRequestType::PinMatrixRequestType_Current), + 2 => ::std::option::Option::Some(PinMatrixRequestType::PinMatrixRequestType_NewFirst), + 3 => ::std::option::Option::Some(PinMatrixRequestType::PinMatrixRequestType_NewSecond), + 4 => ::std::option::Option::Some(PinMatrixRequestType::PinMatrixRequestType_WipeCodeFirst), + 5 => ::std::option::Option::Some(PinMatrixRequestType::PinMatrixRequestType_WipeCodeSecond), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "PinMatrixRequestType_Current" => ::std::option::Option::Some(PinMatrixRequestType::PinMatrixRequestType_Current), + "PinMatrixRequestType_NewFirst" => ::std::option::Option::Some(PinMatrixRequestType::PinMatrixRequestType_NewFirst), + "PinMatrixRequestType_NewSecond" => ::std::option::Option::Some(PinMatrixRequestType::PinMatrixRequestType_NewSecond), + "PinMatrixRequestType_WipeCodeFirst" => ::std::option::Option::Some(PinMatrixRequestType::PinMatrixRequestType_WipeCodeFirst), + "PinMatrixRequestType_WipeCodeSecond" => ::std::option::Option::Some(PinMatrixRequestType::PinMatrixRequestType_WipeCodeSecond), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [PinMatrixRequestType] = &[ + PinMatrixRequestType::PinMatrixRequestType_Current, + PinMatrixRequestType::PinMatrixRequestType_NewFirst, + PinMatrixRequestType::PinMatrixRequestType_NewSecond, + PinMatrixRequestType::PinMatrixRequestType_WipeCodeFirst, + PinMatrixRequestType::PinMatrixRequestType_WipeCodeSecond, + ]; + } + + impl ::protobuf::EnumFull for PinMatrixRequestType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("PinMatrixRequest.PinMatrixRequestType").unwrap()).clone() + } + + fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { + let index = match self { + PinMatrixRequestType::PinMatrixRequestType_Current => 0, + PinMatrixRequestType::PinMatrixRequestType_NewFirst => 1, + PinMatrixRequestType::PinMatrixRequestType_NewSecond => 2, + PinMatrixRequestType::PinMatrixRequestType_WipeCodeFirst => 3, + PinMatrixRequestType::PinMatrixRequestType_WipeCodeSecond => 4, + }; + Self::enum_descriptor().value_by_index(index) + } + } + + // Note, `Default` is implemented although default value is not 0 + impl ::std::default::Default for PinMatrixRequestType { + fn default() -> Self { + PinMatrixRequestType::PinMatrixRequestType_Current + } + } + + impl PinMatrixRequestType { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("PinMatrixRequest.PinMatrixRequestType") + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.common.PinMatrixAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct PinMatrixAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.common.PinMatrixAck.pin) + pub pin: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.common.PinMatrixAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a PinMatrixAck { + fn default() -> &'a PinMatrixAck { + ::default_instance() + } +} + +impl PinMatrixAck { + pub fn new() -> PinMatrixAck { + ::std::default::Default::default() + } + + // required string pin = 1; + + pub fn pin(&self) -> &str { + match self.pin.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_pin(&mut self) { + self.pin = ::std::option::Option::None; + } + + pub fn has_pin(&self) -> bool { + self.pin.is_some() + } + + // Param is passed by value, moved + pub fn set_pin(&mut self, v: ::std::string::String) { + self.pin = ::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_pin(&mut self) -> &mut ::std::string::String { + if self.pin.is_none() { + self.pin = ::std::option::Option::Some(::std::string::String::new()); + } + self.pin.as_mut().unwrap() + } + + // Take field + pub fn take_pin(&mut self) -> ::std::string::String { + self.pin.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pin", + |m: &PinMatrixAck| { &m.pin }, + |m: &mut PinMatrixAck| { &mut m.pin }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "PinMatrixAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for PinMatrixAck { + const NAME: &'static str = "PinMatrixAck"; + + fn is_initialized(&self) -> bool { + if self.pin.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.pin = ::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.pin.as_ref() { + my_size += ::protobuf::rt::string_size(1, &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.pin.as_ref() { + os.write_string(1, 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() -> PinMatrixAck { + PinMatrixAck::new() + } + + fn clear(&mut self) { + self.pin = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static PinMatrixAck { + static instance: PinMatrixAck = PinMatrixAck { + pin: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for PinMatrixAck { + 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("PinMatrixAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for PinMatrixAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PinMatrixAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.common.PassphraseRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct PassphraseRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.common.PassphraseRequest._on_device) + pub _on_device: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.common.PassphraseRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a PassphraseRequest { + fn default() -> &'a PassphraseRequest { + ::default_instance() + } +} + +impl PassphraseRequest { + pub fn new() -> PassphraseRequest { + ::std::default::Default::default() + } + + // optional bool _on_device = 1; + + pub fn _on_device(&self) -> bool { + self._on_device.unwrap_or(false) + } + + pub fn clear__on_device(&mut self) { + self._on_device = ::std::option::Option::None; + } + + pub fn has__on_device(&self) -> bool { + self._on_device.is_some() + } + + // Param is passed by value, moved + pub fn set__on_device(&mut self, v: bool) { + self._on_device = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "_on_device", + |m: &PassphraseRequest| { &m._on_device }, + |m: &mut PassphraseRequest| { &mut m._on_device }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "PassphraseRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for PassphraseRequest { + const NAME: &'static str = "PassphraseRequest"; + + 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 { + 8 => { + self._on_device = ::std::option::Option::Some(is.read_bool()?); + }, + 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._on_device { + my_size += 1 + 1; + } + 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._on_device { + os.write_bool(1, 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() -> PassphraseRequest { + PassphraseRequest::new() + } + + fn clear(&mut self) { + self._on_device = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static PassphraseRequest { + static instance: PassphraseRequest = PassphraseRequest { + _on_device: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for PassphraseRequest { + 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("PassphraseRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for PassphraseRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PassphraseRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.common.PassphraseAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct PassphraseAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.common.PassphraseAck.passphrase) + pub passphrase: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.common.PassphraseAck._state) + pub _state: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.common.PassphraseAck.on_device) + pub on_device: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.common.PassphraseAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a PassphraseAck { + fn default() -> &'a PassphraseAck { + ::default_instance() + } +} + +impl PassphraseAck { + pub fn new() -> PassphraseAck { + ::std::default::Default::default() + } + + // optional string passphrase = 1; + + pub fn passphrase(&self) -> &str { + match self.passphrase.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_passphrase(&mut self) { + self.passphrase = ::std::option::Option::None; + } + + pub fn has_passphrase(&self) -> bool { + self.passphrase.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase(&mut self, v: ::std::string::String) { + self.passphrase = ::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_passphrase(&mut self) -> &mut ::std::string::String { + if self.passphrase.is_none() { + self.passphrase = ::std::option::Option::Some(::std::string::String::new()); + } + self.passphrase.as_mut().unwrap() + } + + // Take field + pub fn take_passphrase(&mut self) -> ::std::string::String { + self.passphrase.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bytes _state = 2; + + pub fn _state(&self) -> &[u8] { + match self._state.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear__state(&mut self) { + self._state = ::std::option::Option::None; + } + + pub fn has__state(&self) -> bool { + self._state.is_some() + } + + // Param is passed by value, moved + pub fn set__state(&mut self, v: ::std::vec::Vec) { + self._state = ::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__state(&mut self) -> &mut ::std::vec::Vec { + if self._state.is_none() { + self._state = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self._state.as_mut().unwrap() + } + + // Take field + pub fn take__state(&mut self) -> ::std::vec::Vec { + self._state.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool on_device = 3; + + pub fn on_device(&self) -> bool { + self.on_device.unwrap_or(false) + } + + pub fn clear_on_device(&mut self) { + self.on_device = ::std::option::Option::None; + } + + pub fn has_on_device(&self) -> bool { + self.on_device.is_some() + } + + // Param is passed by value, moved + pub fn set_on_device(&mut self, v: bool) { + self.on_device = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "passphrase", + |m: &PassphraseAck| { &m.passphrase }, + |m: &mut PassphraseAck| { &mut m.passphrase }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "_state", + |m: &PassphraseAck| { &m._state }, + |m: &mut PassphraseAck| { &mut m._state }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "on_device", + |m: &PassphraseAck| { &m.on_device }, + |m: &mut PassphraseAck| { &mut m.on_device }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "PassphraseAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for PassphraseAck { + const NAME: &'static str = "PassphraseAck"; + + 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.passphrase = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self._state = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.on_device = ::std::option::Option::Some(is.read_bool()?); + }, + 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.passphrase.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self._state.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.on_device { + my_size += 1 + 1; + } + 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.passphrase.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self._state.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.on_device { + os.write_bool(3, 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() -> PassphraseAck { + PassphraseAck::new() + } + + fn clear(&mut self) { + self.passphrase = ::std::option::Option::None; + self._state = ::std::option::Option::None; + self.on_device = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static PassphraseAck { + static instance: PassphraseAck = PassphraseAck { + passphrase: ::std::option::Option::None, + _state: ::std::option::Option::None, + on_device: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for PassphraseAck { + 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("PassphraseAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for PassphraseAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PassphraseAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.common.Deprecated_PassphraseStateRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct Deprecated_PassphraseStateRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.common.Deprecated_PassphraseStateRequest.state) + pub state: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.common.Deprecated_PassphraseStateRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Deprecated_PassphraseStateRequest { + fn default() -> &'a Deprecated_PassphraseStateRequest { + ::default_instance() + } +} + +impl Deprecated_PassphraseStateRequest { + pub fn new() -> Deprecated_PassphraseStateRequest { + ::std::default::Default::default() + } + + // optional bytes state = 1; + + pub fn state(&self) -> &[u8] { + match self.state.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_state(&mut self) { + self.state = ::std::option::Option::None; + } + + pub fn has_state(&self) -> bool { + self.state.is_some() + } + + // Param is passed by value, moved + pub fn set_state(&mut self, v: ::std::vec::Vec) { + self.state = ::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_state(&mut self) -> &mut ::std::vec::Vec { + if self.state.is_none() { + self.state = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.state.as_mut().unwrap() + } + + // Take field + pub fn take_state(&mut self) -> ::std::vec::Vec { + self.state.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "state", + |m: &Deprecated_PassphraseStateRequest| { &m.state }, + |m: &mut Deprecated_PassphraseStateRequest| { &mut m.state }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Deprecated_PassphraseStateRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Deprecated_PassphraseStateRequest { + const NAME: &'static str = "Deprecated_PassphraseStateRequest"; + + 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.state = ::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.state.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.state.as_ref() { + os.write_bytes(1, 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() -> Deprecated_PassphraseStateRequest { + Deprecated_PassphraseStateRequest::new() + } + + fn clear(&mut self) { + self.state = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static Deprecated_PassphraseStateRequest { + static instance: Deprecated_PassphraseStateRequest = Deprecated_PassphraseStateRequest { + state: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Deprecated_PassphraseStateRequest { + 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("Deprecated_PassphraseStateRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Deprecated_PassphraseStateRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Deprecated_PassphraseStateRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.common.Deprecated_PassphraseStateAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct Deprecated_PassphraseStateAck { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.common.Deprecated_PassphraseStateAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Deprecated_PassphraseStateAck { + fn default() -> &'a Deprecated_PassphraseStateAck { + ::default_instance() + } +} + +impl Deprecated_PassphraseStateAck { + pub fn new() -> Deprecated_PassphraseStateAck { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Deprecated_PassphraseStateAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Deprecated_PassphraseStateAck { + const NAME: &'static str = "Deprecated_PassphraseStateAck"; + + 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 { + 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; + 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<()> { + 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() -> Deprecated_PassphraseStateAck { + Deprecated_PassphraseStateAck::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static Deprecated_PassphraseStateAck { + static instance: Deprecated_PassphraseStateAck = Deprecated_PassphraseStateAck { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Deprecated_PassphraseStateAck { + 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("Deprecated_PassphraseStateAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Deprecated_PassphraseStateAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Deprecated_PassphraseStateAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.common.HDNodeType) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct HDNodeType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.common.HDNodeType.depth) + pub depth: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.common.HDNodeType.fingerprint) + pub fingerprint: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.common.HDNodeType.child_num) + pub child_num: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.common.HDNodeType.chain_code) + pub chain_code: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.common.HDNodeType.private_key) + pub private_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.common.HDNodeType.public_key) + pub public_key: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.common.HDNodeType.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a HDNodeType { + fn default() -> &'a HDNodeType { + ::default_instance() + } +} + +impl HDNodeType { + pub fn new() -> HDNodeType { + ::std::default::Default::default() + } + + // required uint32 depth = 1; + + pub fn depth(&self) -> u32 { + self.depth.unwrap_or(0) + } + + pub fn clear_depth(&mut self) { + self.depth = ::std::option::Option::None; + } + + pub fn has_depth(&self) -> bool { + self.depth.is_some() + } + + // Param is passed by value, moved + pub fn set_depth(&mut self, v: u32) { + self.depth = ::std::option::Option::Some(v); + } + + // required uint32 fingerprint = 2; + + pub fn fingerprint(&self) -> u32 { + self.fingerprint.unwrap_or(0) + } + + pub fn clear_fingerprint(&mut self) { + self.fingerprint = ::std::option::Option::None; + } + + pub fn has_fingerprint(&self) -> bool { + self.fingerprint.is_some() + } + + // Param is passed by value, moved + pub fn set_fingerprint(&mut self, v: u32) { + self.fingerprint = ::std::option::Option::Some(v); + } + + // required uint32 child_num = 3; + + pub fn child_num(&self) -> u32 { + self.child_num.unwrap_or(0) + } + + pub fn clear_child_num(&mut self) { + self.child_num = ::std::option::Option::None; + } + + pub fn has_child_num(&self) -> bool { + self.child_num.is_some() + } + + // Param is passed by value, moved + pub fn set_child_num(&mut self, v: u32) { + self.child_num = ::std::option::Option::Some(v); + } + + // required bytes chain_code = 4; + + pub fn chain_code(&self) -> &[u8] { + match self.chain_code.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_chain_code(&mut self) { + self.chain_code = ::std::option::Option::None; + } + + pub fn has_chain_code(&self) -> bool { + self.chain_code.is_some() + } + + // Param is passed by value, moved + pub fn set_chain_code(&mut self, v: ::std::vec::Vec) { + self.chain_code = ::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_chain_code(&mut self) -> &mut ::std::vec::Vec { + if self.chain_code.is_none() { + self.chain_code = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.chain_code.as_mut().unwrap() + } + + // Take field + pub fn take_chain_code(&mut self) -> ::std::vec::Vec { + self.chain_code.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes private_key = 5; + + pub fn private_key(&self) -> &[u8] { + match self.private_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_private_key(&mut self) { + self.private_key = ::std::option::Option::None; + } + + pub fn has_private_key(&self) -> bool { + self.private_key.is_some() + } + + // Param is passed by value, moved + pub fn set_private_key(&mut self, v: ::std::vec::Vec) { + self.private_key = ::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_private_key(&mut self) -> &mut ::std::vec::Vec { + if self.private_key.is_none() { + self.private_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.private_key.as_mut().unwrap() + } + + // Take field + pub fn take_private_key(&mut self) -> ::std::vec::Vec { + self.private_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes public_key = 6; + + pub fn public_key(&self) -> &[u8] { + match self.public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_public_key(&mut self) { + self.public_key = ::std::option::Option::None; + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: ::std::vec::Vec) { + self.public_key = ::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_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.public_key.is_none() { + self.public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> ::std::vec::Vec { + self.public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "depth", + |m: &HDNodeType| { &m.depth }, + |m: &mut HDNodeType| { &mut m.depth }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fingerprint", + |m: &HDNodeType| { &m.fingerprint }, + |m: &mut HDNodeType| { &mut m.fingerprint }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "child_num", + |m: &HDNodeType| { &m.child_num }, + |m: &mut HDNodeType| { &mut m.child_num }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chain_code", + |m: &HDNodeType| { &m.chain_code }, + |m: &mut HDNodeType| { &mut m.chain_code }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "private_key", + |m: &HDNodeType| { &m.private_key }, + |m: &mut HDNodeType| { &mut m.private_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "public_key", + |m: &HDNodeType| { &m.public_key }, + |m: &mut HDNodeType| { &mut m.public_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "HDNodeType", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for HDNodeType { + const NAME: &'static str = "HDNodeType"; + + fn is_initialized(&self) -> bool { + if self.depth.is_none() { + return false; + } + if self.fingerprint.is_none() { + return false; + } + if self.child_num.is_none() { + return false; + } + if self.chain_code.is_none() { + return false; + } + if self.public_key.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.depth = ::std::option::Option::Some(is.read_uint32()?); + }, + 16 => { + self.fingerprint = ::std::option::Option::Some(is.read_uint32()?); + }, + 24 => { + self.child_num = ::std::option::Option::Some(is.read_uint32()?); + }, + 34 => { + self.chain_code = ::std::option::Option::Some(is.read_bytes()?); + }, + 42 => { + self.private_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 50 => { + self.public_key = ::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.depth { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.fingerprint { + my_size += ::protobuf::rt::uint32_size(2, v); + } + if let Some(v) = self.child_num { + my_size += ::protobuf::rt::uint32_size(3, v); + } + if let Some(v) = self.chain_code.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.private_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(5, &v); + } + if let Some(v) = self.public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &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.depth { + os.write_uint32(1, v)?; + } + if let Some(v) = self.fingerprint { + os.write_uint32(2, v)?; + } + if let Some(v) = self.child_num { + os.write_uint32(3, v)?; + } + if let Some(v) = self.chain_code.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.private_key.as_ref() { + os.write_bytes(5, v)?; + } + if let Some(v) = self.public_key.as_ref() { + os.write_bytes(6, 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() -> HDNodeType { + HDNodeType::new() + } + + fn clear(&mut self) { + self.depth = ::std::option::Option::None; + self.fingerprint = ::std::option::Option::None; + self.child_num = ::std::option::Option::None; + self.chain_code = ::std::option::Option::None; + self.private_key = ::std::option::Option::None; + self.public_key = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static HDNodeType { + static instance: HDNodeType = HDNodeType { + depth: ::std::option::Option::None, + fingerprint: ::std::option::Option::None, + child_num: ::std::option::Option::None, + chain_code: ::std::option::Option::None, + private_key: ::std::option::Option::None, + public_key: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for HDNodeType { + 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("HDNodeType").unwrap()).clone() + } +} + +impl ::std::fmt::Display for HDNodeType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for HDNodeType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x15messages-common.proto\x12\x19hw.trezor.messages.common\x1a\x0emess\ + ages.proto\"%\n\x07Success\x12\x1a\n\x07message\x18\x01\x20\x01(\t:\0R\ + \x07message\"\x8f\x04\n\x07Failure\x12B\n\x04code\x18\x01\x20\x01(\x0e2.\ + .hw.trezor.messages.common.Failure.FailureTypeR\x04code\x12\x18\n\x07mes\ + sage\x18\x02\x20\x01(\tR\x07message\"\xa5\x03\n\x0bFailureType\x12\x1d\n\ + \x19Failure_UnexpectedMessage\x10\x01\x12\x1a\n\x16Failure_ButtonExpecte\ + d\x10\x02\x12\x15\n\x11Failure_DataError\x10\x03\x12\x1b\n\x17Failure_Ac\ + tionCancelled\x10\x04\x12\x17\n\x13Failure_PinExpected\x10\x05\x12\x18\n\ + \x14Failure_PinCancelled\x10\x06\x12\x16\n\x12Failure_PinInvalid\x10\x07\ + \x12\x1c\n\x18Failure_InvalidSignature\x10\x08\x12\x18\n\x14Failure_Proc\ + essError\x10\t\x12\x1a\n\x16Failure_NotEnoughFunds\x10\n\x12\x1a\n\x16Fa\ + ilure_NotInitialized\x10\x0b\x12\x17\n\x13Failure_PinMismatch\x10\x0c\ + \x12\x1c\n\x18Failure_WipeCodeMismatch\x10\r\x12\x1a\n\x16Failure_Invali\ + dSession\x10\x0e\x12\x19\n\x15Failure_FirmwareError\x10c\"\x91\x06\n\rBu\ + ttonRequest\x12N\n\x04code\x18\x01\x20\x01(\x0e2:.hw.trezor.messages.com\ + mon.ButtonRequest.ButtonRequestTypeR\x04code\x12\x14\n\x05pages\x18\x02\ + \x20\x01(\rR\x05pages\"\x99\x05\n\x11ButtonRequestType\x12\x17\n\x13Butt\ + onRequest_Other\x10\x01\x12\"\n\x1eButtonRequest_FeeOverThreshold\x10\ + \x02\x12\x1f\n\x1bButtonRequest_ConfirmOutput\x10\x03\x12\x1d\n\x19Butto\ + nRequest_ResetDevice\x10\x04\x12\x1d\n\x19ButtonRequest_ConfirmWord\x10\ + \x05\x12\x1c\n\x18ButtonRequest_WipeDevice\x10\x06\x12\x1d\n\x19ButtonRe\ + quest_ProtectCall\x10\x07\x12\x18\n\x14ButtonRequest_SignTx\x10\x08\x12\ + \x1f\n\x1bButtonRequest_FirmwareCheck\x10\t\x12\x19\n\x15ButtonRequest_A\ + ddress\x10\n\x12\x1b\n\x17ButtonRequest_PublicKey\x10\x0b\x12#\n\x1fButt\ + onRequest_MnemonicWordCount\x10\x0c\x12\x1f\n\x1bButtonRequest_MnemonicI\ + nput\x10\r\x120\n(_Deprecated_ButtonRequest_PassphraseType\x10\x0e\x1a\ + \x02\x08\x01\x12'\n#ButtonRequest_UnknownDerivationPath\x10\x0f\x12\"\n\ + \x1eButtonRequest_RecoveryHomepage\x10\x10\x12\x19\n\x15ButtonRequest_Su\ + ccess\x10\x11\x12\x19\n\x15ButtonRequest_Warning\x10\x12\x12!\n\x1dButto\ + nRequest_PassphraseEntry\x10\x13\x12\x1a\n\x16ButtonRequest_PinEntry\x10\ + \x14\"\x0b\n\tButtonAck\"\xbb\x02\n\x10PinMatrixRequest\x12T\n\x04type\ + \x18\x01\x20\x01(\x0e2@.hw.trezor.messages.common.PinMatrixRequest.PinMa\ + trixRequestTypeR\x04type\"\xd0\x01\n\x14PinMatrixRequestType\x12\x20\n\ + \x1cPinMatrixRequestType_Current\x10\x01\x12!\n\x1dPinMatrixRequestType_\ + NewFirst\x10\x02\x12\"\n\x1ePinMatrixRequestType_NewSecond\x10\x03\x12&\ + \n\"PinMatrixRequestType_WipeCodeFirst\x10\x04\x12'\n#PinMatrixRequestTy\ + pe_WipeCodeSecond\x10\x05\"\x20\n\x0cPinMatrixAck\x12\x10\n\x03pin\x18\ + \x01\x20\x02(\tR\x03pin\"5\n\x11PassphraseRequest\x12\x20\n\n_on_device\ + \x18\x01\x20\x01(\x08R\x08OnDeviceB\x02\x18\x01\"g\n\rPassphraseAck\x12\ + \x1e\n\npassphrase\x18\x01\x20\x01(\tR\npassphrase\x12\x19\n\x06_state\ + \x18\x02\x20\x01(\x0cR\x05StateB\x02\x18\x01\x12\x1b\n\ton_device\x18\ + \x03\x20\x01(\x08R\x08onDevice\"=\n!Deprecated_PassphraseStateRequest\ + \x12\x14\n\x05state\x18\x01\x20\x01(\x0cR\x05state:\x02\x18\x01\"#\n\x1d\ + Deprecated_PassphraseStateAck:\x02\x18\x01\"\xc0\x01\n\nHDNodeType\x12\ + \x14\n\x05depth\x18\x01\x20\x02(\rR\x05depth\x12\x20\n\x0bfingerprint\ + \x18\x02\x20\x02(\rR\x0bfingerprint\x12\x1b\n\tchild_num\x18\x03\x20\x02\ + (\rR\x08childNum\x12\x1d\n\nchain_code\x18\x04\x20\x02(\x0cR\tchainCode\ + \x12\x1f\n\x0bprivate_key\x18\x05\x20\x01(\x0cR\nprivateKey\x12\x1d\n\np\ + ublic_key\x18\x06\x20\x02(\x0cR\tpublicKeyB>\n#com.satoshilabs.trezor.li\ + b.protobufB\x13TrezorMessageCommon\x80\xa6\x1d\x01\ +"; + +/// `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(1); + deps.push(super::messages::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(11); + messages.push(Success::generated_message_descriptor_data()); + messages.push(Failure::generated_message_descriptor_data()); + messages.push(ButtonRequest::generated_message_descriptor_data()); + messages.push(ButtonAck::generated_message_descriptor_data()); + messages.push(PinMatrixRequest::generated_message_descriptor_data()); + messages.push(PinMatrixAck::generated_message_descriptor_data()); + messages.push(PassphraseRequest::generated_message_descriptor_data()); + messages.push(PassphraseAck::generated_message_descriptor_data()); + messages.push(Deprecated_PassphraseStateRequest::generated_message_descriptor_data()); + messages.push(Deprecated_PassphraseStateAck::generated_message_descriptor_data()); + messages.push(HDNodeType::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(3); + enums.push(failure::FailureType::generated_enum_descriptor_data()); + enums.push(button_request::ButtonRequestType::generated_enum_descriptor_data()); + enums.push(pin_matrix_request::PinMatrixRequestType::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_crypto.rs b/wallet/trezor-client/src/protos/generated/messages_crypto.rs new file mode 100644 index 0000000000..5fec7d5f8f --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_crypto.rs @@ -0,0 +1,2956 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-crypto.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.crypto.CipherKeyValue) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CipherKeyValue { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CipherKeyValue.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CipherKeyValue.key) + pub key: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CipherKeyValue.value) + pub value: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CipherKeyValue.encrypt) + pub encrypt: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CipherKeyValue.ask_on_encrypt) + pub ask_on_encrypt: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CipherKeyValue.ask_on_decrypt) + pub ask_on_decrypt: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CipherKeyValue.iv) + pub iv: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.crypto.CipherKeyValue.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CipherKeyValue { + fn default() -> &'a CipherKeyValue { + ::default_instance() + } +} + +impl CipherKeyValue { + pub fn new() -> CipherKeyValue { + ::std::default::Default::default() + } + + // required string key = 2; + + pub fn key(&self) -> &str { + match self.key.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_key(&mut self) { + self.key = ::std::option::Option::None; + } + + pub fn has_key(&self) -> bool { + self.key.is_some() + } + + // Param is passed by value, moved + pub fn set_key(&mut self, v: ::std::string::String) { + self.key = ::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_key(&mut self) -> &mut ::std::string::String { + if self.key.is_none() { + self.key = ::std::option::Option::Some(::std::string::String::new()); + } + self.key.as_mut().unwrap() + } + + // Take field + pub fn take_key(&mut self) -> ::std::string::String { + self.key.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required bytes value = 3; + + pub fn value(&self) -> &[u8] { + match self.value.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_value(&mut self) { + self.value = ::std::option::Option::None; + } + + pub fn has_value(&self) -> bool { + self.value.is_some() + } + + // Param is passed by value, moved + pub fn set_value(&mut self, v: ::std::vec::Vec) { + self.value = ::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_value(&mut self) -> &mut ::std::vec::Vec { + if self.value.is_none() { + self.value = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.value.as_mut().unwrap() + } + + // Take field + pub fn take_value(&mut self) -> ::std::vec::Vec { + self.value.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool encrypt = 4; + + pub fn encrypt(&self) -> bool { + self.encrypt.unwrap_or(false) + } + + pub fn clear_encrypt(&mut self) { + self.encrypt = ::std::option::Option::None; + } + + pub fn has_encrypt(&self) -> bool { + self.encrypt.is_some() + } + + // Param is passed by value, moved + pub fn set_encrypt(&mut self, v: bool) { + self.encrypt = ::std::option::Option::Some(v); + } + + // optional bool ask_on_encrypt = 5; + + pub fn ask_on_encrypt(&self) -> bool { + self.ask_on_encrypt.unwrap_or(false) + } + + pub fn clear_ask_on_encrypt(&mut self) { + self.ask_on_encrypt = ::std::option::Option::None; + } + + pub fn has_ask_on_encrypt(&self) -> bool { + self.ask_on_encrypt.is_some() + } + + // Param is passed by value, moved + pub fn set_ask_on_encrypt(&mut self, v: bool) { + self.ask_on_encrypt = ::std::option::Option::Some(v); + } + + // optional bool ask_on_decrypt = 6; + + pub fn ask_on_decrypt(&self) -> bool { + self.ask_on_decrypt.unwrap_or(false) + } + + pub fn clear_ask_on_decrypt(&mut self) { + self.ask_on_decrypt = ::std::option::Option::None; + } + + pub fn has_ask_on_decrypt(&self) -> bool { + self.ask_on_decrypt.is_some() + } + + // Param is passed by value, moved + pub fn set_ask_on_decrypt(&mut self, v: bool) { + self.ask_on_decrypt = ::std::option::Option::Some(v); + } + + // optional bytes iv = 7; + + pub fn iv(&self) -> &[u8] { + match self.iv.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_iv(&mut self) { + self.iv = ::std::option::Option::None; + } + + pub fn has_iv(&self) -> bool { + self.iv.is_some() + } + + // Param is passed by value, moved + pub fn set_iv(&mut self, v: ::std::vec::Vec) { + self.iv = ::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_iv(&mut self) -> &mut ::std::vec::Vec { + if self.iv.is_none() { + self.iv = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.iv.as_mut().unwrap() + } + + // Take field + pub fn take_iv(&mut self) -> ::std::vec::Vec { + self.iv.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(7); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &CipherKeyValue| { &m.address_n }, + |m: &mut CipherKeyValue| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "key", + |m: &CipherKeyValue| { &m.key }, + |m: &mut CipherKeyValue| { &mut m.key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "value", + |m: &CipherKeyValue| { &m.value }, + |m: &mut CipherKeyValue| { &mut m.value }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "encrypt", + |m: &CipherKeyValue| { &m.encrypt }, + |m: &mut CipherKeyValue| { &mut m.encrypt }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ask_on_encrypt", + |m: &CipherKeyValue| { &m.ask_on_encrypt }, + |m: &mut CipherKeyValue| { &mut m.ask_on_encrypt }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ask_on_decrypt", + |m: &CipherKeyValue| { &m.ask_on_decrypt }, + |m: &mut CipherKeyValue| { &mut m.ask_on_decrypt }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "iv", + |m: &CipherKeyValue| { &m.iv }, + |m: &mut CipherKeyValue| { &mut m.iv }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CipherKeyValue", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CipherKeyValue { + const NAME: &'static str = "CipherKeyValue"; + + fn is_initialized(&self) -> bool { + if self.key.is_none() { + return false; + } + if self.value.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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.key = ::std::option::Option::Some(is.read_string()?); + }, + 26 => { + self.value = ::std::option::Option::Some(is.read_bytes()?); + }, + 32 => { + self.encrypt = ::std::option::Option::Some(is.read_bool()?); + }, + 40 => { + self.ask_on_encrypt = ::std::option::Option::Some(is.read_bool()?); + }, + 48 => { + self.ask_on_decrypt = ::std::option::Option::Some(is.read_bool()?); + }, + 58 => { + self.iv = ::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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.key.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.value.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.encrypt { + my_size += 1 + 1; + } + if let Some(v) = self.ask_on_encrypt { + my_size += 1 + 1; + } + if let Some(v) = self.ask_on_decrypt { + my_size += 1 + 1; + } + if let Some(v) = self.iv.as_ref() { + my_size += ::protobuf::rt::bytes_size(7, &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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.key.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.value.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.encrypt { + os.write_bool(4, v)?; + } + if let Some(v) = self.ask_on_encrypt { + os.write_bool(5, v)?; + } + if let Some(v) = self.ask_on_decrypt { + os.write_bool(6, v)?; + } + if let Some(v) = self.iv.as_ref() { + os.write_bytes(7, 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() -> CipherKeyValue { + CipherKeyValue::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.key = ::std::option::Option::None; + self.value = ::std::option::Option::None; + self.encrypt = ::std::option::Option::None; + self.ask_on_encrypt = ::std::option::Option::None; + self.ask_on_decrypt = ::std::option::Option::None; + self.iv = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CipherKeyValue { + static instance: CipherKeyValue = CipherKeyValue { + address_n: ::std::vec::Vec::new(), + key: ::std::option::Option::None, + value: ::std::option::Option::None, + encrypt: ::std::option::Option::None, + ask_on_encrypt: ::std::option::Option::None, + ask_on_decrypt: ::std::option::Option::None, + iv: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CipherKeyValue { + 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("CipherKeyValue").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CipherKeyValue { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CipherKeyValue { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.crypto.CipheredKeyValue) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CipheredKeyValue { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CipheredKeyValue.value) + pub value: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.crypto.CipheredKeyValue.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CipheredKeyValue { + fn default() -> &'a CipheredKeyValue { + ::default_instance() + } +} + +impl CipheredKeyValue { + pub fn new() -> CipheredKeyValue { + ::std::default::Default::default() + } + + // required bytes value = 1; + + pub fn value(&self) -> &[u8] { + match self.value.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_value(&mut self) { + self.value = ::std::option::Option::None; + } + + pub fn has_value(&self) -> bool { + self.value.is_some() + } + + // Param is passed by value, moved + pub fn set_value(&mut self, v: ::std::vec::Vec) { + self.value = ::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_value(&mut self) -> &mut ::std::vec::Vec { + if self.value.is_none() { + self.value = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.value.as_mut().unwrap() + } + + // Take field + pub fn take_value(&mut self) -> ::std::vec::Vec { + self.value.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "value", + |m: &CipheredKeyValue| { &m.value }, + |m: &mut CipheredKeyValue| { &mut m.value }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CipheredKeyValue", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CipheredKeyValue { + const NAME: &'static str = "CipheredKeyValue"; + + fn is_initialized(&self) -> bool { + if self.value.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.value = ::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.value.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.value.as_ref() { + os.write_bytes(1, 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() -> CipheredKeyValue { + CipheredKeyValue::new() + } + + fn clear(&mut self) { + self.value = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CipheredKeyValue { + static instance: CipheredKeyValue = CipheredKeyValue { + value: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CipheredKeyValue { + 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("CipheredKeyValue").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CipheredKeyValue { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CipheredKeyValue { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.crypto.IdentityType) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct IdentityType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.IdentityType.proto) + pub proto: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.IdentityType.user) + pub user: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.IdentityType.host) + pub host: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.IdentityType.port) + pub port: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.IdentityType.path) + pub path: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.IdentityType.index) + pub index: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.crypto.IdentityType.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a IdentityType { + fn default() -> &'a IdentityType { + ::default_instance() + } +} + +impl IdentityType { + pub fn new() -> IdentityType { + ::std::default::Default::default() + } + + // optional string proto = 1; + + pub fn proto(&self) -> &str { + match self.proto.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_proto(&mut self) { + self.proto = ::std::option::Option::None; + } + + pub fn has_proto(&self) -> bool { + self.proto.is_some() + } + + // Param is passed by value, moved + pub fn set_proto(&mut self, v: ::std::string::String) { + self.proto = ::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_proto(&mut self) -> &mut ::std::string::String { + if self.proto.is_none() { + self.proto = ::std::option::Option::Some(::std::string::String::new()); + } + self.proto.as_mut().unwrap() + } + + // Take field + pub fn take_proto(&mut self) -> ::std::string::String { + self.proto.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string user = 2; + + pub fn user(&self) -> &str { + match self.user.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_user(&mut self) { + self.user = ::std::option::Option::None; + } + + pub fn has_user(&self) -> bool { + self.user.is_some() + } + + // Param is passed by value, moved + pub fn set_user(&mut self, v: ::std::string::String) { + self.user = ::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_user(&mut self) -> &mut ::std::string::String { + if self.user.is_none() { + self.user = ::std::option::Option::Some(::std::string::String::new()); + } + self.user.as_mut().unwrap() + } + + // Take field + pub fn take_user(&mut self) -> ::std::string::String { + self.user.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string host = 3; + + pub fn host(&self) -> &str { + match self.host.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_host(&mut self) { + self.host = ::std::option::Option::None; + } + + pub fn has_host(&self) -> bool { + self.host.is_some() + } + + // Param is passed by value, moved + pub fn set_host(&mut self, v: ::std::string::String) { + self.host = ::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_host(&mut self) -> &mut ::std::string::String { + if self.host.is_none() { + self.host = ::std::option::Option::Some(::std::string::String::new()); + } + self.host.as_mut().unwrap() + } + + // Take field + pub fn take_host(&mut self) -> ::std::string::String { + self.host.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string port = 4; + + pub fn port(&self) -> &str { + match self.port.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_port(&mut self) { + self.port = ::std::option::Option::None; + } + + pub fn has_port(&self) -> bool { + self.port.is_some() + } + + // Param is passed by value, moved + pub fn set_port(&mut self, v: ::std::string::String) { + self.port = ::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_port(&mut self) -> &mut ::std::string::String { + if self.port.is_none() { + self.port = ::std::option::Option::Some(::std::string::String::new()); + } + self.port.as_mut().unwrap() + } + + // Take field + pub fn take_port(&mut self) -> ::std::string::String { + self.port.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string path = 5; + + pub fn path(&self) -> &str { + match self.path.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_path(&mut self) { + self.path = ::std::option::Option::None; + } + + pub fn has_path(&self) -> bool { + self.path.is_some() + } + + // Param is passed by value, moved + pub fn set_path(&mut self, v: ::std::string::String) { + self.path = ::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_path(&mut self) -> &mut ::std::string::String { + if self.path.is_none() { + self.path = ::std::option::Option::Some(::std::string::String::new()); + } + self.path.as_mut().unwrap() + } + + // Take field + pub fn take_path(&mut self) -> ::std::string::String { + self.path.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint32 index = 6; + + pub fn index(&self) -> u32 { + self.index.unwrap_or(0u32) + } + + pub fn clear_index(&mut self) { + self.index = ::std::option::Option::None; + } + + pub fn has_index(&self) -> bool { + self.index.is_some() + } + + // Param is passed by value, moved + pub fn set_index(&mut self, v: u32) { + self.index = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "proto", + |m: &IdentityType| { &m.proto }, + |m: &mut IdentityType| { &mut m.proto }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "user", + |m: &IdentityType| { &m.user }, + |m: &mut IdentityType| { &mut m.user }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "host", + |m: &IdentityType| { &m.host }, + |m: &mut IdentityType| { &mut m.host }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "port", + |m: &IdentityType| { &m.port }, + |m: &mut IdentityType| { &mut m.port }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "path", + |m: &IdentityType| { &m.path }, + |m: &mut IdentityType| { &mut m.path }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "index", + |m: &IdentityType| { &m.index }, + |m: &mut IdentityType| { &mut m.index }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "IdentityType", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for IdentityType { + const NAME: &'static str = "IdentityType"; + + 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.proto = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.user = ::std::option::Option::Some(is.read_string()?); + }, + 26 => { + self.host = ::std::option::Option::Some(is.read_string()?); + }, + 34 => { + self.port = ::std::option::Option::Some(is.read_string()?); + }, + 42 => { + self.path = ::std::option::Option::Some(is.read_string()?); + }, + 48 => { + self.index = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.proto.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.user.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.host.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.port.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(v) = self.path.as_ref() { + my_size += ::protobuf::rt::string_size(5, &v); + } + if let Some(v) = self.index { + my_size += ::protobuf::rt::uint32_size(6, 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.proto.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.user.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.host.as_ref() { + os.write_string(3, v)?; + } + if let Some(v) = self.port.as_ref() { + os.write_string(4, v)?; + } + if let Some(v) = self.path.as_ref() { + os.write_string(5, v)?; + } + if let Some(v) = self.index { + os.write_uint32(6, 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() -> IdentityType { + IdentityType::new() + } + + fn clear(&mut self) { + self.proto = ::std::option::Option::None; + self.user = ::std::option::Option::None; + self.host = ::std::option::Option::None; + self.port = ::std::option::Option::None; + self.path = ::std::option::Option::None; + self.index = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static IdentityType { + static instance: IdentityType = IdentityType { + proto: ::std::option::Option::None, + user: ::std::option::Option::None, + host: ::std::option::Option::None, + port: ::std::option::Option::None, + path: ::std::option::Option::None, + index: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for IdentityType { + 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("IdentityType").unwrap()).clone() + } +} + +impl ::std::fmt::Display for IdentityType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for IdentityType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.crypto.SignIdentity) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SignIdentity { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.SignIdentity.identity) + pub identity: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.SignIdentity.challenge_hidden) + pub challenge_hidden: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.SignIdentity.challenge_visual) + pub challenge_visual: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.SignIdentity.ecdsa_curve_name) + pub ecdsa_curve_name: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.crypto.SignIdentity.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SignIdentity { + fn default() -> &'a SignIdentity { + ::default_instance() + } +} + +impl SignIdentity { + pub fn new() -> SignIdentity { + ::std::default::Default::default() + } + + // optional bytes challenge_hidden = 2; + + pub fn challenge_hidden(&self) -> &[u8] { + match self.challenge_hidden.as_ref() { + Some(v) => v, + None => b"", + } + } + + pub fn clear_challenge_hidden(&mut self) { + self.challenge_hidden = ::std::option::Option::None; + } + + pub fn has_challenge_hidden(&self) -> bool { + self.challenge_hidden.is_some() + } + + // Param is passed by value, moved + pub fn set_challenge_hidden(&mut self, v: ::std::vec::Vec) { + self.challenge_hidden = ::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_challenge_hidden(&mut self) -> &mut ::std::vec::Vec { + if self.challenge_hidden.is_none() { + self.challenge_hidden = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.challenge_hidden.as_mut().unwrap() + } + + // Take field + pub fn take_challenge_hidden(&mut self) -> ::std::vec::Vec { + self.challenge_hidden.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional string challenge_visual = 3; + + pub fn challenge_visual(&self) -> &str { + match self.challenge_visual.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_challenge_visual(&mut self) { + self.challenge_visual = ::std::option::Option::None; + } + + pub fn has_challenge_visual(&self) -> bool { + self.challenge_visual.is_some() + } + + // Param is passed by value, moved + pub fn set_challenge_visual(&mut self, v: ::std::string::String) { + self.challenge_visual = ::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_challenge_visual(&mut self) -> &mut ::std::string::String { + if self.challenge_visual.is_none() { + self.challenge_visual = ::std::option::Option::Some(::std::string::String::new()); + } + self.challenge_visual.as_mut().unwrap() + } + + // Take field + pub fn take_challenge_visual(&mut self) -> ::std::string::String { + self.challenge_visual.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string ecdsa_curve_name = 4; + + pub fn ecdsa_curve_name(&self) -> &str { + match self.ecdsa_curve_name.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_ecdsa_curve_name(&mut self) { + self.ecdsa_curve_name = ::std::option::Option::None; + } + + pub fn has_ecdsa_curve_name(&self) -> bool { + self.ecdsa_curve_name.is_some() + } + + // Param is passed by value, moved + pub fn set_ecdsa_curve_name(&mut self, v: ::std::string::String) { + self.ecdsa_curve_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_ecdsa_curve_name(&mut self) -> &mut ::std::string::String { + if self.ecdsa_curve_name.is_none() { + self.ecdsa_curve_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.ecdsa_curve_name.as_mut().unwrap() + } + + // Take field + pub fn take_ecdsa_curve_name(&mut self) -> ::std::string::String { + self.ecdsa_curve_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_message_field_accessor::<_, IdentityType>( + "identity", + |m: &SignIdentity| { &m.identity }, + |m: &mut SignIdentity| { &mut m.identity }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "challenge_hidden", + |m: &SignIdentity| { &m.challenge_hidden }, + |m: &mut SignIdentity| { &mut m.challenge_hidden }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "challenge_visual", + |m: &SignIdentity| { &m.challenge_visual }, + |m: &mut SignIdentity| { &mut m.challenge_visual }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ecdsa_curve_name", + |m: &SignIdentity| { &m.ecdsa_curve_name }, + |m: &mut SignIdentity| { &mut m.ecdsa_curve_name }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SignIdentity", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SignIdentity { + const NAME: &'static str = "SignIdentity"; + + fn is_initialized(&self) -> bool { + if self.identity.is_none() { + return false; + } + for v in &self.identity { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.identity)?; + }, + 18 => { + self.challenge_hidden = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.challenge_visual = ::std::option::Option::Some(is.read_string()?); + }, + 34 => { + self.ecdsa_curve_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.identity.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.challenge_hidden.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.challenge_visual.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.ecdsa_curve_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.identity.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.challenge_hidden.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.challenge_visual.as_ref() { + os.write_string(3, v)?; + } + if let Some(v) = self.ecdsa_curve_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() -> SignIdentity { + SignIdentity::new() + } + + fn clear(&mut self) { + self.identity.clear(); + self.challenge_hidden = ::std::option::Option::None; + self.challenge_visual = ::std::option::Option::None; + self.ecdsa_curve_name = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static SignIdentity { + static instance: SignIdentity = SignIdentity { + identity: ::protobuf::MessageField::none(), + challenge_hidden: ::std::option::Option::None, + challenge_visual: ::std::option::Option::None, + ecdsa_curve_name: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SignIdentity { + 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("SignIdentity").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SignIdentity { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SignIdentity { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.crypto.SignedIdentity) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SignedIdentity { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.SignedIdentity.address) + pub address: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.SignedIdentity.public_key) + pub public_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.SignedIdentity.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.crypto.SignedIdentity.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SignedIdentity { + fn default() -> &'a SignedIdentity { + ::default_instance() + } +} + +impl SignedIdentity { + pub fn new() -> SignedIdentity { + ::std::default::Default::default() + } + + // optional string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required bytes public_key = 2; + + pub fn public_key(&self) -> &[u8] { + match self.public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_public_key(&mut self) { + self.public_key = ::std::option::Option::None; + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: ::std::vec::Vec) { + self.public_key = ::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_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.public_key.is_none() { + self.public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> ::std::vec::Vec { + self.public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes signature = 3; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &SignedIdentity| { &m.address }, + |m: &mut SignedIdentity| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "public_key", + |m: &SignedIdentity| { &m.public_key }, + |m: &mut SignedIdentity| { &mut m.public_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &SignedIdentity| { &m.signature }, + |m: &mut SignedIdentity| { &mut m.signature }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SignedIdentity", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SignedIdentity { + const NAME: &'static str = "SignedIdentity"; + + fn is_initialized(&self) -> bool { + if self.public_key.is_none() { + return false; + } + if self.signature.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_string()?); + }, + 18 => { + self.public_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.signature = ::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.address.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &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_string(1, v)?; + } + if let Some(v) = self.public_key.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.signature.as_ref() { + os.write_bytes(3, 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() -> SignedIdentity { + SignedIdentity::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.public_key = ::std::option::Option::None; + self.signature = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static SignedIdentity { + static instance: SignedIdentity = SignedIdentity { + address: ::std::option::Option::None, + public_key: ::std::option::Option::None, + signature: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SignedIdentity { + 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("SignedIdentity").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SignedIdentity { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SignedIdentity { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.crypto.GetECDHSessionKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct GetECDHSessionKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.GetECDHSessionKey.identity) + pub identity: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.GetECDHSessionKey.peer_public_key) + pub peer_public_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.GetECDHSessionKey.ecdsa_curve_name) + pub ecdsa_curve_name: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.crypto.GetECDHSessionKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a GetECDHSessionKey { + fn default() -> &'a GetECDHSessionKey { + ::default_instance() + } +} + +impl GetECDHSessionKey { + pub fn new() -> GetECDHSessionKey { + ::std::default::Default::default() + } + + // required bytes peer_public_key = 2; + + pub fn peer_public_key(&self) -> &[u8] { + match self.peer_public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_peer_public_key(&mut self) { + self.peer_public_key = ::std::option::Option::None; + } + + pub fn has_peer_public_key(&self) -> bool { + self.peer_public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_peer_public_key(&mut self, v: ::std::vec::Vec) { + self.peer_public_key = ::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_peer_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.peer_public_key.is_none() { + self.peer_public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.peer_public_key.as_mut().unwrap() + } + + // Take field + pub fn take_peer_public_key(&mut self) -> ::std::vec::Vec { + self.peer_public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional string ecdsa_curve_name = 3; + + pub fn ecdsa_curve_name(&self) -> &str { + match self.ecdsa_curve_name.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_ecdsa_curve_name(&mut self) { + self.ecdsa_curve_name = ::std::option::Option::None; + } + + pub fn has_ecdsa_curve_name(&self) -> bool { + self.ecdsa_curve_name.is_some() + } + + // Param is passed by value, moved + pub fn set_ecdsa_curve_name(&mut self, v: ::std::string::String) { + self.ecdsa_curve_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_ecdsa_curve_name(&mut self) -> &mut ::std::string::String { + if self.ecdsa_curve_name.is_none() { + self.ecdsa_curve_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.ecdsa_curve_name.as_mut().unwrap() + } + + // Take field + pub fn take_ecdsa_curve_name(&mut self) -> ::std::string::String { + self.ecdsa_curve_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(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, IdentityType>( + "identity", + |m: &GetECDHSessionKey| { &m.identity }, + |m: &mut GetECDHSessionKey| { &mut m.identity }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "peer_public_key", + |m: &GetECDHSessionKey| { &m.peer_public_key }, + |m: &mut GetECDHSessionKey| { &mut m.peer_public_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ecdsa_curve_name", + |m: &GetECDHSessionKey| { &m.ecdsa_curve_name }, + |m: &mut GetECDHSessionKey| { &mut m.ecdsa_curve_name }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "GetECDHSessionKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for GetECDHSessionKey { + const NAME: &'static str = "GetECDHSessionKey"; + + fn is_initialized(&self) -> bool { + if self.identity.is_none() { + return false; + } + if self.peer_public_key.is_none() { + return false; + } + for v in &self.identity { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.identity)?; + }, + 18 => { + self.peer_public_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.ecdsa_curve_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.identity.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.peer_public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.ecdsa_curve_name.as_ref() { + my_size += ::protobuf::rt::string_size(3, &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.identity.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.peer_public_key.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.ecdsa_curve_name.as_ref() { + os.write_string(3, 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() -> GetECDHSessionKey { + GetECDHSessionKey::new() + } + + fn clear(&mut self) { + self.identity.clear(); + self.peer_public_key = ::std::option::Option::None; + self.ecdsa_curve_name = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static GetECDHSessionKey { + static instance: GetECDHSessionKey = GetECDHSessionKey { + identity: ::protobuf::MessageField::none(), + peer_public_key: ::std::option::Option::None, + ecdsa_curve_name: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for GetECDHSessionKey { + 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("GetECDHSessionKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for GetECDHSessionKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GetECDHSessionKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.crypto.ECDHSessionKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct ECDHSessionKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.ECDHSessionKey.session_key) + pub session_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.ECDHSessionKey.public_key) + pub public_key: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.crypto.ECDHSessionKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a ECDHSessionKey { + fn default() -> &'a ECDHSessionKey { + ::default_instance() + } +} + +impl ECDHSessionKey { + pub fn new() -> ECDHSessionKey { + ::std::default::Default::default() + } + + // required bytes session_key = 1; + + pub fn session_key(&self) -> &[u8] { + match self.session_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_session_key(&mut self) { + self.session_key = ::std::option::Option::None; + } + + pub fn has_session_key(&self) -> bool { + self.session_key.is_some() + } + + // Param is passed by value, moved + pub fn set_session_key(&mut self, v: ::std::vec::Vec) { + self.session_key = ::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_session_key(&mut self) -> &mut ::std::vec::Vec { + if self.session_key.is_none() { + self.session_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.session_key.as_mut().unwrap() + } + + // Take field + pub fn take_session_key(&mut self) -> ::std::vec::Vec { + self.session_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes public_key = 2; + + pub fn public_key(&self) -> &[u8] { + match self.public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_public_key(&mut self) { + self.public_key = ::std::option::Option::None; + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: ::std::vec::Vec) { + self.public_key = ::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_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.public_key.is_none() { + self.public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> ::std::vec::Vec { + self.public_key.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::<_, _>( + "session_key", + |m: &ECDHSessionKey| { &m.session_key }, + |m: &mut ECDHSessionKey| { &mut m.session_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "public_key", + |m: &ECDHSessionKey| { &m.public_key }, + |m: &mut ECDHSessionKey| { &mut m.public_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "ECDHSessionKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for ECDHSessionKey { + const NAME: &'static str = "ECDHSessionKey"; + + fn is_initialized(&self) -> bool { + if self.session_key.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.session_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.public_key = ::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.session_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.public_key.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.session_key.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.public_key.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() -> ECDHSessionKey { + ECDHSessionKey::new() + } + + fn clear(&mut self) { + self.session_key = ::std::option::Option::None; + self.public_key = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static ECDHSessionKey { + static instance: ECDHSessionKey = ECDHSessionKey { + session_key: ::std::option::Option::None, + public_key: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for ECDHSessionKey { + 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("ECDHSessionKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for ECDHSessionKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ECDHSessionKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.crypto.CosiCommit) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CosiCommit { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CosiCommit.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CosiCommit.data) + pub data: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.crypto.CosiCommit.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CosiCommit { + fn default() -> &'a CosiCommit { + ::default_instance() + } +} + +impl CosiCommit { + pub fn new() -> CosiCommit { + ::std::default::Default::default() + } + + // optional bytes data = 2; + + pub fn data(&self) -> &[u8] { + match self.data.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_data(&mut self) { + self.data = ::std::option::Option::None; + } + + pub fn has_data(&self) -> bool { + self.data.is_some() + } + + // Param is passed by value, moved + pub fn set_data(&mut self, v: ::std::vec::Vec) { + self.data = ::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_data(&mut self) -> &mut ::std::vec::Vec { + if self.data.is_none() { + self.data = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.data.as_mut().unwrap() + } + + // Take field + pub fn take_data(&mut self) -> ::std::vec::Vec { + self.data.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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &CosiCommit| { &m.address_n }, + |m: &mut CosiCommit| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data", + |m: &CosiCommit| { &m.data }, + |m: &mut CosiCommit| { &mut m.data }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CosiCommit", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CosiCommit { + const NAME: &'static str = "CosiCommit"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.data = ::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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.data.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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.data.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() -> CosiCommit { + CosiCommit::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.data = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CosiCommit { + static instance: CosiCommit = CosiCommit { + address_n: ::std::vec::Vec::new(), + data: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CosiCommit { + 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("CosiCommit").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CosiCommit { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CosiCommit { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.crypto.CosiCommitment) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CosiCommitment { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CosiCommitment.commitment) + pub commitment: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CosiCommitment.pubkey) + pub pubkey: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.crypto.CosiCommitment.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CosiCommitment { + fn default() -> &'a CosiCommitment { + ::default_instance() + } +} + +impl CosiCommitment { + pub fn new() -> CosiCommitment { + ::std::default::Default::default() + } + + // required bytes commitment = 1; + + pub fn commitment(&self) -> &[u8] { + match self.commitment.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_commitment(&mut self) { + self.commitment = ::std::option::Option::None; + } + + pub fn has_commitment(&self) -> bool { + self.commitment.is_some() + } + + // Param is passed by value, moved + pub fn set_commitment(&mut self, v: ::std::vec::Vec) { + self.commitment = ::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_commitment(&mut self) -> &mut ::std::vec::Vec { + if self.commitment.is_none() { + self.commitment = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.commitment.as_mut().unwrap() + } + + // Take field + pub fn take_commitment(&mut self) -> ::std::vec::Vec { + self.commitment.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes pubkey = 2; + + pub fn pubkey(&self) -> &[u8] { + match self.pubkey.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_pubkey(&mut self) { + self.pubkey = ::std::option::Option::None; + } + + pub fn has_pubkey(&self) -> bool { + self.pubkey.is_some() + } + + // Param is passed by value, moved + pub fn set_pubkey(&mut self, v: ::std::vec::Vec) { + self.pubkey = ::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_pubkey(&mut self) -> &mut ::std::vec::Vec { + if self.pubkey.is_none() { + self.pubkey = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.pubkey.as_mut().unwrap() + } + + // Take field + pub fn take_pubkey(&mut self) -> ::std::vec::Vec { + self.pubkey.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::<_, _>( + "commitment", + |m: &CosiCommitment| { &m.commitment }, + |m: &mut CosiCommitment| { &mut m.commitment }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pubkey", + |m: &CosiCommitment| { &m.pubkey }, + |m: &mut CosiCommitment| { &mut m.pubkey }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CosiCommitment", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CosiCommitment { + const NAME: &'static str = "CosiCommitment"; + + fn is_initialized(&self) -> bool { + if self.commitment.is_none() { + return false; + } + if self.pubkey.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.commitment = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.pubkey = ::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.commitment.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.pubkey.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.commitment.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.pubkey.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() -> CosiCommitment { + CosiCommitment::new() + } + + fn clear(&mut self) { + self.commitment = ::std::option::Option::None; + self.pubkey = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CosiCommitment { + static instance: CosiCommitment = CosiCommitment { + commitment: ::std::option::Option::None, + pubkey: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CosiCommitment { + 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("CosiCommitment").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CosiCommitment { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CosiCommitment { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.crypto.CosiSign) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CosiSign { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CosiSign.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CosiSign.data) + pub data: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CosiSign.global_commitment) + pub global_commitment: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CosiSign.global_pubkey) + pub global_pubkey: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.crypto.CosiSign.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CosiSign { + fn default() -> &'a CosiSign { + ::default_instance() + } +} + +impl CosiSign { + pub fn new() -> CosiSign { + ::std::default::Default::default() + } + + // required bytes data = 2; + + pub fn data(&self) -> &[u8] { + match self.data.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_data(&mut self) { + self.data = ::std::option::Option::None; + } + + pub fn has_data(&self) -> bool { + self.data.is_some() + } + + // Param is passed by value, moved + pub fn set_data(&mut self, v: ::std::vec::Vec) { + self.data = ::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_data(&mut self) -> &mut ::std::vec::Vec { + if self.data.is_none() { + self.data = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.data.as_mut().unwrap() + } + + // Take field + pub fn take_data(&mut self) -> ::std::vec::Vec { + self.data.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes global_commitment = 3; + + pub fn global_commitment(&self) -> &[u8] { + match self.global_commitment.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_global_commitment(&mut self) { + self.global_commitment = ::std::option::Option::None; + } + + pub fn has_global_commitment(&self) -> bool { + self.global_commitment.is_some() + } + + // Param is passed by value, moved + pub fn set_global_commitment(&mut self, v: ::std::vec::Vec) { + self.global_commitment = ::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_global_commitment(&mut self) -> &mut ::std::vec::Vec { + if self.global_commitment.is_none() { + self.global_commitment = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.global_commitment.as_mut().unwrap() + } + + // Take field + pub fn take_global_commitment(&mut self) -> ::std::vec::Vec { + self.global_commitment.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes global_pubkey = 4; + + pub fn global_pubkey(&self) -> &[u8] { + match self.global_pubkey.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_global_pubkey(&mut self) { + self.global_pubkey = ::std::option::Option::None; + } + + pub fn has_global_pubkey(&self) -> bool { + self.global_pubkey.is_some() + } + + // Param is passed by value, moved + pub fn set_global_pubkey(&mut self, v: ::std::vec::Vec) { + self.global_pubkey = ::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_global_pubkey(&mut self) -> &mut ::std::vec::Vec { + if self.global_pubkey.is_none() { + self.global_pubkey = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.global_pubkey.as_mut().unwrap() + } + + // Take field + pub fn take_global_pubkey(&mut self) -> ::std::vec::Vec { + self.global_pubkey.take().unwrap_or_else(|| ::std::vec::Vec::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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &CosiSign| { &m.address_n }, + |m: &mut CosiSign| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data", + |m: &CosiSign| { &m.data }, + |m: &mut CosiSign| { &mut m.data }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "global_commitment", + |m: &CosiSign| { &m.global_commitment }, + |m: &mut CosiSign| { &mut m.global_commitment }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "global_pubkey", + |m: &CosiSign| { &m.global_pubkey }, + |m: &mut CosiSign| { &mut m.global_pubkey }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CosiSign", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CosiSign { + const NAME: &'static str = "CosiSign"; + + fn is_initialized(&self) -> bool { + if self.data.is_none() { + return false; + } + if self.global_commitment.is_none() { + return false; + } + if self.global_pubkey.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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.data = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.global_commitment = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.global_pubkey = ::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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.data.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.global_commitment.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.global_pubkey.as_ref() { + my_size += ::protobuf::rt::bytes_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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.data.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.global_commitment.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.global_pubkey.as_ref() { + os.write_bytes(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() -> CosiSign { + CosiSign::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.data = ::std::option::Option::None; + self.global_commitment = ::std::option::Option::None; + self.global_pubkey = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CosiSign { + static instance: CosiSign = CosiSign { + address_n: ::std::vec::Vec::new(), + data: ::std::option::Option::None, + global_commitment: ::std::option::Option::None, + global_pubkey: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CosiSign { + 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("CosiSign").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CosiSign { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CosiSign { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.crypto.CosiSignature) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CosiSignature { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.crypto.CosiSignature.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.crypto.CosiSignature.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CosiSignature { + fn default() -> &'a CosiSignature { + ::default_instance() + } +} + +impl CosiSignature { + pub fn new() -> CosiSignature { + ::std::default::Default::default() + } + + // required bytes signature = 1; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &CosiSignature| { &m.signature }, + |m: &mut CosiSignature| { &mut m.signature }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CosiSignature", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CosiSignature { + const NAME: &'static str = "CosiSignature"; + + fn is_initialized(&self) -> bool { + if self.signature.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.signature = ::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.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.signature.as_ref() { + os.write_bytes(1, 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() -> CosiSignature { + CosiSignature::new() + } + + fn clear(&mut self) { + self.signature = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static CosiSignature { + static instance: CosiSignature = CosiSignature { + signature: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CosiSignature { + 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("CosiSignature").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CosiSignature { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CosiSignature { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x15messages-crypto.proto\x12\x19hw.trezor.messages.crypto\x1a\x0emess\ + ages.proto\"\xcb\x01\n\x0eCipherKeyValue\x12\x1b\n\taddress_n\x18\x01\ + \x20\x03(\rR\x08addressN\x12\x10\n\x03key\x18\x02\x20\x02(\tR\x03key\x12\ + \x14\n\x05value\x18\x03\x20\x02(\x0cR\x05value\x12\x18\n\x07encrypt\x18\ + \x04\x20\x01(\x08R\x07encrypt\x12$\n\x0eask_on_encrypt\x18\x05\x20\x01(\ + \x08R\x0caskOnEncrypt\x12$\n\x0eask_on_decrypt\x18\x06\x20\x01(\x08R\x0c\ + askOnDecrypt\x12\x0e\n\x02iv\x18\x07\x20\x01(\x0cR\x02iv\"(\n\x10Ciphere\ + dKeyValue\x12\x14\n\x05value\x18\x01\x20\x02(\x0cR\x05value\"\x8d\x01\n\ + \x0cIdentityType\x12\x14\n\x05proto\x18\x01\x20\x01(\tR\x05proto\x12\x12\ + \n\x04user\x18\x02\x20\x01(\tR\x04user\x12\x12\n\x04host\x18\x03\x20\x01\ + (\tR\x04host\x12\x12\n\x04port\x18\x04\x20\x01(\tR\x04port\x12\x12\n\x04\ + path\x18\x05\x20\x01(\tR\x04path\x12\x17\n\x05index\x18\x06\x20\x01(\r:\ + \x010R\x05index\"\xd7\x01\n\x0cSignIdentity\x12C\n\x08identity\x18\x01\ + \x20\x02(\x0b2'.hw.trezor.messages.crypto.IdentityTypeR\x08identity\x12+\ + \n\x10challenge_hidden\x18\x02\x20\x01(\x0c:\0R\x0fchallengeHidden\x12+\ + \n\x10challenge_visual\x18\x03\x20\x01(\t:\0R\x0fchallengeVisual\x12(\n\ + \x10ecdsa_curve_name\x18\x04\x20\x01(\tR\x0eecdsaCurveName\"g\n\x0eSigne\ + dIdentity\x12\x18\n\x07address\x18\x01\x20\x01(\tR\x07address\x12\x1d\n\ + \npublic_key\x18\x02\x20\x02(\x0cR\tpublicKey\x12\x1c\n\tsignature\x18\ + \x03\x20\x02(\x0cR\tsignature\"\xaa\x01\n\x11GetECDHSessionKey\x12C\n\ + \x08identity\x18\x01\x20\x02(\x0b2'.hw.trezor.messages.crypto.IdentityTy\ + peR\x08identity\x12&\n\x0fpeer_public_key\x18\x02\x20\x02(\x0cR\rpeerPub\ + licKey\x12(\n\x10ecdsa_curve_name\x18\x03\x20\x01(\tR\x0eecdsaCurveName\ + \"P\n\x0eECDHSessionKey\x12\x1f\n\x0bsession_key\x18\x01\x20\x02(\x0cR\n\ + sessionKey\x12\x1d\n\npublic_key\x18\x02\x20\x01(\x0cR\tpublicKey\"A\n\n\ + CosiCommit\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\x16\ + \n\x04data\x18\x02\x20\x01(\x0cR\x04dataB\x02\x18\x01\"H\n\x0eCosiCommit\ + ment\x12\x1e\n\ncommitment\x18\x01\x20\x02(\x0cR\ncommitment\x12\x16\n\ + \x06pubkey\x18\x02\x20\x02(\x0cR\x06pubkey\"\x8d\x01\n\x08CosiSign\x12\ + \x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\x12\n\x04data\x18\ + \x02\x20\x02(\x0cR\x04data\x12+\n\x11global_commitment\x18\x03\x20\x02(\ + \x0cR\x10globalCommitment\x12#\n\rglobal_pubkey\x18\x04\x20\x02(\x0cR\ + \x0cglobalPubkey\"-\n\rCosiSignature\x12\x1c\n\tsignature\x18\x01\x20\ + \x02(\x0cR\tsignatureB>\n#com.satoshilabs.trezor.lib.protobufB\x13Trezor\ + MessageCrypto\x80\xa6\x1d\x01\ +"; + +/// `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(1); + deps.push(super::messages::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(11); + messages.push(CipherKeyValue::generated_message_descriptor_data()); + messages.push(CipheredKeyValue::generated_message_descriptor_data()); + messages.push(IdentityType::generated_message_descriptor_data()); + messages.push(SignIdentity::generated_message_descriptor_data()); + messages.push(SignedIdentity::generated_message_descriptor_data()); + messages.push(GetECDHSessionKey::generated_message_descriptor_data()); + messages.push(ECDHSessionKey::generated_message_descriptor_data()); + messages.push(CosiCommit::generated_message_descriptor_data()); + messages.push(CosiCommitment::generated_message_descriptor_data()); + messages.push(CosiSign::generated_message_descriptor_data()); + messages.push(CosiSignature::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_debug.rs b/wallet/trezor-client/src/protos/generated/messages_debug.rs new file mode 100644 index 0000000000..7bf28d1bf9 --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_debug.rs @@ -0,0 +1,3555 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-debug.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.debug.DebugLinkDecision) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugLinkDecision { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkDecision.button) + pub button: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkDecision.swipe) + pub swipe: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkDecision.input) + pub input: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkDecision.x) + pub x: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkDecision.y) + pub y: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkDecision.wait) + pub wait: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkDecision.hold_ms) + pub hold_ms: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkDecision.physical_button) + pub physical_button: ::std::option::Option<::protobuf::EnumOrUnknown>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.debug.DebugLinkDecision.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugLinkDecision { + fn default() -> &'a DebugLinkDecision { + ::default_instance() + } +} + +impl DebugLinkDecision { + pub fn new() -> DebugLinkDecision { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.debug.DebugLinkDecision.DebugButton button = 1; + + pub fn button(&self) -> debug_link_decision::DebugButton { + match self.button { + Some(e) => e.enum_value_or(debug_link_decision::DebugButton::NO), + None => debug_link_decision::DebugButton::NO, + } + } + + pub fn clear_button(&mut self) { + self.button = ::std::option::Option::None; + } + + pub fn has_button(&self) -> bool { + self.button.is_some() + } + + // Param is passed by value, moved + pub fn set_button(&mut self, v: debug_link_decision::DebugButton) { + self.button = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional .hw.trezor.messages.debug.DebugLinkDecision.DebugSwipeDirection swipe = 2; + + pub fn swipe(&self) -> debug_link_decision::DebugSwipeDirection { + match self.swipe { + Some(e) => e.enum_value_or(debug_link_decision::DebugSwipeDirection::UP), + None => debug_link_decision::DebugSwipeDirection::UP, + } + } + + pub fn clear_swipe(&mut self) { + self.swipe = ::std::option::Option::None; + } + + pub fn has_swipe(&self) -> bool { + self.swipe.is_some() + } + + // Param is passed by value, moved + pub fn set_swipe(&mut self, v: debug_link_decision::DebugSwipeDirection) { + self.swipe = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional string input = 3; + + pub fn input(&self) -> &str { + match self.input.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_input(&mut self) { + self.input = ::std::option::Option::None; + } + + pub fn has_input(&self) -> bool { + self.input.is_some() + } + + // Param is passed by value, moved + pub fn set_input(&mut self, v: ::std::string::String) { + self.input = ::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_input(&mut self) -> &mut ::std::string::String { + if self.input.is_none() { + self.input = ::std::option::Option::Some(::std::string::String::new()); + } + self.input.as_mut().unwrap() + } + + // Take field + pub fn take_input(&mut self) -> ::std::string::String { + self.input.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint32 x = 4; + + pub fn x(&self) -> u32 { + self.x.unwrap_or(0) + } + + pub fn clear_x(&mut self) { + self.x = ::std::option::Option::None; + } + + pub fn has_x(&self) -> bool { + self.x.is_some() + } + + // Param is passed by value, moved + pub fn set_x(&mut self, v: u32) { + self.x = ::std::option::Option::Some(v); + } + + // optional uint32 y = 5; + + pub fn y(&self) -> u32 { + self.y.unwrap_or(0) + } + + pub fn clear_y(&mut self) { + self.y = ::std::option::Option::None; + } + + pub fn has_y(&self) -> bool { + self.y.is_some() + } + + // Param is passed by value, moved + pub fn set_y(&mut self, v: u32) { + self.y = ::std::option::Option::Some(v); + } + + // optional bool wait = 6; + + pub fn wait(&self) -> bool { + self.wait.unwrap_or(false) + } + + pub fn clear_wait(&mut self) { + self.wait = ::std::option::Option::None; + } + + pub fn has_wait(&self) -> bool { + self.wait.is_some() + } + + // Param is passed by value, moved + pub fn set_wait(&mut self, v: bool) { + self.wait = ::std::option::Option::Some(v); + } + + // optional uint32 hold_ms = 7; + + pub fn hold_ms(&self) -> u32 { + self.hold_ms.unwrap_or(0) + } + + pub fn clear_hold_ms(&mut self) { + self.hold_ms = ::std::option::Option::None; + } + + pub fn has_hold_ms(&self) -> bool { + self.hold_ms.is_some() + } + + // Param is passed by value, moved + pub fn set_hold_ms(&mut self, v: u32) { + self.hold_ms = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.debug.DebugLinkDecision.DebugPhysicalButton physical_button = 8; + + pub fn physical_button(&self) -> debug_link_decision::DebugPhysicalButton { + match self.physical_button { + Some(e) => e.enum_value_or(debug_link_decision::DebugPhysicalButton::LEFT_BTN), + None => debug_link_decision::DebugPhysicalButton::LEFT_BTN, + } + } + + pub fn clear_physical_button(&mut self) { + self.physical_button = ::std::option::Option::None; + } + + pub fn has_physical_button(&self) -> bool { + self.physical_button.is_some() + } + + // Param is passed by value, moved + pub fn set_physical_button(&mut self, v: debug_link_decision::DebugPhysicalButton) { + self.physical_button = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(8); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "button", + |m: &DebugLinkDecision| { &m.button }, + |m: &mut DebugLinkDecision| { &mut m.button }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "swipe", + |m: &DebugLinkDecision| { &m.swipe }, + |m: &mut DebugLinkDecision| { &mut m.swipe }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "input", + |m: &DebugLinkDecision| { &m.input }, + |m: &mut DebugLinkDecision| { &mut m.input }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "x", + |m: &DebugLinkDecision| { &m.x }, + |m: &mut DebugLinkDecision| { &mut m.x }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "y", + |m: &DebugLinkDecision| { &m.y }, + |m: &mut DebugLinkDecision| { &mut m.y }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "wait", + |m: &DebugLinkDecision| { &m.wait }, + |m: &mut DebugLinkDecision| { &mut m.wait }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "hold_ms", + |m: &DebugLinkDecision| { &m.hold_ms }, + |m: &mut DebugLinkDecision| { &mut m.hold_ms }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "physical_button", + |m: &DebugLinkDecision| { &m.physical_button }, + |m: &mut DebugLinkDecision| { &mut m.physical_button }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugLinkDecision", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugLinkDecision { + const NAME: &'static str = "DebugLinkDecision"; + + 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 { + 8 => { + self.button = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 16 => { + self.swipe = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 26 => { + self.input = ::std::option::Option::Some(is.read_string()?); + }, + 32 => { + self.x = ::std::option::Option::Some(is.read_uint32()?); + }, + 40 => { + self.y = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.wait = ::std::option::Option::Some(is.read_bool()?); + }, + 56 => { + self.hold_ms = ::std::option::Option::Some(is.read_uint32()?); + }, + 64 => { + self.physical_button = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 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.button { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + if let Some(v) = self.swipe { + my_size += ::protobuf::rt::int32_size(2, v.value()); + } + if let Some(v) = self.input.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.x { + my_size += ::protobuf::rt::uint32_size(4, v); + } + if let Some(v) = self.y { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.wait { + my_size += 1 + 1; + } + if let Some(v) = self.hold_ms { + my_size += ::protobuf::rt::uint32_size(7, v); + } + if let Some(v) = self.physical_button { + my_size += ::protobuf::rt::int32_size(8, v.value()); + } + 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.button { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.swipe { + os.write_enum(2, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.input.as_ref() { + os.write_string(3, v)?; + } + if let Some(v) = self.x { + os.write_uint32(4, v)?; + } + if let Some(v) = self.y { + os.write_uint32(5, v)?; + } + if let Some(v) = self.wait { + os.write_bool(6, v)?; + } + if let Some(v) = self.hold_ms { + os.write_uint32(7, v)?; + } + if let Some(v) = self.physical_button { + os.write_enum(8, ::protobuf::EnumOrUnknown::value(&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() -> DebugLinkDecision { + DebugLinkDecision::new() + } + + fn clear(&mut self) { + self.button = ::std::option::Option::None; + self.swipe = ::std::option::Option::None; + self.input = ::std::option::Option::None; + self.x = ::std::option::Option::None; + self.y = ::std::option::Option::None; + self.wait = ::std::option::Option::None; + self.hold_ms = ::std::option::Option::None; + self.physical_button = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugLinkDecision { + static instance: DebugLinkDecision = DebugLinkDecision { + button: ::std::option::Option::None, + swipe: ::std::option::Option::None, + input: ::std::option::Option::None, + x: ::std::option::Option::None, + y: ::std::option::Option::None, + wait: ::std::option::Option::None, + hold_ms: ::std::option::Option::None, + physical_button: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugLinkDecision { + 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("DebugLinkDecision").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugLinkDecision { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkDecision { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `DebugLinkDecision` +pub mod debug_link_decision { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.debug.DebugLinkDecision.DebugSwipeDirection) + pub enum DebugSwipeDirection { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.debug.DebugLinkDecision.DebugSwipeDirection.UP) + UP = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.debug.DebugLinkDecision.DebugSwipeDirection.DOWN) + DOWN = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.debug.DebugLinkDecision.DebugSwipeDirection.LEFT) + LEFT = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.debug.DebugLinkDecision.DebugSwipeDirection.RIGHT) + RIGHT = 3, + } + + impl ::protobuf::Enum for DebugSwipeDirection { + const NAME: &'static str = "DebugSwipeDirection"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(DebugSwipeDirection::UP), + 1 => ::std::option::Option::Some(DebugSwipeDirection::DOWN), + 2 => ::std::option::Option::Some(DebugSwipeDirection::LEFT), + 3 => ::std::option::Option::Some(DebugSwipeDirection::RIGHT), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "UP" => ::std::option::Option::Some(DebugSwipeDirection::UP), + "DOWN" => ::std::option::Option::Some(DebugSwipeDirection::DOWN), + "LEFT" => ::std::option::Option::Some(DebugSwipeDirection::LEFT), + "RIGHT" => ::std::option::Option::Some(DebugSwipeDirection::RIGHT), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [DebugSwipeDirection] = &[ + DebugSwipeDirection::UP, + DebugSwipeDirection::DOWN, + DebugSwipeDirection::LEFT, + DebugSwipeDirection::RIGHT, + ]; + } + + impl ::protobuf::EnumFull for DebugSwipeDirection { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("DebugLinkDecision.DebugSwipeDirection").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 DebugSwipeDirection { + fn default() -> Self { + DebugSwipeDirection::UP + } + } + + impl DebugSwipeDirection { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("DebugLinkDecision.DebugSwipeDirection") + } + } + + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.debug.DebugLinkDecision.DebugButton) + pub enum DebugButton { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.debug.DebugLinkDecision.DebugButton.NO) + NO = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.debug.DebugLinkDecision.DebugButton.YES) + YES = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.debug.DebugLinkDecision.DebugButton.INFO) + INFO = 2, + } + + impl ::protobuf::Enum for DebugButton { + const NAME: &'static str = "DebugButton"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(DebugButton::NO), + 1 => ::std::option::Option::Some(DebugButton::YES), + 2 => ::std::option::Option::Some(DebugButton::INFO), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "NO" => ::std::option::Option::Some(DebugButton::NO), + "YES" => ::std::option::Option::Some(DebugButton::YES), + "INFO" => ::std::option::Option::Some(DebugButton::INFO), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [DebugButton] = &[ + DebugButton::NO, + DebugButton::YES, + DebugButton::INFO, + ]; + } + + impl ::protobuf::EnumFull for DebugButton { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("DebugLinkDecision.DebugButton").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 DebugButton { + fn default() -> Self { + DebugButton::NO + } + } + + impl DebugButton { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("DebugLinkDecision.DebugButton") + } + } + + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.debug.DebugLinkDecision.DebugPhysicalButton) + pub enum DebugPhysicalButton { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.debug.DebugLinkDecision.DebugPhysicalButton.LEFT_BTN) + LEFT_BTN = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.debug.DebugLinkDecision.DebugPhysicalButton.MIDDLE_BTN) + MIDDLE_BTN = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.debug.DebugLinkDecision.DebugPhysicalButton.RIGHT_BTN) + RIGHT_BTN = 2, + } + + impl ::protobuf::Enum for DebugPhysicalButton { + const NAME: &'static str = "DebugPhysicalButton"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(DebugPhysicalButton::LEFT_BTN), + 1 => ::std::option::Option::Some(DebugPhysicalButton::MIDDLE_BTN), + 2 => ::std::option::Option::Some(DebugPhysicalButton::RIGHT_BTN), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "LEFT_BTN" => ::std::option::Option::Some(DebugPhysicalButton::LEFT_BTN), + "MIDDLE_BTN" => ::std::option::Option::Some(DebugPhysicalButton::MIDDLE_BTN), + "RIGHT_BTN" => ::std::option::Option::Some(DebugPhysicalButton::RIGHT_BTN), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [DebugPhysicalButton] = &[ + DebugPhysicalButton::LEFT_BTN, + DebugPhysicalButton::MIDDLE_BTN, + DebugPhysicalButton::RIGHT_BTN, + ]; + } + + impl ::protobuf::EnumFull for DebugPhysicalButton { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("DebugLinkDecision.DebugPhysicalButton").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 DebugPhysicalButton { + fn default() -> Self { + DebugPhysicalButton::LEFT_BTN + } + } + + impl DebugPhysicalButton { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("DebugLinkDecision.DebugPhysicalButton") + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.debug.DebugLinkLayout) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugLinkLayout { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkLayout.tokens) + pub tokens: ::std::vec::Vec<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.debug.DebugLinkLayout.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugLinkLayout { + fn default() -> &'a DebugLinkLayout { + ::default_instance() + } +} + +impl DebugLinkLayout { + pub fn new() -> DebugLinkLayout { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "tokens", + |m: &DebugLinkLayout| { &m.tokens }, + |m: &mut DebugLinkLayout| { &mut m.tokens }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugLinkLayout", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugLinkLayout { + const NAME: &'static str = "DebugLinkLayout"; + + 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.tokens.push(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; + for value in &self.tokens { + my_size += ::protobuf::rt::string_size(1, &value); + }; + 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<()> { + for v in &self.tokens { + os.write_string(1, &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() -> DebugLinkLayout { + DebugLinkLayout::new() + } + + fn clear(&mut self) { + self.tokens.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugLinkLayout { + static instance: DebugLinkLayout = DebugLinkLayout { + tokens: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugLinkLayout { + 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("DebugLinkLayout").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugLinkLayout { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkLayout { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.debug.DebugLinkReseedRandom) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugLinkReseedRandom { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkReseedRandom.value) + pub value: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.debug.DebugLinkReseedRandom.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugLinkReseedRandom { + fn default() -> &'a DebugLinkReseedRandom { + ::default_instance() + } +} + +impl DebugLinkReseedRandom { + pub fn new() -> DebugLinkReseedRandom { + ::std::default::Default::default() + } + + // optional uint32 value = 1; + + pub fn value(&self) -> u32 { + self.value.unwrap_or(0) + } + + pub fn clear_value(&mut self) { + self.value = ::std::option::Option::None; + } + + pub fn has_value(&self) -> bool { + self.value.is_some() + } + + // Param is passed by value, moved + pub fn set_value(&mut self, v: u32) { + self.value = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "value", + |m: &DebugLinkReseedRandom| { &m.value }, + |m: &mut DebugLinkReseedRandom| { &mut m.value }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugLinkReseedRandom", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugLinkReseedRandom { + const NAME: &'static str = "DebugLinkReseedRandom"; + + 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 { + 8 => { + self.value = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.value { + my_size += ::protobuf::rt::uint32_size(1, 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.value { + os.write_uint32(1, 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() -> DebugLinkReseedRandom { + DebugLinkReseedRandom::new() + } + + fn clear(&mut self) { + self.value = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugLinkReseedRandom { + static instance: DebugLinkReseedRandom = DebugLinkReseedRandom { + value: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugLinkReseedRandom { + 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("DebugLinkReseedRandom").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugLinkReseedRandom { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkReseedRandom { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.debug.DebugLinkRecordScreen) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugLinkRecordScreen { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkRecordScreen.target_directory) + pub target_directory: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkRecordScreen.refresh_index) + pub refresh_index: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.debug.DebugLinkRecordScreen.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugLinkRecordScreen { + fn default() -> &'a DebugLinkRecordScreen { + ::default_instance() + } +} + +impl DebugLinkRecordScreen { + pub fn new() -> DebugLinkRecordScreen { + ::std::default::Default::default() + } + + // optional string target_directory = 1; + + pub fn target_directory(&self) -> &str { + match self.target_directory.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_target_directory(&mut self) { + self.target_directory = ::std::option::Option::None; + } + + pub fn has_target_directory(&self) -> bool { + self.target_directory.is_some() + } + + // Param is passed by value, moved + pub fn set_target_directory(&mut self, v: ::std::string::String) { + self.target_directory = ::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_target_directory(&mut self) -> &mut ::std::string::String { + if self.target_directory.is_none() { + self.target_directory = ::std::option::Option::Some(::std::string::String::new()); + } + self.target_directory.as_mut().unwrap() + } + + // Take field + pub fn take_target_directory(&mut self) -> ::std::string::String { + self.target_directory.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint32 refresh_index = 2; + + pub fn refresh_index(&self) -> u32 { + self.refresh_index.unwrap_or(0u32) + } + + pub fn clear_refresh_index(&mut self) { + self.refresh_index = ::std::option::Option::None; + } + + pub fn has_refresh_index(&self) -> bool { + self.refresh_index.is_some() + } + + // Param is passed by value, moved + pub fn set_refresh_index(&mut self, v: u32) { + self.refresh_index = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "target_directory", + |m: &DebugLinkRecordScreen| { &m.target_directory }, + |m: &mut DebugLinkRecordScreen| { &mut m.target_directory }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "refresh_index", + |m: &DebugLinkRecordScreen| { &m.refresh_index }, + |m: &mut DebugLinkRecordScreen| { &mut m.refresh_index }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugLinkRecordScreen", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugLinkRecordScreen { + const NAME: &'static str = "DebugLinkRecordScreen"; + + 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.target_directory = ::std::option::Option::Some(is.read_string()?); + }, + 16 => { + self.refresh_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.target_directory.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.refresh_index { + my_size += ::protobuf::rt::uint32_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.target_directory.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.refresh_index { + os.write_uint32(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() -> DebugLinkRecordScreen { + DebugLinkRecordScreen::new() + } + + fn clear(&mut self) { + self.target_directory = ::std::option::Option::None; + self.refresh_index = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugLinkRecordScreen { + static instance: DebugLinkRecordScreen = DebugLinkRecordScreen { + target_directory: ::std::option::Option::None, + refresh_index: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugLinkRecordScreen { + 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("DebugLinkRecordScreen").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugLinkRecordScreen { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkRecordScreen { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.debug.DebugLinkGetState) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugLinkGetState { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkGetState.wait_word_list) + pub wait_word_list: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkGetState.wait_word_pos) + pub wait_word_pos: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkGetState.wait_layout) + pub wait_layout: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.debug.DebugLinkGetState.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugLinkGetState { + fn default() -> &'a DebugLinkGetState { + ::default_instance() + } +} + +impl DebugLinkGetState { + pub fn new() -> DebugLinkGetState { + ::std::default::Default::default() + } + + // optional bool wait_word_list = 1; + + pub fn wait_word_list(&self) -> bool { + self.wait_word_list.unwrap_or(false) + } + + pub fn clear_wait_word_list(&mut self) { + self.wait_word_list = ::std::option::Option::None; + } + + pub fn has_wait_word_list(&self) -> bool { + self.wait_word_list.is_some() + } + + // Param is passed by value, moved + pub fn set_wait_word_list(&mut self, v: bool) { + self.wait_word_list = ::std::option::Option::Some(v); + } + + // optional bool wait_word_pos = 2; + + pub fn wait_word_pos(&self) -> bool { + self.wait_word_pos.unwrap_or(false) + } + + pub fn clear_wait_word_pos(&mut self) { + self.wait_word_pos = ::std::option::Option::None; + } + + pub fn has_wait_word_pos(&self) -> bool { + self.wait_word_pos.is_some() + } + + // Param is passed by value, moved + pub fn set_wait_word_pos(&mut self, v: bool) { + self.wait_word_pos = ::std::option::Option::Some(v); + } + + // optional bool wait_layout = 3; + + pub fn wait_layout(&self) -> bool { + self.wait_layout.unwrap_or(false) + } + + pub fn clear_wait_layout(&mut self) { + self.wait_layout = ::std::option::Option::None; + } + + pub fn has_wait_layout(&self) -> bool { + self.wait_layout.is_some() + } + + // Param is passed by value, moved + pub fn set_wait_layout(&mut self, v: bool) { + self.wait_layout = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "wait_word_list", + |m: &DebugLinkGetState| { &m.wait_word_list }, + |m: &mut DebugLinkGetState| { &mut m.wait_word_list }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "wait_word_pos", + |m: &DebugLinkGetState| { &m.wait_word_pos }, + |m: &mut DebugLinkGetState| { &mut m.wait_word_pos }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "wait_layout", + |m: &DebugLinkGetState| { &m.wait_layout }, + |m: &mut DebugLinkGetState| { &mut m.wait_layout }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugLinkGetState", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugLinkGetState { + const NAME: &'static str = "DebugLinkGetState"; + + 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 { + 8 => { + self.wait_word_list = ::std::option::Option::Some(is.read_bool()?); + }, + 16 => { + self.wait_word_pos = ::std::option::Option::Some(is.read_bool()?); + }, + 24 => { + self.wait_layout = ::std::option::Option::Some(is.read_bool()?); + }, + 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.wait_word_list { + my_size += 1 + 1; + } + if let Some(v) = self.wait_word_pos { + my_size += 1 + 1; + } + if let Some(v) = self.wait_layout { + my_size += 1 + 1; + } + 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.wait_word_list { + os.write_bool(1, v)?; + } + if let Some(v) = self.wait_word_pos { + os.write_bool(2, v)?; + } + if let Some(v) = self.wait_layout { + os.write_bool(3, 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() -> DebugLinkGetState { + DebugLinkGetState::new() + } + + fn clear(&mut self) { + self.wait_word_list = ::std::option::Option::None; + self.wait_word_pos = ::std::option::Option::None; + self.wait_layout = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugLinkGetState { + static instance: DebugLinkGetState = DebugLinkGetState { + wait_word_list: ::std::option::Option::None, + wait_word_pos: ::std::option::Option::None, + wait_layout: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugLinkGetState { + 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("DebugLinkGetState").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugLinkGetState { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkGetState { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.debug.DebugLinkState) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugLinkState { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkState.layout) + pub layout: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkState.pin) + pub pin: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkState.matrix) + pub matrix: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkState.mnemonic_secret) + pub mnemonic_secret: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkState.node) + pub node: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkState.passphrase_protection) + pub passphrase_protection: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkState.reset_word) + pub reset_word: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkState.reset_entropy) + pub reset_entropy: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkState.recovery_fake_word) + pub recovery_fake_word: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkState.recovery_word_pos) + pub recovery_word_pos: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkState.reset_word_pos) + pub reset_word_pos: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkState.mnemonic_type) + pub mnemonic_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkState.tokens) + pub tokens: ::std::vec::Vec<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.debug.DebugLinkState.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugLinkState { + fn default() -> &'a DebugLinkState { + ::default_instance() + } +} + +impl DebugLinkState { + pub fn new() -> DebugLinkState { + ::std::default::Default::default() + } + + // optional bytes layout = 1; + + pub fn layout(&self) -> &[u8] { + match self.layout.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_layout(&mut self) { + self.layout = ::std::option::Option::None; + } + + pub fn has_layout(&self) -> bool { + self.layout.is_some() + } + + // Param is passed by value, moved + pub fn set_layout(&mut self, v: ::std::vec::Vec) { + self.layout = ::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_layout(&mut self) -> &mut ::std::vec::Vec { + if self.layout.is_none() { + self.layout = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.layout.as_mut().unwrap() + } + + // Take field + pub fn take_layout(&mut self) -> ::std::vec::Vec { + self.layout.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional string pin = 2; + + pub fn pin(&self) -> &str { + match self.pin.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_pin(&mut self) { + self.pin = ::std::option::Option::None; + } + + pub fn has_pin(&self) -> bool { + self.pin.is_some() + } + + // Param is passed by value, moved + pub fn set_pin(&mut self, v: ::std::string::String) { + self.pin = ::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_pin(&mut self) -> &mut ::std::string::String { + if self.pin.is_none() { + self.pin = ::std::option::Option::Some(::std::string::String::new()); + } + self.pin.as_mut().unwrap() + } + + // Take field + pub fn take_pin(&mut self) -> ::std::string::String { + self.pin.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string matrix = 3; + + pub fn matrix(&self) -> &str { + match self.matrix.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_matrix(&mut self) { + self.matrix = ::std::option::Option::None; + } + + pub fn has_matrix(&self) -> bool { + self.matrix.is_some() + } + + // Param is passed by value, moved + pub fn set_matrix(&mut self, v: ::std::string::String) { + self.matrix = ::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_matrix(&mut self) -> &mut ::std::string::String { + if self.matrix.is_none() { + self.matrix = ::std::option::Option::Some(::std::string::String::new()); + } + self.matrix.as_mut().unwrap() + } + + // Take field + pub fn take_matrix(&mut self) -> ::std::string::String { + self.matrix.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bytes mnemonic_secret = 4; + + pub fn mnemonic_secret(&self) -> &[u8] { + match self.mnemonic_secret.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_mnemonic_secret(&mut self) { + self.mnemonic_secret = ::std::option::Option::None; + } + + pub fn has_mnemonic_secret(&self) -> bool { + self.mnemonic_secret.is_some() + } + + // Param is passed by value, moved + pub fn set_mnemonic_secret(&mut self, v: ::std::vec::Vec) { + self.mnemonic_secret = ::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_mnemonic_secret(&mut self) -> &mut ::std::vec::Vec { + if self.mnemonic_secret.is_none() { + self.mnemonic_secret = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.mnemonic_secret.as_mut().unwrap() + } + + // Take field + pub fn take_mnemonic_secret(&mut self) -> ::std::vec::Vec { + self.mnemonic_secret.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool passphrase_protection = 6; + + pub fn passphrase_protection(&self) -> bool { + self.passphrase_protection.unwrap_or(false) + } + + pub fn clear_passphrase_protection(&mut self) { + self.passphrase_protection = ::std::option::Option::None; + } + + pub fn has_passphrase_protection(&self) -> bool { + self.passphrase_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase_protection(&mut self, v: bool) { + self.passphrase_protection = ::std::option::Option::Some(v); + } + + // optional string reset_word = 7; + + pub fn reset_word(&self) -> &str { + match self.reset_word.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_reset_word(&mut self) { + self.reset_word = ::std::option::Option::None; + } + + pub fn has_reset_word(&self) -> bool { + self.reset_word.is_some() + } + + // Param is passed by value, moved + pub fn set_reset_word(&mut self, v: ::std::string::String) { + self.reset_word = ::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_reset_word(&mut self) -> &mut ::std::string::String { + if self.reset_word.is_none() { + self.reset_word = ::std::option::Option::Some(::std::string::String::new()); + } + self.reset_word.as_mut().unwrap() + } + + // Take field + pub fn take_reset_word(&mut self) -> ::std::string::String { + self.reset_word.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bytes reset_entropy = 8; + + pub fn reset_entropy(&self) -> &[u8] { + match self.reset_entropy.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_reset_entropy(&mut self) { + self.reset_entropy = ::std::option::Option::None; + } + + pub fn has_reset_entropy(&self) -> bool { + self.reset_entropy.is_some() + } + + // Param is passed by value, moved + pub fn set_reset_entropy(&mut self, v: ::std::vec::Vec) { + self.reset_entropy = ::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_reset_entropy(&mut self) -> &mut ::std::vec::Vec { + if self.reset_entropy.is_none() { + self.reset_entropy = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.reset_entropy.as_mut().unwrap() + } + + // Take field + pub fn take_reset_entropy(&mut self) -> ::std::vec::Vec { + self.reset_entropy.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional string recovery_fake_word = 9; + + pub fn recovery_fake_word(&self) -> &str { + match self.recovery_fake_word.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_recovery_fake_word(&mut self) { + self.recovery_fake_word = ::std::option::Option::None; + } + + pub fn has_recovery_fake_word(&self) -> bool { + self.recovery_fake_word.is_some() + } + + // Param is passed by value, moved + pub fn set_recovery_fake_word(&mut self, v: ::std::string::String) { + self.recovery_fake_word = ::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_recovery_fake_word(&mut self) -> &mut ::std::string::String { + if self.recovery_fake_word.is_none() { + self.recovery_fake_word = ::std::option::Option::Some(::std::string::String::new()); + } + self.recovery_fake_word.as_mut().unwrap() + } + + // Take field + pub fn take_recovery_fake_word(&mut self) -> ::std::string::String { + self.recovery_fake_word.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint32 recovery_word_pos = 10; + + pub fn recovery_word_pos(&self) -> u32 { + self.recovery_word_pos.unwrap_or(0) + } + + pub fn clear_recovery_word_pos(&mut self) { + self.recovery_word_pos = ::std::option::Option::None; + } + + pub fn has_recovery_word_pos(&self) -> bool { + self.recovery_word_pos.is_some() + } + + // Param is passed by value, moved + pub fn set_recovery_word_pos(&mut self, v: u32) { + self.recovery_word_pos = ::std::option::Option::Some(v); + } + + // optional uint32 reset_word_pos = 11; + + pub fn reset_word_pos(&self) -> u32 { + self.reset_word_pos.unwrap_or(0) + } + + pub fn clear_reset_word_pos(&mut self) { + self.reset_word_pos = ::std::option::Option::None; + } + + pub fn has_reset_word_pos(&self) -> bool { + self.reset_word_pos.is_some() + } + + // Param is passed by value, moved + pub fn set_reset_word_pos(&mut self, v: u32) { + self.reset_word_pos = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.management.BackupType mnemonic_type = 12; + + pub fn mnemonic_type(&self) -> super::messages_management::BackupType { + match self.mnemonic_type { + Some(e) => e.enum_value_or(super::messages_management::BackupType::Bip39), + None => super::messages_management::BackupType::Bip39, + } + } + + pub fn clear_mnemonic_type(&mut self) { + self.mnemonic_type = ::std::option::Option::None; + } + + pub fn has_mnemonic_type(&self) -> bool { + self.mnemonic_type.is_some() + } + + // Param is passed by value, moved + pub fn set_mnemonic_type(&mut self, v: super::messages_management::BackupType) { + self.mnemonic_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(13); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "layout", + |m: &DebugLinkState| { &m.layout }, + |m: &mut DebugLinkState| { &mut m.layout }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pin", + |m: &DebugLinkState| { &m.pin }, + |m: &mut DebugLinkState| { &mut m.pin }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "matrix", + |m: &DebugLinkState| { &m.matrix }, + |m: &mut DebugLinkState| { &mut m.matrix }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "mnemonic_secret", + |m: &DebugLinkState| { &m.mnemonic_secret }, + |m: &mut DebugLinkState| { &mut m.mnemonic_secret }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::messages_common::HDNodeType>( + "node", + |m: &DebugLinkState| { &m.node }, + |m: &mut DebugLinkState| { &mut m.node }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "passphrase_protection", + |m: &DebugLinkState| { &m.passphrase_protection }, + |m: &mut DebugLinkState| { &mut m.passphrase_protection }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "reset_word", + |m: &DebugLinkState| { &m.reset_word }, + |m: &mut DebugLinkState| { &mut m.reset_word }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "reset_entropy", + |m: &DebugLinkState| { &m.reset_entropy }, + |m: &mut DebugLinkState| { &mut m.reset_entropy }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "recovery_fake_word", + |m: &DebugLinkState| { &m.recovery_fake_word }, + |m: &mut DebugLinkState| { &mut m.recovery_fake_word }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "recovery_word_pos", + |m: &DebugLinkState| { &m.recovery_word_pos }, + |m: &mut DebugLinkState| { &mut m.recovery_word_pos }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "reset_word_pos", + |m: &DebugLinkState| { &m.reset_word_pos }, + |m: &mut DebugLinkState| { &mut m.reset_word_pos }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "mnemonic_type", + |m: &DebugLinkState| { &m.mnemonic_type }, + |m: &mut DebugLinkState| { &mut m.mnemonic_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "tokens", + |m: &DebugLinkState| { &m.tokens }, + |m: &mut DebugLinkState| { &mut m.tokens }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugLinkState", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugLinkState { + const NAME: &'static str = "DebugLinkState"; + + fn is_initialized(&self) -> bool { + for v in &self.node { + if !v.is_initialized() { + 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.layout = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.pin = ::std::option::Option::Some(is.read_string()?); + }, + 26 => { + self.matrix = ::std::option::Option::Some(is.read_string()?); + }, + 34 => { + self.mnemonic_secret = ::std::option::Option::Some(is.read_bytes()?); + }, + 42 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.node)?; + }, + 48 => { + self.passphrase_protection = ::std::option::Option::Some(is.read_bool()?); + }, + 58 => { + self.reset_word = ::std::option::Option::Some(is.read_string()?); + }, + 66 => { + self.reset_entropy = ::std::option::Option::Some(is.read_bytes()?); + }, + 74 => { + self.recovery_fake_word = ::std::option::Option::Some(is.read_string()?); + }, + 80 => { + self.recovery_word_pos = ::std::option::Option::Some(is.read_uint32()?); + }, + 88 => { + self.reset_word_pos = ::std::option::Option::Some(is.read_uint32()?); + }, + 96 => { + self.mnemonic_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 106 => { + self.tokens.push(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.layout.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.pin.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.matrix.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.mnemonic_secret.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.node.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.passphrase_protection { + my_size += 1 + 1; + } + if let Some(v) = self.reset_word.as_ref() { + my_size += ::protobuf::rt::string_size(7, &v); + } + if let Some(v) = self.reset_entropy.as_ref() { + my_size += ::protobuf::rt::bytes_size(8, &v); + } + if let Some(v) = self.recovery_fake_word.as_ref() { + my_size += ::protobuf::rt::string_size(9, &v); + } + if let Some(v) = self.recovery_word_pos { + my_size += ::protobuf::rt::uint32_size(10, v); + } + if let Some(v) = self.reset_word_pos { + my_size += ::protobuf::rt::uint32_size(11, v); + } + if let Some(v) = self.mnemonic_type { + my_size += ::protobuf::rt::int32_size(12, v.value()); + } + for value in &self.tokens { + my_size += ::protobuf::rt::string_size(13, &value); + }; + 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.layout.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.pin.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.matrix.as_ref() { + os.write_string(3, v)?; + } + if let Some(v) = self.mnemonic_secret.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.node.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + } + if let Some(v) = self.passphrase_protection { + os.write_bool(6, v)?; + } + if let Some(v) = self.reset_word.as_ref() { + os.write_string(7, v)?; + } + if let Some(v) = self.reset_entropy.as_ref() { + os.write_bytes(8, v)?; + } + if let Some(v) = self.recovery_fake_word.as_ref() { + os.write_string(9, v)?; + } + if let Some(v) = self.recovery_word_pos { + os.write_uint32(10, v)?; + } + if let Some(v) = self.reset_word_pos { + os.write_uint32(11, v)?; + } + if let Some(v) = self.mnemonic_type { + os.write_enum(12, ::protobuf::EnumOrUnknown::value(&v))?; + } + for v in &self.tokens { + os.write_string(13, &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() -> DebugLinkState { + DebugLinkState::new() + } + + fn clear(&mut self) { + self.layout = ::std::option::Option::None; + self.pin = ::std::option::Option::None; + self.matrix = ::std::option::Option::None; + self.mnemonic_secret = ::std::option::Option::None; + self.node.clear(); + self.passphrase_protection = ::std::option::Option::None; + self.reset_word = ::std::option::Option::None; + self.reset_entropy = ::std::option::Option::None; + self.recovery_fake_word = ::std::option::Option::None; + self.recovery_word_pos = ::std::option::Option::None; + self.reset_word_pos = ::std::option::Option::None; + self.mnemonic_type = ::std::option::Option::None; + self.tokens.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugLinkState { + static instance: DebugLinkState = DebugLinkState { + layout: ::std::option::Option::None, + pin: ::std::option::Option::None, + matrix: ::std::option::Option::None, + mnemonic_secret: ::std::option::Option::None, + node: ::protobuf::MessageField::none(), + passphrase_protection: ::std::option::Option::None, + reset_word: ::std::option::Option::None, + reset_entropy: ::std::option::Option::None, + recovery_fake_word: ::std::option::Option::None, + recovery_word_pos: ::std::option::Option::None, + reset_word_pos: ::std::option::Option::None, + mnemonic_type: ::std::option::Option::None, + tokens: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugLinkState { + 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("DebugLinkState").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugLinkState { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkState { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.debug.DebugLinkStop) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugLinkStop { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.debug.DebugLinkStop.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugLinkStop { + fn default() -> &'a DebugLinkStop { + ::default_instance() + } +} + +impl DebugLinkStop { + pub fn new() -> DebugLinkStop { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugLinkStop", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugLinkStop { + const NAME: &'static str = "DebugLinkStop"; + + 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 { + 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; + 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<()> { + 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() -> DebugLinkStop { + DebugLinkStop::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugLinkStop { + static instance: DebugLinkStop = DebugLinkStop { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugLinkStop { + 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("DebugLinkStop").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugLinkStop { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkStop { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.debug.DebugLinkLog) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugLinkLog { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkLog.level) + pub level: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkLog.bucket) + pub bucket: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkLog.text) + pub text: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.debug.DebugLinkLog.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugLinkLog { + fn default() -> &'a DebugLinkLog { + ::default_instance() + } +} + +impl DebugLinkLog { + pub fn new() -> DebugLinkLog { + ::std::default::Default::default() + } + + // optional uint32 level = 1; + + pub fn level(&self) -> u32 { + self.level.unwrap_or(0) + } + + pub fn clear_level(&mut self) { + self.level = ::std::option::Option::None; + } + + pub fn has_level(&self) -> bool { + self.level.is_some() + } + + // Param is passed by value, moved + pub fn set_level(&mut self, v: u32) { + self.level = ::std::option::Option::Some(v); + } + + // optional string bucket = 2; + + pub fn bucket(&self) -> &str { + match self.bucket.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_bucket(&mut self) { + self.bucket = ::std::option::Option::None; + } + + pub fn has_bucket(&self) -> bool { + self.bucket.is_some() + } + + // Param is passed by value, moved + pub fn set_bucket(&mut self, v: ::std::string::String) { + self.bucket = ::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_bucket(&mut self) -> &mut ::std::string::String { + if self.bucket.is_none() { + self.bucket = ::std::option::Option::Some(::std::string::String::new()); + } + self.bucket.as_mut().unwrap() + } + + // Take field + pub fn take_bucket(&mut self) -> ::std::string::String { + self.bucket.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string text = 3; + + pub fn text(&self) -> &str { + match self.text.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_text(&mut self) { + self.text = ::std::option::Option::None; + } + + pub fn has_text(&self) -> bool { + self.text.is_some() + } + + // Param is passed by value, moved + pub fn set_text(&mut self, v: ::std::string::String) { + self.text = ::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_text(&mut self) -> &mut ::std::string::String { + if self.text.is_none() { + self.text = ::std::option::Option::Some(::std::string::String::new()); + } + self.text.as_mut().unwrap() + } + + // Take field + pub fn take_text(&mut self) -> ::std::string::String { + self.text.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "level", + |m: &DebugLinkLog| { &m.level }, + |m: &mut DebugLinkLog| { &mut m.level }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "bucket", + |m: &DebugLinkLog| { &m.bucket }, + |m: &mut DebugLinkLog| { &mut m.bucket }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "text", + |m: &DebugLinkLog| { &m.text }, + |m: &mut DebugLinkLog| { &mut m.text }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugLinkLog", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugLinkLog { + const NAME: &'static str = "DebugLinkLog"; + + 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 { + 8 => { + self.level = ::std::option::Option::Some(is.read_uint32()?); + }, + 18 => { + self.bucket = ::std::option::Option::Some(is.read_string()?); + }, + 26 => { + self.text = ::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.level { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.bucket.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.text.as_ref() { + my_size += ::protobuf::rt::string_size(3, &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.level { + os.write_uint32(1, v)?; + } + if let Some(v) = self.bucket.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.text.as_ref() { + os.write_string(3, 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() -> DebugLinkLog { + DebugLinkLog::new() + } + + fn clear(&mut self) { + self.level = ::std::option::Option::None; + self.bucket = ::std::option::Option::None; + self.text = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugLinkLog { + static instance: DebugLinkLog = DebugLinkLog { + level: ::std::option::Option::None, + bucket: ::std::option::Option::None, + text: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugLinkLog { + 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("DebugLinkLog").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugLinkLog { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkLog { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.debug.DebugLinkMemoryRead) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugLinkMemoryRead { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkMemoryRead.address) + pub address: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkMemoryRead.length) + pub length: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.debug.DebugLinkMemoryRead.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugLinkMemoryRead { + fn default() -> &'a DebugLinkMemoryRead { + ::default_instance() + } +} + +impl DebugLinkMemoryRead { + pub fn new() -> DebugLinkMemoryRead { + ::std::default::Default::default() + } + + // optional uint32 address = 1; + + pub fn address(&self) -> u32 { + self.address.unwrap_or(0) + } + + 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: u32) { + self.address = ::std::option::Option::Some(v); + } + + // optional uint32 length = 2; + + pub fn length(&self) -> u32 { + self.length.unwrap_or(0) + } + + pub fn clear_length(&mut self) { + self.length = ::std::option::Option::None; + } + + pub fn has_length(&self) -> bool { + self.length.is_some() + } + + // Param is passed by value, moved + pub fn set_length(&mut self, v: u32) { + self.length = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "address", + |m: &DebugLinkMemoryRead| { &m.address }, + |m: &mut DebugLinkMemoryRead| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "length", + |m: &DebugLinkMemoryRead| { &m.length }, + |m: &mut DebugLinkMemoryRead| { &mut m.length }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugLinkMemoryRead", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugLinkMemoryRead { + const NAME: &'static str = "DebugLinkMemoryRead"; + + 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 { + 8 => { + self.address = ::std::option::Option::Some(is.read_uint32()?); + }, + 16 => { + self.length = ::std::option::Option::Some(is.read_uint32()?); + }, + 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 { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.length { + my_size += ::protobuf::rt::uint32_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.address { + os.write_uint32(1, v)?; + } + if let Some(v) = self.length { + os.write_uint32(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() -> DebugLinkMemoryRead { + DebugLinkMemoryRead::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.length = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugLinkMemoryRead { + static instance: DebugLinkMemoryRead = DebugLinkMemoryRead { + address: ::std::option::Option::None, + length: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugLinkMemoryRead { + 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("DebugLinkMemoryRead").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugLinkMemoryRead { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkMemoryRead { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.debug.DebugLinkMemory) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugLinkMemory { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkMemory.memory) + pub memory: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.debug.DebugLinkMemory.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugLinkMemory { + fn default() -> &'a DebugLinkMemory { + ::default_instance() + } +} + +impl DebugLinkMemory { + pub fn new() -> DebugLinkMemory { + ::std::default::Default::default() + } + + // optional bytes memory = 1; + + pub fn memory(&self) -> &[u8] { + match self.memory.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_memory(&mut self) { + self.memory = ::std::option::Option::None; + } + + pub fn has_memory(&self) -> bool { + self.memory.is_some() + } + + // Param is passed by value, moved + pub fn set_memory(&mut self, v: ::std::vec::Vec) { + self.memory = ::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_memory(&mut self) -> &mut ::std::vec::Vec { + if self.memory.is_none() { + self.memory = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.memory.as_mut().unwrap() + } + + // Take field + pub fn take_memory(&mut self) -> ::std::vec::Vec { + self.memory.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "memory", + |m: &DebugLinkMemory| { &m.memory }, + |m: &mut DebugLinkMemory| { &mut m.memory }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugLinkMemory", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugLinkMemory { + const NAME: &'static str = "DebugLinkMemory"; + + 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.memory = ::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.memory.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.memory.as_ref() { + os.write_bytes(1, 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() -> DebugLinkMemory { + DebugLinkMemory::new() + } + + fn clear(&mut self) { + self.memory = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugLinkMemory { + static instance: DebugLinkMemory = DebugLinkMemory { + memory: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugLinkMemory { + 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("DebugLinkMemory").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugLinkMemory { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkMemory { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.debug.DebugLinkMemoryWrite) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugLinkMemoryWrite { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkMemoryWrite.address) + pub address: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkMemoryWrite.memory) + pub memory: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkMemoryWrite.flash) + pub flash: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.debug.DebugLinkMemoryWrite.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugLinkMemoryWrite { + fn default() -> &'a DebugLinkMemoryWrite { + ::default_instance() + } +} + +impl DebugLinkMemoryWrite { + pub fn new() -> DebugLinkMemoryWrite { + ::std::default::Default::default() + } + + // optional uint32 address = 1; + + pub fn address(&self) -> u32 { + self.address.unwrap_or(0) + } + + 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: u32) { + self.address = ::std::option::Option::Some(v); + } + + // optional bytes memory = 2; + + pub fn memory(&self) -> &[u8] { + match self.memory.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_memory(&mut self) { + self.memory = ::std::option::Option::None; + } + + pub fn has_memory(&self) -> bool { + self.memory.is_some() + } + + // Param is passed by value, moved + pub fn set_memory(&mut self, v: ::std::vec::Vec) { + self.memory = ::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_memory(&mut self) -> &mut ::std::vec::Vec { + if self.memory.is_none() { + self.memory = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.memory.as_mut().unwrap() + } + + // Take field + pub fn take_memory(&mut self) -> ::std::vec::Vec { + self.memory.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool flash = 3; + + pub fn flash(&self) -> bool { + self.flash.unwrap_or(false) + } + + pub fn clear_flash(&mut self) { + self.flash = ::std::option::Option::None; + } + + pub fn has_flash(&self) -> bool { + self.flash.is_some() + } + + // Param is passed by value, moved + pub fn set_flash(&mut self, v: bool) { + self.flash = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &DebugLinkMemoryWrite| { &m.address }, + |m: &mut DebugLinkMemoryWrite| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "memory", + |m: &DebugLinkMemoryWrite| { &m.memory }, + |m: &mut DebugLinkMemoryWrite| { &mut m.memory }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "flash", + |m: &DebugLinkMemoryWrite| { &m.flash }, + |m: &mut DebugLinkMemoryWrite| { &mut m.flash }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugLinkMemoryWrite", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugLinkMemoryWrite { + const NAME: &'static str = "DebugLinkMemoryWrite"; + + 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 { + 8 => { + self.address = ::std::option::Option::Some(is.read_uint32()?); + }, + 18 => { + self.memory = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.flash = ::std::option::Option::Some(is.read_bool()?); + }, + 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 { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.memory.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.flash { + my_size += 1 + 1; + } + 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 { + os.write_uint32(1, v)?; + } + if let Some(v) = self.memory.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.flash { + os.write_bool(3, 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() -> DebugLinkMemoryWrite { + DebugLinkMemoryWrite::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.memory = ::std::option::Option::None; + self.flash = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugLinkMemoryWrite { + static instance: DebugLinkMemoryWrite = DebugLinkMemoryWrite { + address: ::std::option::Option::None, + memory: ::std::option::Option::None, + flash: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugLinkMemoryWrite { + 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("DebugLinkMemoryWrite").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugLinkMemoryWrite { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkMemoryWrite { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.debug.DebugLinkFlashErase) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugLinkFlashErase { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkFlashErase.sector) + pub sector: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.debug.DebugLinkFlashErase.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugLinkFlashErase { + fn default() -> &'a DebugLinkFlashErase { + ::default_instance() + } +} + +impl DebugLinkFlashErase { + pub fn new() -> DebugLinkFlashErase { + ::std::default::Default::default() + } + + // optional uint32 sector = 1; + + pub fn sector(&self) -> u32 { + self.sector.unwrap_or(0) + } + + pub fn clear_sector(&mut self) { + self.sector = ::std::option::Option::None; + } + + pub fn has_sector(&self) -> bool { + self.sector.is_some() + } + + // Param is passed by value, moved + pub fn set_sector(&mut self, v: u32) { + self.sector = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sector", + |m: &DebugLinkFlashErase| { &m.sector }, + |m: &mut DebugLinkFlashErase| { &mut m.sector }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugLinkFlashErase", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugLinkFlashErase { + const NAME: &'static str = "DebugLinkFlashErase"; + + 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 { + 8 => { + self.sector = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.sector { + my_size += ::protobuf::rt::uint32_size(1, 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.sector { + os.write_uint32(1, 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() -> DebugLinkFlashErase { + DebugLinkFlashErase::new() + } + + fn clear(&mut self) { + self.sector = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugLinkFlashErase { + static instance: DebugLinkFlashErase = DebugLinkFlashErase { + sector: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugLinkFlashErase { + 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("DebugLinkFlashErase").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugLinkFlashErase { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkFlashErase { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.debug.DebugLinkEraseSdCard) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugLinkEraseSdCard { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkEraseSdCard.format) + pub format: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.debug.DebugLinkEraseSdCard.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugLinkEraseSdCard { + fn default() -> &'a DebugLinkEraseSdCard { + ::default_instance() + } +} + +impl DebugLinkEraseSdCard { + pub fn new() -> DebugLinkEraseSdCard { + ::std::default::Default::default() + } + + // optional bool format = 1; + + pub fn format(&self) -> bool { + self.format.unwrap_or(false) + } + + pub fn clear_format(&mut self) { + self.format = ::std::option::Option::None; + } + + pub fn has_format(&self) -> bool { + self.format.is_some() + } + + // Param is passed by value, moved + pub fn set_format(&mut self, v: bool) { + self.format = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "format", + |m: &DebugLinkEraseSdCard| { &m.format }, + |m: &mut DebugLinkEraseSdCard| { &mut m.format }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugLinkEraseSdCard", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugLinkEraseSdCard { + const NAME: &'static str = "DebugLinkEraseSdCard"; + + 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 { + 8 => { + self.format = ::std::option::Option::Some(is.read_bool()?); + }, + 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.format { + my_size += 1 + 1; + } + 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.format { + os.write_bool(1, 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() -> DebugLinkEraseSdCard { + DebugLinkEraseSdCard::new() + } + + fn clear(&mut self) { + self.format = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugLinkEraseSdCard { + static instance: DebugLinkEraseSdCard = DebugLinkEraseSdCard { + format: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugLinkEraseSdCard { + 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("DebugLinkEraseSdCard").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugLinkEraseSdCard { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkEraseSdCard { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.debug.DebugLinkWatchLayout) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugLinkWatchLayout { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.debug.DebugLinkWatchLayout.watch) + pub watch: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.debug.DebugLinkWatchLayout.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugLinkWatchLayout { + fn default() -> &'a DebugLinkWatchLayout { + ::default_instance() + } +} + +impl DebugLinkWatchLayout { + pub fn new() -> DebugLinkWatchLayout { + ::std::default::Default::default() + } + + // optional bool watch = 1; + + pub fn watch(&self) -> bool { + self.watch.unwrap_or(false) + } + + pub fn clear_watch(&mut self) { + self.watch = ::std::option::Option::None; + } + + pub fn has_watch(&self) -> bool { + self.watch.is_some() + } + + // Param is passed by value, moved + pub fn set_watch(&mut self, v: bool) { + self.watch = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "watch", + |m: &DebugLinkWatchLayout| { &m.watch }, + |m: &mut DebugLinkWatchLayout| { &mut m.watch }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugLinkWatchLayout", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugLinkWatchLayout { + const NAME: &'static str = "DebugLinkWatchLayout"; + + 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 { + 8 => { + self.watch = ::std::option::Option::Some(is.read_bool()?); + }, + 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.watch { + my_size += 1 + 1; + } + 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.watch { + os.write_bool(1, 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() -> DebugLinkWatchLayout { + DebugLinkWatchLayout::new() + } + + fn clear(&mut self) { + self.watch = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugLinkWatchLayout { + static instance: DebugLinkWatchLayout = DebugLinkWatchLayout { + watch: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugLinkWatchLayout { + 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("DebugLinkWatchLayout").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugLinkWatchLayout { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkWatchLayout { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.debug.DebugLinkResetDebugEvents) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugLinkResetDebugEvents { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.debug.DebugLinkResetDebugEvents.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugLinkResetDebugEvents { + fn default() -> &'a DebugLinkResetDebugEvents { + ::default_instance() + } +} + +impl DebugLinkResetDebugEvents { + pub fn new() -> DebugLinkResetDebugEvents { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugLinkResetDebugEvents", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugLinkResetDebugEvents { + const NAME: &'static str = "DebugLinkResetDebugEvents"; + + 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 { + 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; + 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<()> { + 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() -> DebugLinkResetDebugEvents { + DebugLinkResetDebugEvents::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugLinkResetDebugEvents { + static instance: DebugLinkResetDebugEvents = DebugLinkResetDebugEvents { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugLinkResetDebugEvents { + 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("DebugLinkResetDebugEvents").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugLinkResetDebugEvents { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkResetDebugEvents { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x14messages-debug.proto\x12\x18hw.trezor.messages.debug\x1a\x0emessag\ + es.proto\x1a\x15messages-common.proto\x1a\x19messages-management.proto\"\ + \xb0\x04\n\x11DebugLinkDecision\x12O\n\x06button\x18\x01\x20\x01(\x0e27.\ + hw.trezor.messages.debug.DebugLinkDecision.DebugButtonR\x06button\x12U\n\ + \x05swipe\x18\x02\x20\x01(\x0e2?.hw.trezor.messages.debug.DebugLinkDecis\ + ion.DebugSwipeDirectionR\x05swipe\x12\x14\n\x05input\x18\x03\x20\x01(\tR\ + \x05input\x12\x0c\n\x01x\x18\x04\x20\x01(\rR\x01x\x12\x0c\n\x01y\x18\x05\ + \x20\x01(\rR\x01y\x12\x12\n\x04wait\x18\x06\x20\x01(\x08R\x04wait\x12\ + \x17\n\x07hold_ms\x18\x07\x20\x01(\rR\x06holdMs\x12h\n\x0fphysical_butto\ + n\x18\x08\x20\x01(\x0e2?.hw.trezor.messages.debug.DebugLinkDecision.Debu\ + gPhysicalButtonR\x0ephysicalButton\"<\n\x13DebugSwipeDirection\x12\x06\n\ + \x02UP\x10\0\x12\x08\n\x04DOWN\x10\x01\x12\x08\n\x04LEFT\x10\x02\x12\t\n\ + \x05RIGHT\x10\x03\"(\n\x0bDebugButton\x12\x06\n\x02NO\x10\0\x12\x07\n\ + \x03YES\x10\x01\x12\x08\n\x04INFO\x10\x02\"B\n\x13DebugPhysicalButton\ + \x12\x0c\n\x08LEFT_BTN\x10\0\x12\x0e\n\nMIDDLE_BTN\x10\x01\x12\r\n\tRIGH\ + T_BTN\x10\x02\")\n\x0fDebugLinkLayout\x12\x16\n\x06tokens\x18\x01\x20\ + \x03(\tR\x06tokens\"-\n\x15DebugLinkReseedRandom\x12\x14\n\x05value\x18\ + \x01\x20\x01(\rR\x05value\"j\n\x15DebugLinkRecordScreen\x12)\n\x10target\ + _directory\x18\x01\x20\x01(\tR\x0ftargetDirectory\x12&\n\rrefresh_index\ + \x18\x02\x20\x01(\r:\x010R\x0crefreshIndex\"~\n\x11DebugLinkGetState\x12\ + $\n\x0ewait_word_list\x18\x01\x20\x01(\x08R\x0cwaitWordList\x12\"\n\rwai\ + t_word_pos\x18\x02\x20\x01(\x08R\x0bwaitWordPos\x12\x1f\n\x0bwait_layout\ + \x18\x03\x20\x01(\x08R\nwaitLayout\"\x97\x04\n\x0eDebugLinkState\x12\x16\ + \n\x06layout\x18\x01\x20\x01(\x0cR\x06layout\x12\x10\n\x03pin\x18\x02\ + \x20\x01(\tR\x03pin\x12\x16\n\x06matrix\x18\x03\x20\x01(\tR\x06matrix\ + \x12'\n\x0fmnemonic_secret\x18\x04\x20\x01(\x0cR\x0emnemonicSecret\x129\ + \n\x04node\x18\x05\x20\x01(\x0b2%.hw.trezor.messages.common.HDNodeTypeR\ + \x04node\x123\n\x15passphrase_protection\x18\x06\x20\x01(\x08R\x14passph\ + raseProtection\x12\x1d\n\nreset_word\x18\x07\x20\x01(\tR\tresetWord\x12#\ + \n\rreset_entropy\x18\x08\x20\x01(\x0cR\x0cresetEntropy\x12,\n\x12recove\ + ry_fake_word\x18\t\x20\x01(\tR\x10recoveryFakeWord\x12*\n\x11recovery_wo\ + rd_pos\x18\n\x20\x01(\rR\x0frecoveryWordPos\x12$\n\x0ereset_word_pos\x18\ + \x0b\x20\x01(\rR\x0cresetWordPos\x12N\n\rmnemonic_type\x18\x0c\x20\x01(\ + \x0e2).hw.trezor.messages.management.BackupTypeR\x0cmnemonicType\x12\x16\ + \n\x06tokens\x18\r\x20\x03(\tR\x06tokens\"\x0f\n\rDebugLinkStop\"P\n\x0c\ + DebugLinkLog\x12\x14\n\x05level\x18\x01\x20\x01(\rR\x05level\x12\x16\n\ + \x06bucket\x18\x02\x20\x01(\tR\x06bucket\x12\x12\n\x04text\x18\x03\x20\ + \x01(\tR\x04text\"G\n\x13DebugLinkMemoryRead\x12\x18\n\x07address\x18\ + \x01\x20\x01(\rR\x07address\x12\x16\n\x06length\x18\x02\x20\x01(\rR\x06l\ + ength\")\n\x0fDebugLinkMemory\x12\x16\n\x06memory\x18\x01\x20\x01(\x0cR\ + \x06memory\"^\n\x14DebugLinkMemoryWrite\x12\x18\n\x07address\x18\x01\x20\ + \x01(\rR\x07address\x12\x16\n\x06memory\x18\x02\x20\x01(\x0cR\x06memory\ + \x12\x14\n\x05flash\x18\x03\x20\x01(\x08R\x05flash\"-\n\x13DebugLinkFlas\ + hErase\x12\x16\n\x06sector\x18\x01\x20\x01(\rR\x06sector\".\n\x14DebugLi\ + nkEraseSdCard\x12\x16\n\x06format\x18\x01\x20\x01(\x08R\x06format\",\n\ + \x14DebugLinkWatchLayout\x12\x14\n\x05watch\x18\x01\x20\x01(\x08R\x05wat\ + ch\"\x1b\n\x19DebugLinkResetDebugEventsB=\n#com.satoshilabs.trezor.lib.p\ + rotobufB\x12TrezorMessageDebug\x80\xa6\x1d\x01\ +"; + +/// `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(3); + deps.push(super::messages::file_descriptor().clone()); + deps.push(super::messages_common::file_descriptor().clone()); + deps.push(super::messages_management::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(15); + messages.push(DebugLinkDecision::generated_message_descriptor_data()); + messages.push(DebugLinkLayout::generated_message_descriptor_data()); + messages.push(DebugLinkReseedRandom::generated_message_descriptor_data()); + messages.push(DebugLinkRecordScreen::generated_message_descriptor_data()); + messages.push(DebugLinkGetState::generated_message_descriptor_data()); + messages.push(DebugLinkState::generated_message_descriptor_data()); + messages.push(DebugLinkStop::generated_message_descriptor_data()); + messages.push(DebugLinkLog::generated_message_descriptor_data()); + messages.push(DebugLinkMemoryRead::generated_message_descriptor_data()); + messages.push(DebugLinkMemory::generated_message_descriptor_data()); + messages.push(DebugLinkMemoryWrite::generated_message_descriptor_data()); + messages.push(DebugLinkFlashErase::generated_message_descriptor_data()); + messages.push(DebugLinkEraseSdCard::generated_message_descriptor_data()); + messages.push(DebugLinkWatchLayout::generated_message_descriptor_data()); + messages.push(DebugLinkResetDebugEvents::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(3); + enums.push(debug_link_decision::DebugSwipeDirection::generated_enum_descriptor_data()); + enums.push(debug_link_decision::DebugButton::generated_enum_descriptor_data()); + enums.push(debug_link_decision::DebugPhysicalButton::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_eos.rs b/wallet/trezor-client/src/protos/generated/messages_eos.rs new file mode 100644 index 0000000000..15a989f143 --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_eos.rs @@ -0,0 +1,6536 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-eos.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.eos.EosGetPublicKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EosGetPublicKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosGetPublicKey.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosGetPublicKey.show_display) + pub show_display: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosGetPublicKey.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosGetPublicKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EosGetPublicKey { + fn default() -> &'a EosGetPublicKey { + ::default_instance() + } +} + +impl EosGetPublicKey { + pub fn new() -> EosGetPublicKey { + ::std::default::Default::default() + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 3; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &EosGetPublicKey| { &m.address_n }, + |m: &mut EosGetPublicKey| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &EosGetPublicKey| { &m.show_display }, + |m: &mut EosGetPublicKey| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &EosGetPublicKey| { &m.chunkify }, + |m: &mut EosGetPublicKey| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosGetPublicKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EosGetPublicKey { + const NAME: &'static str = "EosGetPublicKey"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 24 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.show_display { + os.write_bool(2, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(3, 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() -> EosGetPublicKey { + EosGetPublicKey::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.show_display = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosGetPublicKey { + static instance: EosGetPublicKey = EosGetPublicKey { + address_n: ::std::vec::Vec::new(), + show_display: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EosGetPublicKey { + 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("EosGetPublicKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EosGetPublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EosGetPublicKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.eos.EosPublicKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EosPublicKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosPublicKey.wif_public_key) + pub wif_public_key: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosPublicKey.raw_public_key) + pub raw_public_key: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosPublicKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EosPublicKey { + fn default() -> &'a EosPublicKey { + ::default_instance() + } +} + +impl EosPublicKey { + pub fn new() -> EosPublicKey { + ::std::default::Default::default() + } + + // required string wif_public_key = 1; + + pub fn wif_public_key(&self) -> &str { + match self.wif_public_key.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_wif_public_key(&mut self) { + self.wif_public_key = ::std::option::Option::None; + } + + pub fn has_wif_public_key(&self) -> bool { + self.wif_public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_wif_public_key(&mut self, v: ::std::string::String) { + self.wif_public_key = ::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_wif_public_key(&mut self) -> &mut ::std::string::String { + if self.wif_public_key.is_none() { + self.wif_public_key = ::std::option::Option::Some(::std::string::String::new()); + } + self.wif_public_key.as_mut().unwrap() + } + + // Take field + pub fn take_wif_public_key(&mut self) -> ::std::string::String { + self.wif_public_key.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required bytes raw_public_key = 2; + + pub fn raw_public_key(&self) -> &[u8] { + match self.raw_public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_raw_public_key(&mut self) { + self.raw_public_key = ::std::option::Option::None; + } + + pub fn has_raw_public_key(&self) -> bool { + self.raw_public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_raw_public_key(&mut self, v: ::std::vec::Vec) { + self.raw_public_key = ::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_raw_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.raw_public_key.is_none() { + self.raw_public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.raw_public_key.as_mut().unwrap() + } + + // Take field + pub fn take_raw_public_key(&mut self) -> ::std::vec::Vec { + self.raw_public_key.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::<_, _>( + "wif_public_key", + |m: &EosPublicKey| { &m.wif_public_key }, + |m: &mut EosPublicKey| { &mut m.wif_public_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "raw_public_key", + |m: &EosPublicKey| { &m.raw_public_key }, + |m: &mut EosPublicKey| { &mut m.raw_public_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosPublicKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EosPublicKey { + const NAME: &'static str = "EosPublicKey"; + + fn is_initialized(&self) -> bool { + if self.wif_public_key.is_none() { + return false; + } + if self.raw_public_key.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.wif_public_key = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.raw_public_key = ::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.wif_public_key.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.raw_public_key.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.wif_public_key.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.raw_public_key.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() -> EosPublicKey { + EosPublicKey::new() + } + + fn clear(&mut self) { + self.wif_public_key = ::std::option::Option::None; + self.raw_public_key = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosPublicKey { + static instance: EosPublicKey = EosPublicKey { + wif_public_key: ::std::option::Option::None, + raw_public_key: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EosPublicKey { + 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("EosPublicKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EosPublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EosPublicKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.eos.EosSignTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EosSignTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosSignTx.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosSignTx.chain_id) + pub chain_id: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosSignTx.header) + pub header: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosSignTx.num_actions) + pub num_actions: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosSignTx.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosSignTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EosSignTx { + fn default() -> &'a EosSignTx { + ::default_instance() + } +} + +impl EosSignTx { + pub fn new() -> EosSignTx { + ::std::default::Default::default() + } + + // required bytes chain_id = 2; + + pub fn chain_id(&self) -> &[u8] { + match self.chain_id.as_ref() { + Some(v) => v, + None => &[], + } + } + + 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: ::std::vec::Vec) { + self.chain_id = ::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_chain_id(&mut self) -> &mut ::std::vec::Vec { + if self.chain_id.is_none() { + self.chain_id = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.chain_id.as_mut().unwrap() + } + + // Take field + pub fn take_chain_id(&mut self) -> ::std::vec::Vec { + self.chain_id.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint32 num_actions = 4; + + pub fn num_actions(&self) -> u32 { + self.num_actions.unwrap_or(0) + } + + pub fn clear_num_actions(&mut self) { + self.num_actions = ::std::option::Option::None; + } + + pub fn has_num_actions(&self) -> bool { + self.num_actions.is_some() + } + + // Param is passed by value, moved + pub fn set_num_actions(&mut self, v: u32) { + self.num_actions = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 5; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + 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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &EosSignTx| { &m.address_n }, + |m: &mut EosSignTx| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chain_id", + |m: &EosSignTx| { &m.chain_id }, + |m: &mut EosSignTx| { &mut m.chain_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, eos_sign_tx::EosTxHeader>( + "header", + |m: &EosSignTx| { &m.header }, + |m: &mut EosSignTx| { &mut m.header }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "num_actions", + |m: &EosSignTx| { &m.num_actions }, + |m: &mut EosSignTx| { &mut m.num_actions }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &EosSignTx| { &m.chunkify }, + |m: &mut EosSignTx| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosSignTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EosSignTx { + const NAME: &'static str = "EosSignTx"; + + fn is_initialized(&self) -> bool { + if self.chain_id.is_none() { + return false; + } + if self.header.is_none() { + return false; + } + if self.num_actions.is_none() { + return false; + } + for v in &self.header { + if !v.is_initialized() { + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.chain_id = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.header)?; + }, + 32 => { + self.num_actions = ::std::option::Option::Some(is.read_uint32()?); + }, + 40 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.chain_id.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.header.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.num_actions { + my_size += ::protobuf::rt::uint32_size(4, v); + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.chain_id.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.header.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.num_actions { + os.write_uint32(4, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(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() -> EosSignTx { + EosSignTx::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.chain_id = ::std::option::Option::None; + self.header.clear(); + self.num_actions = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosSignTx { + static instance: EosSignTx = EosSignTx { + address_n: ::std::vec::Vec::new(), + chain_id: ::std::option::Option::None, + header: ::protobuf::MessageField::none(), + num_actions: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EosSignTx { + 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("EosSignTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EosSignTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EosSignTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `EosSignTx` +pub mod eos_sign_tx { + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosSignTx.EosTxHeader) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosTxHeader { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosSignTx.EosTxHeader.expiration) + pub expiration: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosSignTx.EosTxHeader.ref_block_num) + pub ref_block_num: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosSignTx.EosTxHeader.ref_block_prefix) + pub ref_block_prefix: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosSignTx.EosTxHeader.max_net_usage_words) + pub max_net_usage_words: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosSignTx.EosTxHeader.max_cpu_usage_ms) + pub max_cpu_usage_ms: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosSignTx.EosTxHeader.delay_sec) + pub delay_sec: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosSignTx.EosTxHeader.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosTxHeader { + fn default() -> &'a EosTxHeader { + ::default_instance() + } + } + + impl EosTxHeader { + pub fn new() -> EosTxHeader { + ::std::default::Default::default() + } + + // required uint32 expiration = 1; + + pub fn expiration(&self) -> u32 { + self.expiration.unwrap_or(0) + } + + pub fn clear_expiration(&mut self) { + self.expiration = ::std::option::Option::None; + } + + pub fn has_expiration(&self) -> bool { + self.expiration.is_some() + } + + // Param is passed by value, moved + pub fn set_expiration(&mut self, v: u32) { + self.expiration = ::std::option::Option::Some(v); + } + + // required uint32 ref_block_num = 2; + + pub fn ref_block_num(&self) -> u32 { + self.ref_block_num.unwrap_or(0) + } + + pub fn clear_ref_block_num(&mut self) { + self.ref_block_num = ::std::option::Option::None; + } + + pub fn has_ref_block_num(&self) -> bool { + self.ref_block_num.is_some() + } + + // Param is passed by value, moved + pub fn set_ref_block_num(&mut self, v: u32) { + self.ref_block_num = ::std::option::Option::Some(v); + } + + // required uint32 ref_block_prefix = 3; + + pub fn ref_block_prefix(&self) -> u32 { + self.ref_block_prefix.unwrap_or(0) + } + + pub fn clear_ref_block_prefix(&mut self) { + self.ref_block_prefix = ::std::option::Option::None; + } + + pub fn has_ref_block_prefix(&self) -> bool { + self.ref_block_prefix.is_some() + } + + // Param is passed by value, moved + pub fn set_ref_block_prefix(&mut self, v: u32) { + self.ref_block_prefix = ::std::option::Option::Some(v); + } + + // required uint32 max_net_usage_words = 4; + + pub fn max_net_usage_words(&self) -> u32 { + self.max_net_usage_words.unwrap_or(0) + } + + pub fn clear_max_net_usage_words(&mut self) { + self.max_net_usage_words = ::std::option::Option::None; + } + + pub fn has_max_net_usage_words(&self) -> bool { + self.max_net_usage_words.is_some() + } + + // Param is passed by value, moved + pub fn set_max_net_usage_words(&mut self, v: u32) { + self.max_net_usage_words = ::std::option::Option::Some(v); + } + + // required uint32 max_cpu_usage_ms = 5; + + pub fn max_cpu_usage_ms(&self) -> u32 { + self.max_cpu_usage_ms.unwrap_or(0) + } + + pub fn clear_max_cpu_usage_ms(&mut self) { + self.max_cpu_usage_ms = ::std::option::Option::None; + } + + pub fn has_max_cpu_usage_ms(&self) -> bool { + self.max_cpu_usage_ms.is_some() + } + + // Param is passed by value, moved + pub fn set_max_cpu_usage_ms(&mut self, v: u32) { + self.max_cpu_usage_ms = ::std::option::Option::Some(v); + } + + // required uint32 delay_sec = 6; + + pub fn delay_sec(&self) -> u32 { + self.delay_sec.unwrap_or(0) + } + + pub fn clear_delay_sec(&mut self) { + self.delay_sec = ::std::option::Option::None; + } + + pub fn has_delay_sec(&self) -> bool { + self.delay_sec.is_some() + } + + // Param is passed by value, moved + pub fn set_delay_sec(&mut self, v: u32) { + self.delay_sec = ::std::option::Option::Some(v); + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "expiration", + |m: &EosTxHeader| { &m.expiration }, + |m: &mut EosTxHeader| { &mut m.expiration }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ref_block_num", + |m: &EosTxHeader| { &m.ref_block_num }, + |m: &mut EosTxHeader| { &mut m.ref_block_num }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ref_block_prefix", + |m: &EosTxHeader| { &m.ref_block_prefix }, + |m: &mut EosTxHeader| { &mut m.ref_block_prefix }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "max_net_usage_words", + |m: &EosTxHeader| { &m.max_net_usage_words }, + |m: &mut EosTxHeader| { &mut m.max_net_usage_words }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "max_cpu_usage_ms", + |m: &EosTxHeader| { &m.max_cpu_usage_ms }, + |m: &mut EosTxHeader| { &mut m.max_cpu_usage_ms }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "delay_sec", + |m: &EosTxHeader| { &m.delay_sec }, + |m: &mut EosTxHeader| { &mut m.delay_sec }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosSignTx.EosTxHeader", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosTxHeader { + const NAME: &'static str = "EosTxHeader"; + + fn is_initialized(&self) -> bool { + if self.expiration.is_none() { + return false; + } + if self.ref_block_num.is_none() { + return false; + } + if self.ref_block_prefix.is_none() { + return false; + } + if self.max_net_usage_words.is_none() { + return false; + } + if self.max_cpu_usage_ms.is_none() { + return false; + } + if self.delay_sec.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.expiration = ::std::option::Option::Some(is.read_uint32()?); + }, + 16 => { + self.ref_block_num = ::std::option::Option::Some(is.read_uint32()?); + }, + 24 => { + self.ref_block_prefix = ::std::option::Option::Some(is.read_uint32()?); + }, + 32 => { + self.max_net_usage_words = ::std::option::Option::Some(is.read_uint32()?); + }, + 40 => { + self.max_cpu_usage_ms = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.delay_sec = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.expiration { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.ref_block_num { + my_size += ::protobuf::rt::uint32_size(2, v); + } + if let Some(v) = self.ref_block_prefix { + my_size += ::protobuf::rt::uint32_size(3, v); + } + if let Some(v) = self.max_net_usage_words { + my_size += ::protobuf::rt::uint32_size(4, v); + } + if let Some(v) = self.max_cpu_usage_ms { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.delay_sec { + my_size += ::protobuf::rt::uint32_size(6, 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.expiration { + os.write_uint32(1, v)?; + } + if let Some(v) = self.ref_block_num { + os.write_uint32(2, v)?; + } + if let Some(v) = self.ref_block_prefix { + os.write_uint32(3, v)?; + } + if let Some(v) = self.max_net_usage_words { + os.write_uint32(4, v)?; + } + if let Some(v) = self.max_cpu_usage_ms { + os.write_uint32(5, v)?; + } + if let Some(v) = self.delay_sec { + os.write_uint32(6, 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() -> EosTxHeader { + EosTxHeader::new() + } + + fn clear(&mut self) { + self.expiration = ::std::option::Option::None; + self.ref_block_num = ::std::option::Option::None; + self.ref_block_prefix = ::std::option::Option::None; + self.max_net_usage_words = ::std::option::Option::None; + self.max_cpu_usage_ms = ::std::option::Option::None; + self.delay_sec = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosTxHeader { + static instance: EosTxHeader = EosTxHeader { + expiration: ::std::option::Option::None, + ref_block_num: ::std::option::Option::None, + ref_block_prefix: ::std::option::Option::None, + max_net_usage_words: ::std::option::Option::None, + max_cpu_usage_ms: ::std::option::Option::None, + delay_sec: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosTxHeader { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosSignTx.EosTxHeader").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosTxHeader { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosTxHeader { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EosTxActionRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionRequest.data_size) + pub data_size: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EosTxActionRequest { + fn default() -> &'a EosTxActionRequest { + ::default_instance() + } +} + +impl EosTxActionRequest { + pub fn new() -> EosTxActionRequest { + ::std::default::Default::default() + } + + // optional uint32 data_size = 1; + + pub fn data_size(&self) -> u32 { + self.data_size.unwrap_or(0) + } + + pub fn clear_data_size(&mut self) { + self.data_size = ::std::option::Option::None; + } + + pub fn has_data_size(&self) -> bool { + self.data_size.is_some() + } + + // Param is passed by value, moved + pub fn set_data_size(&mut self, v: u32) { + self.data_size = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data_size", + |m: &EosTxActionRequest| { &m.data_size }, + |m: &mut EosTxActionRequest| { &mut m.data_size }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EosTxActionRequest { + const NAME: &'static str = "EosTxActionRequest"; + + 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 { + 8 => { + self.data_size = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.data_size { + my_size += ::protobuf::rt::uint32_size(1, 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.data_size { + os.write_uint32(1, 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() -> EosTxActionRequest { + EosTxActionRequest::new() + } + + fn clear(&mut self) { + self.data_size = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosTxActionRequest { + static instance: EosTxActionRequest = EosTxActionRequest { + data_size: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EosTxActionRequest { + 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("EosTxActionRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EosTxActionRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EosTxActionRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EosTxActionAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.common) + pub common: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.transfer) + pub transfer: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.delegate) + pub delegate: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.undelegate) + pub undelegate: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.refund) + pub refund: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.buy_ram) + pub buy_ram: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.buy_ram_bytes) + pub buy_ram_bytes: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.sell_ram) + pub sell_ram: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.vote_producer) + pub vote_producer: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.update_auth) + pub update_auth: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.delete_auth) + pub delete_auth: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.link_auth) + pub link_auth: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.unlink_auth) + pub unlink_auth: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.new_account) + pub new_account: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.unknown) + pub unknown: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EosTxActionAck { + fn default() -> &'a EosTxActionAck { + ::default_instance() + } +} + +impl EosTxActionAck { + pub fn new() -> EosTxActionAck { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(15); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, eos_tx_action_ack::EosActionCommon>( + "common", + |m: &EosTxActionAck| { &m.common }, + |m: &mut EosTxActionAck| { &mut m.common }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, eos_tx_action_ack::EosActionTransfer>( + "transfer", + |m: &EosTxActionAck| { &m.transfer }, + |m: &mut EosTxActionAck| { &mut m.transfer }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, eos_tx_action_ack::EosActionDelegate>( + "delegate", + |m: &EosTxActionAck| { &m.delegate }, + |m: &mut EosTxActionAck| { &mut m.delegate }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, eos_tx_action_ack::EosActionUndelegate>( + "undelegate", + |m: &EosTxActionAck| { &m.undelegate }, + |m: &mut EosTxActionAck| { &mut m.undelegate }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, eos_tx_action_ack::EosActionRefund>( + "refund", + |m: &EosTxActionAck| { &m.refund }, + |m: &mut EosTxActionAck| { &mut m.refund }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, eos_tx_action_ack::EosActionBuyRam>( + "buy_ram", + |m: &EosTxActionAck| { &m.buy_ram }, + |m: &mut EosTxActionAck| { &mut m.buy_ram }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, eos_tx_action_ack::EosActionBuyRamBytes>( + "buy_ram_bytes", + |m: &EosTxActionAck| { &m.buy_ram_bytes }, + |m: &mut EosTxActionAck| { &mut m.buy_ram_bytes }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, eos_tx_action_ack::EosActionSellRam>( + "sell_ram", + |m: &EosTxActionAck| { &m.sell_ram }, + |m: &mut EosTxActionAck| { &mut m.sell_ram }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, eos_tx_action_ack::EosActionVoteProducer>( + "vote_producer", + |m: &EosTxActionAck| { &m.vote_producer }, + |m: &mut EosTxActionAck| { &mut m.vote_producer }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, eos_tx_action_ack::EosActionUpdateAuth>( + "update_auth", + |m: &EosTxActionAck| { &m.update_auth }, + |m: &mut EosTxActionAck| { &mut m.update_auth }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, eos_tx_action_ack::EosActionDeleteAuth>( + "delete_auth", + |m: &EosTxActionAck| { &m.delete_auth }, + |m: &mut EosTxActionAck| { &mut m.delete_auth }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, eos_tx_action_ack::EosActionLinkAuth>( + "link_auth", + |m: &EosTxActionAck| { &m.link_auth }, + |m: &mut EosTxActionAck| { &mut m.link_auth }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, eos_tx_action_ack::EosActionUnlinkAuth>( + "unlink_auth", + |m: &EosTxActionAck| { &m.unlink_auth }, + |m: &mut EosTxActionAck| { &mut m.unlink_auth }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, eos_tx_action_ack::EosActionNewAccount>( + "new_account", + |m: &EosTxActionAck| { &m.new_account }, + |m: &mut EosTxActionAck| { &mut m.new_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, eos_tx_action_ack::EosActionUnknown>( + "unknown", + |m: &EosTxActionAck| { &m.unknown }, + |m: &mut EosTxActionAck| { &mut m.unknown }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EosTxActionAck { + const NAME: &'static str = "EosTxActionAck"; + + fn is_initialized(&self) -> bool { + if self.common.is_none() { + return false; + } + for v in &self.common { + if !v.is_initialized() { + return false; + } + }; + for v in &self.transfer { + if !v.is_initialized() { + return false; + } + }; + for v in &self.delegate { + if !v.is_initialized() { + return false; + } + }; + for v in &self.undelegate { + if !v.is_initialized() { + return false; + } + }; + for v in &self.refund { + if !v.is_initialized() { + return false; + } + }; + for v in &self.buy_ram { + if !v.is_initialized() { + return false; + } + }; + for v in &self.buy_ram_bytes { + if !v.is_initialized() { + return false; + } + }; + for v in &self.sell_ram { + if !v.is_initialized() { + return false; + } + }; + for v in &self.vote_producer { + if !v.is_initialized() { + return false; + } + }; + for v in &self.update_auth { + if !v.is_initialized() { + return false; + } + }; + for v in &self.delete_auth { + if !v.is_initialized() { + return false; + } + }; + for v in &self.link_auth { + if !v.is_initialized() { + return false; + } + }; + for v in &self.unlink_auth { + if !v.is_initialized() { + return false; + } + }; + for v in &self.new_account { + if !v.is_initialized() { + return false; + } + }; + for v in &self.unknown { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.common)?; + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.transfer)?; + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.delegate)?; + }, + 34 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.undelegate)?; + }, + 42 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.refund)?; + }, + 50 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.buy_ram)?; + }, + 58 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.buy_ram_bytes)?; + }, + 66 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.sell_ram)?; + }, + 74 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.vote_producer)?; + }, + 82 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.update_auth)?; + }, + 90 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.delete_auth)?; + }, + 98 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.link_auth)?; + }, + 106 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.unlink_auth)?; + }, + 114 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.new_account)?; + }, + 122 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.unknown)?; + }, + 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.common.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.transfer.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.delegate.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.undelegate.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.refund.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.buy_ram.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.buy_ram_bytes.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.sell_ram.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.vote_producer.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.update_auth.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.delete_auth.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.link_auth.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.unlink_auth.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.new_account.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.unknown.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.common.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.transfer.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + if let Some(v) = self.delegate.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.undelegate.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + } + if let Some(v) = self.refund.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + } + if let Some(v) = self.buy_ram.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(6, v, os)?; + } + if let Some(v) = self.buy_ram_bytes.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(7, v, os)?; + } + if let Some(v) = self.sell_ram.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(8, v, os)?; + } + if let Some(v) = self.vote_producer.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(9, v, os)?; + } + if let Some(v) = self.update_auth.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(10, v, os)?; + } + if let Some(v) = self.delete_auth.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(11, v, os)?; + } + if let Some(v) = self.link_auth.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(12, v, os)?; + } + if let Some(v) = self.unlink_auth.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(13, v, os)?; + } + if let Some(v) = self.new_account.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(14, v, os)?; + } + if let Some(v) = self.unknown.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(15, v, os)?; + } + 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() -> EosTxActionAck { + EosTxActionAck::new() + } + + fn clear(&mut self) { + self.common.clear(); + self.transfer.clear(); + self.delegate.clear(); + self.undelegate.clear(); + self.refund.clear(); + self.buy_ram.clear(); + self.buy_ram_bytes.clear(); + self.sell_ram.clear(); + self.vote_producer.clear(); + self.update_auth.clear(); + self.delete_auth.clear(); + self.link_auth.clear(); + self.unlink_auth.clear(); + self.new_account.clear(); + self.unknown.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosTxActionAck { + static instance: EosTxActionAck = EosTxActionAck { + common: ::protobuf::MessageField::none(), + transfer: ::protobuf::MessageField::none(), + delegate: ::protobuf::MessageField::none(), + undelegate: ::protobuf::MessageField::none(), + refund: ::protobuf::MessageField::none(), + buy_ram: ::protobuf::MessageField::none(), + buy_ram_bytes: ::protobuf::MessageField::none(), + sell_ram: ::protobuf::MessageField::none(), + vote_producer: ::protobuf::MessageField::none(), + update_auth: ::protobuf::MessageField::none(), + delete_auth: ::protobuf::MessageField::none(), + link_auth: ::protobuf::MessageField::none(), + unlink_auth: ::protobuf::MessageField::none(), + new_account: ::protobuf::MessageField::none(), + unknown: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EosTxActionAck { + 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("EosTxActionAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EosTxActionAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EosTxActionAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `EosTxActionAck` +pub mod eos_tx_action_ack { + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosAsset) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosAsset { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosAsset.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosAsset.symbol) + pub symbol: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosAsset.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosAsset { + fn default() -> &'a EosAsset { + ::default_instance() + } + } + + impl EosAsset { + pub fn new() -> EosAsset { + ::std::default::Default::default() + } + + // required sint64 amount = 1; + + pub fn amount(&self) -> i64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: i64) { + self.amount = ::std::option::Option::Some(v); + } + + // required uint64 symbol = 2; + + pub fn symbol(&self) -> u64 { + self.symbol.unwrap_or(0) + } + + 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: u64) { + self.symbol = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "amount", + |m: &EosAsset| { &m.amount }, + |m: &mut EosAsset| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "symbol", + |m: &EosAsset| { &m.symbol }, + |m: &mut EosAsset| { &mut m.symbol }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosAsset", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosAsset { + const NAME: &'static str = "EosAsset"; + + fn is_initialized(&self) -> bool { + if self.amount.is_none() { + return false; + } + if self.symbol.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.amount = ::std::option::Option::Some(is.read_sint64()?); + }, + 16 => { + self.symbol = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.amount { + my_size += ::protobuf::rt::sint64_size(1, v); + } + if let Some(v) = self.symbol { + my_size += ::protobuf::rt::uint64_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.amount { + os.write_sint64(1, v)?; + } + if let Some(v) = self.symbol { + os.write_uint64(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() -> EosAsset { + EosAsset::new() + } + + fn clear(&mut self) { + self.amount = ::std::option::Option::None; + self.symbol = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosAsset { + static instance: EosAsset = EosAsset { + amount: ::std::option::Option::None, + symbol: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosAsset { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosAsset").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosAsset { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosAsset { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosPermissionLevel) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosPermissionLevel { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosPermissionLevel.actor) + pub actor: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosPermissionLevel.permission) + pub permission: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosPermissionLevel.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosPermissionLevel { + fn default() -> &'a EosPermissionLevel { + ::default_instance() + } + } + + impl EosPermissionLevel { + pub fn new() -> EosPermissionLevel { + ::std::default::Default::default() + } + + // required uint64 actor = 1; + + pub fn actor(&self) -> u64 { + self.actor.unwrap_or(0) + } + + pub fn clear_actor(&mut self) { + self.actor = ::std::option::Option::None; + } + + pub fn has_actor(&self) -> bool { + self.actor.is_some() + } + + // Param is passed by value, moved + pub fn set_actor(&mut self, v: u64) { + self.actor = ::std::option::Option::Some(v); + } + + // required uint64 permission = 2; + + pub fn permission(&self) -> u64 { + self.permission.unwrap_or(0) + } + + pub fn clear_permission(&mut self) { + self.permission = ::std::option::Option::None; + } + + pub fn has_permission(&self) -> bool { + self.permission.is_some() + } + + // Param is passed by value, moved + pub fn set_permission(&mut self, v: u64) { + self.permission = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "actor", + |m: &EosPermissionLevel| { &m.actor }, + |m: &mut EosPermissionLevel| { &mut m.actor }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "permission", + |m: &EosPermissionLevel| { &m.permission }, + |m: &mut EosPermissionLevel| { &mut m.permission }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosPermissionLevel", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosPermissionLevel { + const NAME: &'static str = "EosPermissionLevel"; + + fn is_initialized(&self) -> bool { + if self.actor.is_none() { + return false; + } + if self.permission.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.actor = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.permission = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.actor { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.permission { + my_size += ::protobuf::rt::uint64_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.actor { + os.write_uint64(1, v)?; + } + if let Some(v) = self.permission { + os.write_uint64(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() -> EosPermissionLevel { + EosPermissionLevel::new() + } + + fn clear(&mut self) { + self.actor = ::std::option::Option::None; + self.permission = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosPermissionLevel { + static instance: EosPermissionLevel = EosPermissionLevel { + actor: ::std::option::Option::None, + permission: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosPermissionLevel { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosPermissionLevel").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosPermissionLevel { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosPermissionLevel { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosAuthorizationKey) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosAuthorizationKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosAuthorizationKey.type) + pub type_: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosAuthorizationKey.key) + pub key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosAuthorizationKey.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosAuthorizationKey.weight) + pub weight: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosAuthorizationKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosAuthorizationKey { + fn default() -> &'a EosAuthorizationKey { + ::default_instance() + } + } + + impl EosAuthorizationKey { + pub fn new() -> EosAuthorizationKey { + ::std::default::Default::default() + } + + // required uint32 type = 1; + + pub fn type_(&self) -> u32 { + self.type_.unwrap_or(0) + } + + pub fn clear_type_(&mut self) { + self.type_ = ::std::option::Option::None; + } + + pub fn has_type(&self) -> bool { + self.type_.is_some() + } + + // Param is passed by value, moved + pub fn set_type(&mut self, v: u32) { + self.type_ = ::std::option::Option::Some(v); + } + + // optional bytes key = 2; + + pub fn key(&self) -> &[u8] { + match self.key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_key(&mut self) { + self.key = ::std::option::Option::None; + } + + pub fn has_key(&self) -> bool { + self.key.is_some() + } + + // Param is passed by value, moved + pub fn set_key(&mut self, v: ::std::vec::Vec) { + self.key = ::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_key(&mut self) -> &mut ::std::vec::Vec { + if self.key.is_none() { + self.key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.key.as_mut().unwrap() + } + + // Take field + pub fn take_key(&mut self) -> ::std::vec::Vec { + self.key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint32 weight = 4; + + pub fn weight(&self) -> u32 { + self.weight.unwrap_or(0) + } + + pub fn clear_weight(&mut self) { + self.weight = ::std::option::Option::None; + } + + pub fn has_weight(&self) -> bool { + self.weight.is_some() + } + + // Param is passed by value, moved + pub fn set_weight(&mut self, v: u32) { + self.weight = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "type", + |m: &EosAuthorizationKey| { &m.type_ }, + |m: &mut EosAuthorizationKey| { &mut m.type_ }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "key", + |m: &EosAuthorizationKey| { &m.key }, + |m: &mut EosAuthorizationKey| { &mut m.key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &EosAuthorizationKey| { &m.address_n }, + |m: &mut EosAuthorizationKey| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "weight", + |m: &EosAuthorizationKey| { &m.weight }, + |m: &mut EosAuthorizationKey| { &mut m.weight }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosAuthorizationKey", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosAuthorizationKey { + const NAME: &'static str = "EosAuthorizationKey"; + + fn is_initialized(&self) -> bool { + if self.type_.is_none() { + return false; + } + if self.weight.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.type_ = ::std::option::Option::Some(is.read_uint32()?); + }, + 18 => { + self.key = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 24 => { + self.address_n.push(is.read_uint32()?); + }, + 32 => { + self.weight = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.type_ { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.key.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(3, *value); + }; + if let Some(v) = self.weight { + my_size += ::protobuf::rt::uint32_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.type_ { + os.write_uint32(1, v)?; + } + if let Some(v) = self.key.as_ref() { + os.write_bytes(2, v)?; + } + for v in &self.address_n { + os.write_uint32(3, *v)?; + }; + if let Some(v) = self.weight { + os.write_uint32(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() -> EosAuthorizationKey { + EosAuthorizationKey::new() + } + + fn clear(&mut self) { + self.type_ = ::std::option::Option::None; + self.key = ::std::option::Option::None; + self.address_n.clear(); + self.weight = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosAuthorizationKey { + static instance: EosAuthorizationKey = EosAuthorizationKey { + type_: ::std::option::Option::None, + key: ::std::option::Option::None, + address_n: ::std::vec::Vec::new(), + weight: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosAuthorizationKey { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosAuthorizationKey").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosAuthorizationKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosAuthorizationKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosAuthorizationAccount) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosAuthorizationAccount { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosAuthorizationAccount.account) + pub account: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosAuthorizationAccount.weight) + pub weight: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosAuthorizationAccount.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosAuthorizationAccount { + fn default() -> &'a EosAuthorizationAccount { + ::default_instance() + } + } + + impl EosAuthorizationAccount { + pub fn new() -> EosAuthorizationAccount { + ::std::default::Default::default() + } + + // required uint32 weight = 2; + + pub fn weight(&self) -> u32 { + self.weight.unwrap_or(0) + } + + pub fn clear_weight(&mut self) { + self.weight = ::std::option::Option::None; + } + + pub fn has_weight(&self) -> bool { + self.weight.is_some() + } + + // Param is passed by value, moved + pub fn set_weight(&mut self, v: u32) { + self.weight = ::std::option::Option::Some(v); + } + + pub(in super) 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_message_field_accessor::<_, EosPermissionLevel>( + "account", + |m: &EosAuthorizationAccount| { &m.account }, + |m: &mut EosAuthorizationAccount| { &mut m.account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "weight", + |m: &EosAuthorizationAccount| { &m.weight }, + |m: &mut EosAuthorizationAccount| { &mut m.weight }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosAuthorizationAccount", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosAuthorizationAccount { + const NAME: &'static str = "EosAuthorizationAccount"; + + fn is_initialized(&self) -> bool { + if self.account.is_none() { + return false; + } + if self.weight.is_none() { + return false; + } + for v in &self.account { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.account)?; + }, + 16 => { + self.weight = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.account.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.weight { + my_size += ::protobuf::rt::uint32_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.account.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.weight { + os.write_uint32(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() -> EosAuthorizationAccount { + EosAuthorizationAccount::new() + } + + fn clear(&mut self) { + self.account.clear(); + self.weight = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosAuthorizationAccount { + static instance: EosAuthorizationAccount = EosAuthorizationAccount { + account: ::protobuf::MessageField::none(), + weight: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosAuthorizationAccount { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosAuthorizationAccount").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosAuthorizationAccount { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosAuthorizationAccount { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosAuthorizationWait) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosAuthorizationWait { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosAuthorizationWait.wait_sec) + pub wait_sec: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosAuthorizationWait.weight) + pub weight: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosAuthorizationWait.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosAuthorizationWait { + fn default() -> &'a EosAuthorizationWait { + ::default_instance() + } + } + + impl EosAuthorizationWait { + pub fn new() -> EosAuthorizationWait { + ::std::default::Default::default() + } + + // required uint32 wait_sec = 1; + + pub fn wait_sec(&self) -> u32 { + self.wait_sec.unwrap_or(0) + } + + pub fn clear_wait_sec(&mut self) { + self.wait_sec = ::std::option::Option::None; + } + + pub fn has_wait_sec(&self) -> bool { + self.wait_sec.is_some() + } + + // Param is passed by value, moved + pub fn set_wait_sec(&mut self, v: u32) { + self.wait_sec = ::std::option::Option::Some(v); + } + + // required uint32 weight = 2; + + pub fn weight(&self) -> u32 { + self.weight.unwrap_or(0) + } + + pub fn clear_weight(&mut self) { + self.weight = ::std::option::Option::None; + } + + pub fn has_weight(&self) -> bool { + self.weight.is_some() + } + + // Param is passed by value, moved + pub fn set_weight(&mut self, v: u32) { + self.weight = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "wait_sec", + |m: &EosAuthorizationWait| { &m.wait_sec }, + |m: &mut EosAuthorizationWait| { &mut m.wait_sec }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "weight", + |m: &EosAuthorizationWait| { &m.weight }, + |m: &mut EosAuthorizationWait| { &mut m.weight }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosAuthorizationWait", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosAuthorizationWait { + const NAME: &'static str = "EosAuthorizationWait"; + + fn is_initialized(&self) -> bool { + if self.wait_sec.is_none() { + return false; + } + if self.weight.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.wait_sec = ::std::option::Option::Some(is.read_uint32()?); + }, + 16 => { + self.weight = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.wait_sec { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.weight { + my_size += ::protobuf::rt::uint32_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.wait_sec { + os.write_uint32(1, v)?; + } + if let Some(v) = self.weight { + os.write_uint32(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() -> EosAuthorizationWait { + EosAuthorizationWait::new() + } + + fn clear(&mut self) { + self.wait_sec = ::std::option::Option::None; + self.weight = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosAuthorizationWait { + static instance: EosAuthorizationWait = EosAuthorizationWait { + wait_sec: ::std::option::Option::None, + weight: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosAuthorizationWait { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosAuthorizationWait").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosAuthorizationWait { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosAuthorizationWait { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosAuthorization) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosAuthorization { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosAuthorization.threshold) + pub threshold: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosAuthorization.keys) + pub keys: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosAuthorization.accounts) + pub accounts: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosAuthorization.waits) + pub waits: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosAuthorization.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosAuthorization { + fn default() -> &'a EosAuthorization { + ::default_instance() + } + } + + impl EosAuthorization { + pub fn new() -> EosAuthorization { + ::std::default::Default::default() + } + + // required uint32 threshold = 1; + + pub fn threshold(&self) -> u32 { + self.threshold.unwrap_or(0) + } + + pub fn clear_threshold(&mut self) { + self.threshold = ::std::option::Option::None; + } + + pub fn has_threshold(&self) -> bool { + self.threshold.is_some() + } + + // Param is passed by value, moved + pub fn set_threshold(&mut self, v: u32) { + self.threshold = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "threshold", + |m: &EosAuthorization| { &m.threshold }, + |m: &mut EosAuthorization| { &mut m.threshold }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "keys", + |m: &EosAuthorization| { &m.keys }, + |m: &mut EosAuthorization| { &mut m.keys }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "accounts", + |m: &EosAuthorization| { &m.accounts }, + |m: &mut EosAuthorization| { &mut m.accounts }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "waits", + |m: &EosAuthorization| { &m.waits }, + |m: &mut EosAuthorization| { &mut m.waits }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosAuthorization", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosAuthorization { + const NAME: &'static str = "EosAuthorization"; + + fn is_initialized(&self) -> bool { + if self.threshold.is_none() { + return false; + } + for v in &self.keys { + if !v.is_initialized() { + return false; + } + }; + for v in &self.accounts { + if !v.is_initialized() { + return false; + } + }; + for v in &self.waits { + if !v.is_initialized() { + 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.threshold = ::std::option::Option::Some(is.read_uint32()?); + }, + 18 => { + self.keys.push(is.read_message()?); + }, + 26 => { + self.accounts.push(is.read_message()?); + }, + 34 => { + self.waits.push(is.read_message()?); + }, + 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.threshold { + my_size += ::protobuf::rt::uint32_size(1, v); + } + for value in &self.keys { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + for value in &self.accounts { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + for value in &self.waits { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + 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.threshold { + os.write_uint32(1, v)?; + } + for v in &self.keys { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + }; + for v in &self.accounts { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + }; + for v in &self.waits { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + }; + 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() -> EosAuthorization { + EosAuthorization::new() + } + + fn clear(&mut self) { + self.threshold = ::std::option::Option::None; + self.keys.clear(); + self.accounts.clear(); + self.waits.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosAuthorization { + static instance: EosAuthorization = EosAuthorization { + threshold: ::std::option::Option::None, + keys: ::std::vec::Vec::new(), + accounts: ::std::vec::Vec::new(), + waits: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosAuthorization { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosAuthorization").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosAuthorization { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosAuthorization { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosActionCommon) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosActionCommon { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionCommon.account) + pub account: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionCommon.name) + pub name: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionCommon.authorization) + pub authorization: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosActionCommon.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosActionCommon { + fn default() -> &'a EosActionCommon { + ::default_instance() + } + } + + impl EosActionCommon { + pub fn new() -> EosActionCommon { + ::std::default::Default::default() + } + + // required uint64 account = 1; + + pub fn account(&self) -> u64 { + self.account.unwrap_or(0) + } + + pub fn clear_account(&mut self) { + self.account = ::std::option::Option::None; + } + + pub fn has_account(&self) -> bool { + self.account.is_some() + } + + // Param is passed by value, moved + pub fn set_account(&mut self, v: u64) { + self.account = ::std::option::Option::Some(v); + } + + // required uint64 name = 2; + + pub fn name(&self) -> u64 { + self.name.unwrap_or(0) + } + + 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: u64) { + self.name = ::std::option::Option::Some(v); + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "account", + |m: &EosActionCommon| { &m.account }, + |m: &mut EosActionCommon| { &mut m.account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "name", + |m: &EosActionCommon| { &m.name }, + |m: &mut EosActionCommon| { &mut m.name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "authorization", + |m: &EosActionCommon| { &m.authorization }, + |m: &mut EosActionCommon| { &mut m.authorization }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosActionCommon", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosActionCommon { + const NAME: &'static str = "EosActionCommon"; + + fn is_initialized(&self) -> bool { + if self.account.is_none() { + return false; + } + if self.name.is_none() { + return false; + } + for v in &self.authorization { + if !v.is_initialized() { + 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.account = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.name = ::std::option::Option::Some(is.read_uint64()?); + }, + 26 => { + self.authorization.push(is.read_message()?); + }, + 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.account { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.name { + my_size += ::protobuf::rt::uint64_size(2, v); + } + for value in &self.authorization { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + 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.account { + os.write_uint64(1, v)?; + } + if let Some(v) = self.name { + os.write_uint64(2, v)?; + } + for v in &self.authorization { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + }; + 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() -> EosActionCommon { + EosActionCommon::new() + } + + fn clear(&mut self) { + self.account = ::std::option::Option::None; + self.name = ::std::option::Option::None; + self.authorization.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosActionCommon { + static instance: EosActionCommon = EosActionCommon { + account: ::std::option::Option::None, + name: ::std::option::Option::None, + authorization: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosActionCommon { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosActionCommon").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosActionCommon { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosActionCommon { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosActionTransfer) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosActionTransfer { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionTransfer.sender) + pub sender: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionTransfer.receiver) + pub receiver: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionTransfer.quantity) + pub quantity: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionTransfer.memo) + pub memo: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosActionTransfer.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosActionTransfer { + fn default() -> &'a EosActionTransfer { + ::default_instance() + } + } + + impl EosActionTransfer { + pub fn new() -> EosActionTransfer { + ::std::default::Default::default() + } + + // required uint64 sender = 1; + + pub fn sender(&self) -> u64 { + self.sender.unwrap_or(0) + } + + pub fn clear_sender(&mut self) { + self.sender = ::std::option::Option::None; + } + + pub fn has_sender(&self) -> bool { + self.sender.is_some() + } + + // Param is passed by value, moved + pub fn set_sender(&mut self, v: u64) { + self.sender = ::std::option::Option::Some(v); + } + + // required uint64 receiver = 2; + + pub fn receiver(&self) -> u64 { + self.receiver.unwrap_or(0) + } + + pub fn clear_receiver(&mut self) { + self.receiver = ::std::option::Option::None; + } + + pub fn has_receiver(&self) -> bool { + self.receiver.is_some() + } + + // Param is passed by value, moved + pub fn set_receiver(&mut self, v: u64) { + self.receiver = ::std::option::Option::Some(v); + } + + // required string memo = 4; + + pub fn memo(&self) -> &str { + match self.memo.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_memo(&mut self) { + self.memo = ::std::option::Option::None; + } + + pub fn has_memo(&self) -> bool { + self.memo.is_some() + } + + // Param is passed by value, moved + pub fn set_memo(&mut self, v: ::std::string::String) { + self.memo = ::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_memo(&mut self) -> &mut ::std::string::String { + if self.memo.is_none() { + self.memo = ::std::option::Option::Some(::std::string::String::new()); + } + self.memo.as_mut().unwrap() + } + + // Take field + pub fn take_memo(&mut self) -> ::std::string::String { + self.memo.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub(in super) 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::<_, _>( + "sender", + |m: &EosActionTransfer| { &m.sender }, + |m: &mut EosActionTransfer| { &mut m.sender }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "receiver", + |m: &EosActionTransfer| { &m.receiver }, + |m: &mut EosActionTransfer| { &mut m.receiver }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, EosAsset>( + "quantity", + |m: &EosActionTransfer| { &m.quantity }, + |m: &mut EosActionTransfer| { &mut m.quantity }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "memo", + |m: &EosActionTransfer| { &m.memo }, + |m: &mut EosActionTransfer| { &mut m.memo }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosActionTransfer", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosActionTransfer { + const NAME: &'static str = "EosActionTransfer"; + + fn is_initialized(&self) -> bool { + if self.sender.is_none() { + return false; + } + if self.receiver.is_none() { + return false; + } + if self.quantity.is_none() { + return false; + } + if self.memo.is_none() { + return false; + } + for v in &self.quantity { + if !v.is_initialized() { + 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.sender = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.receiver = ::std::option::Option::Some(is.read_uint64()?); + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.quantity)?; + }, + 34 => { + self.memo = ::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.sender { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.receiver { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.quantity.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.memo.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.sender { + os.write_uint64(1, v)?; + } + if let Some(v) = self.receiver { + os.write_uint64(2, v)?; + } + if let Some(v) = self.quantity.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.memo.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() -> EosActionTransfer { + EosActionTransfer::new() + } + + fn clear(&mut self) { + self.sender = ::std::option::Option::None; + self.receiver = ::std::option::Option::None; + self.quantity.clear(); + self.memo = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosActionTransfer { + static instance: EosActionTransfer = EosActionTransfer { + sender: ::std::option::Option::None, + receiver: ::std::option::Option::None, + quantity: ::protobuf::MessageField::none(), + memo: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosActionTransfer { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosActionTransfer").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosActionTransfer { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosActionTransfer { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosActionDelegate) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosActionDelegate { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionDelegate.sender) + pub sender: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionDelegate.receiver) + pub receiver: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionDelegate.net_quantity) + pub net_quantity: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionDelegate.cpu_quantity) + pub cpu_quantity: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionDelegate.transfer) + pub transfer: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosActionDelegate.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosActionDelegate { + fn default() -> &'a EosActionDelegate { + ::default_instance() + } + } + + impl EosActionDelegate { + pub fn new() -> EosActionDelegate { + ::std::default::Default::default() + } + + // required uint64 sender = 1; + + pub fn sender(&self) -> u64 { + self.sender.unwrap_or(0) + } + + pub fn clear_sender(&mut self) { + self.sender = ::std::option::Option::None; + } + + pub fn has_sender(&self) -> bool { + self.sender.is_some() + } + + // Param is passed by value, moved + pub fn set_sender(&mut self, v: u64) { + self.sender = ::std::option::Option::Some(v); + } + + // required uint64 receiver = 2; + + pub fn receiver(&self) -> u64 { + self.receiver.unwrap_or(0) + } + + pub fn clear_receiver(&mut self) { + self.receiver = ::std::option::Option::None; + } + + pub fn has_receiver(&self) -> bool { + self.receiver.is_some() + } + + // Param is passed by value, moved + pub fn set_receiver(&mut self, v: u64) { + self.receiver = ::std::option::Option::Some(v); + } + + // required bool transfer = 5; + + pub fn transfer(&self) -> bool { + self.transfer.unwrap_or(false) + } + + pub fn clear_transfer(&mut self) { + self.transfer = ::std::option::Option::None; + } + + pub fn has_transfer(&self) -> bool { + self.transfer.is_some() + } + + // Param is passed by value, moved + pub fn set_transfer(&mut self, v: bool) { + self.transfer = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "sender", + |m: &EosActionDelegate| { &m.sender }, + |m: &mut EosActionDelegate| { &mut m.sender }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "receiver", + |m: &EosActionDelegate| { &m.receiver }, + |m: &mut EosActionDelegate| { &mut m.receiver }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, EosAsset>( + "net_quantity", + |m: &EosActionDelegate| { &m.net_quantity }, + |m: &mut EosActionDelegate| { &mut m.net_quantity }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, EosAsset>( + "cpu_quantity", + |m: &EosActionDelegate| { &m.cpu_quantity }, + |m: &mut EosActionDelegate| { &mut m.cpu_quantity }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "transfer", + |m: &EosActionDelegate| { &m.transfer }, + |m: &mut EosActionDelegate| { &mut m.transfer }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosActionDelegate", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosActionDelegate { + const NAME: &'static str = "EosActionDelegate"; + + fn is_initialized(&self) -> bool { + if self.sender.is_none() { + return false; + } + if self.receiver.is_none() { + return false; + } + if self.net_quantity.is_none() { + return false; + } + if self.cpu_quantity.is_none() { + return false; + } + if self.transfer.is_none() { + return false; + } + for v in &self.net_quantity { + if !v.is_initialized() { + return false; + } + }; + for v in &self.cpu_quantity { + if !v.is_initialized() { + 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.sender = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.receiver = ::std::option::Option::Some(is.read_uint64()?); + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.net_quantity)?; + }, + 34 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.cpu_quantity)?; + }, + 40 => { + self.transfer = ::std::option::Option::Some(is.read_bool()?); + }, + 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.sender { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.receiver { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.net_quantity.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.cpu_quantity.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.transfer { + my_size += 1 + 1; + } + 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.sender { + os.write_uint64(1, v)?; + } + if let Some(v) = self.receiver { + os.write_uint64(2, v)?; + } + if let Some(v) = self.net_quantity.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.cpu_quantity.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + } + if let Some(v) = self.transfer { + os.write_bool(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() -> EosActionDelegate { + EosActionDelegate::new() + } + + fn clear(&mut self) { + self.sender = ::std::option::Option::None; + self.receiver = ::std::option::Option::None; + self.net_quantity.clear(); + self.cpu_quantity.clear(); + self.transfer = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosActionDelegate { + static instance: EosActionDelegate = EosActionDelegate { + sender: ::std::option::Option::None, + receiver: ::std::option::Option::None, + net_quantity: ::protobuf::MessageField::none(), + cpu_quantity: ::protobuf::MessageField::none(), + transfer: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosActionDelegate { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosActionDelegate").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosActionDelegate { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosActionDelegate { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosActionUndelegate) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosActionUndelegate { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionUndelegate.sender) + pub sender: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionUndelegate.receiver) + pub receiver: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionUndelegate.net_quantity) + pub net_quantity: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionUndelegate.cpu_quantity) + pub cpu_quantity: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosActionUndelegate.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosActionUndelegate { + fn default() -> &'a EosActionUndelegate { + ::default_instance() + } + } + + impl EosActionUndelegate { + pub fn new() -> EosActionUndelegate { + ::std::default::Default::default() + } + + // required uint64 sender = 1; + + pub fn sender(&self) -> u64 { + self.sender.unwrap_or(0) + } + + pub fn clear_sender(&mut self) { + self.sender = ::std::option::Option::None; + } + + pub fn has_sender(&self) -> bool { + self.sender.is_some() + } + + // Param is passed by value, moved + pub fn set_sender(&mut self, v: u64) { + self.sender = ::std::option::Option::Some(v); + } + + // required uint64 receiver = 2; + + pub fn receiver(&self) -> u64 { + self.receiver.unwrap_or(0) + } + + pub fn clear_receiver(&mut self) { + self.receiver = ::std::option::Option::None; + } + + pub fn has_receiver(&self) -> bool { + self.receiver.is_some() + } + + // Param is passed by value, moved + pub fn set_receiver(&mut self, v: u64) { + self.receiver = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "sender", + |m: &EosActionUndelegate| { &m.sender }, + |m: &mut EosActionUndelegate| { &mut m.sender }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "receiver", + |m: &EosActionUndelegate| { &m.receiver }, + |m: &mut EosActionUndelegate| { &mut m.receiver }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, EosAsset>( + "net_quantity", + |m: &EosActionUndelegate| { &m.net_quantity }, + |m: &mut EosActionUndelegate| { &mut m.net_quantity }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, EosAsset>( + "cpu_quantity", + |m: &EosActionUndelegate| { &m.cpu_quantity }, + |m: &mut EosActionUndelegate| { &mut m.cpu_quantity }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosActionUndelegate", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosActionUndelegate { + const NAME: &'static str = "EosActionUndelegate"; + + fn is_initialized(&self) -> bool { + if self.sender.is_none() { + return false; + } + if self.receiver.is_none() { + return false; + } + if self.net_quantity.is_none() { + return false; + } + if self.cpu_quantity.is_none() { + return false; + } + for v in &self.net_quantity { + if !v.is_initialized() { + return false; + } + }; + for v in &self.cpu_quantity { + if !v.is_initialized() { + 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.sender = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.receiver = ::std::option::Option::Some(is.read_uint64()?); + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.net_quantity)?; + }, + 34 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.cpu_quantity)?; + }, + 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.sender { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.receiver { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.net_quantity.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.cpu_quantity.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.sender { + os.write_uint64(1, v)?; + } + if let Some(v) = self.receiver { + os.write_uint64(2, v)?; + } + if let Some(v) = self.net_quantity.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.cpu_quantity.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + } + 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() -> EosActionUndelegate { + EosActionUndelegate::new() + } + + fn clear(&mut self) { + self.sender = ::std::option::Option::None; + self.receiver = ::std::option::Option::None; + self.net_quantity.clear(); + self.cpu_quantity.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosActionUndelegate { + static instance: EosActionUndelegate = EosActionUndelegate { + sender: ::std::option::Option::None, + receiver: ::std::option::Option::None, + net_quantity: ::protobuf::MessageField::none(), + cpu_quantity: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosActionUndelegate { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosActionUndelegate").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosActionUndelegate { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosActionUndelegate { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosActionRefund) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosActionRefund { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionRefund.owner) + pub owner: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosActionRefund.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosActionRefund { + fn default() -> &'a EosActionRefund { + ::default_instance() + } + } + + impl EosActionRefund { + pub fn new() -> EosActionRefund { + ::std::default::Default::default() + } + + // required uint64 owner = 1; + + pub fn owner(&self) -> u64 { + self.owner.unwrap_or(0) + } + + pub fn clear_owner(&mut self) { + self.owner = ::std::option::Option::None; + } + + pub fn has_owner(&self) -> bool { + self.owner.is_some() + } + + // Param is passed by value, moved + pub fn set_owner(&mut self, v: u64) { + self.owner = ::std::option::Option::Some(v); + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "owner", + |m: &EosActionRefund| { &m.owner }, + |m: &mut EosActionRefund| { &mut m.owner }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosActionRefund", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosActionRefund { + const NAME: &'static str = "EosActionRefund"; + + fn is_initialized(&self) -> bool { + if self.owner.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.owner = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.owner { + my_size += ::protobuf::rt::uint64_size(1, 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.owner { + os.write_uint64(1, 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() -> EosActionRefund { + EosActionRefund::new() + } + + fn clear(&mut self) { + self.owner = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosActionRefund { + static instance: EosActionRefund = EosActionRefund { + owner: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosActionRefund { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosActionRefund").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosActionRefund { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosActionRefund { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosActionBuyRam) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosActionBuyRam { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionBuyRam.payer) + pub payer: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionBuyRam.receiver) + pub receiver: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionBuyRam.quantity) + pub quantity: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosActionBuyRam.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosActionBuyRam { + fn default() -> &'a EosActionBuyRam { + ::default_instance() + } + } + + impl EosActionBuyRam { + pub fn new() -> EosActionBuyRam { + ::std::default::Default::default() + } + + // required uint64 payer = 1; + + pub fn payer(&self) -> u64 { + self.payer.unwrap_or(0) + } + + pub fn clear_payer(&mut self) { + self.payer = ::std::option::Option::None; + } + + pub fn has_payer(&self) -> bool { + self.payer.is_some() + } + + // Param is passed by value, moved + pub fn set_payer(&mut self, v: u64) { + self.payer = ::std::option::Option::Some(v); + } + + // required uint64 receiver = 2; + + pub fn receiver(&self) -> u64 { + self.receiver.unwrap_or(0) + } + + pub fn clear_receiver(&mut self) { + self.receiver = ::std::option::Option::None; + } + + pub fn has_receiver(&self) -> bool { + self.receiver.is_some() + } + + // Param is passed by value, moved + pub fn set_receiver(&mut self, v: u64) { + self.receiver = ::std::option::Option::Some(v); + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "payer", + |m: &EosActionBuyRam| { &m.payer }, + |m: &mut EosActionBuyRam| { &mut m.payer }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "receiver", + |m: &EosActionBuyRam| { &m.receiver }, + |m: &mut EosActionBuyRam| { &mut m.receiver }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, EosAsset>( + "quantity", + |m: &EosActionBuyRam| { &m.quantity }, + |m: &mut EosActionBuyRam| { &mut m.quantity }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosActionBuyRam", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosActionBuyRam { + const NAME: &'static str = "EosActionBuyRam"; + + fn is_initialized(&self) -> bool { + if self.payer.is_none() { + return false; + } + if self.receiver.is_none() { + return false; + } + if self.quantity.is_none() { + return false; + } + for v in &self.quantity { + if !v.is_initialized() { + 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.payer = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.receiver = ::std::option::Option::Some(is.read_uint64()?); + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.quantity)?; + }, + 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.payer { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.receiver { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.quantity.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.payer { + os.write_uint64(1, v)?; + } + if let Some(v) = self.receiver { + os.write_uint64(2, v)?; + } + if let Some(v) = self.quantity.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + 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() -> EosActionBuyRam { + EosActionBuyRam::new() + } + + fn clear(&mut self) { + self.payer = ::std::option::Option::None; + self.receiver = ::std::option::Option::None; + self.quantity.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosActionBuyRam { + static instance: EosActionBuyRam = EosActionBuyRam { + payer: ::std::option::Option::None, + receiver: ::std::option::Option::None, + quantity: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosActionBuyRam { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosActionBuyRam").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosActionBuyRam { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosActionBuyRam { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosActionBuyRamBytes) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosActionBuyRamBytes { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionBuyRamBytes.payer) + pub payer: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionBuyRamBytes.receiver) + pub receiver: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionBuyRamBytes.bytes) + pub bytes: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosActionBuyRamBytes.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosActionBuyRamBytes { + fn default() -> &'a EosActionBuyRamBytes { + ::default_instance() + } + } + + impl EosActionBuyRamBytes { + pub fn new() -> EosActionBuyRamBytes { + ::std::default::Default::default() + } + + // required uint64 payer = 1; + + pub fn payer(&self) -> u64 { + self.payer.unwrap_or(0) + } + + pub fn clear_payer(&mut self) { + self.payer = ::std::option::Option::None; + } + + pub fn has_payer(&self) -> bool { + self.payer.is_some() + } + + // Param is passed by value, moved + pub fn set_payer(&mut self, v: u64) { + self.payer = ::std::option::Option::Some(v); + } + + // required uint64 receiver = 2; + + pub fn receiver(&self) -> u64 { + self.receiver.unwrap_or(0) + } + + pub fn clear_receiver(&mut self) { + self.receiver = ::std::option::Option::None; + } + + pub fn has_receiver(&self) -> bool { + self.receiver.is_some() + } + + // Param is passed by value, moved + pub fn set_receiver(&mut self, v: u64) { + self.receiver = ::std::option::Option::Some(v); + } + + // required uint32 bytes = 3; + + pub fn bytes(&self) -> u32 { + self.bytes.unwrap_or(0) + } + + pub fn clear_bytes(&mut self) { + self.bytes = ::std::option::Option::None; + } + + pub fn has_bytes(&self) -> bool { + self.bytes.is_some() + } + + // Param is passed by value, moved + pub fn set_bytes(&mut self, v: u32) { + self.bytes = ::std::option::Option::Some(v); + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "payer", + |m: &EosActionBuyRamBytes| { &m.payer }, + |m: &mut EosActionBuyRamBytes| { &mut m.payer }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "receiver", + |m: &EosActionBuyRamBytes| { &m.receiver }, + |m: &mut EosActionBuyRamBytes| { &mut m.receiver }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "bytes", + |m: &EosActionBuyRamBytes| { &m.bytes }, + |m: &mut EosActionBuyRamBytes| { &mut m.bytes }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosActionBuyRamBytes", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosActionBuyRamBytes { + const NAME: &'static str = "EosActionBuyRamBytes"; + + fn is_initialized(&self) -> bool { + if self.payer.is_none() { + return false; + } + if self.receiver.is_none() { + return false; + } + if self.bytes.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.payer = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.receiver = ::std::option::Option::Some(is.read_uint64()?); + }, + 24 => { + self.bytes = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.payer { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.receiver { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.bytes { + my_size += ::protobuf::rt::uint32_size(3, 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.payer { + os.write_uint64(1, v)?; + } + if let Some(v) = self.receiver { + os.write_uint64(2, v)?; + } + if let Some(v) = self.bytes { + os.write_uint32(3, 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() -> EosActionBuyRamBytes { + EosActionBuyRamBytes::new() + } + + fn clear(&mut self) { + self.payer = ::std::option::Option::None; + self.receiver = ::std::option::Option::None; + self.bytes = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosActionBuyRamBytes { + static instance: EosActionBuyRamBytes = EosActionBuyRamBytes { + payer: ::std::option::Option::None, + receiver: ::std::option::Option::None, + bytes: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosActionBuyRamBytes { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosActionBuyRamBytes").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosActionBuyRamBytes { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosActionBuyRamBytes { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosActionSellRam) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosActionSellRam { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionSellRam.account) + pub account: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionSellRam.bytes) + pub bytes: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosActionSellRam.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosActionSellRam { + fn default() -> &'a EosActionSellRam { + ::default_instance() + } + } + + impl EosActionSellRam { + pub fn new() -> EosActionSellRam { + ::std::default::Default::default() + } + + // required uint64 account = 1; + + pub fn account(&self) -> u64 { + self.account.unwrap_or(0) + } + + pub fn clear_account(&mut self) { + self.account = ::std::option::Option::None; + } + + pub fn has_account(&self) -> bool { + self.account.is_some() + } + + // Param is passed by value, moved + pub fn set_account(&mut self, v: u64) { + self.account = ::std::option::Option::Some(v); + } + + // required uint64 bytes = 2; + + pub fn bytes(&self) -> u64 { + self.bytes.unwrap_or(0) + } + + pub fn clear_bytes(&mut self) { + self.bytes = ::std::option::Option::None; + } + + pub fn has_bytes(&self) -> bool { + self.bytes.is_some() + } + + // Param is passed by value, moved + pub fn set_bytes(&mut self, v: u64) { + self.bytes = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "account", + |m: &EosActionSellRam| { &m.account }, + |m: &mut EosActionSellRam| { &mut m.account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "bytes", + |m: &EosActionSellRam| { &m.bytes }, + |m: &mut EosActionSellRam| { &mut m.bytes }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosActionSellRam", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosActionSellRam { + const NAME: &'static str = "EosActionSellRam"; + + fn is_initialized(&self) -> bool { + if self.account.is_none() { + return false; + } + if self.bytes.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.account = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.bytes = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.account { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.bytes { + my_size += ::protobuf::rt::uint64_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.account { + os.write_uint64(1, v)?; + } + if let Some(v) = self.bytes { + os.write_uint64(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() -> EosActionSellRam { + EosActionSellRam::new() + } + + fn clear(&mut self) { + self.account = ::std::option::Option::None; + self.bytes = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosActionSellRam { + static instance: EosActionSellRam = EosActionSellRam { + account: ::std::option::Option::None, + bytes: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosActionSellRam { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosActionSellRam").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosActionSellRam { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosActionSellRam { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosActionVoteProducer) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosActionVoteProducer { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionVoteProducer.voter) + pub voter: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionVoteProducer.proxy) + pub proxy: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionVoteProducer.producers) + pub producers: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosActionVoteProducer.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosActionVoteProducer { + fn default() -> &'a EosActionVoteProducer { + ::default_instance() + } + } + + impl EosActionVoteProducer { + pub fn new() -> EosActionVoteProducer { + ::std::default::Default::default() + } + + // required uint64 voter = 1; + + pub fn voter(&self) -> u64 { + self.voter.unwrap_or(0) + } + + pub fn clear_voter(&mut self) { + self.voter = ::std::option::Option::None; + } + + pub fn has_voter(&self) -> bool { + self.voter.is_some() + } + + // Param is passed by value, moved + pub fn set_voter(&mut self, v: u64) { + self.voter = ::std::option::Option::Some(v); + } + + // required uint64 proxy = 2; + + pub fn proxy(&self) -> u64 { + self.proxy.unwrap_or(0) + } + + pub fn clear_proxy(&mut self) { + self.proxy = ::std::option::Option::None; + } + + pub fn has_proxy(&self) -> bool { + self.proxy.is_some() + } + + // Param is passed by value, moved + pub fn set_proxy(&mut self, v: u64) { + self.proxy = ::std::option::Option::Some(v); + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "voter", + |m: &EosActionVoteProducer| { &m.voter }, + |m: &mut EosActionVoteProducer| { &mut m.voter }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "proxy", + |m: &EosActionVoteProducer| { &m.proxy }, + |m: &mut EosActionVoteProducer| { &mut m.proxy }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "producers", + |m: &EosActionVoteProducer| { &m.producers }, + |m: &mut EosActionVoteProducer| { &mut m.producers }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosActionVoteProducer", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosActionVoteProducer { + const NAME: &'static str = "EosActionVoteProducer"; + + fn is_initialized(&self) -> bool { + if self.voter.is_none() { + return false; + } + if self.proxy.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.voter = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.proxy = ::std::option::Option::Some(is.read_uint64()?); + }, + 26 => { + is.read_repeated_packed_uint64_into(&mut self.producers)?; + }, + 24 => { + self.producers.push(is.read_uint64()?); + }, + 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.voter { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.proxy { + my_size += ::protobuf::rt::uint64_size(2, v); + } + for value in &self.producers { + my_size += ::protobuf::rt::uint64_size(3, *value); + }; + 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.voter { + os.write_uint64(1, v)?; + } + if let Some(v) = self.proxy { + os.write_uint64(2, v)?; + } + for v in &self.producers { + os.write_uint64(3, *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() -> EosActionVoteProducer { + EosActionVoteProducer::new() + } + + fn clear(&mut self) { + self.voter = ::std::option::Option::None; + self.proxy = ::std::option::Option::None; + self.producers.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosActionVoteProducer { + static instance: EosActionVoteProducer = EosActionVoteProducer { + voter: ::std::option::Option::None, + proxy: ::std::option::Option::None, + producers: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosActionVoteProducer { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosActionVoteProducer").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosActionVoteProducer { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosActionVoteProducer { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosActionUpdateAuth) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosActionUpdateAuth { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionUpdateAuth.account) + pub account: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionUpdateAuth.permission) + pub permission: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionUpdateAuth.parent) + pub parent: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionUpdateAuth.auth) + pub auth: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosActionUpdateAuth.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosActionUpdateAuth { + fn default() -> &'a EosActionUpdateAuth { + ::default_instance() + } + } + + impl EosActionUpdateAuth { + pub fn new() -> EosActionUpdateAuth { + ::std::default::Default::default() + } + + // required uint64 account = 1; + + pub fn account(&self) -> u64 { + self.account.unwrap_or(0) + } + + pub fn clear_account(&mut self) { + self.account = ::std::option::Option::None; + } + + pub fn has_account(&self) -> bool { + self.account.is_some() + } + + // Param is passed by value, moved + pub fn set_account(&mut self, v: u64) { + self.account = ::std::option::Option::Some(v); + } + + // required uint64 permission = 2; + + pub fn permission(&self) -> u64 { + self.permission.unwrap_or(0) + } + + pub fn clear_permission(&mut self) { + self.permission = ::std::option::Option::None; + } + + pub fn has_permission(&self) -> bool { + self.permission.is_some() + } + + // Param is passed by value, moved + pub fn set_permission(&mut self, v: u64) { + self.permission = ::std::option::Option::Some(v); + } + + // required uint64 parent = 3; + + pub fn parent(&self) -> u64 { + self.parent.unwrap_or(0) + } + + pub fn clear_parent(&mut self) { + self.parent = ::std::option::Option::None; + } + + pub fn has_parent(&self) -> bool { + self.parent.is_some() + } + + // Param is passed by value, moved + pub fn set_parent(&mut self, v: u64) { + self.parent = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "account", + |m: &EosActionUpdateAuth| { &m.account }, + |m: &mut EosActionUpdateAuth| { &mut m.account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "permission", + |m: &EosActionUpdateAuth| { &m.permission }, + |m: &mut EosActionUpdateAuth| { &mut m.permission }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "parent", + |m: &EosActionUpdateAuth| { &m.parent }, + |m: &mut EosActionUpdateAuth| { &mut m.parent }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, EosAuthorization>( + "auth", + |m: &EosActionUpdateAuth| { &m.auth }, + |m: &mut EosActionUpdateAuth| { &mut m.auth }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosActionUpdateAuth", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosActionUpdateAuth { + const NAME: &'static str = "EosActionUpdateAuth"; + + fn is_initialized(&self) -> bool { + if self.account.is_none() { + return false; + } + if self.permission.is_none() { + return false; + } + if self.parent.is_none() { + return false; + } + if self.auth.is_none() { + return false; + } + for v in &self.auth { + if !v.is_initialized() { + 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.account = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.permission = ::std::option::Option::Some(is.read_uint64()?); + }, + 24 => { + self.parent = ::std::option::Option::Some(is.read_uint64()?); + }, + 34 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.auth)?; + }, + 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.account { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.permission { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.parent { + my_size += ::protobuf::rt::uint64_size(3, v); + } + if let Some(v) = self.auth.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.account { + os.write_uint64(1, v)?; + } + if let Some(v) = self.permission { + os.write_uint64(2, v)?; + } + if let Some(v) = self.parent { + os.write_uint64(3, v)?; + } + if let Some(v) = self.auth.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + } + 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() -> EosActionUpdateAuth { + EosActionUpdateAuth::new() + } + + fn clear(&mut self) { + self.account = ::std::option::Option::None; + self.permission = ::std::option::Option::None; + self.parent = ::std::option::Option::None; + self.auth.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosActionUpdateAuth { + static instance: EosActionUpdateAuth = EosActionUpdateAuth { + account: ::std::option::Option::None, + permission: ::std::option::Option::None, + parent: ::std::option::Option::None, + auth: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosActionUpdateAuth { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosActionUpdateAuth").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosActionUpdateAuth { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosActionUpdateAuth { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosActionDeleteAuth) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosActionDeleteAuth { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionDeleteAuth.account) + pub account: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionDeleteAuth.permission) + pub permission: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosActionDeleteAuth.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosActionDeleteAuth { + fn default() -> &'a EosActionDeleteAuth { + ::default_instance() + } + } + + impl EosActionDeleteAuth { + pub fn new() -> EosActionDeleteAuth { + ::std::default::Default::default() + } + + // required uint64 account = 1; + + pub fn account(&self) -> u64 { + self.account.unwrap_or(0) + } + + pub fn clear_account(&mut self) { + self.account = ::std::option::Option::None; + } + + pub fn has_account(&self) -> bool { + self.account.is_some() + } + + // Param is passed by value, moved + pub fn set_account(&mut self, v: u64) { + self.account = ::std::option::Option::Some(v); + } + + // required uint64 permission = 2; + + pub fn permission(&self) -> u64 { + self.permission.unwrap_or(0) + } + + pub fn clear_permission(&mut self) { + self.permission = ::std::option::Option::None; + } + + pub fn has_permission(&self) -> bool { + self.permission.is_some() + } + + // Param is passed by value, moved + pub fn set_permission(&mut self, v: u64) { + self.permission = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "account", + |m: &EosActionDeleteAuth| { &m.account }, + |m: &mut EosActionDeleteAuth| { &mut m.account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "permission", + |m: &EosActionDeleteAuth| { &m.permission }, + |m: &mut EosActionDeleteAuth| { &mut m.permission }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosActionDeleteAuth", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosActionDeleteAuth { + const NAME: &'static str = "EosActionDeleteAuth"; + + fn is_initialized(&self) -> bool { + if self.account.is_none() { + return false; + } + if self.permission.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.account = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.permission = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.account { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.permission { + my_size += ::protobuf::rt::uint64_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.account { + os.write_uint64(1, v)?; + } + if let Some(v) = self.permission { + os.write_uint64(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() -> EosActionDeleteAuth { + EosActionDeleteAuth::new() + } + + fn clear(&mut self) { + self.account = ::std::option::Option::None; + self.permission = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosActionDeleteAuth { + static instance: EosActionDeleteAuth = EosActionDeleteAuth { + account: ::std::option::Option::None, + permission: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosActionDeleteAuth { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosActionDeleteAuth").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosActionDeleteAuth { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosActionDeleteAuth { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosActionLinkAuth) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosActionLinkAuth { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionLinkAuth.account) + pub account: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionLinkAuth.code) + pub code: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionLinkAuth.type) + pub type_: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionLinkAuth.requirement) + pub requirement: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosActionLinkAuth.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosActionLinkAuth { + fn default() -> &'a EosActionLinkAuth { + ::default_instance() + } + } + + impl EosActionLinkAuth { + pub fn new() -> EosActionLinkAuth { + ::std::default::Default::default() + } + + // required uint64 account = 1; + + pub fn account(&self) -> u64 { + self.account.unwrap_or(0) + } + + pub fn clear_account(&mut self) { + self.account = ::std::option::Option::None; + } + + pub fn has_account(&self) -> bool { + self.account.is_some() + } + + // Param is passed by value, moved + pub fn set_account(&mut self, v: u64) { + self.account = ::std::option::Option::Some(v); + } + + // required uint64 code = 2; + + pub fn code(&self) -> u64 { + self.code.unwrap_or(0) + } + + pub fn clear_code(&mut self) { + self.code = ::std::option::Option::None; + } + + pub fn has_code(&self) -> bool { + self.code.is_some() + } + + // Param is passed by value, moved + pub fn set_code(&mut self, v: u64) { + self.code = ::std::option::Option::Some(v); + } + + // required uint64 type = 3; + + pub fn type_(&self) -> u64 { + self.type_.unwrap_or(0) + } + + pub fn clear_type_(&mut self) { + self.type_ = ::std::option::Option::None; + } + + pub fn has_type(&self) -> bool { + self.type_.is_some() + } + + // Param is passed by value, moved + pub fn set_type(&mut self, v: u64) { + self.type_ = ::std::option::Option::Some(v); + } + + // required uint64 requirement = 4; + + pub fn requirement(&self) -> u64 { + self.requirement.unwrap_or(0) + } + + pub fn clear_requirement(&mut self) { + self.requirement = ::std::option::Option::None; + } + + pub fn has_requirement(&self) -> bool { + self.requirement.is_some() + } + + // Param is passed by value, moved + pub fn set_requirement(&mut self, v: u64) { + self.requirement = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "account", + |m: &EosActionLinkAuth| { &m.account }, + |m: &mut EosActionLinkAuth| { &mut m.account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "code", + |m: &EosActionLinkAuth| { &m.code }, + |m: &mut EosActionLinkAuth| { &mut m.code }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "type", + |m: &EosActionLinkAuth| { &m.type_ }, + |m: &mut EosActionLinkAuth| { &mut m.type_ }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "requirement", + |m: &EosActionLinkAuth| { &m.requirement }, + |m: &mut EosActionLinkAuth| { &mut m.requirement }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosActionLinkAuth", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosActionLinkAuth { + const NAME: &'static str = "EosActionLinkAuth"; + + fn is_initialized(&self) -> bool { + if self.account.is_none() { + return false; + } + if self.code.is_none() { + return false; + } + if self.type_.is_none() { + return false; + } + if self.requirement.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.account = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.code = ::std::option::Option::Some(is.read_uint64()?); + }, + 24 => { + self.type_ = ::std::option::Option::Some(is.read_uint64()?); + }, + 32 => { + self.requirement = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.account { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.code { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.type_ { + my_size += ::protobuf::rt::uint64_size(3, v); + } + if let Some(v) = self.requirement { + my_size += ::protobuf::rt::uint64_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.account { + os.write_uint64(1, v)?; + } + if let Some(v) = self.code { + os.write_uint64(2, v)?; + } + if let Some(v) = self.type_ { + os.write_uint64(3, v)?; + } + if let Some(v) = self.requirement { + os.write_uint64(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() -> EosActionLinkAuth { + EosActionLinkAuth::new() + } + + fn clear(&mut self) { + self.account = ::std::option::Option::None; + self.code = ::std::option::Option::None; + self.type_ = ::std::option::Option::None; + self.requirement = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosActionLinkAuth { + static instance: EosActionLinkAuth = EosActionLinkAuth { + account: ::std::option::Option::None, + code: ::std::option::Option::None, + type_: ::std::option::Option::None, + requirement: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosActionLinkAuth { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosActionLinkAuth").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosActionLinkAuth { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosActionLinkAuth { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosActionUnlinkAuth) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosActionUnlinkAuth { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionUnlinkAuth.account) + pub account: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionUnlinkAuth.code) + pub code: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionUnlinkAuth.type) + pub type_: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosActionUnlinkAuth.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosActionUnlinkAuth { + fn default() -> &'a EosActionUnlinkAuth { + ::default_instance() + } + } + + impl EosActionUnlinkAuth { + pub fn new() -> EosActionUnlinkAuth { + ::std::default::Default::default() + } + + // required uint64 account = 1; + + pub fn account(&self) -> u64 { + self.account.unwrap_or(0) + } + + pub fn clear_account(&mut self) { + self.account = ::std::option::Option::None; + } + + pub fn has_account(&self) -> bool { + self.account.is_some() + } + + // Param is passed by value, moved + pub fn set_account(&mut self, v: u64) { + self.account = ::std::option::Option::Some(v); + } + + // required uint64 code = 2; + + pub fn code(&self) -> u64 { + self.code.unwrap_or(0) + } + + pub fn clear_code(&mut self) { + self.code = ::std::option::Option::None; + } + + pub fn has_code(&self) -> bool { + self.code.is_some() + } + + // Param is passed by value, moved + pub fn set_code(&mut self, v: u64) { + self.code = ::std::option::Option::Some(v); + } + + // required uint64 type = 3; + + pub fn type_(&self) -> u64 { + self.type_.unwrap_or(0) + } + + pub fn clear_type_(&mut self) { + self.type_ = ::std::option::Option::None; + } + + pub fn has_type(&self) -> bool { + self.type_.is_some() + } + + // Param is passed by value, moved + pub fn set_type(&mut self, v: u64) { + self.type_ = ::std::option::Option::Some(v); + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "account", + |m: &EosActionUnlinkAuth| { &m.account }, + |m: &mut EosActionUnlinkAuth| { &mut m.account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "code", + |m: &EosActionUnlinkAuth| { &m.code }, + |m: &mut EosActionUnlinkAuth| { &mut m.code }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "type", + |m: &EosActionUnlinkAuth| { &m.type_ }, + |m: &mut EosActionUnlinkAuth| { &mut m.type_ }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosActionUnlinkAuth", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosActionUnlinkAuth { + const NAME: &'static str = "EosActionUnlinkAuth"; + + fn is_initialized(&self) -> bool { + if self.account.is_none() { + return false; + } + if self.code.is_none() { + return false; + } + if self.type_.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.account = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.code = ::std::option::Option::Some(is.read_uint64()?); + }, + 24 => { + self.type_ = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.account { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.code { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.type_ { + my_size += ::protobuf::rt::uint64_size(3, 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.account { + os.write_uint64(1, v)?; + } + if let Some(v) = self.code { + os.write_uint64(2, v)?; + } + if let Some(v) = self.type_ { + os.write_uint64(3, 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() -> EosActionUnlinkAuth { + EosActionUnlinkAuth::new() + } + + fn clear(&mut self) { + self.account = ::std::option::Option::None; + self.code = ::std::option::Option::None; + self.type_ = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosActionUnlinkAuth { + static instance: EosActionUnlinkAuth = EosActionUnlinkAuth { + account: ::std::option::Option::None, + code: ::std::option::Option::None, + type_: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosActionUnlinkAuth { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosActionUnlinkAuth").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosActionUnlinkAuth { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosActionUnlinkAuth { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosActionNewAccount) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosActionNewAccount { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionNewAccount.creator) + pub creator: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionNewAccount.name) + pub name: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionNewAccount.owner) + pub owner: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionNewAccount.active) + pub active: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosActionNewAccount.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosActionNewAccount { + fn default() -> &'a EosActionNewAccount { + ::default_instance() + } + } + + impl EosActionNewAccount { + pub fn new() -> EosActionNewAccount { + ::std::default::Default::default() + } + + // required uint64 creator = 1; + + pub fn creator(&self) -> u64 { + self.creator.unwrap_or(0) + } + + pub fn clear_creator(&mut self) { + self.creator = ::std::option::Option::None; + } + + pub fn has_creator(&self) -> bool { + self.creator.is_some() + } + + // Param is passed by value, moved + pub fn set_creator(&mut self, v: u64) { + self.creator = ::std::option::Option::Some(v); + } + + // required uint64 name = 2; + + pub fn name(&self) -> u64 { + self.name.unwrap_or(0) + } + + 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: u64) { + self.name = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "creator", + |m: &EosActionNewAccount| { &m.creator }, + |m: &mut EosActionNewAccount| { &mut m.creator }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "name", + |m: &EosActionNewAccount| { &m.name }, + |m: &mut EosActionNewAccount| { &mut m.name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, EosAuthorization>( + "owner", + |m: &EosActionNewAccount| { &m.owner }, + |m: &mut EosActionNewAccount| { &mut m.owner }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, EosAuthorization>( + "active", + |m: &EosActionNewAccount| { &m.active }, + |m: &mut EosActionNewAccount| { &mut m.active }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosActionNewAccount", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosActionNewAccount { + const NAME: &'static str = "EosActionNewAccount"; + + fn is_initialized(&self) -> bool { + if self.creator.is_none() { + return false; + } + if self.name.is_none() { + return false; + } + if self.owner.is_none() { + return false; + } + if self.active.is_none() { + return false; + } + for v in &self.owner { + if !v.is_initialized() { + return false; + } + }; + for v in &self.active { + if !v.is_initialized() { + 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.creator = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.name = ::std::option::Option::Some(is.read_uint64()?); + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.owner)?; + }, + 34 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.active)?; + }, + 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.creator { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.name { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.owner.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.active.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.creator { + os.write_uint64(1, v)?; + } + if let Some(v) = self.name { + os.write_uint64(2, v)?; + } + if let Some(v) = self.owner.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.active.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + } + 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() -> EosActionNewAccount { + EosActionNewAccount::new() + } + + fn clear(&mut self) { + self.creator = ::std::option::Option::None; + self.name = ::std::option::Option::None; + self.owner.clear(); + self.active.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosActionNewAccount { + static instance: EosActionNewAccount = EosActionNewAccount { + creator: ::std::option::Option::None, + name: ::std::option::Option::None, + owner: ::protobuf::MessageField::none(), + active: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosActionNewAccount { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosActionNewAccount").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosActionNewAccount { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosActionNewAccount { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.eos.EosTxActionAck.EosActionUnknown) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EosActionUnknown { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionUnknown.data_size) + pub data_size: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosTxActionAck.EosActionUnknown.data_chunk) + pub data_chunk: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosTxActionAck.EosActionUnknown.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EosActionUnknown { + fn default() -> &'a EosActionUnknown { + ::default_instance() + } + } + + impl EosActionUnknown { + pub fn new() -> EosActionUnknown { + ::std::default::Default::default() + } + + // required uint32 data_size = 1; + + pub fn data_size(&self) -> u32 { + self.data_size.unwrap_or(0) + } + + pub fn clear_data_size(&mut self) { + self.data_size = ::std::option::Option::None; + } + + pub fn has_data_size(&self) -> bool { + self.data_size.is_some() + } + + // Param is passed by value, moved + pub fn set_data_size(&mut self, v: u32) { + self.data_size = ::std::option::Option::Some(v); + } + + // required bytes data_chunk = 2; + + pub fn data_chunk(&self) -> &[u8] { + match self.data_chunk.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_data_chunk(&mut self) { + self.data_chunk = ::std::option::Option::None; + } + + pub fn has_data_chunk(&self) -> bool { + self.data_chunk.is_some() + } + + // Param is passed by value, moved + pub fn set_data_chunk(&mut self, v: ::std::vec::Vec) { + self.data_chunk = ::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_data_chunk(&mut self) -> &mut ::std::vec::Vec { + if self.data_chunk.is_none() { + self.data_chunk = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.data_chunk.as_mut().unwrap() + } + + // Take field + pub fn take_data_chunk(&mut self) -> ::std::vec::Vec { + self.data_chunk.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) 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::<_, _>( + "data_size", + |m: &EosActionUnknown| { &m.data_size }, + |m: &mut EosActionUnknown| { &mut m.data_size }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data_chunk", + |m: &EosActionUnknown| { &m.data_chunk }, + |m: &mut EosActionUnknown| { &mut m.data_chunk }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosTxActionAck.EosActionUnknown", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EosActionUnknown { + const NAME: &'static str = "EosActionUnknown"; + + fn is_initialized(&self) -> bool { + if self.data_size.is_none() { + return false; + } + if self.data_chunk.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.data_size = ::std::option::Option::Some(is.read_uint32()?); + }, + 18 => { + self.data_chunk = ::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.data_size { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.data_chunk.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.data_size { + os.write_uint32(1, v)?; + } + if let Some(v) = self.data_chunk.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() -> EosActionUnknown { + EosActionUnknown::new() + } + + fn clear(&mut self) { + self.data_size = ::std::option::Option::None; + self.data_chunk = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosActionUnknown { + static instance: EosActionUnknown = EosActionUnknown { + data_size: ::std::option::Option::None, + data_chunk: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EosActionUnknown { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EosTxActionAck.EosActionUnknown").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EosActionUnknown { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EosActionUnknown { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.eos.EosSignedTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EosSignedTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.eos.EosSignedTx.signature) + pub signature: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.eos.EosSignedTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EosSignedTx { + fn default() -> &'a EosSignedTx { + ::default_instance() + } +} + +impl EosSignedTx { + pub fn new() -> EosSignedTx { + ::std::default::Default::default() + } + + // required string signature = 1; + + pub fn signature(&self) -> &str { + match self.signature.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::string::String) { + self.signature = ::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_signature(&mut self) -> &mut ::std::string::String { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::string::String::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::string::String { + self.signature.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &EosSignedTx| { &m.signature }, + |m: &mut EosSignedTx| { &mut m.signature }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EosSignedTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EosSignedTx { + const NAME: &'static str = "EosSignedTx"; + + fn is_initialized(&self) -> bool { + if self.signature.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.signature = ::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.signature.as_ref() { + my_size += ::protobuf::rt::string_size(1, &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.signature.as_ref() { + os.write_string(1, 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() -> EosSignedTx { + EosSignedTx::new() + } + + fn clear(&mut self) { + self.signature = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EosSignedTx { + static instance: EosSignedTx = EosSignedTx { + signature: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EosSignedTx { + 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("EosSignedTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EosSignedTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EosSignedTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x12messages-eos.proto\x12\x16hw.trezor.messages.eos\"m\n\x0fEosGetPub\ + licKey\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12!\n\x0csh\ + ow_display\x18\x02\x20\x01(\x08R\x0bshowDisplay\x12\x1a\n\x08chunkify\ + \x18\x03\x20\x01(\x08R\x08chunkify\"Z\n\x0cEosPublicKey\x12$\n\x0ewif_pu\ + blic_key\x18\x01\x20\x02(\tR\x0cwifPublicKey\x12$\n\x0eraw_public_key\ + \x18\x02\x20\x02(\x0cR\x0crawPublicKey\"\xba\x03\n\tEosSignTx\x12\x1b\n\ + \taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\x19\n\x08chain_id\x18\ + \x02\x20\x02(\x0cR\x07chainId\x12E\n\x06header\x18\x03\x20\x02(\x0b2-.hw\ + .trezor.messages.eos.EosSignTx.EosTxHeaderR\x06header\x12\x1f\n\x0bnum_a\ + ctions\x18\x04\x20\x02(\rR\nnumActions\x12\x1a\n\x08chunkify\x18\x05\x20\ + \x01(\x08R\x08chunkify\x1a\xf0\x01\n\x0bEosTxHeader\x12\x1e\n\nexpiratio\ + n\x18\x01\x20\x02(\rR\nexpiration\x12\"\n\rref_block_num\x18\x02\x20\x02\ + (\rR\x0brefBlockNum\x12(\n\x10ref_block_prefix\x18\x03\x20\x02(\rR\x0ere\ + fBlockPrefix\x12-\n\x13max_net_usage_words\x18\x04\x20\x02(\rR\x10maxNet\ + UsageWords\x12'\n\x10max_cpu_usage_ms\x18\x05\x20\x02(\rR\rmaxCpuUsageMs\ + \x12\x1b\n\tdelay_sec\x18\x06\x20\x02(\rR\x08delaySec\"1\n\x12EosTxActio\ + nRequest\x12\x1b\n\tdata_size\x18\x01\x20\x01(\rR\x08dataSize\"\xe2\x20\ + \n\x0eEosTxActionAck\x12N\n\x06common\x18\x01\x20\x02(\x0b26.hw.trezor.m\ + essages.eos.EosTxActionAck.EosActionCommonR\x06common\x12T\n\x08transfer\ + \x18\x02\x20\x01(\x0b28.hw.trezor.messages.eos.EosTxActionAck.EosActionT\ + ransferR\x08transfer\x12T\n\x08delegate\x18\x03\x20\x01(\x0b28.hw.trezor\ + .messages.eos.EosTxActionAck.EosActionDelegateR\x08delegate\x12Z\n\nunde\ + legate\x18\x04\x20\x01(\x0b2:.hw.trezor.messages.eos.EosTxActionAck.EosA\ + ctionUndelegateR\nundelegate\x12N\n\x06refund\x18\x05\x20\x01(\x0b26.hw.\ + trezor.messages.eos.EosTxActionAck.EosActionRefundR\x06refund\x12O\n\x07\ + buy_ram\x18\x06\x20\x01(\x0b26.hw.trezor.messages.eos.EosTxActionAck.Eos\ + ActionBuyRamR\x06buyRam\x12_\n\rbuy_ram_bytes\x18\x07\x20\x01(\x0b2;.hw.\ + trezor.messages.eos.EosTxActionAck.EosActionBuyRamBytesR\x0bbuyRamBytes\ + \x12R\n\x08sell_ram\x18\x08\x20\x01(\x0b27.hw.trezor.messages.eos.EosTxA\ + ctionAck.EosActionSellRamR\x07sellRam\x12a\n\rvote_producer\x18\t\x20\ + \x01(\x0b2<.hw.trezor.messages.eos.EosTxActionAck.EosActionVoteProducerR\ + \x0cvoteProducer\x12[\n\x0bupdate_auth\x18\n\x20\x01(\x0b2:.hw.trezor.me\ + ssages.eos.EosTxActionAck.EosActionUpdateAuthR\nupdateAuth\x12[\n\x0bdel\ + ete_auth\x18\x0b\x20\x01(\x0b2:.hw.trezor.messages.eos.EosTxActionAck.Eo\ + sActionDeleteAuthR\ndeleteAuth\x12U\n\tlink_auth\x18\x0c\x20\x01(\x0b28.\ + hw.trezor.messages.eos.EosTxActionAck.EosActionLinkAuthR\x08linkAuth\x12\ + [\n\x0bunlink_auth\x18\r\x20\x01(\x0b2:.hw.trezor.messages.eos.EosTxActi\ + onAck.EosActionUnlinkAuthR\nunlinkAuth\x12[\n\x0bnew_account\x18\x0e\x20\ + \x01(\x0b2:.hw.trezor.messages.eos.EosTxActionAck.EosActionNewAccountR\n\ + newAccount\x12Q\n\x07unknown\x18\x0f\x20\x01(\x0b27.hw.trezor.messages.e\ + os.EosTxActionAck.EosActionUnknownR\x07unknown\x1a:\n\x08EosAsset\x12\ + \x16\n\x06amount\x18\x01\x20\x02(\x12R\x06amount\x12\x16\n\x06symbol\x18\ + \x02\x20\x02(\x04R\x06symbol\x1aJ\n\x12EosPermissionLevel\x12\x14\n\x05a\ + ctor\x18\x01\x20\x02(\x04R\x05actor\x12\x1e\n\npermission\x18\x02\x20\ + \x02(\x04R\npermission\x1ap\n\x13EosAuthorizationKey\x12\x12\n\x04type\ + \x18\x01\x20\x02(\rR\x04type\x12\x10\n\x03key\x18\x02\x20\x01(\x0cR\x03k\ + ey\x12\x1b\n\taddress_n\x18\x03\x20\x03(\rR\x08addressN\x12\x16\n\x06wei\ + ght\x18\x04\x20\x02(\rR\x06weight\x1a\x86\x01\n\x17EosAuthorizationAccou\ + nt\x12S\n\x07account\x18\x01\x20\x02(\x0b29.hw.trezor.messages.eos.EosTx\ + ActionAck.EosPermissionLevelR\x07account\x12\x16\n\x06weight\x18\x02\x20\ + \x02(\rR\x06weight\x1aI\n\x14EosAuthorizationWait\x12\x19\n\x08wait_sec\ + \x18\x01\x20\x02(\rR\x07waitSec\x12\x16\n\x06weight\x18\x02\x20\x02(\rR\ + \x06weight\x1a\xaf\x02\n\x10EosAuthorization\x12\x1c\n\tthreshold\x18\ + \x01\x20\x02(\rR\tthreshold\x12N\n\x04keys\x18\x02\x20\x03(\x0b2:.hw.tre\ + zor.messages.eos.EosTxActionAck.EosAuthorizationKeyR\x04keys\x12Z\n\x08a\ + ccounts\x18\x03\x20\x03(\x0b2>.hw.trezor.messages.eos.EosTxActionAck.Eos\ + AuthorizationAccountR\x08accounts\x12Q\n\x05waits\x18\x04\x20\x03(\x0b2;\ + .hw.trezor.messages.eos.EosTxActionAck.EosAuthorizationWaitR\x05waits\ + \x1a\xa0\x01\n\x0fEosActionCommon\x12\x18\n\x07account\x18\x01\x20\x02(\ + \x04R\x07account\x12\x12\n\x04name\x18\x02\x20\x02(\x04R\x04name\x12_\n\ + \rauthorization\x18\x03\x20\x03(\x0b29.hw.trezor.messages.eos.EosTxActio\ + nAck.EosPermissionLevelR\rauthorization\x1a\xa8\x01\n\x11EosActionTransf\ + er\x12\x16\n\x06sender\x18\x01\x20\x02(\x04R\x06sender\x12\x1a\n\x08rece\ + iver\x18\x02\x20\x02(\x04R\x08receiver\x12K\n\x08quantity\x18\x03\x20\ + \x02(\x0b2/.hw.trezor.messages.eos.EosTxActionAck.EosAssetR\x08quantity\ + \x12\x12\n\x04memo\x18\x04\x20\x02(\tR\x04memo\x1a\x8b\x02\n\x11EosActio\ + nDelegate\x12\x16\n\x06sender\x18\x01\x20\x02(\x04R\x06sender\x12\x1a\n\ + \x08receiver\x18\x02\x20\x02(\x04R\x08receiver\x12R\n\x0cnet_quantity\ + \x18\x03\x20\x02(\x0b2/.hw.trezor.messages.eos.EosTxActionAck.EosAssetR\ + \x0bnetQuantity\x12R\n\x0ccpu_quantity\x18\x04\x20\x02(\x0b2/.hw.trezor.\ + messages.eos.EosTxActionAck.EosAssetR\x0bcpuQuantity\x12\x1a\n\x08transf\ + er\x18\x05\x20\x02(\x08R\x08transfer\x1a\xf1\x01\n\x13EosActionUndelegat\ + e\x12\x16\n\x06sender\x18\x01\x20\x02(\x04R\x06sender\x12\x1a\n\x08recei\ + ver\x18\x02\x20\x02(\x04R\x08receiver\x12R\n\x0cnet_quantity\x18\x03\x20\ + \x02(\x0b2/.hw.trezor.messages.eos.EosTxActionAck.EosAssetR\x0bnetQuanti\ + ty\x12R\n\x0ccpu_quantity\x18\x04\x20\x02(\x0b2/.hw.trezor.messages.eos.\ + EosTxActionAck.EosAssetR\x0bcpuQuantity\x1a'\n\x0fEosActionRefund\x12\ + \x14\n\x05owner\x18\x01\x20\x02(\x04R\x05owner\x1a\x90\x01\n\x0fEosActio\ + nBuyRam\x12\x14\n\x05payer\x18\x01\x20\x02(\x04R\x05payer\x12\x1a\n\x08r\ + eceiver\x18\x02\x20\x02(\x04R\x08receiver\x12K\n\x08quantity\x18\x03\x20\ + \x02(\x0b2/.hw.trezor.messages.eos.EosTxActionAck.EosAssetR\x08quantity\ + \x1a^\n\x14EosActionBuyRamBytes\x12\x14\n\x05payer\x18\x01\x20\x02(\x04R\ + \x05payer\x12\x1a\n\x08receiver\x18\x02\x20\x02(\x04R\x08receiver\x12\ + \x14\n\x05bytes\x18\x03\x20\x02(\rR\x05bytes\x1aB\n\x10EosActionSellRam\ + \x12\x18\n\x07account\x18\x01\x20\x02(\x04R\x07account\x12\x14\n\x05byte\ + s\x18\x02\x20\x02(\x04R\x05bytes\x1aa\n\x15EosActionVoteProducer\x12\x14\ + \n\x05voter\x18\x01\x20\x02(\x04R\x05voter\x12\x14\n\x05proxy\x18\x02\ + \x20\x02(\x04R\x05proxy\x12\x1c\n\tproducers\x18\x03\x20\x03(\x04R\tprod\ + ucers\x1a\xb4\x01\n\x13EosActionUpdateAuth\x12\x18\n\x07account\x18\x01\ + \x20\x02(\x04R\x07account\x12\x1e\n\npermission\x18\x02\x20\x02(\x04R\np\ + ermission\x12\x16\n\x06parent\x18\x03\x20\x02(\x04R\x06parent\x12K\n\x04\ + auth\x18\x04\x20\x02(\x0b27.hw.trezor.messages.eos.EosTxActionAck.EosAut\ + horizationR\x04auth\x1aO\n\x13EosActionDeleteAuth\x12\x18\n\x07account\ + \x18\x01\x20\x02(\x04R\x07account\x12\x1e\n\npermission\x18\x02\x20\x02(\ + \x04R\npermission\x1aw\n\x11EosActionLinkAuth\x12\x18\n\x07account\x18\ + \x01\x20\x02(\x04R\x07account\x12\x12\n\x04code\x18\x02\x20\x02(\x04R\ + \x04code\x12\x12\n\x04type\x18\x03\x20\x02(\x04R\x04type\x12\x20\n\x0bre\ + quirement\x18\x04\x20\x02(\x04R\x0brequirement\x1aW\n\x13EosActionUnlink\ + Auth\x12\x18\n\x07account\x18\x01\x20\x02(\x04R\x07account\x12\x12\n\x04\ + code\x18\x02\x20\x02(\x04R\x04code\x12\x12\n\x04type\x18\x03\x20\x02(\ + \x04R\x04type\x1a\xe3\x01\n\x13EosActionNewAccount\x12\x18\n\x07creator\ + \x18\x01\x20\x02(\x04R\x07creator\x12\x12\n\x04name\x18\x02\x20\x02(\x04\ + R\x04name\x12M\n\x05owner\x18\x03\x20\x02(\x0b27.hw.trezor.messages.eos.\ + EosTxActionAck.EosAuthorizationR\x05owner\x12O\n\x06active\x18\x04\x20\ + \x02(\x0b27.hw.trezor.messages.eos.EosTxActionAck.EosAuthorizationR\x06a\ + ctive\x1aN\n\x10EosActionUnknown\x12\x1b\n\tdata_size\x18\x01\x20\x02(\r\ + R\x08dataSize\x12\x1d\n\ndata_chunk\x18\x02\x20\x02(\x0cR\tdataChunk\"+\ + \n\x0bEosSignedTx\x12\x1c\n\tsignature\x18\x01\x20\x02(\tR\tsignatureB7\ + \n#com.satoshilabs.trezor.lib.protobufB\x10TrezorMessageEos\ +"; + +/// `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(28); + messages.push(EosGetPublicKey::generated_message_descriptor_data()); + messages.push(EosPublicKey::generated_message_descriptor_data()); + messages.push(EosSignTx::generated_message_descriptor_data()); + messages.push(EosTxActionRequest::generated_message_descriptor_data()); + messages.push(EosTxActionAck::generated_message_descriptor_data()); + messages.push(EosSignedTx::generated_message_descriptor_data()); + messages.push(eos_sign_tx::EosTxHeader::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosAsset::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosPermissionLevel::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosAuthorizationKey::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosAuthorizationAccount::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosAuthorizationWait::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosAuthorization::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosActionCommon::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosActionTransfer::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosActionDelegate::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosActionUndelegate::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosActionRefund::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosActionBuyRam::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosActionBuyRamBytes::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosActionSellRam::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosActionVoteProducer::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosActionUpdateAuth::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosActionDeleteAuth::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosActionLinkAuth::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosActionUnlinkAuth::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosActionNewAccount::generated_message_descriptor_data()); + messages.push(eos_tx_action_ack::EosActionUnknown::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_ethereum.rs b/wallet/trezor-client/src/protos/generated/messages_ethereum.rs new file mode 100644 index 0000000000..701dda7126 --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_ethereum.rs @@ -0,0 +1,4199 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum.EthereumGetPublicKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumGetPublicKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumGetPublicKey.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumGetPublicKey.show_display) + pub show_display: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum.EthereumGetPublicKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumGetPublicKey { + fn default() -> &'a EthereumGetPublicKey { + ::default_instance() + } +} + +impl EthereumGetPublicKey { + pub fn new() -> EthereumGetPublicKey { + ::std::default::Default::default() + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + 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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &EthereumGetPublicKey| { &m.address_n }, + |m: &mut EthereumGetPublicKey| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &EthereumGetPublicKey| { &m.show_display }, + |m: &mut EthereumGetPublicKey| { &mut m.show_display }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumGetPublicKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumGetPublicKey { + const NAME: &'static str = "EthereumGetPublicKey"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.show_display { + os.write_bool(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() -> EthereumGetPublicKey { + EthereumGetPublicKey::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.show_display = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumGetPublicKey { + static instance: EthereumGetPublicKey = EthereumGetPublicKey { + address_n: ::std::vec::Vec::new(), + show_display: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumGetPublicKey { + 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("EthereumGetPublicKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumGetPublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumGetPublicKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum.EthereumPublicKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumPublicKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumPublicKey.node) + pub node: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumPublicKey.xpub) + pub xpub: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum.EthereumPublicKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumPublicKey { + fn default() -> &'a EthereumPublicKey { + ::default_instance() + } +} + +impl EthereumPublicKey { + pub fn new() -> EthereumPublicKey { + ::std::default::Default::default() + } + + // required string xpub = 2; + + pub fn xpub(&self) -> &str { + match self.xpub.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_xpub(&mut self) { + self.xpub = ::std::option::Option::None; + } + + pub fn has_xpub(&self) -> bool { + self.xpub.is_some() + } + + // Param is passed by value, moved + pub fn set_xpub(&mut self, v: ::std::string::String) { + self.xpub = ::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_xpub(&mut self) -> &mut ::std::string::String { + if self.xpub.is_none() { + self.xpub = ::std::option::Option::Some(::std::string::String::new()); + } + self.xpub.as_mut().unwrap() + } + + // Take field + pub fn take_xpub(&mut self) -> ::std::string::String { + self.xpub.take().unwrap_or_else(|| ::std::string::String::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_message_field_accessor::<_, super::messages_common::HDNodeType>( + "node", + |m: &EthereumPublicKey| { &m.node }, + |m: &mut EthereumPublicKey| { &mut m.node }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "xpub", + |m: &EthereumPublicKey| { &m.xpub }, + |m: &mut EthereumPublicKey| { &mut m.xpub }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumPublicKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumPublicKey { + const NAME: &'static str = "EthereumPublicKey"; + + fn is_initialized(&self) -> bool { + if self.node.is_none() { + return false; + } + if self.xpub.is_none() { + return false; + } + for v in &self.node { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.node)?; + }, + 18 => { + self.xpub = ::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.node.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.xpub.as_ref() { + my_size += ::protobuf::rt::string_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.node.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.xpub.as_ref() { + os.write_string(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() -> EthereumPublicKey { + EthereumPublicKey::new() + } + + fn clear(&mut self) { + self.node.clear(); + self.xpub = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumPublicKey { + static instance: EthereumPublicKey = EthereumPublicKey { + node: ::protobuf::MessageField::none(), + xpub: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumPublicKey { + 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("EthereumPublicKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumPublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumPublicKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum.EthereumGetAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumGetAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumGetAddress.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumGetAddress.show_display) + pub show_display: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumGetAddress.encoded_network) + pub encoded_network: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumGetAddress.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum.EthereumGetAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumGetAddress { + fn default() -> &'a EthereumGetAddress { + ::default_instance() + } +} + +impl EthereumGetAddress { + pub fn new() -> EthereumGetAddress { + ::std::default::Default::default() + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + // optional bytes encoded_network = 3; + + 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) { + 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 { + 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 { + self.encoded_network.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool chunkify = 4; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + 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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &EthereumGetAddress| { &m.address_n }, + |m: &mut EthereumGetAddress| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &EthereumGetAddress| { &m.show_display }, + |m: &mut EthereumGetAddress| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "encoded_network", + |m: &EthereumGetAddress| { &m.encoded_network }, + |m: &mut EthereumGetAddress| { &mut m.encoded_network }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &EthereumGetAddress| { &m.chunkify }, + |m: &mut EthereumGetAddress| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumGetAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumGetAddress { + const NAME: &'static str = "EthereumGetAddress"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 26 => { + self.encoded_network = ::std::option::Option::Some(is.read_bytes()?); + }, + 32 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + if let Some(v) = self.encoded_network.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.show_display { + os.write_bool(2, v)?; + } + if let Some(v) = self.encoded_network.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(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() -> EthereumGetAddress { + EthereumGetAddress::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.show_display = ::std::option::Option::None; + self.encoded_network = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumGetAddress { + static instance: EthereumGetAddress = EthereumGetAddress { + address_n: ::std::vec::Vec::new(), + show_display: ::std::option::Option::None, + encoded_network: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumGetAddress { + 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("EthereumGetAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumGetAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumGetAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum.EthereumAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumAddress._old_address) + pub _old_address: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumAddress.address) + pub address: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum.EthereumAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumAddress { + fn default() -> &'a EthereumAddress { + ::default_instance() + } +} + +impl EthereumAddress { + pub fn new() -> EthereumAddress { + ::std::default::Default::default() + } + + // optional bytes _old_address = 1; + + pub fn _old_address(&self) -> &[u8] { + match self._old_address.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear__old_address(&mut self) { + self._old_address = ::std::option::Option::None; + } + + pub fn has__old_address(&self) -> bool { + self._old_address.is_some() + } + + // Param is passed by value, moved + pub fn set__old_address(&mut self, v: ::std::vec::Vec) { + self._old_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__old_address(&mut self) -> &mut ::std::vec::Vec { + if self._old_address.is_none() { + self._old_address = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self._old_address.as_mut().unwrap() + } + + // Take field + pub fn take__old_address(&mut self) -> ::std::vec::Vec { + self._old_address.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional string address = 2; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::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::<_, _>( + "_old_address", + |m: &EthereumAddress| { &m._old_address }, + |m: &mut EthereumAddress| { &mut m._old_address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &EthereumAddress| { &m.address }, + |m: &mut EthereumAddress| { &mut m.address }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumAddress { + const NAME: &'static str = "EthereumAddress"; + + 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._old_address = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.address = ::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._old_address.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.address.as_ref() { + my_size += ::protobuf::rt::string_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._old_address.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.address.as_ref() { + os.write_string(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() -> EthereumAddress { + EthereumAddress::new() + } + + fn clear(&mut self) { + self._old_address = ::std::option::Option::None; + self.address = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumAddress { + static instance: EthereumAddress = EthereumAddress { + _old_address: ::std::option::Option::None, + address: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumAddress { + 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("EthereumAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum.EthereumSignTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumSignTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTx.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTx.nonce) + pub nonce: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTx.gas_price) + pub gas_price: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTx.gas_limit) + pub gas_limit: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTx.to) + pub to: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTx.value) + pub value: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTx.data_initial_chunk) + pub data_initial_chunk: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTx.data_length) + pub data_length: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTx.chain_id) + pub chain_id: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTx.tx_type) + pub tx_type: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTx.definitions) + pub definitions: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTx.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum.EthereumSignTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumSignTx { + fn default() -> &'a EthereumSignTx { + ::default_instance() + } +} + +impl EthereumSignTx { + pub fn new() -> EthereumSignTx { + ::std::default::Default::default() + } + + // optional bytes nonce = 2; + + pub fn nonce(&self) -> &[u8] { + match self.nonce.as_ref() { + Some(v) => v, + None => b"", + } + } + + pub fn clear_nonce(&mut self) { + self.nonce = ::std::option::Option::None; + } + + pub fn has_nonce(&self) -> bool { + self.nonce.is_some() + } + + // Param is passed by value, moved + pub fn set_nonce(&mut self, v: ::std::vec::Vec) { + self.nonce = ::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_nonce(&mut self) -> &mut ::std::vec::Vec { + if self.nonce.is_none() { + self.nonce = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.nonce.as_mut().unwrap() + } + + // Take field + pub fn take_nonce(&mut self) -> ::std::vec::Vec { + self.nonce.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes gas_price = 3; + + pub fn gas_price(&self) -> &[u8] { + match self.gas_price.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_gas_price(&mut self) { + self.gas_price = ::std::option::Option::None; + } + + pub fn has_gas_price(&self) -> bool { + self.gas_price.is_some() + } + + // Param is passed by value, moved + pub fn set_gas_price(&mut self, v: ::std::vec::Vec) { + self.gas_price = ::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_gas_price(&mut self) -> &mut ::std::vec::Vec { + if self.gas_price.is_none() { + self.gas_price = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.gas_price.as_mut().unwrap() + } + + // Take field + pub fn take_gas_price(&mut self) -> ::std::vec::Vec { + self.gas_price.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes gas_limit = 4; + + pub fn gas_limit(&self) -> &[u8] { + match self.gas_limit.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_gas_limit(&mut self) { + self.gas_limit = ::std::option::Option::None; + } + + pub fn has_gas_limit(&self) -> bool { + self.gas_limit.is_some() + } + + // Param is passed by value, moved + pub fn set_gas_limit(&mut self, v: ::std::vec::Vec) { + self.gas_limit = ::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_gas_limit(&mut self) -> &mut ::std::vec::Vec { + if self.gas_limit.is_none() { + self.gas_limit = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.gas_limit.as_mut().unwrap() + } + + // Take field + pub fn take_gas_limit(&mut self) -> ::std::vec::Vec { + self.gas_limit.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional string to = 11; + + pub fn to(&self) -> &str { + match self.to.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_to(&mut self) { + self.to = ::std::option::Option::None; + } + + pub fn has_to(&self) -> bool { + self.to.is_some() + } + + // Param is passed by value, moved + pub fn set_to(&mut self, v: ::std::string::String) { + self.to = ::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_to(&mut self) -> &mut ::std::string::String { + if self.to.is_none() { + self.to = ::std::option::Option::Some(::std::string::String::new()); + } + self.to.as_mut().unwrap() + } + + // Take field + pub fn take_to(&mut self) -> ::std::string::String { + self.to.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bytes value = 6; + + pub fn value(&self) -> &[u8] { + match self.value.as_ref() { + Some(v) => v, + None => b"", + } + } + + pub fn clear_value(&mut self) { + self.value = ::std::option::Option::None; + } + + pub fn has_value(&self) -> bool { + self.value.is_some() + } + + // Param is passed by value, moved + pub fn set_value(&mut self, v: ::std::vec::Vec) { + self.value = ::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_value(&mut self) -> &mut ::std::vec::Vec { + if self.value.is_none() { + self.value = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.value.as_mut().unwrap() + } + + // Take field + pub fn take_value(&mut self) -> ::std::vec::Vec { + self.value.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes data_initial_chunk = 7; + + pub fn data_initial_chunk(&self) -> &[u8] { + match self.data_initial_chunk.as_ref() { + Some(v) => v, + None => b"", + } + } + + pub fn clear_data_initial_chunk(&mut self) { + self.data_initial_chunk = ::std::option::Option::None; + } + + pub fn has_data_initial_chunk(&self) -> bool { + self.data_initial_chunk.is_some() + } + + // Param is passed by value, moved + pub fn set_data_initial_chunk(&mut self, v: ::std::vec::Vec) { + self.data_initial_chunk = ::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_data_initial_chunk(&mut self) -> &mut ::std::vec::Vec { + if self.data_initial_chunk.is_none() { + self.data_initial_chunk = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.data_initial_chunk.as_mut().unwrap() + } + + // Take field + pub fn take_data_initial_chunk(&mut self) -> ::std::vec::Vec { + self.data_initial_chunk.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 data_length = 8; + + pub fn data_length(&self) -> u32 { + self.data_length.unwrap_or(0u32) + } + + pub fn clear_data_length(&mut self) { + self.data_length = ::std::option::Option::None; + } + + pub fn has_data_length(&self) -> bool { + self.data_length.is_some() + } + + // Param is passed by value, moved + pub fn set_data_length(&mut self, v: u32) { + self.data_length = ::std::option::Option::Some(v); + } + + // required uint64 chain_id = 9; + + 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); + } + + // optional uint32 tx_type = 10; + + pub fn tx_type(&self) -> u32 { + self.tx_type.unwrap_or(0) + } + + pub fn clear_tx_type(&mut self) { + self.tx_type = ::std::option::Option::None; + } + + pub fn has_tx_type(&self) -> bool { + self.tx_type.is_some() + } + + // Param is passed by value, moved + pub fn set_tx_type(&mut self, v: u32) { + self.tx_type = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 13; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(12); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &EthereumSignTx| { &m.address_n }, + |m: &mut EthereumSignTx| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "nonce", + |m: &EthereumSignTx| { &m.nonce }, + |m: &mut EthereumSignTx| { &mut m.nonce }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "gas_price", + |m: &EthereumSignTx| { &m.gas_price }, + |m: &mut EthereumSignTx| { &mut m.gas_price }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "gas_limit", + |m: &EthereumSignTx| { &m.gas_limit }, + |m: &mut EthereumSignTx| { &mut m.gas_limit }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "to", + |m: &EthereumSignTx| { &m.to }, + |m: &mut EthereumSignTx| { &mut m.to }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "value", + |m: &EthereumSignTx| { &m.value }, + |m: &mut EthereumSignTx| { &mut m.value }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data_initial_chunk", + |m: &EthereumSignTx| { &m.data_initial_chunk }, + |m: &mut EthereumSignTx| { &mut m.data_initial_chunk }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data_length", + |m: &EthereumSignTx| { &m.data_length }, + |m: &mut EthereumSignTx| { &mut m.data_length }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chain_id", + |m: &EthereumSignTx| { &m.chain_id }, + |m: &mut EthereumSignTx| { &mut m.chain_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "tx_type", + |m: &EthereumSignTx| { &m.tx_type }, + |m: &mut EthereumSignTx| { &mut m.tx_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::messages_ethereum_definitions::EthereumDefinitions>( + "definitions", + |m: &EthereumSignTx| { &m.definitions }, + |m: &mut EthereumSignTx| { &mut m.definitions }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &EthereumSignTx| { &m.chunkify }, + |m: &mut EthereumSignTx| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumSignTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumSignTx { + const NAME: &'static str = "EthereumSignTx"; + + fn is_initialized(&self) -> bool { + if self.gas_price.is_none() { + return false; + } + if self.gas_limit.is_none() { + return false; + } + if self.chain_id.is_none() { + return false; + } + for v in &self.definitions { + if !v.is_initialized() { + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.nonce = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.gas_price = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.gas_limit = ::std::option::Option::Some(is.read_bytes()?); + }, + 90 => { + self.to = ::std::option::Option::Some(is.read_string()?); + }, + 50 => { + self.value = ::std::option::Option::Some(is.read_bytes()?); + }, + 58 => { + self.data_initial_chunk = ::std::option::Option::Some(is.read_bytes()?); + }, + 64 => { + self.data_length = ::std::option::Option::Some(is.read_uint32()?); + }, + 72 => { + self.chain_id = ::std::option::Option::Some(is.read_uint64()?); + }, + 80 => { + self.tx_type = ::std::option::Option::Some(is.read_uint32()?); + }, + 98 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.definitions)?; + }, + 104 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.nonce.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.gas_price.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.gas_limit.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.to.as_ref() { + my_size += ::protobuf::rt::string_size(11, &v); + } + if let Some(v) = self.value.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &v); + } + if let Some(v) = self.data_initial_chunk.as_ref() { + my_size += ::protobuf::rt::bytes_size(7, &v); + } + if let Some(v) = self.data_length { + my_size += ::protobuf::rt::uint32_size(8, v); + } + if let Some(v) = self.chain_id { + my_size += ::protobuf::rt::uint64_size(9, v); + } + if let Some(v) = self.tx_type { + my_size += ::protobuf::rt::uint32_size(10, v); + } + if let Some(v) = self.definitions.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.nonce.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.gas_price.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.gas_limit.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.to.as_ref() { + os.write_string(11, v)?; + } + if let Some(v) = self.value.as_ref() { + os.write_bytes(6, v)?; + } + if let Some(v) = self.data_initial_chunk.as_ref() { + os.write_bytes(7, v)?; + } + if let Some(v) = self.data_length { + os.write_uint32(8, v)?; + } + if let Some(v) = self.chain_id { + os.write_uint64(9, v)?; + } + if let Some(v) = self.tx_type { + os.write_uint32(10, v)?; + } + if let Some(v) = self.definitions.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(12, v, os)?; + } + if let Some(v) = self.chunkify { + os.write_bool(13, 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() -> EthereumSignTx { + EthereumSignTx::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.nonce = ::std::option::Option::None; + self.gas_price = ::std::option::Option::None; + self.gas_limit = ::std::option::Option::None; + self.to = ::std::option::Option::None; + self.value = ::std::option::Option::None; + self.data_initial_chunk = ::std::option::Option::None; + self.data_length = ::std::option::Option::None; + self.chain_id = ::std::option::Option::None; + self.tx_type = ::std::option::Option::None; + self.definitions.clear(); + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumSignTx { + static instance: EthereumSignTx = EthereumSignTx { + address_n: ::std::vec::Vec::new(), + nonce: ::std::option::Option::None, + gas_price: ::std::option::Option::None, + gas_limit: ::std::option::Option::None, + to: ::std::option::Option::None, + value: ::std::option::Option::None, + data_initial_chunk: ::std::option::Option::None, + data_length: ::std::option::Option::None, + chain_id: ::std::option::Option::None, + tx_type: ::std::option::Option::None, + definitions: ::protobuf::MessageField::none(), + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumSignTx { + 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("EthereumSignTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumSignTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumSignTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum.EthereumSignTxEIP1559) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumSignTxEIP1559 { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.nonce) + pub nonce: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.max_gas_fee) + pub max_gas_fee: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.max_priority_fee) + pub max_priority_fee: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.gas_limit) + pub gas_limit: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.to) + pub to: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.value) + pub value: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.data_initial_chunk) + pub data_initial_chunk: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.data_length) + pub data_length: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.chain_id) + pub chain_id: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.access_list) + pub access_list: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.definitions) + pub definitions: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumSignTxEIP1559 { + fn default() -> &'a EthereumSignTxEIP1559 { + ::default_instance() + } +} + +impl EthereumSignTxEIP1559 { + pub fn new() -> EthereumSignTxEIP1559 { + ::std::default::Default::default() + } + + // required bytes nonce = 2; + + pub fn nonce(&self) -> &[u8] { + match self.nonce.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_nonce(&mut self) { + self.nonce = ::std::option::Option::None; + } + + pub fn has_nonce(&self) -> bool { + self.nonce.is_some() + } + + // Param is passed by value, moved + pub fn set_nonce(&mut self, v: ::std::vec::Vec) { + self.nonce = ::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_nonce(&mut self) -> &mut ::std::vec::Vec { + if self.nonce.is_none() { + self.nonce = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.nonce.as_mut().unwrap() + } + + // Take field + pub fn take_nonce(&mut self) -> ::std::vec::Vec { + self.nonce.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes max_gas_fee = 3; + + pub fn max_gas_fee(&self) -> &[u8] { + match self.max_gas_fee.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_max_gas_fee(&mut self) { + self.max_gas_fee = ::std::option::Option::None; + } + + pub fn has_max_gas_fee(&self) -> bool { + self.max_gas_fee.is_some() + } + + // Param is passed by value, moved + pub fn set_max_gas_fee(&mut self, v: ::std::vec::Vec) { + self.max_gas_fee = ::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_max_gas_fee(&mut self) -> &mut ::std::vec::Vec { + if self.max_gas_fee.is_none() { + self.max_gas_fee = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.max_gas_fee.as_mut().unwrap() + } + + // Take field + pub fn take_max_gas_fee(&mut self) -> ::std::vec::Vec { + self.max_gas_fee.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes max_priority_fee = 4; + + pub fn max_priority_fee(&self) -> &[u8] { + match self.max_priority_fee.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_max_priority_fee(&mut self) { + self.max_priority_fee = ::std::option::Option::None; + } + + pub fn has_max_priority_fee(&self) -> bool { + self.max_priority_fee.is_some() + } + + // Param is passed by value, moved + pub fn set_max_priority_fee(&mut self, v: ::std::vec::Vec) { + self.max_priority_fee = ::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_max_priority_fee(&mut self) -> &mut ::std::vec::Vec { + if self.max_priority_fee.is_none() { + self.max_priority_fee = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.max_priority_fee.as_mut().unwrap() + } + + // Take field + pub fn take_max_priority_fee(&mut self) -> ::std::vec::Vec { + self.max_priority_fee.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes gas_limit = 5; + + pub fn gas_limit(&self) -> &[u8] { + match self.gas_limit.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_gas_limit(&mut self) { + self.gas_limit = ::std::option::Option::None; + } + + pub fn has_gas_limit(&self) -> bool { + self.gas_limit.is_some() + } + + // Param is passed by value, moved + pub fn set_gas_limit(&mut self, v: ::std::vec::Vec) { + self.gas_limit = ::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_gas_limit(&mut self) -> &mut ::std::vec::Vec { + if self.gas_limit.is_none() { + self.gas_limit = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.gas_limit.as_mut().unwrap() + } + + // Take field + pub fn take_gas_limit(&mut self) -> ::std::vec::Vec { + self.gas_limit.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional string to = 6; + + pub fn to(&self) -> &str { + match self.to.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_to(&mut self) { + self.to = ::std::option::Option::None; + } + + pub fn has_to(&self) -> bool { + self.to.is_some() + } + + // Param is passed by value, moved + pub fn set_to(&mut self, v: ::std::string::String) { + self.to = ::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_to(&mut self) -> &mut ::std::string::String { + if self.to.is_none() { + self.to = ::std::option::Option::Some(::std::string::String::new()); + } + self.to.as_mut().unwrap() + } + + // Take field + pub fn take_to(&mut self) -> ::std::string::String { + self.to.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required bytes value = 7; + + pub fn value(&self) -> &[u8] { + match self.value.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_value(&mut self) { + self.value = ::std::option::Option::None; + } + + pub fn has_value(&self) -> bool { + self.value.is_some() + } + + // Param is passed by value, moved + pub fn set_value(&mut self, v: ::std::vec::Vec) { + self.value = ::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_value(&mut self) -> &mut ::std::vec::Vec { + if self.value.is_none() { + self.value = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.value.as_mut().unwrap() + } + + // Take field + pub fn take_value(&mut self) -> ::std::vec::Vec { + self.value.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes data_initial_chunk = 8; + + pub fn data_initial_chunk(&self) -> &[u8] { + match self.data_initial_chunk.as_ref() { + Some(v) => v, + None => b"", + } + } + + pub fn clear_data_initial_chunk(&mut self) { + self.data_initial_chunk = ::std::option::Option::None; + } + + pub fn has_data_initial_chunk(&self) -> bool { + self.data_initial_chunk.is_some() + } + + // Param is passed by value, moved + pub fn set_data_initial_chunk(&mut self, v: ::std::vec::Vec) { + self.data_initial_chunk = ::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_data_initial_chunk(&mut self) -> &mut ::std::vec::Vec { + if self.data_initial_chunk.is_none() { + self.data_initial_chunk = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.data_initial_chunk.as_mut().unwrap() + } + + // Take field + pub fn take_data_initial_chunk(&mut self) -> ::std::vec::Vec { + self.data_initial_chunk.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint32 data_length = 9; + + pub fn data_length(&self) -> u32 { + self.data_length.unwrap_or(0) + } + + pub fn clear_data_length(&mut self) { + self.data_length = ::std::option::Option::None; + } + + pub fn has_data_length(&self) -> bool { + self.data_length.is_some() + } + + // Param is passed by value, moved + pub fn set_data_length(&mut self, v: u32) { + self.data_length = ::std::option::Option::Some(v); + } + + // required uint64 chain_id = 10; + + 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); + } + + // optional bool chunkify = 13; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(13); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &EthereumSignTxEIP1559| { &m.address_n }, + |m: &mut EthereumSignTxEIP1559| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "nonce", + |m: &EthereumSignTxEIP1559| { &m.nonce }, + |m: &mut EthereumSignTxEIP1559| { &mut m.nonce }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "max_gas_fee", + |m: &EthereumSignTxEIP1559| { &m.max_gas_fee }, + |m: &mut EthereumSignTxEIP1559| { &mut m.max_gas_fee }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "max_priority_fee", + |m: &EthereumSignTxEIP1559| { &m.max_priority_fee }, + |m: &mut EthereumSignTxEIP1559| { &mut m.max_priority_fee }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "gas_limit", + |m: &EthereumSignTxEIP1559| { &m.gas_limit }, + |m: &mut EthereumSignTxEIP1559| { &mut m.gas_limit }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "to", + |m: &EthereumSignTxEIP1559| { &m.to }, + |m: &mut EthereumSignTxEIP1559| { &mut m.to }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "value", + |m: &EthereumSignTxEIP1559| { &m.value }, + |m: &mut EthereumSignTxEIP1559| { &mut m.value }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data_initial_chunk", + |m: &EthereumSignTxEIP1559| { &m.data_initial_chunk }, + |m: &mut EthereumSignTxEIP1559| { &mut m.data_initial_chunk }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data_length", + |m: &EthereumSignTxEIP1559| { &m.data_length }, + |m: &mut EthereumSignTxEIP1559| { &mut m.data_length }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chain_id", + |m: &EthereumSignTxEIP1559| { &m.chain_id }, + |m: &mut EthereumSignTxEIP1559| { &mut m.chain_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "access_list", + |m: &EthereumSignTxEIP1559| { &m.access_list }, + |m: &mut EthereumSignTxEIP1559| { &mut m.access_list }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::messages_ethereum_definitions::EthereumDefinitions>( + "definitions", + |m: &EthereumSignTxEIP1559| { &m.definitions }, + |m: &mut EthereumSignTxEIP1559| { &mut m.definitions }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &EthereumSignTxEIP1559| { &m.chunkify }, + |m: &mut EthereumSignTxEIP1559| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumSignTxEIP1559", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumSignTxEIP1559 { + const NAME: &'static str = "EthereumSignTxEIP1559"; + + fn is_initialized(&self) -> bool { + if self.nonce.is_none() { + return false; + } + if self.max_gas_fee.is_none() { + return false; + } + if self.max_priority_fee.is_none() { + return false; + } + if self.gas_limit.is_none() { + return false; + } + if self.value.is_none() { + return false; + } + if self.data_length.is_none() { + return false; + } + if self.chain_id.is_none() { + return false; + } + for v in &self.access_list { + if !v.is_initialized() { + return false; + } + }; + for v in &self.definitions { + if !v.is_initialized() { + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.nonce = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.max_gas_fee = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.max_priority_fee = ::std::option::Option::Some(is.read_bytes()?); + }, + 42 => { + self.gas_limit = ::std::option::Option::Some(is.read_bytes()?); + }, + 50 => { + self.to = ::std::option::Option::Some(is.read_string()?); + }, + 58 => { + self.value = ::std::option::Option::Some(is.read_bytes()?); + }, + 66 => { + self.data_initial_chunk = ::std::option::Option::Some(is.read_bytes()?); + }, + 72 => { + self.data_length = ::std::option::Option::Some(is.read_uint32()?); + }, + 80 => { + self.chain_id = ::std::option::Option::Some(is.read_uint64()?); + }, + 90 => { + self.access_list.push(is.read_message()?); + }, + 98 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.definitions)?; + }, + 104 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.nonce.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.max_gas_fee.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.max_priority_fee.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.gas_limit.as_ref() { + my_size += ::protobuf::rt::bytes_size(5, &v); + } + if let Some(v) = self.to.as_ref() { + my_size += ::protobuf::rt::string_size(6, &v); + } + if let Some(v) = self.value.as_ref() { + my_size += ::protobuf::rt::bytes_size(7, &v); + } + if let Some(v) = self.data_initial_chunk.as_ref() { + my_size += ::protobuf::rt::bytes_size(8, &v); + } + if let Some(v) = self.data_length { + my_size += ::protobuf::rt::uint32_size(9, v); + } + if let Some(v) = self.chain_id { + my_size += ::protobuf::rt::uint64_size(10, v); + } + for value in &self.access_list { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + if let Some(v) = self.definitions.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.nonce.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.max_gas_fee.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.max_priority_fee.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.gas_limit.as_ref() { + os.write_bytes(5, v)?; + } + if let Some(v) = self.to.as_ref() { + os.write_string(6, v)?; + } + if let Some(v) = self.value.as_ref() { + os.write_bytes(7, v)?; + } + if let Some(v) = self.data_initial_chunk.as_ref() { + os.write_bytes(8, v)?; + } + if let Some(v) = self.data_length { + os.write_uint32(9, v)?; + } + if let Some(v) = self.chain_id { + os.write_uint64(10, v)?; + } + for v in &self.access_list { + ::protobuf::rt::write_message_field_with_cached_size(11, v, os)?; + }; + if let Some(v) = self.definitions.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(12, v, os)?; + } + if let Some(v) = self.chunkify { + os.write_bool(13, 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() -> EthereumSignTxEIP1559 { + EthereumSignTxEIP1559::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.nonce = ::std::option::Option::None; + self.max_gas_fee = ::std::option::Option::None; + self.max_priority_fee = ::std::option::Option::None; + self.gas_limit = ::std::option::Option::None; + self.to = ::std::option::Option::None; + self.value = ::std::option::Option::None; + self.data_initial_chunk = ::std::option::Option::None; + self.data_length = ::std::option::Option::None; + self.chain_id = ::std::option::Option::None; + self.access_list.clear(); + self.definitions.clear(); + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumSignTxEIP1559 { + static instance: EthereumSignTxEIP1559 = EthereumSignTxEIP1559 { + address_n: ::std::vec::Vec::new(), + nonce: ::std::option::Option::None, + max_gas_fee: ::std::option::Option::None, + max_priority_fee: ::std::option::Option::None, + gas_limit: ::std::option::Option::None, + to: ::std::option::Option::None, + value: ::std::option::Option::None, + data_initial_chunk: ::std::option::Option::None, + data_length: ::std::option::Option::None, + chain_id: ::std::option::Option::None, + access_list: ::std::vec::Vec::new(), + definitions: ::protobuf::MessageField::none(), + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumSignTxEIP1559 { + 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("EthereumSignTxEIP1559").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumSignTxEIP1559 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumSignTxEIP1559 { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `EthereumSignTxEIP1559` +pub mod ethereum_sign_tx_eip1559 { + // @@protoc_insertion_point(message:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.EthereumAccessList) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EthereumAccessList { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.EthereumAccessList.address) + pub address: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.EthereumAccessList.storage_keys) + pub storage_keys: ::std::vec::Vec<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum.EthereumSignTxEIP1559.EthereumAccessList.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EthereumAccessList { + fn default() -> &'a EthereumAccessList { + ::default_instance() + } + } + + impl EthereumAccessList { + pub fn new() -> EthereumAccessList { + ::std::default::Default::default() + } + + // required string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub(in super) 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::<_, _>( + "address", + |m: &EthereumAccessList| { &m.address }, + |m: &mut EthereumAccessList| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "storage_keys", + |m: &EthereumAccessList| { &m.storage_keys }, + |m: &mut EthereumAccessList| { &mut m.storage_keys }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumSignTxEIP1559.EthereumAccessList", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EthereumAccessList { + const NAME: &'static str = "EthereumAccessList"; + + fn is_initialized(&self) -> bool { + if self.address.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_string()?); + }, + 18 => { + self.storage_keys.push(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.address.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + for value in &self.storage_keys { + my_size += ::protobuf::rt::bytes_size(2, &value); + }; + 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_string(1, v)?; + } + for v in &self.storage_keys { + 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() -> EthereumAccessList { + EthereumAccessList::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.storage_keys.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumAccessList { + static instance: EthereumAccessList = EthereumAccessList { + address: ::std::option::Option::None, + storage_keys: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EthereumAccessList { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EthereumSignTxEIP1559.EthereumAccessList").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EthereumAccessList { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EthereumAccessList { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum.EthereumTxRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumTxRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumTxRequest.data_length) + pub data_length: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumTxRequest.signature_v) + pub signature_v: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumTxRequest.signature_r) + pub signature_r: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumTxRequest.signature_s) + pub signature_s: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum.EthereumTxRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumTxRequest { + fn default() -> &'a EthereumTxRequest { + ::default_instance() + } +} + +impl EthereumTxRequest { + pub fn new() -> EthereumTxRequest { + ::std::default::Default::default() + } + + // optional uint32 data_length = 1; + + pub fn data_length(&self) -> u32 { + self.data_length.unwrap_or(0) + } + + pub fn clear_data_length(&mut self) { + self.data_length = ::std::option::Option::None; + } + + pub fn has_data_length(&self) -> bool { + self.data_length.is_some() + } + + // Param is passed by value, moved + pub fn set_data_length(&mut self, v: u32) { + self.data_length = ::std::option::Option::Some(v); + } + + // optional uint32 signature_v = 2; + + pub fn signature_v(&self) -> u32 { + self.signature_v.unwrap_or(0) + } + + pub fn clear_signature_v(&mut self) { + self.signature_v = ::std::option::Option::None; + } + + pub fn has_signature_v(&self) -> bool { + self.signature_v.is_some() + } + + // Param is passed by value, moved + pub fn set_signature_v(&mut self, v: u32) { + self.signature_v = ::std::option::Option::Some(v); + } + + // optional bytes signature_r = 3; + + pub fn signature_r(&self) -> &[u8] { + match self.signature_r.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature_r(&mut self) { + self.signature_r = ::std::option::Option::None; + } + + pub fn has_signature_r(&self) -> bool { + self.signature_r.is_some() + } + + // Param is passed by value, moved + pub fn set_signature_r(&mut self, v: ::std::vec::Vec) { + self.signature_r = ::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_signature_r(&mut self) -> &mut ::std::vec::Vec { + if self.signature_r.is_none() { + self.signature_r = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature_r.as_mut().unwrap() + } + + // Take field + pub fn take_signature_r(&mut self) -> ::std::vec::Vec { + self.signature_r.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes signature_s = 4; + + pub fn signature_s(&self) -> &[u8] { + match self.signature_s.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature_s(&mut self) { + self.signature_s = ::std::option::Option::None; + } + + pub fn has_signature_s(&self) -> bool { + self.signature_s.is_some() + } + + // Param is passed by value, moved + pub fn set_signature_s(&mut self, v: ::std::vec::Vec) { + self.signature_s = ::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_signature_s(&mut self) -> &mut ::std::vec::Vec { + if self.signature_s.is_none() { + self.signature_s = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature_s.as_mut().unwrap() + } + + // Take field + pub fn take_signature_s(&mut self) -> ::std::vec::Vec { + self.signature_s.take().unwrap_or_else(|| ::std::vec::Vec::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::<_, _>( + "data_length", + |m: &EthereumTxRequest| { &m.data_length }, + |m: &mut EthereumTxRequest| { &mut m.data_length }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature_v", + |m: &EthereumTxRequest| { &m.signature_v }, + |m: &mut EthereumTxRequest| { &mut m.signature_v }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature_r", + |m: &EthereumTxRequest| { &m.signature_r }, + |m: &mut EthereumTxRequest| { &mut m.signature_r }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature_s", + |m: &EthereumTxRequest| { &m.signature_s }, + |m: &mut EthereumTxRequest| { &mut m.signature_s }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumTxRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumTxRequest { + const NAME: &'static str = "EthereumTxRequest"; + + 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 { + 8 => { + self.data_length = ::std::option::Option::Some(is.read_uint32()?); + }, + 16 => { + self.signature_v = ::std::option::Option::Some(is.read_uint32()?); + }, + 26 => { + self.signature_r = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.signature_s = ::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.data_length { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.signature_v { + my_size += ::protobuf::rt::uint32_size(2, v); + } + if let Some(v) = self.signature_r.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.signature_s.as_ref() { + my_size += ::protobuf::rt::bytes_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.data_length { + os.write_uint32(1, v)?; + } + if let Some(v) = self.signature_v { + os.write_uint32(2, v)?; + } + if let Some(v) = self.signature_r.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.signature_s.as_ref() { + os.write_bytes(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() -> EthereumTxRequest { + EthereumTxRequest::new() + } + + fn clear(&mut self) { + self.data_length = ::std::option::Option::None; + self.signature_v = ::std::option::Option::None; + self.signature_r = ::std::option::Option::None; + self.signature_s = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumTxRequest { + static instance: EthereumTxRequest = EthereumTxRequest { + data_length: ::std::option::Option::None, + signature_v: ::std::option::Option::None, + signature_r: ::std::option::Option::None, + signature_s: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumTxRequest { + 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("EthereumTxRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumTxRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumTxRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum.EthereumTxAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumTxAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumTxAck.data_chunk) + pub data_chunk: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum.EthereumTxAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumTxAck { + fn default() -> &'a EthereumTxAck { + ::default_instance() + } +} + +impl EthereumTxAck { + pub fn new() -> EthereumTxAck { + ::std::default::Default::default() + } + + // required bytes data_chunk = 1; + + pub fn data_chunk(&self) -> &[u8] { + match self.data_chunk.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_data_chunk(&mut self) { + self.data_chunk = ::std::option::Option::None; + } + + pub fn has_data_chunk(&self) -> bool { + self.data_chunk.is_some() + } + + // Param is passed by value, moved + pub fn set_data_chunk(&mut self, v: ::std::vec::Vec) { + self.data_chunk = ::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_data_chunk(&mut self) -> &mut ::std::vec::Vec { + if self.data_chunk.is_none() { + self.data_chunk = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.data_chunk.as_mut().unwrap() + } + + // Take field + pub fn take_data_chunk(&mut self) -> ::std::vec::Vec { + self.data_chunk.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data_chunk", + |m: &EthereumTxAck| { &m.data_chunk }, + |m: &mut EthereumTxAck| { &mut m.data_chunk }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumTxAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumTxAck { + const NAME: &'static str = "EthereumTxAck"; + + fn is_initialized(&self) -> bool { + if self.data_chunk.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.data_chunk = ::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.data_chunk.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.data_chunk.as_ref() { + os.write_bytes(1, 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() -> EthereumTxAck { + EthereumTxAck::new() + } + + fn clear(&mut self) { + self.data_chunk = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumTxAck { + static instance: EthereumTxAck = EthereumTxAck { + data_chunk: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumTxAck { + 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("EthereumTxAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumTxAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumTxAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum.EthereumSignMessage) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumSignMessage { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignMessage.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignMessage.message) + pub message: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignMessage.encoded_network) + pub encoded_network: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignMessage.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum.EthereumSignMessage.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumSignMessage { + fn default() -> &'a EthereumSignMessage { + ::default_instance() + } +} + +impl EthereumSignMessage { + pub fn new() -> EthereumSignMessage { + ::std::default::Default::default() + } + + // required bytes message = 2; + + pub fn message(&self) -> &[u8] { + match self.message.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_message(&mut self) { + self.message = ::std::option::Option::None; + } + + pub fn has_message(&self) -> bool { + self.message.is_some() + } + + // Param is passed by value, moved + pub fn set_message(&mut self, v: ::std::vec::Vec) { + self.message = ::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_message(&mut self) -> &mut ::std::vec::Vec { + if self.message.is_none() { + self.message = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.message.as_mut().unwrap() + } + + // Take field + pub fn take_message(&mut self) -> ::std::vec::Vec { + self.message.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes encoded_network = 3; + + 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) { + 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 { + 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 { + self.encoded_network.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool chunkify = 4; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + 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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &EthereumSignMessage| { &m.address_n }, + |m: &mut EthereumSignMessage| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "message", + |m: &EthereumSignMessage| { &m.message }, + |m: &mut EthereumSignMessage| { &mut m.message }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "encoded_network", + |m: &EthereumSignMessage| { &m.encoded_network }, + |m: &mut EthereumSignMessage| { &mut m.encoded_network }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &EthereumSignMessage| { &m.chunkify }, + |m: &mut EthereumSignMessage| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumSignMessage", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumSignMessage { + const NAME: &'static str = "EthereumSignMessage"; + + fn is_initialized(&self) -> bool { + if self.message.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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.message = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.encoded_network = ::std::option::Option::Some(is.read_bytes()?); + }, + 32 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.message.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.encoded_network.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.message.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.encoded_network.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(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() -> EthereumSignMessage { + EthereumSignMessage::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.message = ::std::option::Option::None; + self.encoded_network = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumSignMessage { + static instance: EthereumSignMessage = EthereumSignMessage { + address_n: ::std::vec::Vec::new(), + message: ::std::option::Option::None, + encoded_network: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumSignMessage { + 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("EthereumSignMessage").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumSignMessage { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumSignMessage { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum.EthereumMessageSignature) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumMessageSignature { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumMessageSignature.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumMessageSignature.address) + pub address: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum.EthereumMessageSignature.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumMessageSignature { + fn default() -> &'a EthereumMessageSignature { + ::default_instance() + } +} + +impl EthereumMessageSignature { + pub fn new() -> EthereumMessageSignature { + ::std::default::Default::default() + } + + // required bytes signature = 2; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required string address = 3; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::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::<_, _>( + "signature", + |m: &EthereumMessageSignature| { &m.signature }, + |m: &mut EthereumMessageSignature| { &mut m.signature }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &EthereumMessageSignature| { &m.address }, + |m: &mut EthereumMessageSignature| { &mut m.address }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumMessageSignature", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumMessageSignature { + const NAME: &'static str = "EthereumMessageSignature"; + + fn is_initialized(&self) -> bool { + if self.signature.is_none() { + return false; + } + if self.address.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 { + 18 => { + self.signature = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.address = ::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.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.address.as_ref() { + my_size += ::protobuf::rt::string_size(3, &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.signature.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.address.as_ref() { + os.write_string(3, 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() -> EthereumMessageSignature { + EthereumMessageSignature::new() + } + + fn clear(&mut self) { + self.signature = ::std::option::Option::None; + self.address = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumMessageSignature { + static instance: EthereumMessageSignature = EthereumMessageSignature { + signature: ::std::option::Option::None, + address: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumMessageSignature { + 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("EthereumMessageSignature").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumMessageSignature { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumMessageSignature { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum.EthereumVerifyMessage) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumVerifyMessage { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumVerifyMessage.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumVerifyMessage.message) + pub message: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumVerifyMessage.address) + pub address: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumVerifyMessage.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum.EthereumVerifyMessage.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumVerifyMessage { + fn default() -> &'a EthereumVerifyMessage { + ::default_instance() + } +} + +impl EthereumVerifyMessage { + pub fn new() -> EthereumVerifyMessage { + ::std::default::Default::default() + } + + // required bytes signature = 2; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes message = 3; + + pub fn message(&self) -> &[u8] { + match self.message.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_message(&mut self) { + self.message = ::std::option::Option::None; + } + + pub fn has_message(&self) -> bool { + self.message.is_some() + } + + // Param is passed by value, moved + pub fn set_message(&mut self, v: ::std::vec::Vec) { + self.message = ::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_message(&mut self) -> &mut ::std::vec::Vec { + if self.message.is_none() { + self.message = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.message.as_mut().unwrap() + } + + // Take field + pub fn take_message(&mut self) -> ::std::vec::Vec { + self.message.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required string address = 4; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bool chunkify = 5; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "signature", + |m: &EthereumVerifyMessage| { &m.signature }, + |m: &mut EthereumVerifyMessage| { &mut m.signature }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "message", + |m: &EthereumVerifyMessage| { &m.message }, + |m: &mut EthereumVerifyMessage| { &mut m.message }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &EthereumVerifyMessage| { &m.address }, + |m: &mut EthereumVerifyMessage| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &EthereumVerifyMessage| { &m.chunkify }, + |m: &mut EthereumVerifyMessage| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumVerifyMessage", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumVerifyMessage { + const NAME: &'static str = "EthereumVerifyMessage"; + + fn is_initialized(&self) -> bool { + if self.signature.is_none() { + return false; + } + if self.message.is_none() { + return false; + } + if self.address.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 { + 18 => { + self.signature = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.message = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.address = ::std::option::Option::Some(is.read_string()?); + }, + 40 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.message.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.address.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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.signature.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.message.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.address.as_ref() { + os.write_string(4, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(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() -> EthereumVerifyMessage { + EthereumVerifyMessage::new() + } + + fn clear(&mut self) { + self.signature = ::std::option::Option::None; + self.message = ::std::option::Option::None; + self.address = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumVerifyMessage { + static instance: EthereumVerifyMessage = EthereumVerifyMessage { + signature: ::std::option::Option::None, + message: ::std::option::Option::None, + address: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumVerifyMessage { + 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("EthereumVerifyMessage").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumVerifyMessage { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumVerifyMessage { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum.EthereumSignTypedHash) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumSignTypedHash { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTypedHash.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTypedHash.domain_separator_hash) + pub domain_separator_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTypedHash.message_hash) + pub message_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumSignTypedHash.encoded_network) + pub encoded_network: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum.EthereumSignTypedHash.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumSignTypedHash { + fn default() -> &'a EthereumSignTypedHash { + ::default_instance() + } +} + +impl EthereumSignTypedHash { + pub fn new() -> EthereumSignTypedHash { + ::std::default::Default::default() + } + + // required bytes domain_separator_hash = 2; + + pub fn domain_separator_hash(&self) -> &[u8] { + match self.domain_separator_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_domain_separator_hash(&mut self) { + self.domain_separator_hash = ::std::option::Option::None; + } + + pub fn has_domain_separator_hash(&self) -> bool { + self.domain_separator_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_domain_separator_hash(&mut self, v: ::std::vec::Vec) { + self.domain_separator_hash = ::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_domain_separator_hash(&mut self) -> &mut ::std::vec::Vec { + if self.domain_separator_hash.is_none() { + self.domain_separator_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.domain_separator_hash.as_mut().unwrap() + } + + // Take field + pub fn take_domain_separator_hash(&mut self) -> ::std::vec::Vec { + self.domain_separator_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes message_hash = 3; + + pub fn message_hash(&self) -> &[u8] { + match self.message_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_message_hash(&mut self) { + self.message_hash = ::std::option::Option::None; + } + + pub fn has_message_hash(&self) -> bool { + self.message_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_message_hash(&mut self, v: ::std::vec::Vec) { + self.message_hash = ::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_message_hash(&mut self) -> &mut ::std::vec::Vec { + if self.message_hash.is_none() { + self.message_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.message_hash.as_mut().unwrap() + } + + // Take field + pub fn take_message_hash(&mut self) -> ::std::vec::Vec { + self.message_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes encoded_network = 4; + + 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) { + 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 { + 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 { + self.encoded_network.take().unwrap_or_else(|| ::std::vec::Vec::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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &EthereumSignTypedHash| { &m.address_n }, + |m: &mut EthereumSignTypedHash| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "domain_separator_hash", + |m: &EthereumSignTypedHash| { &m.domain_separator_hash }, + |m: &mut EthereumSignTypedHash| { &mut m.domain_separator_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "message_hash", + |m: &EthereumSignTypedHash| { &m.message_hash }, + |m: &mut EthereumSignTypedHash| { &mut m.message_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "encoded_network", + |m: &EthereumSignTypedHash| { &m.encoded_network }, + |m: &mut EthereumSignTypedHash| { &mut m.encoded_network }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumSignTypedHash", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumSignTypedHash { + const NAME: &'static str = "EthereumSignTypedHash"; + + fn is_initialized(&self) -> bool { + if self.domain_separator_hash.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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.domain_separator_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.message_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.encoded_network = ::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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.domain_separator_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.message_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.encoded_network.as_ref() { + my_size += ::protobuf::rt::bytes_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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.domain_separator_hash.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.message_hash.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.encoded_network.as_ref() { + os.write_bytes(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() -> EthereumSignTypedHash { + EthereumSignTypedHash::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.domain_separator_hash = ::std::option::Option::None; + self.message_hash = ::std::option::Option::None; + self.encoded_network = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumSignTypedHash { + static instance: EthereumSignTypedHash = EthereumSignTypedHash { + address_n: ::std::vec::Vec::new(), + domain_separator_hash: ::std::option::Option::None, + message_hash: ::std::option::Option::None, + encoded_network: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumSignTypedHash { + 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("EthereumSignTypedHash").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumSignTypedHash { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumSignTypedHash { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum.EthereumTypedDataSignature) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumTypedDataSignature { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumTypedDataSignature.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumTypedDataSignature.address) + pub address: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum.EthereumTypedDataSignature.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumTypedDataSignature { + fn default() -> &'a EthereumTypedDataSignature { + ::default_instance() + } +} + +impl EthereumTypedDataSignature { + pub fn new() -> EthereumTypedDataSignature { + ::std::default::Default::default() + } + + // required bytes signature = 1; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required string address = 2; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::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::<_, _>( + "signature", + |m: &EthereumTypedDataSignature| { &m.signature }, + |m: &mut EthereumTypedDataSignature| { &mut m.signature }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &EthereumTypedDataSignature| { &m.address }, + |m: &mut EthereumTypedDataSignature| { &mut m.address }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumTypedDataSignature", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumTypedDataSignature { + const NAME: &'static str = "EthereumTypedDataSignature"; + + fn is_initialized(&self) -> bool { + if self.signature.is_none() { + return false; + } + if self.address.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.signature = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.address = ::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.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.address.as_ref() { + my_size += ::protobuf::rt::string_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.signature.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.address.as_ref() { + os.write_string(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() -> EthereumTypedDataSignature { + EthereumTypedDataSignature::new() + } + + fn clear(&mut self) { + self.signature = ::std::option::Option::None; + self.address = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumTypedDataSignature { + static instance: EthereumTypedDataSignature = EthereumTypedDataSignature { + signature: ::std::option::Option::None, + address: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumTypedDataSignature { + 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("EthereumTypedDataSignature").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumTypedDataSignature { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumTypedDataSignature { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x17messages-ethereum.proto\x12\x1bhw.trezor.messages.ethereum\x1a\x15\ + messages-common.proto\x1a#messages-ethereum-definitions.proto\"V\n\x14Et\ + hereumGetPublicKey\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\ + \x12!\n\x0cshow_display\x18\x02\x20\x01(\x08R\x0bshowDisplay\"b\n\x11Eth\ + ereumPublicKey\x129\n\x04node\x18\x01\x20\x02(\x0b2%.hw.trezor.messages.\ + common.HDNodeTypeR\x04node\x12\x12\n\x04xpub\x18\x02\x20\x02(\tR\x04xpub\ + \"\x99\x01\n\x12EthereumGetAddress\x12\x1b\n\taddress_n\x18\x01\x20\x03(\ + \rR\x08addressN\x12!\n\x0cshow_display\x18\x02\x20\x01(\x08R\x0bshowDisp\ + lay\x12'\n\x0fencoded_network\x18\x03\x20\x01(\x0cR\x0eencodedNetwork\ + \x12\x1a\n\x08chunkify\x18\x04\x20\x01(\x08R\x08chunkify\"Q\n\x0fEthereu\ + mAddress\x12$\n\x0c_old_address\x18\x01\x20\x01(\x0cR\nOldAddressB\x02\ + \x18\x01\x12\x18\n\x07address\x18\x02\x20\x01(\tR\x07address\"\xad\x03\n\ + \x0eEthereumSignTx\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\ + \x12\x16\n\x05nonce\x18\x02\x20\x01(\x0c:\0R\x05nonce\x12\x1b\n\tgas_pri\ + ce\x18\x03\x20\x02(\x0cR\x08gasPrice\x12\x1b\n\tgas_limit\x18\x04\x20\ + \x02(\x0cR\x08gasLimit\x12\x10\n\x02to\x18\x0b\x20\x01(\t:\0R\x02to\x12\ + \x16\n\x05value\x18\x06\x20\x01(\x0c:\0R\x05value\x12.\n\x12data_initial\ + _chunk\x18\x07\x20\x01(\x0c:\0R\x10dataInitialChunk\x12\"\n\x0bdata_leng\ + th\x18\x08\x20\x01(\r:\x010R\ndataLength\x12\x19\n\x08chain_id\x18\t\x20\ + \x02(\x04R\x07chainId\x12\x17\n\x07tx_type\x18\n\x20\x01(\rR\x06txType\ + \x12^\n\x0bdefinitions\x18\x0c\x20\x01(\x0b2<.hw.trezor.messages.ethereu\ + m_definitions.EthereumDefinitionsR\x0bdefinitions\x12\x1a\n\x08chunkify\ + \x18\r\x20\x01(\x08R\x08chunkify\"\xfc\x04\n\x15EthereumSignTxEIP1559\ + \x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\x14\n\x05nonce\ + \x18\x02\x20\x02(\x0cR\x05nonce\x12\x1e\n\x0bmax_gas_fee\x18\x03\x20\x02\ + (\x0cR\tmaxGasFee\x12(\n\x10max_priority_fee\x18\x04\x20\x02(\x0cR\x0ema\ + xPriorityFee\x12\x1b\n\tgas_limit\x18\x05\x20\x02(\x0cR\x08gasLimit\x12\ + \x10\n\x02to\x18\x06\x20\x01(\t:\0R\x02to\x12\x14\n\x05value\x18\x07\x20\ + \x02(\x0cR\x05value\x12.\n\x12data_initial_chunk\x18\x08\x20\x01(\x0c:\0\ + R\x10dataInitialChunk\x12\x1f\n\x0bdata_length\x18\t\x20\x02(\rR\ndataLe\ + ngth\x12\x19\n\x08chain_id\x18\n\x20\x02(\x04R\x07chainId\x12f\n\x0bacce\ + ss_list\x18\x0b\x20\x03(\x0b2E.hw.trezor.messages.ethereum.EthereumSignT\ + xEIP1559.EthereumAccessListR\naccessList\x12^\n\x0bdefinitions\x18\x0c\ + \x20\x01(\x0b2<.hw.trezor.messages.ethereum_definitions.EthereumDefiniti\ + onsR\x0bdefinitions\x12\x1a\n\x08chunkify\x18\r\x20\x01(\x08R\x08chunkif\ + y\x1aQ\n\x12EthereumAccessList\x12\x18\n\x07address\x18\x01\x20\x02(\tR\ + \x07address\x12!\n\x0cstorage_keys\x18\x02\x20\x03(\x0cR\x0bstorageKeys\ + \"\x97\x01\n\x11EthereumTxRequest\x12\x1f\n\x0bdata_length\x18\x01\x20\ + \x01(\rR\ndataLength\x12\x1f\n\x0bsignature_v\x18\x02\x20\x01(\rR\nsigna\ + tureV\x12\x1f\n\x0bsignature_r\x18\x03\x20\x01(\x0cR\nsignatureR\x12\x1f\ + \n\x0bsignature_s\x18\x04\x20\x01(\x0cR\nsignatureS\".\n\rEthereumTxAck\ + \x12\x1d\n\ndata_chunk\x18\x01\x20\x02(\x0cR\tdataChunk\"\x91\x01\n\x13E\ + thereumSignMessage\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\ + \x12\x18\n\x07message\x18\x02\x20\x02(\x0cR\x07message\x12'\n\x0fencoded\ + _network\x18\x03\x20\x01(\x0cR\x0eencodedNetwork\x12\x1a\n\x08chunkify\ + \x18\x04\x20\x01(\x08R\x08chunkify\"R\n\x18EthereumMessageSignature\x12\ + \x1c\n\tsignature\x18\x02\x20\x02(\x0cR\tsignature\x12\x18\n\x07address\ + \x18\x03\x20\x02(\tR\x07address\"\x85\x01\n\x15EthereumVerifyMessage\x12\ + \x1c\n\tsignature\x18\x02\x20\x02(\x0cR\tsignature\x12\x18\n\x07message\ + \x18\x03\x20\x02(\x0cR\x07message\x12\x18\n\x07address\x18\x04\x20\x02(\ + \tR\x07address\x12\x1a\n\x08chunkify\x18\x05\x20\x01(\x08R\x08chunkify\"\ + \xb4\x01\n\x15EthereumSignTypedHash\x12\x1b\n\taddress_n\x18\x01\x20\x03\ + (\rR\x08addressN\x122\n\x15domain_separator_hash\x18\x02\x20\x02(\x0cR\ + \x13domainSeparatorHash\x12!\n\x0cmessage_hash\x18\x03\x20\x01(\x0cR\x0b\ + messageHash\x12'\n\x0fencoded_network\x18\x04\x20\x01(\x0cR\x0eencodedNe\ + twork\"T\n\x1aEthereumTypedDataSignature\x12\x1c\n\tsignature\x18\x01\ + \x20\x02(\x0cR\tsignature\x12\x18\n\x07address\x18\x02\x20\x02(\tR\x07ad\ + dressB<\n#com.satoshilabs.trezor.lib.protobufB\x15TrezorMessageEthereum\ +"; + +/// `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(2); + deps.push(super::messages_common::file_descriptor().clone()); + deps.push(super::messages_ethereum_definitions::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(14); + messages.push(EthereumGetPublicKey::generated_message_descriptor_data()); + messages.push(EthereumPublicKey::generated_message_descriptor_data()); + messages.push(EthereumGetAddress::generated_message_descriptor_data()); + messages.push(EthereumAddress::generated_message_descriptor_data()); + messages.push(EthereumSignTx::generated_message_descriptor_data()); + messages.push(EthereumSignTxEIP1559::generated_message_descriptor_data()); + messages.push(EthereumTxRequest::generated_message_descriptor_data()); + messages.push(EthereumTxAck::generated_message_descriptor_data()); + messages.push(EthereumSignMessage::generated_message_descriptor_data()); + messages.push(EthereumMessageSignature::generated_message_descriptor_data()); + messages.push(EthereumVerifyMessage::generated_message_descriptor_data()); + messages.push(EthereumSignTypedHash::generated_message_descriptor_data()); + messages.push(EthereumTypedDataSignature::generated_message_descriptor_data()); + messages.push(ethereum_sign_tx_eip1559::EthereumAccessList::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_ethereum_definitions.rs b/wallet/trezor-client/src/protos/generated/messages_ethereum_definitions.rs new file mode 100644 index 0000000000..a212384667 --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_ethereum_definitions.rs @@ -0,0 +1,1001 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum_definitions.EthereumNetworkInfo) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumNetworkInfo { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_definitions.EthereumNetworkInfo.chain_id) + pub chain_id: ::std::option::Option, + // @@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, + // @@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 { + ::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", + 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; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum_definitions.EthereumTokenInfo) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumTokenInfo { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_definitions.EthereumTokenInfo.address) + pub address: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_definitions.EthereumTokenInfo.chain_id) + pub chain_id: ::std::option::Option, + // @@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, + // @@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 { + ::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) { + 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 { + 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 { + 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", + 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; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum_definitions.EthereumDefinitions) +#[derive(PartialEq,Clone,Default,Debug)] +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>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_definitions.EthereumDefinitions.encoded_token) + pub encoded_token: ::std::option::Option<::std::vec::Vec>, + // 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 { + ::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) { + 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 { + 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 { + 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) { + 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 { + 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 { + 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", + 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; +} + +#[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 { + match value { + 0 => ::std::option::Option::Some(EthereumDefinitionType::NETWORK), + 1 => ::std::option::Option::Some(EthereumDefinitionType::TOKEN), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "NETWORK" => ::std::option::Option::Some(EthereumDefinitionType::NETWORK), + "TOKEN" => ::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") + } +} + +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) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_ethereum_eip712.rs b/wallet/trezor-client/src/protos/generated/messages_ethereum_eip712.rs new file mode 100644 index 0000000000..6e982994fb --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_ethereum_eip712.rs @@ -0,0 +1,1465 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-eip712.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum_eip712.EthereumSignTypedData) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumSignTypedData { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_eip712.EthereumSignTypedData.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_eip712.EthereumSignTypedData.primary_type) + pub primary_type: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_eip712.EthereumSignTypedData.metamask_v4_compat) + pub metamask_v4_compat: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_eip712.EthereumSignTypedData.definitions) + pub definitions: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum_eip712.EthereumSignTypedData.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumSignTypedData { + fn default() -> &'a EthereumSignTypedData { + ::default_instance() + } +} + +impl EthereumSignTypedData { + pub fn new() -> EthereumSignTypedData { + ::std::default::Default::default() + } + + // required string primary_type = 2; + + pub fn primary_type(&self) -> &str { + match self.primary_type.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_primary_type(&mut self) { + self.primary_type = ::std::option::Option::None; + } + + pub fn has_primary_type(&self) -> bool { + self.primary_type.is_some() + } + + // Param is passed by value, moved + pub fn set_primary_type(&mut self, v: ::std::string::String) { + self.primary_type = ::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_primary_type(&mut self) -> &mut ::std::string::String { + if self.primary_type.is_none() { + self.primary_type = ::std::option::Option::Some(::std::string::String::new()); + } + self.primary_type.as_mut().unwrap() + } + + // Take field + pub fn take_primary_type(&mut self) -> ::std::string::String { + self.primary_type.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bool metamask_v4_compat = 3; + + pub fn metamask_v4_compat(&self) -> bool { + self.metamask_v4_compat.unwrap_or(true) + } + + pub fn clear_metamask_v4_compat(&mut self) { + self.metamask_v4_compat = ::std::option::Option::None; + } + + pub fn has_metamask_v4_compat(&self) -> bool { + self.metamask_v4_compat.is_some() + } + + // Param is passed by value, moved + pub fn set_metamask_v4_compat(&mut self, v: bool) { + self.metamask_v4_compat = ::std::option::Option::Some(v); + } + + 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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &EthereumSignTypedData| { &m.address_n }, + |m: &mut EthereumSignTypedData| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "primary_type", + |m: &EthereumSignTypedData| { &m.primary_type }, + |m: &mut EthereumSignTypedData| { &mut m.primary_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "metamask_v4_compat", + |m: &EthereumSignTypedData| { &m.metamask_v4_compat }, + |m: &mut EthereumSignTypedData| { &mut m.metamask_v4_compat }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::messages_ethereum_definitions::EthereumDefinitions>( + "definitions", + |m: &EthereumSignTypedData| { &m.definitions }, + |m: &mut EthereumSignTypedData| { &mut m.definitions }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumSignTypedData", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumSignTypedData { + const NAME: &'static str = "EthereumSignTypedData"; + + fn is_initialized(&self) -> bool { + if self.primary_type.is_none() { + return false; + } + for v in &self.definitions { + if !v.is_initialized() { + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.primary_type = ::std::option::Option::Some(is.read_string()?); + }, + 24 => { + self.metamask_v4_compat = ::std::option::Option::Some(is.read_bool()?); + }, + 34 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.definitions)?; + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.primary_type.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.metamask_v4_compat { + my_size += 1 + 1; + } + if let Some(v) = self.definitions.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.primary_type.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.metamask_v4_compat { + os.write_bool(3, v)?; + } + if let Some(v) = self.definitions.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + } + 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() -> EthereumSignTypedData { + EthereumSignTypedData::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.primary_type = ::std::option::Option::None; + self.metamask_v4_compat = ::std::option::Option::None; + self.definitions.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumSignTypedData { + static instance: EthereumSignTypedData = EthereumSignTypedData { + address_n: ::std::vec::Vec::new(), + primary_type: ::std::option::Option::None, + metamask_v4_compat: ::std::option::Option::None, + definitions: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumSignTypedData { + 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("EthereumSignTypedData").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumSignTypedData { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumSignTypedData { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumTypedDataStructRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructRequest.name) + pub name: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumTypedDataStructRequest { + fn default() -> &'a EthereumTypedDataStructRequest { + ::default_instance() + } +} + +impl EthereumTypedDataStructRequest { + pub fn new() -> EthereumTypedDataStructRequest { + ::std::default::Default::default() + } + + // required string name = 1; + + 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(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "name", + |m: &EthereumTypedDataStructRequest| { &m.name }, + |m: &mut EthereumTypedDataStructRequest| { &mut m.name }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumTypedDataStructRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumTypedDataStructRequest { + const NAME: &'static str = "EthereumTypedDataStructRequest"; + + fn is_initialized(&self) -> bool { + 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.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.name.as_ref() { + my_size += ::protobuf::rt::string_size(1, &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.name.as_ref() { + os.write_string(1, 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() -> EthereumTypedDataStructRequest { + EthereumTypedDataStructRequest::new() + } + + fn clear(&mut self) { + self.name = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumTypedDataStructRequest { + static instance: EthereumTypedDataStructRequest = EthereumTypedDataStructRequest { + name: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumTypedDataStructRequest { + 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("EthereumTypedDataStructRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumTypedDataStructRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumTypedDataStructRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumTypedDataStructAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.members) + pub members: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumTypedDataStructAck { + fn default() -> &'a EthereumTypedDataStructAck { + ::default_instance() + } +} + +impl EthereumTypedDataStructAck { + pub fn new() -> EthereumTypedDataStructAck { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "members", + |m: &EthereumTypedDataStructAck| { &m.members }, + |m: &mut EthereumTypedDataStructAck| { &mut m.members }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumTypedDataStructAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumTypedDataStructAck { + const NAME: &'static str = "EthereumTypedDataStructAck"; + + fn is_initialized(&self) -> bool { + for v in &self.members { + if !v.is_initialized() { + 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.members.push(is.read_message()?); + }, + 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; + for value in &self.members { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + 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<()> { + for v in &self.members { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + }; + 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() -> EthereumTypedDataStructAck { + EthereumTypedDataStructAck::new() + } + + fn clear(&mut self) { + self.members.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumTypedDataStructAck { + static instance: EthereumTypedDataStructAck = EthereumTypedDataStructAck { + members: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumTypedDataStructAck { + 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("EthereumTypedDataStructAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumTypedDataStructAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumTypedDataStructAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `EthereumTypedDataStructAck` +pub mod ethereum_typed_data_struct_ack { + // @@protoc_insertion_point(message:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumStructMember) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EthereumStructMember { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumStructMember.type) + pub type_: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumStructMember.name) + pub name: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumStructMember.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EthereumStructMember { + fn default() -> &'a EthereumStructMember { + ::default_instance() + } + } + + impl EthereumStructMember { + pub fn new() -> EthereumStructMember { + ::std::default::Default::default() + } + + // required string name = 2; + + 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()) + } + + pub(in super) 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_message_field_accessor::<_, EthereumFieldType>( + "type", + |m: &EthereumStructMember| { &m.type_ }, + |m: &mut EthereumStructMember| { &mut m.type_ }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "name", + |m: &EthereumStructMember| { &m.name }, + |m: &mut EthereumStructMember| { &mut m.name }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumTypedDataStructAck.EthereumStructMember", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EthereumStructMember { + const NAME: &'static str = "EthereumStructMember"; + + fn is_initialized(&self) -> bool { + if self.type_.is_none() { + return false; + } + if self.name.is_none() { + return false; + } + for v in &self.type_ { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.type_)?; + }, + 18 => { + 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.type_.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.name.as_ref() { + my_size += ::protobuf::rt::string_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.type_.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.name.as_ref() { + os.write_string(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() -> EthereumStructMember { + EthereumStructMember::new() + } + + fn clear(&mut self) { + self.type_.clear(); + self.name = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumStructMember { + static instance: EthereumStructMember = EthereumStructMember { + type_: ::protobuf::MessageField::none(), + name: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EthereumStructMember { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EthereumTypedDataStructAck.EthereumStructMember").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EthereumStructMember { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EthereumStructMember { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumFieldType) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct EthereumFieldType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumFieldType.data_type) + pub data_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumFieldType.size) + pub size: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumFieldType.entry_type) + pub entry_type: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumFieldType.struct_name) + pub struct_name: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumFieldType.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a EthereumFieldType { + fn default() -> &'a EthereumFieldType { + ::default_instance() + } + } + + impl EthereumFieldType { + pub fn new() -> EthereumFieldType { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumDataType data_type = 1; + + pub fn data_type(&self) -> EthereumDataType { + match self.data_type { + Some(e) => e.enum_value_or(EthereumDataType::UINT), + None => EthereumDataType::UINT, + } + } + + pub fn clear_data_type(&mut self) { + self.data_type = ::std::option::Option::None; + } + + pub fn has_data_type(&self) -> bool { + self.data_type.is_some() + } + + // Param is passed by value, moved + pub fn set_data_type(&mut self, v: EthereumDataType) { + self.data_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional uint32 size = 2; + + pub fn size(&self) -> u32 { + self.size.unwrap_or(0) + } + + pub fn clear_size(&mut self) { + self.size = ::std::option::Option::None; + } + + pub fn has_size(&self) -> bool { + self.size.is_some() + } + + // Param is passed by value, moved + pub fn set_size(&mut self, v: u32) { + self.size = ::std::option::Option::Some(v); + } + + // optional string struct_name = 4; + + pub fn struct_name(&self) -> &str { + match self.struct_name.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_struct_name(&mut self) { + self.struct_name = ::std::option::Option::None; + } + + pub fn has_struct_name(&self) -> bool { + self.struct_name.is_some() + } + + // Param is passed by value, moved + pub fn set_struct_name(&mut self, v: ::std::string::String) { + self.struct_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_struct_name(&mut self) -> &mut ::std::string::String { + if self.struct_name.is_none() { + self.struct_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.struct_name.as_mut().unwrap() + } + + // Take field + pub fn take_struct_name(&mut self) -> ::std::string::String { + self.struct_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub(in super) 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::<_, _>( + "data_type", + |m: &EthereumFieldType| { &m.data_type }, + |m: &mut EthereumFieldType| { &mut m.data_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "size", + |m: &EthereumFieldType| { &m.size }, + |m: &mut EthereumFieldType| { &mut m.size }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, EthereumFieldType>( + "entry_type", + |m: &EthereumFieldType| { &m.entry_type }, + |m: &mut EthereumFieldType| { &mut m.entry_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "struct_name", + |m: &EthereumFieldType| { &m.struct_name }, + |m: &mut EthereumFieldType| { &mut m.struct_name }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumTypedDataStructAck.EthereumFieldType", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for EthereumFieldType { + const NAME: &'static str = "EthereumFieldType"; + + fn is_initialized(&self) -> bool { + if self.data_type.is_none() { + return false; + } + for v in &self.entry_type { + if !v.is_initialized() { + 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.data_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 16 => { + self.size = ::std::option::Option::Some(is.read_uint32()?); + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.entry_type)?; + }, + 34 => { + self.struct_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.data_type { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + if let Some(v) = self.size { + my_size += ::protobuf::rt::uint32_size(2, v); + } + if let Some(v) = self.entry_type.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.struct_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.data_type { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.size { + os.write_uint32(2, v)?; + } + if let Some(v) = self.entry_type.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.struct_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() -> EthereumFieldType { + EthereumFieldType::new() + } + + fn clear(&mut self) { + self.data_type = ::std::option::Option::None; + self.size = ::std::option::Option::None; + self.entry_type.clear(); + self.struct_name = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumFieldType { + static instance: EthereumFieldType = EthereumFieldType { + data_type: ::std::option::Option::None, + size: ::std::option::Option::None, + entry_type: ::protobuf::MessageField::none(), + struct_name: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for EthereumFieldType { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("EthereumTypedDataStructAck.EthereumFieldType").unwrap()).clone() + } + } + + impl ::std::fmt::Display for EthereumFieldType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for EthereumFieldType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumDataType) + pub enum EthereumDataType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumDataType.UINT) + UINT = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumDataType.INT) + INT = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumDataType.BYTES) + BYTES = 3, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumDataType.STRING) + STRING = 4, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumDataType.BOOL) + BOOL = 5, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumDataType.ADDRESS) + ADDRESS = 6, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumDataType.ARRAY) + ARRAY = 7, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.ethereum_eip712.EthereumTypedDataStructAck.EthereumDataType.STRUCT) + STRUCT = 8, + } + + impl ::protobuf::Enum for EthereumDataType { + const NAME: &'static str = "EthereumDataType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 1 => ::std::option::Option::Some(EthereumDataType::UINT), + 2 => ::std::option::Option::Some(EthereumDataType::INT), + 3 => ::std::option::Option::Some(EthereumDataType::BYTES), + 4 => ::std::option::Option::Some(EthereumDataType::STRING), + 5 => ::std::option::Option::Some(EthereumDataType::BOOL), + 6 => ::std::option::Option::Some(EthereumDataType::ADDRESS), + 7 => ::std::option::Option::Some(EthereumDataType::ARRAY), + 8 => ::std::option::Option::Some(EthereumDataType::STRUCT), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "UINT" => ::std::option::Option::Some(EthereumDataType::UINT), + "INT" => ::std::option::Option::Some(EthereumDataType::INT), + "BYTES" => ::std::option::Option::Some(EthereumDataType::BYTES), + "STRING" => ::std::option::Option::Some(EthereumDataType::STRING), + "BOOL" => ::std::option::Option::Some(EthereumDataType::BOOL), + "ADDRESS" => ::std::option::Option::Some(EthereumDataType::ADDRESS), + "ARRAY" => ::std::option::Option::Some(EthereumDataType::ARRAY), + "STRUCT" => ::std::option::Option::Some(EthereumDataType::STRUCT), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [EthereumDataType] = &[ + EthereumDataType::UINT, + EthereumDataType::INT, + EthereumDataType::BYTES, + EthereumDataType::STRING, + EthereumDataType::BOOL, + EthereumDataType::ADDRESS, + EthereumDataType::ARRAY, + EthereumDataType::STRUCT, + ]; + } + + impl ::protobuf::EnumFull for EthereumDataType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("EthereumTypedDataStructAck.EthereumDataType").unwrap()).clone() + } + + fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { + let index = match self { + EthereumDataType::UINT => 0, + EthereumDataType::INT => 1, + EthereumDataType::BYTES => 2, + EthereumDataType::STRING => 3, + EthereumDataType::BOOL => 4, + EthereumDataType::ADDRESS => 5, + EthereumDataType::ARRAY => 6, + EthereumDataType::STRUCT => 7, + }; + Self::enum_descriptor().value_by_index(index) + } + } + + // Note, `Default` is implemented although default value is not 0 + impl ::std::default::Default for EthereumDataType { + fn default() -> Self { + EthereumDataType::UINT + } + } + + impl EthereumDataType { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("EthereumTypedDataStructAck.EthereumDataType") + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum_eip712.EthereumTypedDataValueRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumTypedDataValueRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_eip712.EthereumTypedDataValueRequest.member_path) + pub member_path: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum_eip712.EthereumTypedDataValueRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumTypedDataValueRequest { + fn default() -> &'a EthereumTypedDataValueRequest { + ::default_instance() + } +} + +impl EthereumTypedDataValueRequest { + pub fn new() -> EthereumTypedDataValueRequest { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "member_path", + |m: &EthereumTypedDataValueRequest| { &m.member_path }, + |m: &mut EthereumTypedDataValueRequest| { &mut m.member_path }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumTypedDataValueRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumTypedDataValueRequest { + const NAME: &'static str = "EthereumTypedDataValueRequest"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.member_path)?; + }, + 8 => { + self.member_path.push(is.read_uint32()?); + }, + 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; + for value in &self.member_path { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + 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<()> { + for v in &self.member_path { + os.write_uint32(1, *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() -> EthereumTypedDataValueRequest { + EthereumTypedDataValueRequest::new() + } + + fn clear(&mut self) { + self.member_path.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumTypedDataValueRequest { + static instance: EthereumTypedDataValueRequest = EthereumTypedDataValueRequest { + member_path: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumTypedDataValueRequest { + 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("EthereumTypedDataValueRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumTypedDataValueRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumTypedDataValueRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ethereum_eip712.EthereumTypedDataValueAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EthereumTypedDataValueAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ethereum_eip712.EthereumTypedDataValueAck.value) + pub value: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum_eip712.EthereumTypedDataValueAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EthereumTypedDataValueAck { + fn default() -> &'a EthereumTypedDataValueAck { + ::default_instance() + } +} + +impl EthereumTypedDataValueAck { + pub fn new() -> EthereumTypedDataValueAck { + ::std::default::Default::default() + } + + // required bytes value = 1; + + pub fn value(&self) -> &[u8] { + match self.value.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_value(&mut self) { + self.value = ::std::option::Option::None; + } + + pub fn has_value(&self) -> bool { + self.value.is_some() + } + + // Param is passed by value, moved + pub fn set_value(&mut self, v: ::std::vec::Vec) { + self.value = ::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_value(&mut self) -> &mut ::std::vec::Vec { + if self.value.is_none() { + self.value = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.value.as_mut().unwrap() + } + + // Take field + pub fn take_value(&mut self) -> ::std::vec::Vec { + self.value.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "value", + |m: &EthereumTypedDataValueAck| { &m.value }, + |m: &mut EthereumTypedDataValueAck| { &mut m.value }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EthereumTypedDataValueAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EthereumTypedDataValueAck { + const NAME: &'static str = "EthereumTypedDataValueAck"; + + fn is_initialized(&self) -> bool { + if self.value.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.value = ::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.value.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.value.as_ref() { + os.write_bytes(1, 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() -> EthereumTypedDataValueAck { + EthereumTypedDataValueAck::new() + } + + fn clear(&mut self) { + self.value = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EthereumTypedDataValueAck { + static instance: EthereumTypedDataValueAck = EthereumTypedDataValueAck { + value: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EthereumTypedDataValueAck { + 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("EthereumTypedDataValueAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EthereumTypedDataValueAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EthereumTypedDataValueAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x1emessages-ethereum-eip712.proto\x12\"hw.trezor.messages.ethereum_ei\ + p712\x1a#messages-ethereum-definitions.proto\"\xeb\x01\n\x15EthereumSign\ + TypedData\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12!\n\ + \x0cprimary_type\x18\x02\x20\x02(\tR\x0bprimaryType\x122\n\x12metamask_v\ + 4_compat\x18\x03\x20\x01(\x08:\x04trueR\x10metamaskV4Compat\x12^\n\x0bde\ + finitions\x18\x04\x20\x01(\x0b2<.hw.trezor.messages.ethereum_definitions\ + .EthereumDefinitionsR\x0bdefinitions\"4\n\x1eEthereumTypedDataStructRequ\ + est\x12\x12\n\x04name\x18\x01\x20\x02(\tR\x04name\"\xb4\x05\n\x1aEthereu\ + mTypedDataStructAck\x12m\n\x07members\x18\x01\x20\x03(\x0b2S.hw.trezor.m\ + essages.ethereum_eip712.EthereumTypedDataStructAck.EthereumStructMemberR\ + \x07members\x1a\x90\x01\n\x14EthereumStructMember\x12d\n\x04type\x18\x01\ + \x20\x02(\x0b2P.hw.trezor.messages.ethereum_eip712.EthereumTypedDataStru\ + ctAck.EthereumFieldTypeR\x04type\x12\x12\n\x04name\x18\x02\x20\x02(\tR\ + \x04name\x1a\xa7\x02\n\x11EthereumFieldType\x12l\n\tdata_type\x18\x01\ + \x20\x02(\x0e2O.hw.trezor.messages.ethereum_eip712.EthereumTypedDataStru\ + ctAck.EthereumDataTypeR\x08dataType\x12\x12\n\x04size\x18\x02\x20\x01(\r\ + R\x04size\x12o\n\nentry_type\x18\x03\x20\x01(\x0b2P.hw.trezor.messages.e\ + thereum_eip712.EthereumTypedDataStructAck.EthereumFieldTypeR\tentryType\ + \x12\x1f\n\x0bstruct_name\x18\x04\x20\x01(\tR\nstructName\"j\n\x10Ethere\ + umDataType\x12\x08\n\x04UINT\x10\x01\x12\x07\n\x03INT\x10\x02\x12\t\n\ + \x05BYTES\x10\x03\x12\n\n\x06STRING\x10\x04\x12\x08\n\x04BOOL\x10\x05\ + \x12\x0b\n\x07ADDRESS\x10\x06\x12\t\n\x05ARRAY\x10\x07\x12\n\n\x06STRUCT\ + \x10\x08\"@\n\x1dEthereumTypedDataValueRequest\x12\x1f\n\x0bmember_path\ + \x18\x01\x20\x03(\rR\nmemberPath\"1\n\x19EthereumTypedDataValueAck\x12\ + \x14\n\x05value\x18\x01\x20\x02(\x0cR\x05valueBB\n#com.satoshilabs.trezo\ + r.lib.protobufB\x1bTrezorMessageEthereumEIP712\ +"; + +/// `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(1); + deps.push(super::messages_ethereum_definitions::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(7); + messages.push(EthereumSignTypedData::generated_message_descriptor_data()); + messages.push(EthereumTypedDataStructRequest::generated_message_descriptor_data()); + messages.push(EthereumTypedDataStructAck::generated_message_descriptor_data()); + messages.push(EthereumTypedDataValueRequest::generated_message_descriptor_data()); + messages.push(EthereumTypedDataValueAck::generated_message_descriptor_data()); + messages.push(ethereum_typed_data_struct_ack::EthereumStructMember::generated_message_descriptor_data()); + messages.push(ethereum_typed_data_struct_ack::EthereumFieldType::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(1); + enums.push(ethereum_typed_data_struct_ack::EthereumDataType::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_management.rs b/wallet/trezor-client/src/protos/generated/messages_management.rs new file mode 100644 index 0000000000..8a9b86eb3b --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_management.rs @@ -0,0 +1,10842 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-management.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.management.Initialize) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct Initialize { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.Initialize.session_id) + pub session_id: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Initialize._skip_passphrase) + pub _skip_passphrase: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Initialize.derive_cardano) + pub derive_cardano: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.Initialize.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Initialize { + fn default() -> &'a Initialize { + ::default_instance() + } +} + +impl Initialize { + pub fn new() -> Initialize { + ::std::default::Default::default() + } + + // optional bytes session_id = 1; + + pub fn session_id(&self) -> &[u8] { + match self.session_id.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_session_id(&mut self) { + self.session_id = ::std::option::Option::None; + } + + pub fn has_session_id(&self) -> bool { + self.session_id.is_some() + } + + // Param is passed by value, moved + pub fn set_session_id(&mut self, v: ::std::vec::Vec) { + self.session_id = ::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_session_id(&mut self) -> &mut ::std::vec::Vec { + if self.session_id.is_none() { + self.session_id = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.session_id.as_mut().unwrap() + } + + // Take field + pub fn take_session_id(&mut self) -> ::std::vec::Vec { + self.session_id.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool _skip_passphrase = 2; + + pub fn _skip_passphrase(&self) -> bool { + self._skip_passphrase.unwrap_or(false) + } + + pub fn clear__skip_passphrase(&mut self) { + self._skip_passphrase = ::std::option::Option::None; + } + + pub fn has__skip_passphrase(&self) -> bool { + self._skip_passphrase.is_some() + } + + // Param is passed by value, moved + pub fn set__skip_passphrase(&mut self, v: bool) { + self._skip_passphrase = ::std::option::Option::Some(v); + } + + // optional bool derive_cardano = 3; + + pub fn derive_cardano(&self) -> bool { + self.derive_cardano.unwrap_or(false) + } + + pub fn clear_derive_cardano(&mut self) { + self.derive_cardano = ::std::option::Option::None; + } + + pub fn has_derive_cardano(&self) -> bool { + self.derive_cardano.is_some() + } + + // Param is passed by value, moved + pub fn set_derive_cardano(&mut self, v: bool) { + self.derive_cardano = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "session_id", + |m: &Initialize| { &m.session_id }, + |m: &mut Initialize| { &mut m.session_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "_skip_passphrase", + |m: &Initialize| { &m._skip_passphrase }, + |m: &mut Initialize| { &mut m._skip_passphrase }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "derive_cardano", + |m: &Initialize| { &m.derive_cardano }, + |m: &mut Initialize| { &mut m.derive_cardano }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Initialize", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Initialize { + const NAME: &'static str = "Initialize"; + + 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.session_id = ::std::option::Option::Some(is.read_bytes()?); + }, + 16 => { + self._skip_passphrase = ::std::option::Option::Some(is.read_bool()?); + }, + 24 => { + self.derive_cardano = ::std::option::Option::Some(is.read_bool()?); + }, + 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.session_id.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self._skip_passphrase { + my_size += 1 + 1; + } + if let Some(v) = self.derive_cardano { + my_size += 1 + 1; + } + 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.session_id.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self._skip_passphrase { + os.write_bool(2, v)?; + } + if let Some(v) = self.derive_cardano { + os.write_bool(3, 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() -> Initialize { + Initialize::new() + } + + fn clear(&mut self) { + self.session_id = ::std::option::Option::None; + self._skip_passphrase = ::std::option::Option::None; + self.derive_cardano = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static Initialize { + static instance: Initialize = Initialize { + session_id: ::std::option::Option::None, + _skip_passphrase: ::std::option::Option::None, + derive_cardano: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Initialize { + 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("Initialize").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Initialize { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Initialize { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.GetFeatures) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct GetFeatures { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.GetFeatures.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a GetFeatures { + fn default() -> &'a GetFeatures { + ::default_instance() + } +} + +impl GetFeatures { + pub fn new() -> GetFeatures { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "GetFeatures", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for GetFeatures { + const NAME: &'static str = "GetFeatures"; + + 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 { + 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; + 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<()> { + 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() -> GetFeatures { + GetFeatures::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static GetFeatures { + static instance: GetFeatures = GetFeatures { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for GetFeatures { + 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("GetFeatures").unwrap()).clone() + } +} + +impl ::std::fmt::Display for GetFeatures { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GetFeatures { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.Features) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct Features { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.vendor) + pub vendor: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.major_version) + pub major_version: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.minor_version) + pub minor_version: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.patch_version) + pub patch_version: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.bootloader_mode) + pub bootloader_mode: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.device_id) + pub device_id: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.pin_protection) + pub pin_protection: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.passphrase_protection) + pub passphrase_protection: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.language) + pub language: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.label) + pub label: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.initialized) + pub initialized: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.revision) + pub revision: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.bootloader_hash) + pub bootloader_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.imported) + pub imported: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.unlocked) + pub unlocked: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features._passphrase_cached) + pub _passphrase_cached: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.firmware_present) + pub firmware_present: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.needs_backup) + pub needs_backup: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.flags) + pub flags: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.model) + pub model: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.fw_major) + pub fw_major: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.fw_minor) + pub fw_minor: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.fw_patch) + pub fw_patch: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.fw_vendor) + pub fw_vendor: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.unfinished_backup) + pub unfinished_backup: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.no_backup) + pub no_backup: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.recovery_mode) + pub recovery_mode: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.capabilities) + pub capabilities: ::std::vec::Vec<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.backup_type) + pub backup_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.sd_card_present) + pub sd_card_present: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.sd_protection) + pub sd_protection: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.wipe_code_protection) + pub wipe_code_protection: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.session_id) + pub session_id: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.passphrase_always_on_device) + pub passphrase_always_on_device: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.safety_checks) + pub safety_checks: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.auto_lock_delay_ms) + pub auto_lock_delay_ms: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.display_rotation) + pub display_rotation: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.experimental_features) + pub experimental_features: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.busy) + pub busy: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.homescreen_format) + pub homescreen_format: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.hide_passphrase_from_host) + pub hide_passphrase_from_host: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.internal_model) + pub internal_model: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.unit_color) + pub unit_color: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.unit_btconly) + pub unit_btconly: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.homescreen_width) + pub homescreen_width: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.homescreen_height) + pub homescreen_height: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.bootloader_locked) + pub bootloader_locked: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.language_version_matches) + pub language_version_matches: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Features.unit_packaging) + pub unit_packaging: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.Features.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Features { + fn default() -> &'a Features { + ::default_instance() + } +} + +impl Features { + pub fn new() -> Features { + ::std::default::Default::default() + } + + // optional string vendor = 1; + + pub fn vendor(&self) -> &str { + match self.vendor.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_vendor(&mut self) { + self.vendor = ::std::option::Option::None; + } + + pub fn has_vendor(&self) -> bool { + self.vendor.is_some() + } + + // Param is passed by value, moved + pub fn set_vendor(&mut self, v: ::std::string::String) { + self.vendor = ::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_vendor(&mut self) -> &mut ::std::string::String { + if self.vendor.is_none() { + self.vendor = ::std::option::Option::Some(::std::string::String::new()); + } + self.vendor.as_mut().unwrap() + } + + // Take field + pub fn take_vendor(&mut self) -> ::std::string::String { + self.vendor.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required uint32 major_version = 2; + + pub fn major_version(&self) -> u32 { + self.major_version.unwrap_or(0) + } + + pub fn clear_major_version(&mut self) { + self.major_version = ::std::option::Option::None; + } + + pub fn has_major_version(&self) -> bool { + self.major_version.is_some() + } + + // Param is passed by value, moved + pub fn set_major_version(&mut self, v: u32) { + self.major_version = ::std::option::Option::Some(v); + } + + // required uint32 minor_version = 3; + + pub fn minor_version(&self) -> u32 { + self.minor_version.unwrap_or(0) + } + + pub fn clear_minor_version(&mut self) { + self.minor_version = ::std::option::Option::None; + } + + pub fn has_minor_version(&self) -> bool { + self.minor_version.is_some() + } + + // Param is passed by value, moved + pub fn set_minor_version(&mut self, v: u32) { + self.minor_version = ::std::option::Option::Some(v); + } + + // required uint32 patch_version = 4; + + pub fn patch_version(&self) -> u32 { + self.patch_version.unwrap_or(0) + } + + pub fn clear_patch_version(&mut self) { + self.patch_version = ::std::option::Option::None; + } + + pub fn has_patch_version(&self) -> bool { + self.patch_version.is_some() + } + + // Param is passed by value, moved + pub fn set_patch_version(&mut self, v: u32) { + self.patch_version = ::std::option::Option::Some(v); + } + + // optional bool bootloader_mode = 5; + + pub fn bootloader_mode(&self) -> bool { + self.bootloader_mode.unwrap_or(false) + } + + pub fn clear_bootloader_mode(&mut self) { + self.bootloader_mode = ::std::option::Option::None; + } + + pub fn has_bootloader_mode(&self) -> bool { + self.bootloader_mode.is_some() + } + + // Param is passed by value, moved + pub fn set_bootloader_mode(&mut self, v: bool) { + self.bootloader_mode = ::std::option::Option::Some(v); + } + + // optional string device_id = 6; + + pub fn device_id(&self) -> &str { + match self.device_id.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_device_id(&mut self) { + self.device_id = ::std::option::Option::None; + } + + pub fn has_device_id(&self) -> bool { + self.device_id.is_some() + } + + // Param is passed by value, moved + pub fn set_device_id(&mut self, v: ::std::string::String) { + self.device_id = ::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_device_id(&mut self) -> &mut ::std::string::String { + if self.device_id.is_none() { + self.device_id = ::std::option::Option::Some(::std::string::String::new()); + } + self.device_id.as_mut().unwrap() + } + + // Take field + pub fn take_device_id(&mut self) -> ::std::string::String { + self.device_id.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bool pin_protection = 7; + + pub fn pin_protection(&self) -> bool { + self.pin_protection.unwrap_or(false) + } + + pub fn clear_pin_protection(&mut self) { + self.pin_protection = ::std::option::Option::None; + } + + pub fn has_pin_protection(&self) -> bool { + self.pin_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_pin_protection(&mut self, v: bool) { + self.pin_protection = ::std::option::Option::Some(v); + } + + // optional bool passphrase_protection = 8; + + pub fn passphrase_protection(&self) -> bool { + self.passphrase_protection.unwrap_or(false) + } + + pub fn clear_passphrase_protection(&mut self) { + self.passphrase_protection = ::std::option::Option::None; + } + + pub fn has_passphrase_protection(&self) -> bool { + self.passphrase_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase_protection(&mut self, v: bool) { + self.passphrase_protection = ::std::option::Option::Some(v); + } + + // optional string language = 9; + + pub fn language(&self) -> &str { + match self.language.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_language(&mut self) { + self.language = ::std::option::Option::None; + } + + pub fn has_language(&self) -> bool { + self.language.is_some() + } + + // Param is passed by value, moved + pub fn set_language(&mut self, v: ::std::string::String) { + self.language = ::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_language(&mut self) -> &mut ::std::string::String { + if self.language.is_none() { + self.language = ::std::option::Option::Some(::std::string::String::new()); + } + self.language.as_mut().unwrap() + } + + // Take field + pub fn take_language(&mut self) -> ::std::string::String { + self.language.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string label = 10; + + pub fn label(&self) -> &str { + match self.label.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_label(&mut self) { + self.label = ::std::option::Option::None; + } + + pub fn has_label(&self) -> bool { + self.label.is_some() + } + + // Param is passed by value, moved + pub fn set_label(&mut self, v: ::std::string::String) { + self.label = ::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_label(&mut self) -> &mut ::std::string::String { + if self.label.is_none() { + self.label = ::std::option::Option::Some(::std::string::String::new()); + } + self.label.as_mut().unwrap() + } + + // Take field + pub fn take_label(&mut self) -> ::std::string::String { + self.label.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bool initialized = 12; + + pub fn initialized(&self) -> bool { + self.initialized.unwrap_or(false) + } + + pub fn clear_initialized(&mut self) { + self.initialized = ::std::option::Option::None; + } + + pub fn has_initialized(&self) -> bool { + self.initialized.is_some() + } + + // Param is passed by value, moved + pub fn set_initialized(&mut self, v: bool) { + self.initialized = ::std::option::Option::Some(v); + } + + // optional bytes revision = 13; + + pub fn revision(&self) -> &[u8] { + match self.revision.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_revision(&mut self) { + self.revision = ::std::option::Option::None; + } + + pub fn has_revision(&self) -> bool { + self.revision.is_some() + } + + // Param is passed by value, moved + pub fn set_revision(&mut self, v: ::std::vec::Vec) { + self.revision = ::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_revision(&mut self) -> &mut ::std::vec::Vec { + if self.revision.is_none() { + self.revision = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.revision.as_mut().unwrap() + } + + // Take field + pub fn take_revision(&mut self) -> ::std::vec::Vec { + self.revision.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes bootloader_hash = 14; + + pub fn bootloader_hash(&self) -> &[u8] { + match self.bootloader_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_bootloader_hash(&mut self) { + self.bootloader_hash = ::std::option::Option::None; + } + + pub fn has_bootloader_hash(&self) -> bool { + self.bootloader_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_bootloader_hash(&mut self, v: ::std::vec::Vec) { + self.bootloader_hash = ::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_bootloader_hash(&mut self) -> &mut ::std::vec::Vec { + if self.bootloader_hash.is_none() { + self.bootloader_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.bootloader_hash.as_mut().unwrap() + } + + // Take field + pub fn take_bootloader_hash(&mut self) -> ::std::vec::Vec { + self.bootloader_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool imported = 15; + + pub fn imported(&self) -> bool { + self.imported.unwrap_or(false) + } + + pub fn clear_imported(&mut self) { + self.imported = ::std::option::Option::None; + } + + pub fn has_imported(&self) -> bool { + self.imported.is_some() + } + + // Param is passed by value, moved + pub fn set_imported(&mut self, v: bool) { + self.imported = ::std::option::Option::Some(v); + } + + // optional bool unlocked = 16; + + pub fn unlocked(&self) -> bool { + self.unlocked.unwrap_or(false) + } + + pub fn clear_unlocked(&mut self) { + self.unlocked = ::std::option::Option::None; + } + + pub fn has_unlocked(&self) -> bool { + self.unlocked.is_some() + } + + // Param is passed by value, moved + pub fn set_unlocked(&mut self, v: bool) { + self.unlocked = ::std::option::Option::Some(v); + } + + // optional bool _passphrase_cached = 17; + + pub fn _passphrase_cached(&self) -> bool { + self._passphrase_cached.unwrap_or(false) + } + + pub fn clear__passphrase_cached(&mut self) { + self._passphrase_cached = ::std::option::Option::None; + } + + pub fn has__passphrase_cached(&self) -> bool { + self._passphrase_cached.is_some() + } + + // Param is passed by value, moved + pub fn set__passphrase_cached(&mut self, v: bool) { + self._passphrase_cached = ::std::option::Option::Some(v); + } + + // optional bool firmware_present = 18; + + pub fn firmware_present(&self) -> bool { + self.firmware_present.unwrap_or(false) + } + + pub fn clear_firmware_present(&mut self) { + self.firmware_present = ::std::option::Option::None; + } + + pub fn has_firmware_present(&self) -> bool { + self.firmware_present.is_some() + } + + // Param is passed by value, moved + pub fn set_firmware_present(&mut self, v: bool) { + self.firmware_present = ::std::option::Option::Some(v); + } + + // optional bool needs_backup = 19; + + pub fn needs_backup(&self) -> bool { + self.needs_backup.unwrap_or(false) + } + + pub fn clear_needs_backup(&mut self) { + self.needs_backup = ::std::option::Option::None; + } + + pub fn has_needs_backup(&self) -> bool { + self.needs_backup.is_some() + } + + // Param is passed by value, moved + pub fn set_needs_backup(&mut self, v: bool) { + self.needs_backup = ::std::option::Option::Some(v); + } + + // optional uint32 flags = 20; + + pub fn flags(&self) -> u32 { + self.flags.unwrap_or(0) + } + + pub fn clear_flags(&mut self) { + self.flags = ::std::option::Option::None; + } + + pub fn has_flags(&self) -> bool { + self.flags.is_some() + } + + // Param is passed by value, moved + pub fn set_flags(&mut self, v: u32) { + self.flags = ::std::option::Option::Some(v); + } + + // optional string model = 21; + + pub fn model(&self) -> &str { + match self.model.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_model(&mut self) { + self.model = ::std::option::Option::None; + } + + pub fn has_model(&self) -> bool { + self.model.is_some() + } + + // Param is passed by value, moved + pub fn set_model(&mut self, v: ::std::string::String) { + self.model = ::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_model(&mut self) -> &mut ::std::string::String { + if self.model.is_none() { + self.model = ::std::option::Option::Some(::std::string::String::new()); + } + self.model.as_mut().unwrap() + } + + // Take field + pub fn take_model(&mut self) -> ::std::string::String { + self.model.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint32 fw_major = 22; + + pub fn fw_major(&self) -> u32 { + self.fw_major.unwrap_or(0) + } + + pub fn clear_fw_major(&mut self) { + self.fw_major = ::std::option::Option::None; + } + + pub fn has_fw_major(&self) -> bool { + self.fw_major.is_some() + } + + // Param is passed by value, moved + pub fn set_fw_major(&mut self, v: u32) { + self.fw_major = ::std::option::Option::Some(v); + } + + // optional uint32 fw_minor = 23; + + pub fn fw_minor(&self) -> u32 { + self.fw_minor.unwrap_or(0) + } + + pub fn clear_fw_minor(&mut self) { + self.fw_minor = ::std::option::Option::None; + } + + pub fn has_fw_minor(&self) -> bool { + self.fw_minor.is_some() + } + + // Param is passed by value, moved + pub fn set_fw_minor(&mut self, v: u32) { + self.fw_minor = ::std::option::Option::Some(v); + } + + // optional uint32 fw_patch = 24; + + pub fn fw_patch(&self) -> u32 { + self.fw_patch.unwrap_or(0) + } + + pub fn clear_fw_patch(&mut self) { + self.fw_patch = ::std::option::Option::None; + } + + pub fn has_fw_patch(&self) -> bool { + self.fw_patch.is_some() + } + + // Param is passed by value, moved + pub fn set_fw_patch(&mut self, v: u32) { + self.fw_patch = ::std::option::Option::Some(v); + } + + // optional string fw_vendor = 25; + + pub fn fw_vendor(&self) -> &str { + match self.fw_vendor.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_fw_vendor(&mut self) { + self.fw_vendor = ::std::option::Option::None; + } + + pub fn has_fw_vendor(&self) -> bool { + self.fw_vendor.is_some() + } + + // Param is passed by value, moved + pub fn set_fw_vendor(&mut self, v: ::std::string::String) { + self.fw_vendor = ::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_fw_vendor(&mut self) -> &mut ::std::string::String { + if self.fw_vendor.is_none() { + self.fw_vendor = ::std::option::Option::Some(::std::string::String::new()); + } + self.fw_vendor.as_mut().unwrap() + } + + // Take field + pub fn take_fw_vendor(&mut self) -> ::std::string::String { + self.fw_vendor.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bool unfinished_backup = 27; + + pub fn unfinished_backup(&self) -> bool { + self.unfinished_backup.unwrap_or(false) + } + + pub fn clear_unfinished_backup(&mut self) { + self.unfinished_backup = ::std::option::Option::None; + } + + pub fn has_unfinished_backup(&self) -> bool { + self.unfinished_backup.is_some() + } + + // Param is passed by value, moved + pub fn set_unfinished_backup(&mut self, v: bool) { + self.unfinished_backup = ::std::option::Option::Some(v); + } + + // optional bool no_backup = 28; + + pub fn no_backup(&self) -> bool { + self.no_backup.unwrap_or(false) + } + + pub fn clear_no_backup(&mut self) { + self.no_backup = ::std::option::Option::None; + } + + pub fn has_no_backup(&self) -> bool { + self.no_backup.is_some() + } + + // Param is passed by value, moved + pub fn set_no_backup(&mut self, v: bool) { + self.no_backup = ::std::option::Option::Some(v); + } + + // optional bool recovery_mode = 29; + + pub fn recovery_mode(&self) -> bool { + self.recovery_mode.unwrap_or(false) + } + + pub fn clear_recovery_mode(&mut self) { + self.recovery_mode = ::std::option::Option::None; + } + + pub fn has_recovery_mode(&self) -> bool { + self.recovery_mode.is_some() + } + + // Param is passed by value, moved + pub fn set_recovery_mode(&mut self, v: bool) { + self.recovery_mode = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.management.BackupType backup_type = 31; + + pub fn backup_type(&self) -> BackupType { + match self.backup_type { + Some(e) => e.enum_value_or(BackupType::Bip39), + None => BackupType::Bip39, + } + } + + pub fn clear_backup_type(&mut self) { + self.backup_type = ::std::option::Option::None; + } + + pub fn has_backup_type(&self) -> bool { + self.backup_type.is_some() + } + + // Param is passed by value, moved + pub fn set_backup_type(&mut self, v: BackupType) { + self.backup_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bool sd_card_present = 32; + + pub fn sd_card_present(&self) -> bool { + self.sd_card_present.unwrap_or(false) + } + + pub fn clear_sd_card_present(&mut self) { + self.sd_card_present = ::std::option::Option::None; + } + + pub fn has_sd_card_present(&self) -> bool { + self.sd_card_present.is_some() + } + + // Param is passed by value, moved + pub fn set_sd_card_present(&mut self, v: bool) { + self.sd_card_present = ::std::option::Option::Some(v); + } + + // optional bool sd_protection = 33; + + pub fn sd_protection(&self) -> bool { + self.sd_protection.unwrap_or(false) + } + + pub fn clear_sd_protection(&mut self) { + self.sd_protection = ::std::option::Option::None; + } + + pub fn has_sd_protection(&self) -> bool { + self.sd_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_sd_protection(&mut self, v: bool) { + self.sd_protection = ::std::option::Option::Some(v); + } + + // optional bool wipe_code_protection = 34; + + pub fn wipe_code_protection(&self) -> bool { + self.wipe_code_protection.unwrap_or(false) + } + + pub fn clear_wipe_code_protection(&mut self) { + self.wipe_code_protection = ::std::option::Option::None; + } + + pub fn has_wipe_code_protection(&self) -> bool { + self.wipe_code_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_wipe_code_protection(&mut self, v: bool) { + self.wipe_code_protection = ::std::option::Option::Some(v); + } + + // optional bytes session_id = 35; + + pub fn session_id(&self) -> &[u8] { + match self.session_id.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_session_id(&mut self) { + self.session_id = ::std::option::Option::None; + } + + pub fn has_session_id(&self) -> bool { + self.session_id.is_some() + } + + // Param is passed by value, moved + pub fn set_session_id(&mut self, v: ::std::vec::Vec) { + self.session_id = ::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_session_id(&mut self) -> &mut ::std::vec::Vec { + if self.session_id.is_none() { + self.session_id = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.session_id.as_mut().unwrap() + } + + // Take field + pub fn take_session_id(&mut self) -> ::std::vec::Vec { + self.session_id.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool passphrase_always_on_device = 36; + + pub fn passphrase_always_on_device(&self) -> bool { + self.passphrase_always_on_device.unwrap_or(false) + } + + pub fn clear_passphrase_always_on_device(&mut self) { + self.passphrase_always_on_device = ::std::option::Option::None; + } + + pub fn has_passphrase_always_on_device(&self) -> bool { + self.passphrase_always_on_device.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase_always_on_device(&mut self, v: bool) { + self.passphrase_always_on_device = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.management.SafetyCheckLevel safety_checks = 37; + + pub fn safety_checks(&self) -> SafetyCheckLevel { + match self.safety_checks { + Some(e) => e.enum_value_or(SafetyCheckLevel::Strict), + None => SafetyCheckLevel::Strict, + } + } + + pub fn clear_safety_checks(&mut self) { + self.safety_checks = ::std::option::Option::None; + } + + pub fn has_safety_checks(&self) -> bool { + self.safety_checks.is_some() + } + + // Param is passed by value, moved + pub fn set_safety_checks(&mut self, v: SafetyCheckLevel) { + self.safety_checks = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional uint32 auto_lock_delay_ms = 38; + + pub fn auto_lock_delay_ms(&self) -> u32 { + self.auto_lock_delay_ms.unwrap_or(0) + } + + pub fn clear_auto_lock_delay_ms(&mut self) { + self.auto_lock_delay_ms = ::std::option::Option::None; + } + + pub fn has_auto_lock_delay_ms(&self) -> bool { + self.auto_lock_delay_ms.is_some() + } + + // Param is passed by value, moved + pub fn set_auto_lock_delay_ms(&mut self, v: u32) { + self.auto_lock_delay_ms = ::std::option::Option::Some(v); + } + + // optional uint32 display_rotation = 39; + + pub fn display_rotation(&self) -> u32 { + self.display_rotation.unwrap_or(0) + } + + pub fn clear_display_rotation(&mut self) { + self.display_rotation = ::std::option::Option::None; + } + + pub fn has_display_rotation(&self) -> bool { + self.display_rotation.is_some() + } + + // Param is passed by value, moved + pub fn set_display_rotation(&mut self, v: u32) { + self.display_rotation = ::std::option::Option::Some(v); + } + + // optional bool experimental_features = 40; + + pub fn experimental_features(&self) -> bool { + self.experimental_features.unwrap_or(false) + } + + pub fn clear_experimental_features(&mut self) { + self.experimental_features = ::std::option::Option::None; + } + + pub fn has_experimental_features(&self) -> bool { + self.experimental_features.is_some() + } + + // Param is passed by value, moved + pub fn set_experimental_features(&mut self, v: bool) { + self.experimental_features = ::std::option::Option::Some(v); + } + + // optional bool busy = 41; + + pub fn busy(&self) -> bool { + self.busy.unwrap_or(false) + } + + pub fn clear_busy(&mut self) { + self.busy = ::std::option::Option::None; + } + + pub fn has_busy(&self) -> bool { + self.busy.is_some() + } + + // Param is passed by value, moved + pub fn set_busy(&mut self, v: bool) { + self.busy = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.management.HomescreenFormat homescreen_format = 42; + + pub fn homescreen_format(&self) -> HomescreenFormat { + match self.homescreen_format { + Some(e) => e.enum_value_or(HomescreenFormat::Toif), + None => HomescreenFormat::Toif, + } + } + + pub fn clear_homescreen_format(&mut self) { + self.homescreen_format = ::std::option::Option::None; + } + + pub fn has_homescreen_format(&self) -> bool { + self.homescreen_format.is_some() + } + + // Param is passed by value, moved + pub fn set_homescreen_format(&mut self, v: HomescreenFormat) { + self.homescreen_format = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bool hide_passphrase_from_host = 43; + + pub fn hide_passphrase_from_host(&self) -> bool { + self.hide_passphrase_from_host.unwrap_or(false) + } + + pub fn clear_hide_passphrase_from_host(&mut self) { + self.hide_passphrase_from_host = ::std::option::Option::None; + } + + pub fn has_hide_passphrase_from_host(&self) -> bool { + self.hide_passphrase_from_host.is_some() + } + + // Param is passed by value, moved + pub fn set_hide_passphrase_from_host(&mut self, v: bool) { + self.hide_passphrase_from_host = ::std::option::Option::Some(v); + } + + // optional string internal_model = 44; + + pub fn internal_model(&self) -> &str { + match self.internal_model.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_internal_model(&mut self) { + self.internal_model = ::std::option::Option::None; + } + + pub fn has_internal_model(&self) -> bool { + self.internal_model.is_some() + } + + // Param is passed by value, moved + pub fn set_internal_model(&mut self, v: ::std::string::String) { + self.internal_model = ::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_internal_model(&mut self) -> &mut ::std::string::String { + if self.internal_model.is_none() { + self.internal_model = ::std::option::Option::Some(::std::string::String::new()); + } + self.internal_model.as_mut().unwrap() + } + + // Take field + pub fn take_internal_model(&mut self) -> ::std::string::String { + self.internal_model.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint32 unit_color = 45; + + pub fn unit_color(&self) -> u32 { + self.unit_color.unwrap_or(0) + } + + pub fn clear_unit_color(&mut self) { + self.unit_color = ::std::option::Option::None; + } + + pub fn has_unit_color(&self) -> bool { + self.unit_color.is_some() + } + + // Param is passed by value, moved + pub fn set_unit_color(&mut self, v: u32) { + self.unit_color = ::std::option::Option::Some(v); + } + + // optional bool unit_btconly = 46; + + pub fn unit_btconly(&self) -> bool { + self.unit_btconly.unwrap_or(false) + } + + pub fn clear_unit_btconly(&mut self) { + self.unit_btconly = ::std::option::Option::None; + } + + pub fn has_unit_btconly(&self) -> bool { + self.unit_btconly.is_some() + } + + // Param is passed by value, moved + pub fn set_unit_btconly(&mut self, v: bool) { + self.unit_btconly = ::std::option::Option::Some(v); + } + + // optional uint32 homescreen_width = 47; + + pub fn homescreen_width(&self) -> u32 { + self.homescreen_width.unwrap_or(0) + } + + pub fn clear_homescreen_width(&mut self) { + self.homescreen_width = ::std::option::Option::None; + } + + pub fn has_homescreen_width(&self) -> bool { + self.homescreen_width.is_some() + } + + // Param is passed by value, moved + pub fn set_homescreen_width(&mut self, v: u32) { + self.homescreen_width = ::std::option::Option::Some(v); + } + + // optional uint32 homescreen_height = 48; + + pub fn homescreen_height(&self) -> u32 { + self.homescreen_height.unwrap_or(0) + } + + pub fn clear_homescreen_height(&mut self) { + self.homescreen_height = ::std::option::Option::None; + } + + pub fn has_homescreen_height(&self) -> bool { + self.homescreen_height.is_some() + } + + // Param is passed by value, moved + pub fn set_homescreen_height(&mut self, v: u32) { + self.homescreen_height = ::std::option::Option::Some(v); + } + + // optional bool bootloader_locked = 49; + + pub fn bootloader_locked(&self) -> bool { + self.bootloader_locked.unwrap_or(false) + } + + pub fn clear_bootloader_locked(&mut self) { + self.bootloader_locked = ::std::option::Option::None; + } + + pub fn has_bootloader_locked(&self) -> bool { + self.bootloader_locked.is_some() + } + + // Param is passed by value, moved + pub fn set_bootloader_locked(&mut self, v: bool) { + self.bootloader_locked = ::std::option::Option::Some(v); + } + + // optional bool language_version_matches = 50; + + pub fn language_version_matches(&self) -> bool { + self.language_version_matches.unwrap_or(true) + } + + pub fn clear_language_version_matches(&mut self) { + self.language_version_matches = ::std::option::Option::None; + } + + pub fn has_language_version_matches(&self) -> bool { + self.language_version_matches.is_some() + } + + // Param is passed by value, moved + pub fn set_language_version_matches(&mut self, v: bool) { + self.language_version_matches = ::std::option::Option::Some(v); + } + + // optional uint32 unit_packaging = 51; + + pub fn unit_packaging(&self) -> u32 { + self.unit_packaging.unwrap_or(0) + } + + pub fn clear_unit_packaging(&mut self) { + self.unit_packaging = ::std::option::Option::None; + } + + pub fn has_unit_packaging(&self) -> bool { + self.unit_packaging.is_some() + } + + // Param is passed by value, moved + pub fn set_unit_packaging(&mut self, v: u32) { + self.unit_packaging = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(49); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "vendor", + |m: &Features| { &m.vendor }, + |m: &mut Features| { &mut m.vendor }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "major_version", + |m: &Features| { &m.major_version }, + |m: &mut Features| { &mut m.major_version }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "minor_version", + |m: &Features| { &m.minor_version }, + |m: &mut Features| { &mut m.minor_version }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "patch_version", + |m: &Features| { &m.patch_version }, + |m: &mut Features| { &mut m.patch_version }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "bootloader_mode", + |m: &Features| { &m.bootloader_mode }, + |m: &mut Features| { &mut m.bootloader_mode }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "device_id", + |m: &Features| { &m.device_id }, + |m: &mut Features| { &mut m.device_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pin_protection", + |m: &Features| { &m.pin_protection }, + |m: &mut Features| { &mut m.pin_protection }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "passphrase_protection", + |m: &Features| { &m.passphrase_protection }, + |m: &mut Features| { &mut m.passphrase_protection }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "language", + |m: &Features| { &m.language }, + |m: &mut Features| { &mut m.language }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "label", + |m: &Features| { &m.label }, + |m: &mut Features| { &mut m.label }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "initialized", + |m: &Features| { &m.initialized }, + |m: &mut Features| { &mut m.initialized }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "revision", + |m: &Features| { &m.revision }, + |m: &mut Features| { &mut m.revision }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "bootloader_hash", + |m: &Features| { &m.bootloader_hash }, + |m: &mut Features| { &mut m.bootloader_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "imported", + |m: &Features| { &m.imported }, + |m: &mut Features| { &mut m.imported }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "unlocked", + |m: &Features| { &m.unlocked }, + |m: &mut Features| { &mut m.unlocked }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "_passphrase_cached", + |m: &Features| { &m._passphrase_cached }, + |m: &mut Features| { &mut m._passphrase_cached }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "firmware_present", + |m: &Features| { &m.firmware_present }, + |m: &mut Features| { &mut m.firmware_present }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "needs_backup", + |m: &Features| { &m.needs_backup }, + |m: &mut Features| { &mut m.needs_backup }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "flags", + |m: &Features| { &m.flags }, + |m: &mut Features| { &mut m.flags }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "model", + |m: &Features| { &m.model }, + |m: &mut Features| { &mut m.model }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fw_major", + |m: &Features| { &m.fw_major }, + |m: &mut Features| { &mut m.fw_major }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fw_minor", + |m: &Features| { &m.fw_minor }, + |m: &mut Features| { &mut m.fw_minor }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fw_patch", + |m: &Features| { &m.fw_patch }, + |m: &mut Features| { &mut m.fw_patch }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fw_vendor", + |m: &Features| { &m.fw_vendor }, + |m: &mut Features| { &mut m.fw_vendor }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "unfinished_backup", + |m: &Features| { &m.unfinished_backup }, + |m: &mut Features| { &mut m.unfinished_backup }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "no_backup", + |m: &Features| { &m.no_backup }, + |m: &mut Features| { &mut m.no_backup }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "recovery_mode", + |m: &Features| { &m.recovery_mode }, + |m: &mut Features| { &mut m.recovery_mode }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "capabilities", + |m: &Features| { &m.capabilities }, + |m: &mut Features| { &mut m.capabilities }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "backup_type", + |m: &Features| { &m.backup_type }, + |m: &mut Features| { &mut m.backup_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sd_card_present", + |m: &Features| { &m.sd_card_present }, + |m: &mut Features| { &mut m.sd_card_present }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sd_protection", + |m: &Features| { &m.sd_protection }, + |m: &mut Features| { &mut m.sd_protection }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "wipe_code_protection", + |m: &Features| { &m.wipe_code_protection }, + |m: &mut Features| { &mut m.wipe_code_protection }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "session_id", + |m: &Features| { &m.session_id }, + |m: &mut Features| { &mut m.session_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "passphrase_always_on_device", + |m: &Features| { &m.passphrase_always_on_device }, + |m: &mut Features| { &mut m.passphrase_always_on_device }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "safety_checks", + |m: &Features| { &m.safety_checks }, + |m: &mut Features| { &mut m.safety_checks }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "auto_lock_delay_ms", + |m: &Features| { &m.auto_lock_delay_ms }, + |m: &mut Features| { &mut m.auto_lock_delay_ms }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "display_rotation", + |m: &Features| { &m.display_rotation }, + |m: &mut Features| { &mut m.display_rotation }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "experimental_features", + |m: &Features| { &m.experimental_features }, + |m: &mut Features| { &mut m.experimental_features }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "busy", + |m: &Features| { &m.busy }, + |m: &mut Features| { &mut m.busy }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "homescreen_format", + |m: &Features| { &m.homescreen_format }, + |m: &mut Features| { &mut m.homescreen_format }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "hide_passphrase_from_host", + |m: &Features| { &m.hide_passphrase_from_host }, + |m: &mut Features| { &mut m.hide_passphrase_from_host }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "internal_model", + |m: &Features| { &m.internal_model }, + |m: &mut Features| { &mut m.internal_model }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "unit_color", + |m: &Features| { &m.unit_color }, + |m: &mut Features| { &mut m.unit_color }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "unit_btconly", + |m: &Features| { &m.unit_btconly }, + |m: &mut Features| { &mut m.unit_btconly }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "homescreen_width", + |m: &Features| { &m.homescreen_width }, + |m: &mut Features| { &mut m.homescreen_width }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "homescreen_height", + |m: &Features| { &m.homescreen_height }, + |m: &mut Features| { &mut m.homescreen_height }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "bootloader_locked", + |m: &Features| { &m.bootloader_locked }, + |m: &mut Features| { &mut m.bootloader_locked }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "language_version_matches", + |m: &Features| { &m.language_version_matches }, + |m: &mut Features| { &mut m.language_version_matches }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "unit_packaging", + |m: &Features| { &m.unit_packaging }, + |m: &mut Features| { &mut m.unit_packaging }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Features", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Features { + const NAME: &'static str = "Features"; + + fn is_initialized(&self) -> bool { + if self.major_version.is_none() { + return false; + } + if self.minor_version.is_none() { + return false; + } + if self.patch_version.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.vendor = ::std::option::Option::Some(is.read_string()?); + }, + 16 => { + self.major_version = ::std::option::Option::Some(is.read_uint32()?); + }, + 24 => { + self.minor_version = ::std::option::Option::Some(is.read_uint32()?); + }, + 32 => { + self.patch_version = ::std::option::Option::Some(is.read_uint32()?); + }, + 40 => { + self.bootloader_mode = ::std::option::Option::Some(is.read_bool()?); + }, + 50 => { + self.device_id = ::std::option::Option::Some(is.read_string()?); + }, + 56 => { + self.pin_protection = ::std::option::Option::Some(is.read_bool()?); + }, + 64 => { + self.passphrase_protection = ::std::option::Option::Some(is.read_bool()?); + }, + 74 => { + self.language = ::std::option::Option::Some(is.read_string()?); + }, + 82 => { + self.label = ::std::option::Option::Some(is.read_string()?); + }, + 96 => { + self.initialized = ::std::option::Option::Some(is.read_bool()?); + }, + 106 => { + self.revision = ::std::option::Option::Some(is.read_bytes()?); + }, + 114 => { + self.bootloader_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 120 => { + self.imported = ::std::option::Option::Some(is.read_bool()?); + }, + 128 => { + self.unlocked = ::std::option::Option::Some(is.read_bool()?); + }, + 136 => { + self._passphrase_cached = ::std::option::Option::Some(is.read_bool()?); + }, + 144 => { + self.firmware_present = ::std::option::Option::Some(is.read_bool()?); + }, + 152 => { + self.needs_backup = ::std::option::Option::Some(is.read_bool()?); + }, + 160 => { + self.flags = ::std::option::Option::Some(is.read_uint32()?); + }, + 170 => { + self.model = ::std::option::Option::Some(is.read_string()?); + }, + 176 => { + self.fw_major = ::std::option::Option::Some(is.read_uint32()?); + }, + 184 => { + self.fw_minor = ::std::option::Option::Some(is.read_uint32()?); + }, + 192 => { + self.fw_patch = ::std::option::Option::Some(is.read_uint32()?); + }, + 202 => { + self.fw_vendor = ::std::option::Option::Some(is.read_string()?); + }, + 216 => { + self.unfinished_backup = ::std::option::Option::Some(is.read_bool()?); + }, + 224 => { + self.no_backup = ::std::option::Option::Some(is.read_bool()?); + }, + 232 => { + self.recovery_mode = ::std::option::Option::Some(is.read_bool()?); + }, + 240 => { + self.capabilities.push(is.read_enum_or_unknown()?); + }, + 242 => { + ::protobuf::rt::read_repeated_packed_enum_or_unknown_into(is, &mut self.capabilities)? + }, + 248 => { + self.backup_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 256 => { + self.sd_card_present = ::std::option::Option::Some(is.read_bool()?); + }, + 264 => { + self.sd_protection = ::std::option::Option::Some(is.read_bool()?); + }, + 272 => { + self.wipe_code_protection = ::std::option::Option::Some(is.read_bool()?); + }, + 282 => { + self.session_id = ::std::option::Option::Some(is.read_bytes()?); + }, + 288 => { + self.passphrase_always_on_device = ::std::option::Option::Some(is.read_bool()?); + }, + 296 => { + self.safety_checks = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 304 => { + self.auto_lock_delay_ms = ::std::option::Option::Some(is.read_uint32()?); + }, + 312 => { + self.display_rotation = ::std::option::Option::Some(is.read_uint32()?); + }, + 320 => { + self.experimental_features = ::std::option::Option::Some(is.read_bool()?); + }, + 328 => { + self.busy = ::std::option::Option::Some(is.read_bool()?); + }, + 336 => { + self.homescreen_format = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 344 => { + self.hide_passphrase_from_host = ::std::option::Option::Some(is.read_bool()?); + }, + 354 => { + self.internal_model = ::std::option::Option::Some(is.read_string()?); + }, + 360 => { + self.unit_color = ::std::option::Option::Some(is.read_uint32()?); + }, + 368 => { + self.unit_btconly = ::std::option::Option::Some(is.read_bool()?); + }, + 376 => { + self.homescreen_width = ::std::option::Option::Some(is.read_uint32()?); + }, + 384 => { + self.homescreen_height = ::std::option::Option::Some(is.read_uint32()?); + }, + 392 => { + self.bootloader_locked = ::std::option::Option::Some(is.read_bool()?); + }, + 400 => { + self.language_version_matches = ::std::option::Option::Some(is.read_bool()?); + }, + 408 => { + self.unit_packaging = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.vendor.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.major_version { + my_size += ::protobuf::rt::uint32_size(2, v); + } + if let Some(v) = self.minor_version { + my_size += ::protobuf::rt::uint32_size(3, v); + } + if let Some(v) = self.patch_version { + my_size += ::protobuf::rt::uint32_size(4, v); + } + if let Some(v) = self.bootloader_mode { + my_size += 1 + 1; + } + if let Some(v) = self.device_id.as_ref() { + my_size += ::protobuf::rt::string_size(6, &v); + } + if let Some(v) = self.pin_protection { + my_size += 1 + 1; + } + if let Some(v) = self.passphrase_protection { + my_size += 1 + 1; + } + if let Some(v) = self.language.as_ref() { + my_size += ::protobuf::rt::string_size(9, &v); + } + if let Some(v) = self.label.as_ref() { + my_size += ::protobuf::rt::string_size(10, &v); + } + if let Some(v) = self.initialized { + my_size += 1 + 1; + } + if let Some(v) = self.revision.as_ref() { + my_size += ::protobuf::rt::bytes_size(13, &v); + } + if let Some(v) = self.bootloader_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(14, &v); + } + if let Some(v) = self.imported { + my_size += 1 + 1; + } + if let Some(v) = self.unlocked { + my_size += 2 + 1; + } + if let Some(v) = self._passphrase_cached { + my_size += 2 + 1; + } + if let Some(v) = self.firmware_present { + my_size += 2 + 1; + } + if let Some(v) = self.needs_backup { + my_size += 2 + 1; + } + if let Some(v) = self.flags { + my_size += ::protobuf::rt::uint32_size(20, v); + } + if let Some(v) = self.model.as_ref() { + my_size += ::protobuf::rt::string_size(21, &v); + } + if let Some(v) = self.fw_major { + my_size += ::protobuf::rt::uint32_size(22, v); + } + if let Some(v) = self.fw_minor { + my_size += ::protobuf::rt::uint32_size(23, v); + } + if let Some(v) = self.fw_patch { + my_size += ::protobuf::rt::uint32_size(24, v); + } + if let Some(v) = self.fw_vendor.as_ref() { + my_size += ::protobuf::rt::string_size(25, &v); + } + if let Some(v) = self.unfinished_backup { + my_size += 2 + 1; + } + if let Some(v) = self.no_backup { + my_size += 2 + 1; + } + if let Some(v) = self.recovery_mode { + my_size += 2 + 1; + } + for value in &self.capabilities { + my_size += ::protobuf::rt::int32_size(30, value.value()); + }; + if let Some(v) = self.backup_type { + my_size += ::protobuf::rt::int32_size(31, v.value()); + } + if let Some(v) = self.sd_card_present { + my_size += 2 + 1; + } + if let Some(v) = self.sd_protection { + my_size += 2 + 1; + } + if let Some(v) = self.wipe_code_protection { + my_size += 2 + 1; + } + if let Some(v) = self.session_id.as_ref() { + my_size += ::protobuf::rt::bytes_size(35, &v); + } + if let Some(v) = self.passphrase_always_on_device { + my_size += 2 + 1; + } + if let Some(v) = self.safety_checks { + my_size += ::protobuf::rt::int32_size(37, v.value()); + } + if let Some(v) = self.auto_lock_delay_ms { + my_size += ::protobuf::rt::uint32_size(38, v); + } + if let Some(v) = self.display_rotation { + my_size += ::protobuf::rt::uint32_size(39, v); + } + if let Some(v) = self.experimental_features { + my_size += 2 + 1; + } + if let Some(v) = self.busy { + my_size += 2 + 1; + } + if let Some(v) = self.homescreen_format { + my_size += ::protobuf::rt::int32_size(42, v.value()); + } + if let Some(v) = self.hide_passphrase_from_host { + my_size += 2 + 1; + } + if let Some(v) = self.internal_model.as_ref() { + my_size += ::protobuf::rt::string_size(44, &v); + } + if let Some(v) = self.unit_color { + my_size += ::protobuf::rt::uint32_size(45, v); + } + if let Some(v) = self.unit_btconly { + my_size += 2 + 1; + } + if let Some(v) = self.homescreen_width { + my_size += ::protobuf::rt::uint32_size(47, v); + } + if let Some(v) = self.homescreen_height { + my_size += ::protobuf::rt::uint32_size(48, v); + } + if let Some(v) = self.bootloader_locked { + my_size += 2 + 1; + } + if let Some(v) = self.language_version_matches { + my_size += 2 + 1; + } + if let Some(v) = self.unit_packaging { + my_size += ::protobuf::rt::uint32_size(51, 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.vendor.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.major_version { + os.write_uint32(2, v)?; + } + if let Some(v) = self.minor_version { + os.write_uint32(3, v)?; + } + if let Some(v) = self.patch_version { + os.write_uint32(4, v)?; + } + if let Some(v) = self.bootloader_mode { + os.write_bool(5, v)?; + } + if let Some(v) = self.device_id.as_ref() { + os.write_string(6, v)?; + } + if let Some(v) = self.pin_protection { + os.write_bool(7, v)?; + } + if let Some(v) = self.passphrase_protection { + os.write_bool(8, v)?; + } + if let Some(v) = self.language.as_ref() { + os.write_string(9, v)?; + } + if let Some(v) = self.label.as_ref() { + os.write_string(10, v)?; + } + if let Some(v) = self.initialized { + os.write_bool(12, v)?; + } + if let Some(v) = self.revision.as_ref() { + os.write_bytes(13, v)?; + } + if let Some(v) = self.bootloader_hash.as_ref() { + os.write_bytes(14, v)?; + } + if let Some(v) = self.imported { + os.write_bool(15, v)?; + } + if let Some(v) = self.unlocked { + os.write_bool(16, v)?; + } + if let Some(v) = self._passphrase_cached { + os.write_bool(17, v)?; + } + if let Some(v) = self.firmware_present { + os.write_bool(18, v)?; + } + if let Some(v) = self.needs_backup { + os.write_bool(19, v)?; + } + if let Some(v) = self.flags { + os.write_uint32(20, v)?; + } + if let Some(v) = self.model.as_ref() { + os.write_string(21, v)?; + } + if let Some(v) = self.fw_major { + os.write_uint32(22, v)?; + } + if let Some(v) = self.fw_minor { + os.write_uint32(23, v)?; + } + if let Some(v) = self.fw_patch { + os.write_uint32(24, v)?; + } + if let Some(v) = self.fw_vendor.as_ref() { + os.write_string(25, v)?; + } + if let Some(v) = self.unfinished_backup { + os.write_bool(27, v)?; + } + if let Some(v) = self.no_backup { + os.write_bool(28, v)?; + } + if let Some(v) = self.recovery_mode { + os.write_bool(29, v)?; + } + for v in &self.capabilities { + os.write_enum(30, ::protobuf::EnumOrUnknown::value(v))?; + }; + if let Some(v) = self.backup_type { + os.write_enum(31, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.sd_card_present { + os.write_bool(32, v)?; + } + if let Some(v) = self.sd_protection { + os.write_bool(33, v)?; + } + if let Some(v) = self.wipe_code_protection { + os.write_bool(34, v)?; + } + if let Some(v) = self.session_id.as_ref() { + os.write_bytes(35, v)?; + } + if let Some(v) = self.passphrase_always_on_device { + os.write_bool(36, v)?; + } + if let Some(v) = self.safety_checks { + os.write_enum(37, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.auto_lock_delay_ms { + os.write_uint32(38, v)?; + } + if let Some(v) = self.display_rotation { + os.write_uint32(39, v)?; + } + if let Some(v) = self.experimental_features { + os.write_bool(40, v)?; + } + if let Some(v) = self.busy { + os.write_bool(41, v)?; + } + if let Some(v) = self.homescreen_format { + os.write_enum(42, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.hide_passphrase_from_host { + os.write_bool(43, v)?; + } + if let Some(v) = self.internal_model.as_ref() { + os.write_string(44, v)?; + } + if let Some(v) = self.unit_color { + os.write_uint32(45, v)?; + } + if let Some(v) = self.unit_btconly { + os.write_bool(46, v)?; + } + if let Some(v) = self.homescreen_width { + os.write_uint32(47, v)?; + } + if let Some(v) = self.homescreen_height { + os.write_uint32(48, v)?; + } + if let Some(v) = self.bootloader_locked { + os.write_bool(49, v)?; + } + if let Some(v) = self.language_version_matches { + os.write_bool(50, v)?; + } + if let Some(v) = self.unit_packaging { + os.write_uint32(51, 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() -> Features { + Features::new() + } + + fn clear(&mut self) { + self.vendor = ::std::option::Option::None; + self.major_version = ::std::option::Option::None; + self.minor_version = ::std::option::Option::None; + self.patch_version = ::std::option::Option::None; + self.bootloader_mode = ::std::option::Option::None; + self.device_id = ::std::option::Option::None; + self.pin_protection = ::std::option::Option::None; + self.passphrase_protection = ::std::option::Option::None; + self.language = ::std::option::Option::None; + self.label = ::std::option::Option::None; + self.initialized = ::std::option::Option::None; + self.revision = ::std::option::Option::None; + self.bootloader_hash = ::std::option::Option::None; + self.imported = ::std::option::Option::None; + self.unlocked = ::std::option::Option::None; + self._passphrase_cached = ::std::option::Option::None; + self.firmware_present = ::std::option::Option::None; + self.needs_backup = ::std::option::Option::None; + self.flags = ::std::option::Option::None; + self.model = ::std::option::Option::None; + self.fw_major = ::std::option::Option::None; + self.fw_minor = ::std::option::Option::None; + self.fw_patch = ::std::option::Option::None; + self.fw_vendor = ::std::option::Option::None; + self.unfinished_backup = ::std::option::Option::None; + self.no_backup = ::std::option::Option::None; + self.recovery_mode = ::std::option::Option::None; + self.capabilities.clear(); + self.backup_type = ::std::option::Option::None; + self.sd_card_present = ::std::option::Option::None; + self.sd_protection = ::std::option::Option::None; + self.wipe_code_protection = ::std::option::Option::None; + self.session_id = ::std::option::Option::None; + self.passphrase_always_on_device = ::std::option::Option::None; + self.safety_checks = ::std::option::Option::None; + self.auto_lock_delay_ms = ::std::option::Option::None; + self.display_rotation = ::std::option::Option::None; + self.experimental_features = ::std::option::Option::None; + self.busy = ::std::option::Option::None; + self.homescreen_format = ::std::option::Option::None; + self.hide_passphrase_from_host = ::std::option::Option::None; + self.internal_model = ::std::option::Option::None; + self.unit_color = ::std::option::Option::None; + self.unit_btconly = ::std::option::Option::None; + self.homescreen_width = ::std::option::Option::None; + self.homescreen_height = ::std::option::Option::None; + self.bootloader_locked = ::std::option::Option::None; + self.language_version_matches = ::std::option::Option::None; + self.unit_packaging = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static Features { + static instance: Features = Features { + vendor: ::std::option::Option::None, + major_version: ::std::option::Option::None, + minor_version: ::std::option::Option::None, + patch_version: ::std::option::Option::None, + bootloader_mode: ::std::option::Option::None, + device_id: ::std::option::Option::None, + pin_protection: ::std::option::Option::None, + passphrase_protection: ::std::option::Option::None, + language: ::std::option::Option::None, + label: ::std::option::Option::None, + initialized: ::std::option::Option::None, + revision: ::std::option::Option::None, + bootloader_hash: ::std::option::Option::None, + imported: ::std::option::Option::None, + unlocked: ::std::option::Option::None, + _passphrase_cached: ::std::option::Option::None, + firmware_present: ::std::option::Option::None, + needs_backup: ::std::option::Option::None, + flags: ::std::option::Option::None, + model: ::std::option::Option::None, + fw_major: ::std::option::Option::None, + fw_minor: ::std::option::Option::None, + fw_patch: ::std::option::Option::None, + fw_vendor: ::std::option::Option::None, + unfinished_backup: ::std::option::Option::None, + no_backup: ::std::option::Option::None, + recovery_mode: ::std::option::Option::None, + capabilities: ::std::vec::Vec::new(), + backup_type: ::std::option::Option::None, + sd_card_present: ::std::option::Option::None, + sd_protection: ::std::option::Option::None, + wipe_code_protection: ::std::option::Option::None, + session_id: ::std::option::Option::None, + passphrase_always_on_device: ::std::option::Option::None, + safety_checks: ::std::option::Option::None, + auto_lock_delay_ms: ::std::option::Option::None, + display_rotation: ::std::option::Option::None, + experimental_features: ::std::option::Option::None, + busy: ::std::option::Option::None, + homescreen_format: ::std::option::Option::None, + hide_passphrase_from_host: ::std::option::Option::None, + internal_model: ::std::option::Option::None, + unit_color: ::std::option::Option::None, + unit_btconly: ::std::option::Option::None, + homescreen_width: ::std::option::Option::None, + homescreen_height: ::std::option::Option::None, + bootloader_locked: ::std::option::Option::None, + language_version_matches: ::std::option::Option::None, + unit_packaging: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Features { + 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("Features").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Features { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Features { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `Features` +pub mod features { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.management.Features.Capability) + pub enum Capability { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_Bitcoin) + Capability_Bitcoin = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_Bitcoin_like) + Capability_Bitcoin_like = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_Binance) + Capability_Binance = 3, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_Cardano) + Capability_Cardano = 4, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_Crypto) + Capability_Crypto = 5, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_EOS) + Capability_EOS = 6, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_Ethereum) + Capability_Ethereum = 7, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_Lisk) + Capability_Lisk = 8, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_Monero) + Capability_Monero = 9, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_NEM) + Capability_NEM = 10, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_Ripple) + Capability_Ripple = 11, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_Stellar) + Capability_Stellar = 12, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_Tezos) + Capability_Tezos = 13, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_U2F) + Capability_U2F = 14, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_Shamir) + Capability_Shamir = 15, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_ShamirGroups) + Capability_ShamirGroups = 16, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_PassphraseEntry) + Capability_PassphraseEntry = 17, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_Solana) + Capability_Solana = 18, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_Translations) + Capability_Translations = 19, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.Features.Capability.Capability_Mintlayer) + Capability_Mintlayer = 20, + } + + impl ::protobuf::Enum for Capability { + const NAME: &'static str = "Capability"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 1 => ::std::option::Option::Some(Capability::Capability_Bitcoin), + 2 => ::std::option::Option::Some(Capability::Capability_Bitcoin_like), + 3 => ::std::option::Option::Some(Capability::Capability_Binance), + 4 => ::std::option::Option::Some(Capability::Capability_Cardano), + 5 => ::std::option::Option::Some(Capability::Capability_Crypto), + 6 => ::std::option::Option::Some(Capability::Capability_EOS), + 7 => ::std::option::Option::Some(Capability::Capability_Ethereum), + 8 => ::std::option::Option::Some(Capability::Capability_Lisk), + 9 => ::std::option::Option::Some(Capability::Capability_Monero), + 10 => ::std::option::Option::Some(Capability::Capability_NEM), + 11 => ::std::option::Option::Some(Capability::Capability_Ripple), + 12 => ::std::option::Option::Some(Capability::Capability_Stellar), + 13 => ::std::option::Option::Some(Capability::Capability_Tezos), + 14 => ::std::option::Option::Some(Capability::Capability_U2F), + 15 => ::std::option::Option::Some(Capability::Capability_Shamir), + 16 => ::std::option::Option::Some(Capability::Capability_ShamirGroups), + 17 => ::std::option::Option::Some(Capability::Capability_PassphraseEntry), + 18 => ::std::option::Option::Some(Capability::Capability_Solana), + 19 => ::std::option::Option::Some(Capability::Capability_Translations), + 20 => ::std::option::Option::Some(Capability::Capability_Mintlayer), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "Capability_Bitcoin" => ::std::option::Option::Some(Capability::Capability_Bitcoin), + "Capability_Bitcoin_like" => ::std::option::Option::Some(Capability::Capability_Bitcoin_like), + "Capability_Binance" => ::std::option::Option::Some(Capability::Capability_Binance), + "Capability_Cardano" => ::std::option::Option::Some(Capability::Capability_Cardano), + "Capability_Crypto" => ::std::option::Option::Some(Capability::Capability_Crypto), + "Capability_EOS" => ::std::option::Option::Some(Capability::Capability_EOS), + "Capability_Ethereum" => ::std::option::Option::Some(Capability::Capability_Ethereum), + "Capability_Lisk" => ::std::option::Option::Some(Capability::Capability_Lisk), + "Capability_Monero" => ::std::option::Option::Some(Capability::Capability_Monero), + "Capability_NEM" => ::std::option::Option::Some(Capability::Capability_NEM), + "Capability_Ripple" => ::std::option::Option::Some(Capability::Capability_Ripple), + "Capability_Stellar" => ::std::option::Option::Some(Capability::Capability_Stellar), + "Capability_Tezos" => ::std::option::Option::Some(Capability::Capability_Tezos), + "Capability_U2F" => ::std::option::Option::Some(Capability::Capability_U2F), + "Capability_Shamir" => ::std::option::Option::Some(Capability::Capability_Shamir), + "Capability_ShamirGroups" => ::std::option::Option::Some(Capability::Capability_ShamirGroups), + "Capability_PassphraseEntry" => ::std::option::Option::Some(Capability::Capability_PassphraseEntry), + "Capability_Solana" => ::std::option::Option::Some(Capability::Capability_Solana), + "Capability_Translations" => ::std::option::Option::Some(Capability::Capability_Translations), + "Capability_Mintlayer" => ::std::option::Option::Some(Capability::Capability_Mintlayer), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [Capability] = &[ + Capability::Capability_Bitcoin, + Capability::Capability_Bitcoin_like, + Capability::Capability_Binance, + Capability::Capability_Cardano, + Capability::Capability_Crypto, + Capability::Capability_EOS, + Capability::Capability_Ethereum, + Capability::Capability_Lisk, + Capability::Capability_Monero, + Capability::Capability_NEM, + Capability::Capability_Ripple, + Capability::Capability_Stellar, + Capability::Capability_Tezos, + Capability::Capability_U2F, + Capability::Capability_Shamir, + Capability::Capability_ShamirGroups, + Capability::Capability_PassphraseEntry, + Capability::Capability_Solana, + Capability::Capability_Translations, + Capability::Capability_Mintlayer, + ]; + } + + impl ::protobuf::EnumFull for Capability { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("Features.Capability").unwrap()).clone() + } + + fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { + let index = match self { + Capability::Capability_Bitcoin => 0, + Capability::Capability_Bitcoin_like => 1, + Capability::Capability_Binance => 2, + Capability::Capability_Cardano => 3, + Capability::Capability_Crypto => 4, + Capability::Capability_EOS => 5, + Capability::Capability_Ethereum => 6, + Capability::Capability_Lisk => 7, + Capability::Capability_Monero => 8, + Capability::Capability_NEM => 9, + Capability::Capability_Ripple => 10, + Capability::Capability_Stellar => 11, + Capability::Capability_Tezos => 12, + Capability::Capability_U2F => 13, + Capability::Capability_Shamir => 14, + Capability::Capability_ShamirGroups => 15, + Capability::Capability_PassphraseEntry => 16, + Capability::Capability_Solana => 17, + Capability::Capability_Translations => 18, + Capability::Capability_Mintlayer => 19, + }; + Self::enum_descriptor().value_by_index(index) + } + } + + // Note, `Default` is implemented although default value is not 0 + impl ::std::default::Default for Capability { + fn default() -> Self { + Capability::Capability_Bitcoin + } + } + + impl Capability { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("Features.Capability") + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.LockDevice) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct LockDevice { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.LockDevice.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a LockDevice { + fn default() -> &'a LockDevice { + ::default_instance() + } +} + +impl LockDevice { + pub fn new() -> LockDevice { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "LockDevice", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for LockDevice { + const NAME: &'static str = "LockDevice"; + + 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 { + 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; + 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<()> { + 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() -> LockDevice { + LockDevice::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static LockDevice { + static instance: LockDevice = LockDevice { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for LockDevice { + 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("LockDevice").unwrap()).clone() + } +} + +impl ::std::fmt::Display for LockDevice { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for LockDevice { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.SetBusy) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SetBusy { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.SetBusy.expiry_ms) + pub expiry_ms: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.SetBusy.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SetBusy { + fn default() -> &'a SetBusy { + ::default_instance() + } +} + +impl SetBusy { + pub fn new() -> SetBusy { + ::std::default::Default::default() + } + + // optional uint32 expiry_ms = 1; + + pub fn expiry_ms(&self) -> u32 { + self.expiry_ms.unwrap_or(0) + } + + pub fn clear_expiry_ms(&mut self) { + self.expiry_ms = ::std::option::Option::None; + } + + pub fn has_expiry_ms(&self) -> bool { + self.expiry_ms.is_some() + } + + // Param is passed by value, moved + pub fn set_expiry_ms(&mut self, v: u32) { + self.expiry_ms = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "expiry_ms", + |m: &SetBusy| { &m.expiry_ms }, + |m: &mut SetBusy| { &mut m.expiry_ms }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SetBusy", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SetBusy { + const NAME: &'static str = "SetBusy"; + + 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 { + 8 => { + self.expiry_ms = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.expiry_ms { + my_size += ::protobuf::rt::uint32_size(1, 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.expiry_ms { + os.write_uint32(1, 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() -> SetBusy { + SetBusy::new() + } + + fn clear(&mut self) { + self.expiry_ms = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static SetBusy { + static instance: SetBusy = SetBusy { + expiry_ms: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SetBusy { + 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("SetBusy").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SetBusy { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SetBusy { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.EndSession) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EndSession { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.EndSession.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EndSession { + fn default() -> &'a EndSession { + ::default_instance() + } +} + +impl EndSession { + pub fn new() -> EndSession { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EndSession", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EndSession { + const NAME: &'static str = "EndSession"; + + 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 { + 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; + 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<()> { + 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() -> EndSession { + EndSession::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static EndSession { + static instance: EndSession = EndSession { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EndSession { + 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("EndSession").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EndSession { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EndSession { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.ApplySettings) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct ApplySettings { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.ApplySettings.language) + pub language: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ApplySettings.label) + pub label: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ApplySettings.use_passphrase) + pub use_passphrase: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ApplySettings.homescreen) + pub homescreen: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ApplySettings._passphrase_source) + pub _passphrase_source: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ApplySettings.auto_lock_delay_ms) + pub auto_lock_delay_ms: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ApplySettings.display_rotation) + pub display_rotation: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ApplySettings.passphrase_always_on_device) + pub passphrase_always_on_device: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ApplySettings.safety_checks) + pub safety_checks: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ApplySettings.experimental_features) + pub experimental_features: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ApplySettings.hide_passphrase_from_host) + pub hide_passphrase_from_host: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.ApplySettings.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a ApplySettings { + fn default() -> &'a ApplySettings { + ::default_instance() + } +} + +impl ApplySettings { + pub fn new() -> ApplySettings { + ::std::default::Default::default() + } + + // optional string language = 1; + + pub fn language(&self) -> &str { + match self.language.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_language(&mut self) { + self.language = ::std::option::Option::None; + } + + pub fn has_language(&self) -> bool { + self.language.is_some() + } + + // Param is passed by value, moved + pub fn set_language(&mut self, v: ::std::string::String) { + self.language = ::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_language(&mut self) -> &mut ::std::string::String { + if self.language.is_none() { + self.language = ::std::option::Option::Some(::std::string::String::new()); + } + self.language.as_mut().unwrap() + } + + // Take field + pub fn take_language(&mut self) -> ::std::string::String { + self.language.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string label = 2; + + pub fn label(&self) -> &str { + match self.label.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_label(&mut self) { + self.label = ::std::option::Option::None; + } + + pub fn has_label(&self) -> bool { + self.label.is_some() + } + + // Param is passed by value, moved + pub fn set_label(&mut self, v: ::std::string::String) { + self.label = ::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_label(&mut self) -> &mut ::std::string::String { + if self.label.is_none() { + self.label = ::std::option::Option::Some(::std::string::String::new()); + } + self.label.as_mut().unwrap() + } + + // Take field + pub fn take_label(&mut self) -> ::std::string::String { + self.label.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bool use_passphrase = 3; + + pub fn use_passphrase(&self) -> bool { + self.use_passphrase.unwrap_or(false) + } + + pub fn clear_use_passphrase(&mut self) { + self.use_passphrase = ::std::option::Option::None; + } + + pub fn has_use_passphrase(&self) -> bool { + self.use_passphrase.is_some() + } + + // Param is passed by value, moved + pub fn set_use_passphrase(&mut self, v: bool) { + self.use_passphrase = ::std::option::Option::Some(v); + } + + // optional bytes homescreen = 4; + + pub fn homescreen(&self) -> &[u8] { + match self.homescreen.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_homescreen(&mut self) { + self.homescreen = ::std::option::Option::None; + } + + pub fn has_homescreen(&self) -> bool { + self.homescreen.is_some() + } + + // Param is passed by value, moved + pub fn set_homescreen(&mut self, v: ::std::vec::Vec) { + self.homescreen = ::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_homescreen(&mut self) -> &mut ::std::vec::Vec { + if self.homescreen.is_none() { + self.homescreen = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.homescreen.as_mut().unwrap() + } + + // Take field + pub fn take_homescreen(&mut self) -> ::std::vec::Vec { + self.homescreen.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 _passphrase_source = 5; + + pub fn _passphrase_source(&self) -> u32 { + self._passphrase_source.unwrap_or(0) + } + + pub fn clear__passphrase_source(&mut self) { + self._passphrase_source = ::std::option::Option::None; + } + + pub fn has__passphrase_source(&self) -> bool { + self._passphrase_source.is_some() + } + + // Param is passed by value, moved + pub fn set__passphrase_source(&mut self, v: u32) { + self._passphrase_source = ::std::option::Option::Some(v); + } + + // optional uint32 auto_lock_delay_ms = 6; + + pub fn auto_lock_delay_ms(&self) -> u32 { + self.auto_lock_delay_ms.unwrap_or(0) + } + + pub fn clear_auto_lock_delay_ms(&mut self) { + self.auto_lock_delay_ms = ::std::option::Option::None; + } + + pub fn has_auto_lock_delay_ms(&self) -> bool { + self.auto_lock_delay_ms.is_some() + } + + // Param is passed by value, moved + pub fn set_auto_lock_delay_ms(&mut self, v: u32) { + self.auto_lock_delay_ms = ::std::option::Option::Some(v); + } + + // optional uint32 display_rotation = 7; + + pub fn display_rotation(&self) -> u32 { + self.display_rotation.unwrap_or(0) + } + + pub fn clear_display_rotation(&mut self) { + self.display_rotation = ::std::option::Option::None; + } + + pub fn has_display_rotation(&self) -> bool { + self.display_rotation.is_some() + } + + // Param is passed by value, moved + pub fn set_display_rotation(&mut self, v: u32) { + self.display_rotation = ::std::option::Option::Some(v); + } + + // optional bool passphrase_always_on_device = 8; + + pub fn passphrase_always_on_device(&self) -> bool { + self.passphrase_always_on_device.unwrap_or(false) + } + + pub fn clear_passphrase_always_on_device(&mut self) { + self.passphrase_always_on_device = ::std::option::Option::None; + } + + pub fn has_passphrase_always_on_device(&self) -> bool { + self.passphrase_always_on_device.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase_always_on_device(&mut self, v: bool) { + self.passphrase_always_on_device = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.management.SafetyCheckLevel safety_checks = 9; + + pub fn safety_checks(&self) -> SafetyCheckLevel { + match self.safety_checks { + Some(e) => e.enum_value_or(SafetyCheckLevel::Strict), + None => SafetyCheckLevel::Strict, + } + } + + pub fn clear_safety_checks(&mut self) { + self.safety_checks = ::std::option::Option::None; + } + + pub fn has_safety_checks(&self) -> bool { + self.safety_checks.is_some() + } + + // Param is passed by value, moved + pub fn set_safety_checks(&mut self, v: SafetyCheckLevel) { + self.safety_checks = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bool experimental_features = 10; + + pub fn experimental_features(&self) -> bool { + self.experimental_features.unwrap_or(false) + } + + pub fn clear_experimental_features(&mut self) { + self.experimental_features = ::std::option::Option::None; + } + + pub fn has_experimental_features(&self) -> bool { + self.experimental_features.is_some() + } + + // Param is passed by value, moved + pub fn set_experimental_features(&mut self, v: bool) { + self.experimental_features = ::std::option::Option::Some(v); + } + + // optional bool hide_passphrase_from_host = 11; + + pub fn hide_passphrase_from_host(&self) -> bool { + self.hide_passphrase_from_host.unwrap_or(false) + } + + pub fn clear_hide_passphrase_from_host(&mut self) { + self.hide_passphrase_from_host = ::std::option::Option::None; + } + + pub fn has_hide_passphrase_from_host(&self) -> bool { + self.hide_passphrase_from_host.is_some() + } + + // Param is passed by value, moved + pub fn set_hide_passphrase_from_host(&mut self, v: bool) { + self.hide_passphrase_from_host = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(11); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "language", + |m: &ApplySettings| { &m.language }, + |m: &mut ApplySettings| { &mut m.language }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "label", + |m: &ApplySettings| { &m.label }, + |m: &mut ApplySettings| { &mut m.label }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "use_passphrase", + |m: &ApplySettings| { &m.use_passphrase }, + |m: &mut ApplySettings| { &mut m.use_passphrase }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "homescreen", + |m: &ApplySettings| { &m.homescreen }, + |m: &mut ApplySettings| { &mut m.homescreen }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "_passphrase_source", + |m: &ApplySettings| { &m._passphrase_source }, + |m: &mut ApplySettings| { &mut m._passphrase_source }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "auto_lock_delay_ms", + |m: &ApplySettings| { &m.auto_lock_delay_ms }, + |m: &mut ApplySettings| { &mut m.auto_lock_delay_ms }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "display_rotation", + |m: &ApplySettings| { &m.display_rotation }, + |m: &mut ApplySettings| { &mut m.display_rotation }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "passphrase_always_on_device", + |m: &ApplySettings| { &m.passphrase_always_on_device }, + |m: &mut ApplySettings| { &mut m.passphrase_always_on_device }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "safety_checks", + |m: &ApplySettings| { &m.safety_checks }, + |m: &mut ApplySettings| { &mut m.safety_checks }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "experimental_features", + |m: &ApplySettings| { &m.experimental_features }, + |m: &mut ApplySettings| { &mut m.experimental_features }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "hide_passphrase_from_host", + |m: &ApplySettings| { &m.hide_passphrase_from_host }, + |m: &mut ApplySettings| { &mut m.hide_passphrase_from_host }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "ApplySettings", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for ApplySettings { + const NAME: &'static str = "ApplySettings"; + + 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.language = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.label = ::std::option::Option::Some(is.read_string()?); + }, + 24 => { + self.use_passphrase = ::std::option::Option::Some(is.read_bool()?); + }, + 34 => { + self.homescreen = ::std::option::Option::Some(is.read_bytes()?); + }, + 40 => { + self._passphrase_source = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.auto_lock_delay_ms = ::std::option::Option::Some(is.read_uint32()?); + }, + 56 => { + self.display_rotation = ::std::option::Option::Some(is.read_uint32()?); + }, + 64 => { + self.passphrase_always_on_device = ::std::option::Option::Some(is.read_bool()?); + }, + 72 => { + self.safety_checks = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 80 => { + self.experimental_features = ::std::option::Option::Some(is.read_bool()?); + }, + 88 => { + self.hide_passphrase_from_host = ::std::option::Option::Some(is.read_bool()?); + }, + 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.language.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.label.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.use_passphrase { + my_size += 1 + 1; + } + if let Some(v) = self.homescreen.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self._passphrase_source { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.auto_lock_delay_ms { + my_size += ::protobuf::rt::uint32_size(6, v); + } + if let Some(v) = self.display_rotation { + my_size += ::protobuf::rt::uint32_size(7, v); + } + if let Some(v) = self.passphrase_always_on_device { + my_size += 1 + 1; + } + if let Some(v) = self.safety_checks { + my_size += ::protobuf::rt::int32_size(9, v.value()); + } + if let Some(v) = self.experimental_features { + my_size += 1 + 1; + } + if let Some(v) = self.hide_passphrase_from_host { + my_size += 1 + 1; + } + 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.language.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.label.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.use_passphrase { + os.write_bool(3, v)?; + } + if let Some(v) = self.homescreen.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self._passphrase_source { + os.write_uint32(5, v)?; + } + if let Some(v) = self.auto_lock_delay_ms { + os.write_uint32(6, v)?; + } + if let Some(v) = self.display_rotation { + os.write_uint32(7, v)?; + } + if let Some(v) = self.passphrase_always_on_device { + os.write_bool(8, v)?; + } + if let Some(v) = self.safety_checks { + os.write_enum(9, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.experimental_features { + os.write_bool(10, v)?; + } + if let Some(v) = self.hide_passphrase_from_host { + os.write_bool(11, 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() -> ApplySettings { + ApplySettings::new() + } + + fn clear(&mut self) { + self.language = ::std::option::Option::None; + self.label = ::std::option::Option::None; + self.use_passphrase = ::std::option::Option::None; + self.homescreen = ::std::option::Option::None; + self._passphrase_source = ::std::option::Option::None; + self.auto_lock_delay_ms = ::std::option::Option::None; + self.display_rotation = ::std::option::Option::None; + self.passphrase_always_on_device = ::std::option::Option::None; + self.safety_checks = ::std::option::Option::None; + self.experimental_features = ::std::option::Option::None; + self.hide_passphrase_from_host = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static ApplySettings { + static instance: ApplySettings = ApplySettings { + language: ::std::option::Option::None, + label: ::std::option::Option::None, + use_passphrase: ::std::option::Option::None, + homescreen: ::std::option::Option::None, + _passphrase_source: ::std::option::Option::None, + auto_lock_delay_ms: ::std::option::Option::None, + display_rotation: ::std::option::Option::None, + passphrase_always_on_device: ::std::option::Option::None, + safety_checks: ::std::option::Option::None, + experimental_features: ::std::option::Option::None, + hide_passphrase_from_host: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for ApplySettings { + 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("ApplySettings").unwrap()).clone() + } +} + +impl ::std::fmt::Display for ApplySettings { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ApplySettings { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.ChangeLanguage) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct ChangeLanguage { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.ChangeLanguage.data_length) + pub data_length: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ChangeLanguage.show_display) + pub show_display: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.ChangeLanguage.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a ChangeLanguage { + fn default() -> &'a ChangeLanguage { + ::default_instance() + } +} + +impl ChangeLanguage { + pub fn new() -> ChangeLanguage { + ::std::default::Default::default() + } + + // required uint32 data_length = 1; + + pub fn data_length(&self) -> u32 { + self.data_length.unwrap_or(0) + } + + pub fn clear_data_length(&mut self) { + self.data_length = ::std::option::Option::None; + } + + pub fn has_data_length(&self) -> bool { + self.data_length.is_some() + } + + // Param is passed by value, moved + pub fn set_data_length(&mut self, v: u32) { + self.data_length = ::std::option::Option::Some(v); + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "data_length", + |m: &ChangeLanguage| { &m.data_length }, + |m: &mut ChangeLanguage| { &mut m.data_length }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &ChangeLanguage| { &m.show_display }, + |m: &mut ChangeLanguage| { &mut m.show_display }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "ChangeLanguage", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for ChangeLanguage { + const NAME: &'static str = "ChangeLanguage"; + + fn is_initialized(&self) -> bool { + if self.data_length.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.data_length = ::std::option::Option::Some(is.read_uint32()?); + }, + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 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.data_length { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + 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.data_length { + os.write_uint32(1, v)?; + } + if let Some(v) = self.show_display { + os.write_bool(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() -> ChangeLanguage { + ChangeLanguage::new() + } + + fn clear(&mut self) { + self.data_length = ::std::option::Option::None; + self.show_display = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static ChangeLanguage { + static instance: ChangeLanguage = ChangeLanguage { + data_length: ::std::option::Option::None, + show_display: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for ChangeLanguage { + 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("ChangeLanguage").unwrap()).clone() + } +} + +impl ::std::fmt::Display for ChangeLanguage { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ChangeLanguage { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.TranslationDataRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TranslationDataRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.TranslationDataRequest.data_length) + pub data_length: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.TranslationDataRequest.data_offset) + pub data_offset: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.TranslationDataRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TranslationDataRequest { + fn default() -> &'a TranslationDataRequest { + ::default_instance() + } +} + +impl TranslationDataRequest { + pub fn new() -> TranslationDataRequest { + ::std::default::Default::default() + } + + // required uint32 data_length = 1; + + pub fn data_length(&self) -> u32 { + self.data_length.unwrap_or(0) + } + + pub fn clear_data_length(&mut self) { + self.data_length = ::std::option::Option::None; + } + + pub fn has_data_length(&self) -> bool { + self.data_length.is_some() + } + + // Param is passed by value, moved + pub fn set_data_length(&mut self, v: u32) { + self.data_length = ::std::option::Option::Some(v); + } + + // required uint32 data_offset = 2; + + pub fn data_offset(&self) -> u32 { + self.data_offset.unwrap_or(0) + } + + pub fn clear_data_offset(&mut self) { + self.data_offset = ::std::option::Option::None; + } + + pub fn has_data_offset(&self) -> bool { + self.data_offset.is_some() + } + + // Param is passed by value, moved + pub fn set_data_offset(&mut self, v: u32) { + self.data_offset = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "data_length", + |m: &TranslationDataRequest| { &m.data_length }, + |m: &mut TranslationDataRequest| { &mut m.data_length }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data_offset", + |m: &TranslationDataRequest| { &m.data_offset }, + |m: &mut TranslationDataRequest| { &mut m.data_offset }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TranslationDataRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TranslationDataRequest { + const NAME: &'static str = "TranslationDataRequest"; + + fn is_initialized(&self) -> bool { + if self.data_length.is_none() { + return false; + } + if self.data_offset.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.data_length = ::std::option::Option::Some(is.read_uint32()?); + }, + 16 => { + self.data_offset = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.data_length { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.data_offset { + my_size += ::protobuf::rt::uint32_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.data_length { + os.write_uint32(1, v)?; + } + if let Some(v) = self.data_offset { + os.write_uint32(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() -> TranslationDataRequest { + TranslationDataRequest::new() + } + + fn clear(&mut self) { + self.data_length = ::std::option::Option::None; + self.data_offset = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TranslationDataRequest { + static instance: TranslationDataRequest = TranslationDataRequest { + data_length: ::std::option::Option::None, + data_offset: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TranslationDataRequest { + 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("TranslationDataRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TranslationDataRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TranslationDataRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.TranslationDataAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TranslationDataAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.TranslationDataAck.data_chunk) + pub data_chunk: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.TranslationDataAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TranslationDataAck { + fn default() -> &'a TranslationDataAck { + ::default_instance() + } +} + +impl TranslationDataAck { + pub fn new() -> TranslationDataAck { + ::std::default::Default::default() + } + + // required bytes data_chunk = 1; + + pub fn data_chunk(&self) -> &[u8] { + match self.data_chunk.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_data_chunk(&mut self) { + self.data_chunk = ::std::option::Option::None; + } + + pub fn has_data_chunk(&self) -> bool { + self.data_chunk.is_some() + } + + // Param is passed by value, moved + pub fn set_data_chunk(&mut self, v: ::std::vec::Vec) { + self.data_chunk = ::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_data_chunk(&mut self) -> &mut ::std::vec::Vec { + if self.data_chunk.is_none() { + self.data_chunk = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.data_chunk.as_mut().unwrap() + } + + // Take field + pub fn take_data_chunk(&mut self) -> ::std::vec::Vec { + self.data_chunk.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data_chunk", + |m: &TranslationDataAck| { &m.data_chunk }, + |m: &mut TranslationDataAck| { &mut m.data_chunk }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TranslationDataAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TranslationDataAck { + const NAME: &'static str = "TranslationDataAck"; + + fn is_initialized(&self) -> bool { + if self.data_chunk.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.data_chunk = ::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.data_chunk.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.data_chunk.as_ref() { + os.write_bytes(1, 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() -> TranslationDataAck { + TranslationDataAck::new() + } + + fn clear(&mut self) { + self.data_chunk = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TranslationDataAck { + static instance: TranslationDataAck = TranslationDataAck { + data_chunk: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TranslationDataAck { + 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("TranslationDataAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TranslationDataAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TranslationDataAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.ApplyFlags) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct ApplyFlags { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.ApplyFlags.flags) + pub flags: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.ApplyFlags.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a ApplyFlags { + fn default() -> &'a ApplyFlags { + ::default_instance() + } +} + +impl ApplyFlags { + pub fn new() -> ApplyFlags { + ::std::default::Default::default() + } + + // required uint32 flags = 1; + + pub fn flags(&self) -> u32 { + self.flags.unwrap_or(0) + } + + pub fn clear_flags(&mut self) { + self.flags = ::std::option::Option::None; + } + + pub fn has_flags(&self) -> bool { + self.flags.is_some() + } + + // Param is passed by value, moved + pub fn set_flags(&mut self, v: u32) { + self.flags = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "flags", + |m: &ApplyFlags| { &m.flags }, + |m: &mut ApplyFlags| { &mut m.flags }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "ApplyFlags", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for ApplyFlags { + const NAME: &'static str = "ApplyFlags"; + + fn is_initialized(&self) -> bool { + if self.flags.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.flags = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.flags { + my_size += ::protobuf::rt::uint32_size(1, 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.flags { + os.write_uint32(1, 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() -> ApplyFlags { + ApplyFlags::new() + } + + fn clear(&mut self) { + self.flags = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static ApplyFlags { + static instance: ApplyFlags = ApplyFlags { + flags: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for ApplyFlags { + 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("ApplyFlags").unwrap()).clone() + } +} + +impl ::std::fmt::Display for ApplyFlags { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ApplyFlags { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.ChangePin) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct ChangePin { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.ChangePin.remove) + pub remove: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.ChangePin.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a ChangePin { + fn default() -> &'a ChangePin { + ::default_instance() + } +} + +impl ChangePin { + pub fn new() -> ChangePin { + ::std::default::Default::default() + } + + // optional bool remove = 1; + + pub fn remove(&self) -> bool { + self.remove.unwrap_or(false) + } + + pub fn clear_remove(&mut self) { + self.remove = ::std::option::Option::None; + } + + pub fn has_remove(&self) -> bool { + self.remove.is_some() + } + + // Param is passed by value, moved + pub fn set_remove(&mut self, v: bool) { + self.remove = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "remove", + |m: &ChangePin| { &m.remove }, + |m: &mut ChangePin| { &mut m.remove }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "ChangePin", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for ChangePin { + const NAME: &'static str = "ChangePin"; + + 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 { + 8 => { + self.remove = ::std::option::Option::Some(is.read_bool()?); + }, + 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.remove { + my_size += 1 + 1; + } + 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.remove { + os.write_bool(1, 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() -> ChangePin { + ChangePin::new() + } + + fn clear(&mut self) { + self.remove = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static ChangePin { + static instance: ChangePin = ChangePin { + remove: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for ChangePin { + 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("ChangePin").unwrap()).clone() + } +} + +impl ::std::fmt::Display for ChangePin { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ChangePin { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.ChangeWipeCode) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct ChangeWipeCode { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.ChangeWipeCode.remove) + pub remove: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.ChangeWipeCode.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a ChangeWipeCode { + fn default() -> &'a ChangeWipeCode { + ::default_instance() + } +} + +impl ChangeWipeCode { + pub fn new() -> ChangeWipeCode { + ::std::default::Default::default() + } + + // optional bool remove = 1; + + pub fn remove(&self) -> bool { + self.remove.unwrap_or(false) + } + + pub fn clear_remove(&mut self) { + self.remove = ::std::option::Option::None; + } + + pub fn has_remove(&self) -> bool { + self.remove.is_some() + } + + // Param is passed by value, moved + pub fn set_remove(&mut self, v: bool) { + self.remove = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "remove", + |m: &ChangeWipeCode| { &m.remove }, + |m: &mut ChangeWipeCode| { &mut m.remove }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "ChangeWipeCode", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for ChangeWipeCode { + const NAME: &'static str = "ChangeWipeCode"; + + 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 { + 8 => { + self.remove = ::std::option::Option::Some(is.read_bool()?); + }, + 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.remove { + my_size += 1 + 1; + } + 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.remove { + os.write_bool(1, 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() -> ChangeWipeCode { + ChangeWipeCode::new() + } + + fn clear(&mut self) { + self.remove = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static ChangeWipeCode { + static instance: ChangeWipeCode = ChangeWipeCode { + remove: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for ChangeWipeCode { + 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("ChangeWipeCode").unwrap()).clone() + } +} + +impl ::std::fmt::Display for ChangeWipeCode { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ChangeWipeCode { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.SdProtect) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SdProtect { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.SdProtect.operation) + pub operation: ::std::option::Option<::protobuf::EnumOrUnknown>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.SdProtect.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SdProtect { + fn default() -> &'a SdProtect { + ::default_instance() + } +} + +impl SdProtect { + pub fn new() -> SdProtect { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.management.SdProtect.SdProtectOperationType operation = 1; + + pub fn operation(&self) -> sd_protect::SdProtectOperationType { + match self.operation { + Some(e) => e.enum_value_or(sd_protect::SdProtectOperationType::DISABLE), + None => sd_protect::SdProtectOperationType::DISABLE, + } + } + + pub fn clear_operation(&mut self) { + self.operation = ::std::option::Option::None; + } + + pub fn has_operation(&self) -> bool { + self.operation.is_some() + } + + // Param is passed by value, moved + pub fn set_operation(&mut self, v: sd_protect::SdProtectOperationType) { + self.operation = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "operation", + |m: &SdProtect| { &m.operation }, + |m: &mut SdProtect| { &mut m.operation }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SdProtect", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SdProtect { + const NAME: &'static str = "SdProtect"; + + fn is_initialized(&self) -> bool { + if self.operation.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.operation = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 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.operation { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + 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.operation { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&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() -> SdProtect { + SdProtect::new() + } + + fn clear(&mut self) { + self.operation = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static SdProtect { + static instance: SdProtect = SdProtect { + operation: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SdProtect { + 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("SdProtect").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SdProtect { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SdProtect { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `SdProtect` +pub mod sd_protect { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.management.SdProtect.SdProtectOperationType) + pub enum SdProtectOperationType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.SdProtect.SdProtectOperationType.DISABLE) + DISABLE = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.SdProtect.SdProtectOperationType.ENABLE) + ENABLE = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.SdProtect.SdProtectOperationType.REFRESH) + REFRESH = 2, + } + + impl ::protobuf::Enum for SdProtectOperationType { + const NAME: &'static str = "SdProtectOperationType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(SdProtectOperationType::DISABLE), + 1 => ::std::option::Option::Some(SdProtectOperationType::ENABLE), + 2 => ::std::option::Option::Some(SdProtectOperationType::REFRESH), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "DISABLE" => ::std::option::Option::Some(SdProtectOperationType::DISABLE), + "ENABLE" => ::std::option::Option::Some(SdProtectOperationType::ENABLE), + "REFRESH" => ::std::option::Option::Some(SdProtectOperationType::REFRESH), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [SdProtectOperationType] = &[ + SdProtectOperationType::DISABLE, + SdProtectOperationType::ENABLE, + SdProtectOperationType::REFRESH, + ]; + } + + impl ::protobuf::EnumFull for SdProtectOperationType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("SdProtect.SdProtectOperationType").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 SdProtectOperationType { + fn default() -> Self { + SdProtectOperationType::DISABLE + } + } + + impl SdProtectOperationType { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("SdProtect.SdProtectOperationType") + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.Ping) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct Ping { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.Ping.message) + pub message: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.Ping.button_protection) + pub button_protection: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.Ping.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Ping { + fn default() -> &'a Ping { + ::default_instance() + } +} + +impl Ping { + pub fn new() -> Ping { + ::std::default::Default::default() + } + + // optional string message = 1; + + pub fn message(&self) -> &str { + match self.message.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_message(&mut self) { + self.message = ::std::option::Option::None; + } + + pub fn has_message(&self) -> bool { + self.message.is_some() + } + + // Param is passed by value, moved + pub fn set_message(&mut self, v: ::std::string::String) { + self.message = ::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_message(&mut self) -> &mut ::std::string::String { + if self.message.is_none() { + self.message = ::std::option::Option::Some(::std::string::String::new()); + } + self.message.as_mut().unwrap() + } + + // Take field + pub fn take_message(&mut self) -> ::std::string::String { + self.message.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bool button_protection = 2; + + pub fn button_protection(&self) -> bool { + self.button_protection.unwrap_or(false) + } + + pub fn clear_button_protection(&mut self) { + self.button_protection = ::std::option::Option::None; + } + + pub fn has_button_protection(&self) -> bool { + self.button_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_button_protection(&mut self, v: bool) { + self.button_protection = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "message", + |m: &Ping| { &m.message }, + |m: &mut Ping| { &mut m.message }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "button_protection", + |m: &Ping| { &m.button_protection }, + |m: &mut Ping| { &mut m.button_protection }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Ping", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Ping { + const NAME: &'static str = "Ping"; + + 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.message = ::std::option::Option::Some(is.read_string()?); + }, + 16 => { + self.button_protection = ::std::option::Option::Some(is.read_bool()?); + }, + 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.message.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.button_protection { + my_size += 1 + 1; + } + 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.message.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.button_protection { + os.write_bool(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() -> Ping { + Ping::new() + } + + fn clear(&mut self) { + self.message = ::std::option::Option::None; + self.button_protection = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static Ping { + static instance: Ping = Ping { + message: ::std::option::Option::None, + button_protection: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Ping { + 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("Ping").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Ping { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Ping { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.Cancel) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct Cancel { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.Cancel.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Cancel { + fn default() -> &'a Cancel { + ::default_instance() + } +} + +impl Cancel { + pub fn new() -> Cancel { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Cancel", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Cancel { + const NAME: &'static str = "Cancel"; + + 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 { + 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; + 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<()> { + 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() -> Cancel { + Cancel::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static Cancel { + static instance: Cancel = Cancel { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Cancel { + 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("Cancel").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Cancel { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Cancel { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.GetEntropy) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct GetEntropy { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.GetEntropy.size) + pub size: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.GetEntropy.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a GetEntropy { + fn default() -> &'a GetEntropy { + ::default_instance() + } +} + +impl GetEntropy { + pub fn new() -> GetEntropy { + ::std::default::Default::default() + } + + // required uint32 size = 1; + + pub fn size(&self) -> u32 { + self.size.unwrap_or(0) + } + + pub fn clear_size(&mut self) { + self.size = ::std::option::Option::None; + } + + pub fn has_size(&self) -> bool { + self.size.is_some() + } + + // Param is passed by value, moved + pub fn set_size(&mut self, v: u32) { + self.size = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "size", + |m: &GetEntropy| { &m.size }, + |m: &mut GetEntropy| { &mut m.size }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "GetEntropy", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for GetEntropy { + const NAME: &'static str = "GetEntropy"; + + fn is_initialized(&self) -> bool { + if self.size.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.size = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.size { + my_size += ::protobuf::rt::uint32_size(1, 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.size { + os.write_uint32(1, 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() -> GetEntropy { + GetEntropy::new() + } + + fn clear(&mut self) { + self.size = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static GetEntropy { + static instance: GetEntropy = GetEntropy { + size: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for GetEntropy { + 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("GetEntropy").unwrap()).clone() + } +} + +impl ::std::fmt::Display for GetEntropy { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GetEntropy { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.Entropy) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct Entropy { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.Entropy.entropy) + pub entropy: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.Entropy.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Entropy { + fn default() -> &'a Entropy { + ::default_instance() + } +} + +impl Entropy { + pub fn new() -> Entropy { + ::std::default::Default::default() + } + + // required bytes entropy = 1; + + pub fn entropy(&self) -> &[u8] { + match self.entropy.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_entropy(&mut self) { + self.entropy = ::std::option::Option::None; + } + + pub fn has_entropy(&self) -> bool { + self.entropy.is_some() + } + + // Param is passed by value, moved + pub fn set_entropy(&mut self, v: ::std::vec::Vec) { + self.entropy = ::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_entropy(&mut self) -> &mut ::std::vec::Vec { + if self.entropy.is_none() { + self.entropy = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.entropy.as_mut().unwrap() + } + + // Take field + pub fn take_entropy(&mut self) -> ::std::vec::Vec { + self.entropy.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "entropy", + |m: &Entropy| { &m.entropy }, + |m: &mut Entropy| { &mut m.entropy }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Entropy", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Entropy { + const NAME: &'static str = "Entropy"; + + fn is_initialized(&self) -> bool { + if self.entropy.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.entropy = ::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.entropy.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.entropy.as_ref() { + os.write_bytes(1, 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() -> Entropy { + Entropy::new() + } + + fn clear(&mut self) { + self.entropy = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static Entropy { + static instance: Entropy = Entropy { + entropy: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Entropy { + 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("Entropy").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Entropy { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Entropy { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.GetFirmwareHash) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct GetFirmwareHash { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.GetFirmwareHash.challenge) + pub challenge: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.GetFirmwareHash.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a GetFirmwareHash { + fn default() -> &'a GetFirmwareHash { + ::default_instance() + } +} + +impl GetFirmwareHash { + pub fn new() -> GetFirmwareHash { + ::std::default::Default::default() + } + + // optional bytes challenge = 1; + + pub fn challenge(&self) -> &[u8] { + match self.challenge.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_challenge(&mut self) { + self.challenge = ::std::option::Option::None; + } + + pub fn has_challenge(&self) -> bool { + self.challenge.is_some() + } + + // Param is passed by value, moved + pub fn set_challenge(&mut self, v: ::std::vec::Vec) { + self.challenge = ::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_challenge(&mut self) -> &mut ::std::vec::Vec { + if self.challenge.is_none() { + self.challenge = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.challenge.as_mut().unwrap() + } + + // Take field + pub fn take_challenge(&mut self) -> ::std::vec::Vec { + self.challenge.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "challenge", + |m: &GetFirmwareHash| { &m.challenge }, + |m: &mut GetFirmwareHash| { &mut m.challenge }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "GetFirmwareHash", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for GetFirmwareHash { + const NAME: &'static str = "GetFirmwareHash"; + + 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.challenge = ::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.challenge.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.challenge.as_ref() { + os.write_bytes(1, 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() -> GetFirmwareHash { + GetFirmwareHash::new() + } + + fn clear(&mut self) { + self.challenge = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static GetFirmwareHash { + static instance: GetFirmwareHash = GetFirmwareHash { + challenge: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for GetFirmwareHash { + 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("GetFirmwareHash").unwrap()).clone() + } +} + +impl ::std::fmt::Display for GetFirmwareHash { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GetFirmwareHash { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.FirmwareHash) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct FirmwareHash { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.FirmwareHash.hash) + pub hash: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.FirmwareHash.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a FirmwareHash { + fn default() -> &'a FirmwareHash { + ::default_instance() + } +} + +impl FirmwareHash { + pub fn new() -> FirmwareHash { + ::std::default::Default::default() + } + + // required bytes hash = 1; + + pub fn hash(&self) -> &[u8] { + match self.hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_hash(&mut self) { + self.hash = ::std::option::Option::None; + } + + pub fn has_hash(&self) -> bool { + self.hash.is_some() + } + + // Param is passed by value, moved + pub fn set_hash(&mut self, v: ::std::vec::Vec) { + self.hash = ::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_hash(&mut self) -> &mut ::std::vec::Vec { + if self.hash.is_none() { + self.hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.hash.as_mut().unwrap() + } + + // Take field + pub fn take_hash(&mut self) -> ::std::vec::Vec { + self.hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "hash", + |m: &FirmwareHash| { &m.hash }, + |m: &mut FirmwareHash| { &mut m.hash }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "FirmwareHash", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for FirmwareHash { + const NAME: &'static str = "FirmwareHash"; + + fn is_initialized(&self) -> bool { + if self.hash.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.hash = ::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.hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.hash.as_ref() { + os.write_bytes(1, 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() -> FirmwareHash { + FirmwareHash::new() + } + + fn clear(&mut self) { + self.hash = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static FirmwareHash { + static instance: FirmwareHash = FirmwareHash { + hash: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for FirmwareHash { + 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("FirmwareHash").unwrap()).clone() + } +} + +impl ::std::fmt::Display for FirmwareHash { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for FirmwareHash { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.AuthenticateDevice) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct AuthenticateDevice { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.AuthenticateDevice.challenge) + pub challenge: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.AuthenticateDevice.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a AuthenticateDevice { + fn default() -> &'a AuthenticateDevice { + ::default_instance() + } +} + +impl AuthenticateDevice { + pub fn new() -> AuthenticateDevice { + ::std::default::Default::default() + } + + // required bytes challenge = 1; + + pub fn challenge(&self) -> &[u8] { + match self.challenge.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_challenge(&mut self) { + self.challenge = ::std::option::Option::None; + } + + pub fn has_challenge(&self) -> bool { + self.challenge.is_some() + } + + // Param is passed by value, moved + pub fn set_challenge(&mut self, v: ::std::vec::Vec) { + self.challenge = ::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_challenge(&mut self) -> &mut ::std::vec::Vec { + if self.challenge.is_none() { + self.challenge = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.challenge.as_mut().unwrap() + } + + // Take field + pub fn take_challenge(&mut self) -> ::std::vec::Vec { + self.challenge.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "challenge", + |m: &AuthenticateDevice| { &m.challenge }, + |m: &mut AuthenticateDevice| { &mut m.challenge }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "AuthenticateDevice", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for AuthenticateDevice { + const NAME: &'static str = "AuthenticateDevice"; + + fn is_initialized(&self) -> bool { + if self.challenge.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.challenge = ::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.challenge.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.challenge.as_ref() { + os.write_bytes(1, 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() -> AuthenticateDevice { + AuthenticateDevice::new() + } + + fn clear(&mut self) { + self.challenge = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static AuthenticateDevice { + static instance: AuthenticateDevice = AuthenticateDevice { + challenge: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for AuthenticateDevice { + 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("AuthenticateDevice").unwrap()).clone() + } +} + +impl ::std::fmt::Display for AuthenticateDevice { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for AuthenticateDevice { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.AuthenticityProof) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct AuthenticityProof { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.AuthenticityProof.certificates) + pub certificates: ::std::vec::Vec<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.AuthenticityProof.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.AuthenticityProof.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a AuthenticityProof { + fn default() -> &'a AuthenticityProof { + ::default_instance() + } +} + +impl AuthenticityProof { + pub fn new() -> AuthenticityProof { + ::std::default::Default::default() + } + + // required bytes signature = 2; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.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_vec_simpler_accessor::<_, _>( + "certificates", + |m: &AuthenticityProof| { &m.certificates }, + |m: &mut AuthenticityProof| { &mut m.certificates }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &AuthenticityProof| { &m.signature }, + |m: &mut AuthenticityProof| { &mut m.signature }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "AuthenticityProof", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for AuthenticityProof { + const NAME: &'static str = "AuthenticityProof"; + + fn is_initialized(&self) -> bool { + if self.signature.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.certificates.push(is.read_bytes()?); + }, + 18 => { + self.signature = ::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; + for value in &self.certificates { + my_size += ::protobuf::rt::bytes_size(1, &value); + }; + if let Some(v) = self.signature.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<()> { + for v in &self.certificates { + os.write_bytes(1, &v)?; + }; + if let Some(v) = self.signature.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() -> AuthenticityProof { + AuthenticityProof::new() + } + + fn clear(&mut self) { + self.certificates.clear(); + self.signature = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static AuthenticityProof { + static instance: AuthenticityProof = AuthenticityProof { + certificates: ::std::vec::Vec::new(), + signature: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for AuthenticityProof { + 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("AuthenticityProof").unwrap()).clone() + } +} + +impl ::std::fmt::Display for AuthenticityProof { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for AuthenticityProof { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.WipeDevice) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct WipeDevice { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.WipeDevice.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a WipeDevice { + fn default() -> &'a WipeDevice { + ::default_instance() + } +} + +impl WipeDevice { + pub fn new() -> WipeDevice { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "WipeDevice", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for WipeDevice { + const NAME: &'static str = "WipeDevice"; + + 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 { + 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; + 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<()> { + 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() -> WipeDevice { + WipeDevice::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static WipeDevice { + static instance: WipeDevice = WipeDevice { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for WipeDevice { + 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("WipeDevice").unwrap()).clone() + } +} + +impl ::std::fmt::Display for WipeDevice { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for WipeDevice { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.LoadDevice) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct LoadDevice { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.LoadDevice.mnemonics) + pub mnemonics: ::std::vec::Vec<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.LoadDevice.pin) + pub pin: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.LoadDevice.passphrase_protection) + pub passphrase_protection: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.LoadDevice.language) + pub language: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.LoadDevice.label) + pub label: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.LoadDevice.skip_checksum) + pub skip_checksum: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.LoadDevice.u2f_counter) + pub u2f_counter: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.LoadDevice.needs_backup) + pub needs_backup: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.LoadDevice.no_backup) + pub no_backup: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.LoadDevice.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a LoadDevice { + fn default() -> &'a LoadDevice { + ::default_instance() + } +} + +impl LoadDevice { + pub fn new() -> LoadDevice { + ::std::default::Default::default() + } + + // optional string pin = 3; + + pub fn pin(&self) -> &str { + match self.pin.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_pin(&mut self) { + self.pin = ::std::option::Option::None; + } + + pub fn has_pin(&self) -> bool { + self.pin.is_some() + } + + // Param is passed by value, moved + pub fn set_pin(&mut self, v: ::std::string::String) { + self.pin = ::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_pin(&mut self) -> &mut ::std::string::String { + if self.pin.is_none() { + self.pin = ::std::option::Option::Some(::std::string::String::new()); + } + self.pin.as_mut().unwrap() + } + + // Take field + pub fn take_pin(&mut self) -> ::std::string::String { + self.pin.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bool passphrase_protection = 4; + + pub fn passphrase_protection(&self) -> bool { + self.passphrase_protection.unwrap_or(false) + } + + pub fn clear_passphrase_protection(&mut self) { + self.passphrase_protection = ::std::option::Option::None; + } + + pub fn has_passphrase_protection(&self) -> bool { + self.passphrase_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase_protection(&mut self, v: bool) { + self.passphrase_protection = ::std::option::Option::Some(v); + } + + // optional string language = 5; + + pub fn language(&self) -> &str { + match self.language.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_language(&mut self) { + self.language = ::std::option::Option::None; + } + + pub fn has_language(&self) -> bool { + self.language.is_some() + } + + // Param is passed by value, moved + pub fn set_language(&mut self, v: ::std::string::String) { + self.language = ::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_language(&mut self) -> &mut ::std::string::String { + if self.language.is_none() { + self.language = ::std::option::Option::Some(::std::string::String::new()); + } + self.language.as_mut().unwrap() + } + + // Take field + pub fn take_language(&mut self) -> ::std::string::String { + self.language.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string label = 6; + + pub fn label(&self) -> &str { + match self.label.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_label(&mut self) { + self.label = ::std::option::Option::None; + } + + pub fn has_label(&self) -> bool { + self.label.is_some() + } + + // Param is passed by value, moved + pub fn set_label(&mut self, v: ::std::string::String) { + self.label = ::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_label(&mut self) -> &mut ::std::string::String { + if self.label.is_none() { + self.label = ::std::option::Option::Some(::std::string::String::new()); + } + self.label.as_mut().unwrap() + } + + // Take field + pub fn take_label(&mut self) -> ::std::string::String { + self.label.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bool skip_checksum = 7; + + pub fn skip_checksum(&self) -> bool { + self.skip_checksum.unwrap_or(false) + } + + pub fn clear_skip_checksum(&mut self) { + self.skip_checksum = ::std::option::Option::None; + } + + pub fn has_skip_checksum(&self) -> bool { + self.skip_checksum.is_some() + } + + // Param is passed by value, moved + pub fn set_skip_checksum(&mut self, v: bool) { + self.skip_checksum = ::std::option::Option::Some(v); + } + + // optional uint32 u2f_counter = 8; + + pub fn u2f_counter(&self) -> u32 { + self.u2f_counter.unwrap_or(0) + } + + pub fn clear_u2f_counter(&mut self) { + self.u2f_counter = ::std::option::Option::None; + } + + pub fn has_u2f_counter(&self) -> bool { + self.u2f_counter.is_some() + } + + // Param is passed by value, moved + pub fn set_u2f_counter(&mut self, v: u32) { + self.u2f_counter = ::std::option::Option::Some(v); + } + + // optional bool needs_backup = 9; + + pub fn needs_backup(&self) -> bool { + self.needs_backup.unwrap_or(false) + } + + pub fn clear_needs_backup(&mut self) { + self.needs_backup = ::std::option::Option::None; + } + + pub fn has_needs_backup(&self) -> bool { + self.needs_backup.is_some() + } + + // Param is passed by value, moved + pub fn set_needs_backup(&mut self, v: bool) { + self.needs_backup = ::std::option::Option::Some(v); + } + + // optional bool no_backup = 10; + + pub fn no_backup(&self) -> bool { + self.no_backup.unwrap_or(false) + } + + pub fn clear_no_backup(&mut self) { + self.no_backup = ::std::option::Option::None; + } + + pub fn has_no_backup(&self) -> bool { + self.no_backup.is_some() + } + + // Param is passed by value, moved + pub fn set_no_backup(&mut self, v: bool) { + self.no_backup = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(9); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "mnemonics", + |m: &LoadDevice| { &m.mnemonics }, + |m: &mut LoadDevice| { &mut m.mnemonics }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pin", + |m: &LoadDevice| { &m.pin }, + |m: &mut LoadDevice| { &mut m.pin }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "passphrase_protection", + |m: &LoadDevice| { &m.passphrase_protection }, + |m: &mut LoadDevice| { &mut m.passphrase_protection }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "language", + |m: &LoadDevice| { &m.language }, + |m: &mut LoadDevice| { &mut m.language }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "label", + |m: &LoadDevice| { &m.label }, + |m: &mut LoadDevice| { &mut m.label }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "skip_checksum", + |m: &LoadDevice| { &m.skip_checksum }, + |m: &mut LoadDevice| { &mut m.skip_checksum }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "u2f_counter", + |m: &LoadDevice| { &m.u2f_counter }, + |m: &mut LoadDevice| { &mut m.u2f_counter }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "needs_backup", + |m: &LoadDevice| { &m.needs_backup }, + |m: &mut LoadDevice| { &mut m.needs_backup }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "no_backup", + |m: &LoadDevice| { &m.no_backup }, + |m: &mut LoadDevice| { &mut m.no_backup }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "LoadDevice", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for LoadDevice { + const NAME: &'static str = "LoadDevice"; + + 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.mnemonics.push(is.read_string()?); + }, + 26 => { + self.pin = ::std::option::Option::Some(is.read_string()?); + }, + 32 => { + self.passphrase_protection = ::std::option::Option::Some(is.read_bool()?); + }, + 42 => { + self.language = ::std::option::Option::Some(is.read_string()?); + }, + 50 => { + self.label = ::std::option::Option::Some(is.read_string()?); + }, + 56 => { + self.skip_checksum = ::std::option::Option::Some(is.read_bool()?); + }, + 64 => { + self.u2f_counter = ::std::option::Option::Some(is.read_uint32()?); + }, + 72 => { + self.needs_backup = ::std::option::Option::Some(is.read_bool()?); + }, + 80 => { + self.no_backup = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.mnemonics { + my_size += ::protobuf::rt::string_size(1, &value); + }; + if let Some(v) = self.pin.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.passphrase_protection { + my_size += 1 + 1; + } + if let Some(v) = self.language.as_ref() { + my_size += ::protobuf::rt::string_size(5, &v); + } + if let Some(v) = self.label.as_ref() { + my_size += ::protobuf::rt::string_size(6, &v); + } + if let Some(v) = self.skip_checksum { + my_size += 1 + 1; + } + if let Some(v) = self.u2f_counter { + my_size += ::protobuf::rt::uint32_size(8, v); + } + if let Some(v) = self.needs_backup { + my_size += 1 + 1; + } + if let Some(v) = self.no_backup { + my_size += 1 + 1; + } + 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<()> { + for v in &self.mnemonics { + os.write_string(1, &v)?; + }; + if let Some(v) = self.pin.as_ref() { + os.write_string(3, v)?; + } + if let Some(v) = self.passphrase_protection { + os.write_bool(4, v)?; + } + if let Some(v) = self.language.as_ref() { + os.write_string(5, v)?; + } + if let Some(v) = self.label.as_ref() { + os.write_string(6, v)?; + } + if let Some(v) = self.skip_checksum { + os.write_bool(7, v)?; + } + if let Some(v) = self.u2f_counter { + os.write_uint32(8, v)?; + } + if let Some(v) = self.needs_backup { + os.write_bool(9, v)?; + } + if let Some(v) = self.no_backup { + os.write_bool(10, 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() -> LoadDevice { + LoadDevice::new() + } + + fn clear(&mut self) { + self.mnemonics.clear(); + self.pin = ::std::option::Option::None; + self.passphrase_protection = ::std::option::Option::None; + self.language = ::std::option::Option::None; + self.label = ::std::option::Option::None; + self.skip_checksum = ::std::option::Option::None; + self.u2f_counter = ::std::option::Option::None; + self.needs_backup = ::std::option::Option::None; + self.no_backup = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static LoadDevice { + static instance: LoadDevice = LoadDevice { + mnemonics: ::std::vec::Vec::new(), + pin: ::std::option::Option::None, + passphrase_protection: ::std::option::Option::None, + language: ::std::option::Option::None, + label: ::std::option::Option::None, + skip_checksum: ::std::option::Option::None, + u2f_counter: ::std::option::Option::None, + needs_backup: ::std::option::Option::None, + no_backup: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for LoadDevice { + 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("LoadDevice").unwrap()).clone() + } +} + +impl ::std::fmt::Display for LoadDevice { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for LoadDevice { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.ResetDevice) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct ResetDevice { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.ResetDevice.display_random) + pub display_random: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ResetDevice.strength) + pub strength: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ResetDevice.passphrase_protection) + pub passphrase_protection: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ResetDevice.pin_protection) + pub pin_protection: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ResetDevice.language) + pub language: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ResetDevice.label) + pub label: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ResetDevice.u2f_counter) + pub u2f_counter: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ResetDevice.skip_backup) + pub skip_backup: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ResetDevice.no_backup) + pub no_backup: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.ResetDevice.backup_type) + pub backup_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.ResetDevice.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a ResetDevice { + fn default() -> &'a ResetDevice { + ::default_instance() + } +} + +impl ResetDevice { + pub fn new() -> ResetDevice { + ::std::default::Default::default() + } + + // optional bool display_random = 1; + + pub fn display_random(&self) -> bool { + self.display_random.unwrap_or(false) + } + + pub fn clear_display_random(&mut self) { + self.display_random = ::std::option::Option::None; + } + + pub fn has_display_random(&self) -> bool { + self.display_random.is_some() + } + + // Param is passed by value, moved + pub fn set_display_random(&mut self, v: bool) { + self.display_random = ::std::option::Option::Some(v); + } + + // optional uint32 strength = 2; + + pub fn strength(&self) -> u32 { + self.strength.unwrap_or(256u32) + } + + pub fn clear_strength(&mut self) { + self.strength = ::std::option::Option::None; + } + + pub fn has_strength(&self) -> bool { + self.strength.is_some() + } + + // Param is passed by value, moved + pub fn set_strength(&mut self, v: u32) { + self.strength = ::std::option::Option::Some(v); + } + + // optional bool passphrase_protection = 3; + + pub fn passphrase_protection(&self) -> bool { + self.passphrase_protection.unwrap_or(false) + } + + pub fn clear_passphrase_protection(&mut self) { + self.passphrase_protection = ::std::option::Option::None; + } + + pub fn has_passphrase_protection(&self) -> bool { + self.passphrase_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase_protection(&mut self, v: bool) { + self.passphrase_protection = ::std::option::Option::Some(v); + } + + // optional bool pin_protection = 4; + + pub fn pin_protection(&self) -> bool { + self.pin_protection.unwrap_or(false) + } + + pub fn clear_pin_protection(&mut self) { + self.pin_protection = ::std::option::Option::None; + } + + pub fn has_pin_protection(&self) -> bool { + self.pin_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_pin_protection(&mut self, v: bool) { + self.pin_protection = ::std::option::Option::Some(v); + } + + // optional string language = 5; + + pub fn language(&self) -> &str { + match self.language.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_language(&mut self) { + self.language = ::std::option::Option::None; + } + + pub fn has_language(&self) -> bool { + self.language.is_some() + } + + // Param is passed by value, moved + pub fn set_language(&mut self, v: ::std::string::String) { + self.language = ::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_language(&mut self) -> &mut ::std::string::String { + if self.language.is_none() { + self.language = ::std::option::Option::Some(::std::string::String::new()); + } + self.language.as_mut().unwrap() + } + + // Take field + pub fn take_language(&mut self) -> ::std::string::String { + self.language.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string label = 6; + + pub fn label(&self) -> &str { + match self.label.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_label(&mut self) { + self.label = ::std::option::Option::None; + } + + pub fn has_label(&self) -> bool { + self.label.is_some() + } + + // Param is passed by value, moved + pub fn set_label(&mut self, v: ::std::string::String) { + self.label = ::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_label(&mut self) -> &mut ::std::string::String { + if self.label.is_none() { + self.label = ::std::option::Option::Some(::std::string::String::new()); + } + self.label.as_mut().unwrap() + } + + // Take field + pub fn take_label(&mut self) -> ::std::string::String { + self.label.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint32 u2f_counter = 7; + + pub fn u2f_counter(&self) -> u32 { + self.u2f_counter.unwrap_or(0) + } + + pub fn clear_u2f_counter(&mut self) { + self.u2f_counter = ::std::option::Option::None; + } + + pub fn has_u2f_counter(&self) -> bool { + self.u2f_counter.is_some() + } + + // Param is passed by value, moved + pub fn set_u2f_counter(&mut self, v: u32) { + self.u2f_counter = ::std::option::Option::Some(v); + } + + // optional bool skip_backup = 8; + + pub fn skip_backup(&self) -> bool { + self.skip_backup.unwrap_or(false) + } + + pub fn clear_skip_backup(&mut self) { + self.skip_backup = ::std::option::Option::None; + } + + pub fn has_skip_backup(&self) -> bool { + self.skip_backup.is_some() + } + + // Param is passed by value, moved + pub fn set_skip_backup(&mut self, v: bool) { + self.skip_backup = ::std::option::Option::Some(v); + } + + // optional bool no_backup = 9; + + pub fn no_backup(&self) -> bool { + self.no_backup.unwrap_or(false) + } + + pub fn clear_no_backup(&mut self) { + self.no_backup = ::std::option::Option::None; + } + + pub fn has_no_backup(&self) -> bool { + self.no_backup.is_some() + } + + // Param is passed by value, moved + pub fn set_no_backup(&mut self, v: bool) { + self.no_backup = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.management.BackupType backup_type = 10; + + pub fn backup_type(&self) -> BackupType { + match self.backup_type { + Some(e) => e.enum_value_or(BackupType::Bip39), + None => BackupType::Bip39, + } + } + + pub fn clear_backup_type(&mut self) { + self.backup_type = ::std::option::Option::None; + } + + pub fn has_backup_type(&self) -> bool { + self.backup_type.is_some() + } + + // Param is passed by value, moved + pub fn set_backup_type(&mut self, v: BackupType) { + self.backup_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(10); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "display_random", + |m: &ResetDevice| { &m.display_random }, + |m: &mut ResetDevice| { &mut m.display_random }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "strength", + |m: &ResetDevice| { &m.strength }, + |m: &mut ResetDevice| { &mut m.strength }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "passphrase_protection", + |m: &ResetDevice| { &m.passphrase_protection }, + |m: &mut ResetDevice| { &mut m.passphrase_protection }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pin_protection", + |m: &ResetDevice| { &m.pin_protection }, + |m: &mut ResetDevice| { &mut m.pin_protection }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "language", + |m: &ResetDevice| { &m.language }, + |m: &mut ResetDevice| { &mut m.language }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "label", + |m: &ResetDevice| { &m.label }, + |m: &mut ResetDevice| { &mut m.label }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "u2f_counter", + |m: &ResetDevice| { &m.u2f_counter }, + |m: &mut ResetDevice| { &mut m.u2f_counter }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "skip_backup", + |m: &ResetDevice| { &m.skip_backup }, + |m: &mut ResetDevice| { &mut m.skip_backup }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "no_backup", + |m: &ResetDevice| { &m.no_backup }, + |m: &mut ResetDevice| { &mut m.no_backup }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "backup_type", + |m: &ResetDevice| { &m.backup_type }, + |m: &mut ResetDevice| { &mut m.backup_type }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "ResetDevice", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for ResetDevice { + const NAME: &'static str = "ResetDevice"; + + 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 { + 8 => { + self.display_random = ::std::option::Option::Some(is.read_bool()?); + }, + 16 => { + self.strength = ::std::option::Option::Some(is.read_uint32()?); + }, + 24 => { + self.passphrase_protection = ::std::option::Option::Some(is.read_bool()?); + }, + 32 => { + self.pin_protection = ::std::option::Option::Some(is.read_bool()?); + }, + 42 => { + self.language = ::std::option::Option::Some(is.read_string()?); + }, + 50 => { + self.label = ::std::option::Option::Some(is.read_string()?); + }, + 56 => { + self.u2f_counter = ::std::option::Option::Some(is.read_uint32()?); + }, + 64 => { + self.skip_backup = ::std::option::Option::Some(is.read_bool()?); + }, + 72 => { + self.no_backup = ::std::option::Option::Some(is.read_bool()?); + }, + 80 => { + self.backup_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 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.display_random { + my_size += 1 + 1; + } + if let Some(v) = self.strength { + my_size += ::protobuf::rt::uint32_size(2, v); + } + if let Some(v) = self.passphrase_protection { + my_size += 1 + 1; + } + if let Some(v) = self.pin_protection { + my_size += 1 + 1; + } + if let Some(v) = self.language.as_ref() { + my_size += ::protobuf::rt::string_size(5, &v); + } + if let Some(v) = self.label.as_ref() { + my_size += ::protobuf::rt::string_size(6, &v); + } + if let Some(v) = self.u2f_counter { + my_size += ::protobuf::rt::uint32_size(7, v); + } + if let Some(v) = self.skip_backup { + my_size += 1 + 1; + } + if let Some(v) = self.no_backup { + my_size += 1 + 1; + } + if let Some(v) = self.backup_type { + my_size += ::protobuf::rt::int32_size(10, v.value()); + } + 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.display_random { + os.write_bool(1, v)?; + } + if let Some(v) = self.strength { + os.write_uint32(2, v)?; + } + if let Some(v) = self.passphrase_protection { + os.write_bool(3, v)?; + } + if let Some(v) = self.pin_protection { + os.write_bool(4, v)?; + } + if let Some(v) = self.language.as_ref() { + os.write_string(5, v)?; + } + if let Some(v) = self.label.as_ref() { + os.write_string(6, v)?; + } + if let Some(v) = self.u2f_counter { + os.write_uint32(7, v)?; + } + if let Some(v) = self.skip_backup { + os.write_bool(8, v)?; + } + if let Some(v) = self.no_backup { + os.write_bool(9, v)?; + } + if let Some(v) = self.backup_type { + os.write_enum(10, ::protobuf::EnumOrUnknown::value(&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() -> ResetDevice { + ResetDevice::new() + } + + fn clear(&mut self) { + self.display_random = ::std::option::Option::None; + self.strength = ::std::option::Option::None; + self.passphrase_protection = ::std::option::Option::None; + self.pin_protection = ::std::option::Option::None; + self.language = ::std::option::Option::None; + self.label = ::std::option::Option::None; + self.u2f_counter = ::std::option::Option::None; + self.skip_backup = ::std::option::Option::None; + self.no_backup = ::std::option::Option::None; + self.backup_type = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static ResetDevice { + static instance: ResetDevice = ResetDevice { + display_random: ::std::option::Option::None, + strength: ::std::option::Option::None, + passphrase_protection: ::std::option::Option::None, + pin_protection: ::std::option::Option::None, + language: ::std::option::Option::None, + label: ::std::option::Option::None, + u2f_counter: ::std::option::Option::None, + skip_backup: ::std::option::Option::None, + no_backup: ::std::option::Option::None, + backup_type: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for ResetDevice { + 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("ResetDevice").unwrap()).clone() + } +} + +impl ::std::fmt::Display for ResetDevice { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ResetDevice { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.BackupDevice) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct BackupDevice { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.BackupDevice.group_threshold) + pub group_threshold: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.BackupDevice.groups) + pub groups: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.BackupDevice.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a BackupDevice { + fn default() -> &'a BackupDevice { + ::default_instance() + } +} + +impl BackupDevice { + pub fn new() -> BackupDevice { + ::std::default::Default::default() + } + + // optional uint32 group_threshold = 1; + + pub fn group_threshold(&self) -> u32 { + self.group_threshold.unwrap_or(0) + } + + pub fn clear_group_threshold(&mut self) { + self.group_threshold = ::std::option::Option::None; + } + + pub fn has_group_threshold(&self) -> bool { + self.group_threshold.is_some() + } + + // Param is passed by value, moved + pub fn set_group_threshold(&mut self, v: u32) { + self.group_threshold = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "group_threshold", + |m: &BackupDevice| { &m.group_threshold }, + |m: &mut BackupDevice| { &mut m.group_threshold }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "groups", + |m: &BackupDevice| { &m.groups }, + |m: &mut BackupDevice| { &mut m.groups }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "BackupDevice", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for BackupDevice { + const NAME: &'static str = "BackupDevice"; + + fn is_initialized(&self) -> bool { + for v in &self.groups { + if !v.is_initialized() { + 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.group_threshold = ::std::option::Option::Some(is.read_uint32()?); + }, + 18 => { + self.groups.push(is.read_message()?); + }, + 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.group_threshold { + my_size += ::protobuf::rt::uint32_size(1, v); + } + for value in &self.groups { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + 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.group_threshold { + os.write_uint32(1, v)?; + } + for v in &self.groups { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + }; + 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() -> BackupDevice { + BackupDevice::new() + } + + fn clear(&mut self) { + self.group_threshold = ::std::option::Option::None; + self.groups.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static BackupDevice { + static instance: BackupDevice = BackupDevice { + group_threshold: ::std::option::Option::None, + groups: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for BackupDevice { + 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("BackupDevice").unwrap()).clone() + } +} + +impl ::std::fmt::Display for BackupDevice { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for BackupDevice { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `BackupDevice` +pub mod backup_device { + // @@protoc_insertion_point(message:hw.trezor.messages.management.BackupDevice.Slip39Group) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct Slip39Group { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.BackupDevice.Slip39Group.member_threshold) + pub member_threshold: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.BackupDevice.Slip39Group.member_count) + pub member_count: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.BackupDevice.Slip39Group.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a Slip39Group { + fn default() -> &'a Slip39Group { + ::default_instance() + } + } + + impl Slip39Group { + pub fn new() -> Slip39Group { + ::std::default::Default::default() + } + + // required uint32 member_threshold = 1; + + pub fn member_threshold(&self) -> u32 { + self.member_threshold.unwrap_or(0) + } + + pub fn clear_member_threshold(&mut self) { + self.member_threshold = ::std::option::Option::None; + } + + pub fn has_member_threshold(&self) -> bool { + self.member_threshold.is_some() + } + + // Param is passed by value, moved + pub fn set_member_threshold(&mut self, v: u32) { + self.member_threshold = ::std::option::Option::Some(v); + } + + // required uint32 member_count = 2; + + pub fn member_count(&self) -> u32 { + self.member_count.unwrap_or(0) + } + + pub fn clear_member_count(&mut self) { + self.member_count = ::std::option::Option::None; + } + + pub fn has_member_count(&self) -> bool { + self.member_count.is_some() + } + + // Param is passed by value, moved + pub fn set_member_count(&mut self, v: u32) { + self.member_count = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "member_threshold", + |m: &Slip39Group| { &m.member_threshold }, + |m: &mut Slip39Group| { &mut m.member_threshold }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "member_count", + |m: &Slip39Group| { &m.member_count }, + |m: &mut Slip39Group| { &mut m.member_count }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "BackupDevice.Slip39Group", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for Slip39Group { + const NAME: &'static str = "Slip39Group"; + + fn is_initialized(&self) -> bool { + if self.member_threshold.is_none() { + return false; + } + if self.member_count.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.member_threshold = ::std::option::Option::Some(is.read_uint32()?); + }, + 16 => { + self.member_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.member_threshold { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.member_count { + my_size += ::protobuf::rt::uint32_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.member_threshold { + os.write_uint32(1, v)?; + } + if let Some(v) = self.member_count { + os.write_uint32(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() -> Slip39Group { + Slip39Group::new() + } + + fn clear(&mut self) { + self.member_threshold = ::std::option::Option::None; + self.member_count = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static Slip39Group { + static instance: Slip39Group = Slip39Group { + member_threshold: ::std::option::Option::None, + member_count: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for Slip39Group { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("BackupDevice.Slip39Group").unwrap()).clone() + } + } + + impl ::std::fmt::Display for Slip39Group { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for Slip39Group { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.EntropyRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EntropyRequest { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.EntropyRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EntropyRequest { + fn default() -> &'a EntropyRequest { + ::default_instance() + } +} + +impl EntropyRequest { + pub fn new() -> EntropyRequest { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EntropyRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EntropyRequest { + const NAME: &'static str = "EntropyRequest"; + + 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 { + 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; + 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<()> { + 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() -> EntropyRequest { + EntropyRequest::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static EntropyRequest { + static instance: EntropyRequest = EntropyRequest { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EntropyRequest { + 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("EntropyRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EntropyRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EntropyRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.EntropyAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct EntropyAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.EntropyAck.entropy) + pub entropy: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.EntropyAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a EntropyAck { + fn default() -> &'a EntropyAck { + ::default_instance() + } +} + +impl EntropyAck { + pub fn new() -> EntropyAck { + ::std::default::Default::default() + } + + // required bytes entropy = 1; + + pub fn entropy(&self) -> &[u8] { + match self.entropy.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_entropy(&mut self) { + self.entropy = ::std::option::Option::None; + } + + pub fn has_entropy(&self) -> bool { + self.entropy.is_some() + } + + // Param is passed by value, moved + pub fn set_entropy(&mut self, v: ::std::vec::Vec) { + self.entropy = ::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_entropy(&mut self) -> &mut ::std::vec::Vec { + if self.entropy.is_none() { + self.entropy = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.entropy.as_mut().unwrap() + } + + // Take field + pub fn take_entropy(&mut self) -> ::std::vec::Vec { + self.entropy.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "entropy", + |m: &EntropyAck| { &m.entropy }, + |m: &mut EntropyAck| { &mut m.entropy }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "EntropyAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for EntropyAck { + const NAME: &'static str = "EntropyAck"; + + fn is_initialized(&self) -> bool { + if self.entropy.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.entropy = ::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.entropy.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.entropy.as_ref() { + os.write_bytes(1, 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() -> EntropyAck { + EntropyAck::new() + } + + fn clear(&mut self) { + self.entropy = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static EntropyAck { + static instance: EntropyAck = EntropyAck { + entropy: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for EntropyAck { + 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("EntropyAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for EntropyAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EntropyAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.RecoveryDevice) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct RecoveryDevice { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.RecoveryDevice.word_count) + pub word_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.RecoveryDevice.passphrase_protection) + pub passphrase_protection: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.RecoveryDevice.pin_protection) + pub pin_protection: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.RecoveryDevice.language) + pub language: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.RecoveryDevice.label) + pub label: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.RecoveryDevice.enforce_wordlist) + pub enforce_wordlist: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.RecoveryDevice.type) + pub type_: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.RecoveryDevice.u2f_counter) + pub u2f_counter: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.management.RecoveryDevice.dry_run) + pub dry_run: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.RecoveryDevice.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a RecoveryDevice { + fn default() -> &'a RecoveryDevice { + ::default_instance() + } +} + +impl RecoveryDevice { + pub fn new() -> RecoveryDevice { + ::std::default::Default::default() + } + + // optional uint32 word_count = 1; + + pub fn word_count(&self) -> u32 { + self.word_count.unwrap_or(0) + } + + pub fn clear_word_count(&mut self) { + self.word_count = ::std::option::Option::None; + } + + pub fn has_word_count(&self) -> bool { + self.word_count.is_some() + } + + // Param is passed by value, moved + pub fn set_word_count(&mut self, v: u32) { + self.word_count = ::std::option::Option::Some(v); + } + + // optional bool passphrase_protection = 2; + + pub fn passphrase_protection(&self) -> bool { + self.passphrase_protection.unwrap_or(false) + } + + pub fn clear_passphrase_protection(&mut self) { + self.passphrase_protection = ::std::option::Option::None; + } + + pub fn has_passphrase_protection(&self) -> bool { + self.passphrase_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase_protection(&mut self, v: bool) { + self.passphrase_protection = ::std::option::Option::Some(v); + } + + // optional bool pin_protection = 3; + + pub fn pin_protection(&self) -> bool { + self.pin_protection.unwrap_or(false) + } + + pub fn clear_pin_protection(&mut self) { + self.pin_protection = ::std::option::Option::None; + } + + pub fn has_pin_protection(&self) -> bool { + self.pin_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_pin_protection(&mut self, v: bool) { + self.pin_protection = ::std::option::Option::Some(v); + } + + // optional string language = 4; + + pub fn language(&self) -> &str { + match self.language.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_language(&mut self) { + self.language = ::std::option::Option::None; + } + + pub fn has_language(&self) -> bool { + self.language.is_some() + } + + // Param is passed by value, moved + pub fn set_language(&mut self, v: ::std::string::String) { + self.language = ::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_language(&mut self) -> &mut ::std::string::String { + if self.language.is_none() { + self.language = ::std::option::Option::Some(::std::string::String::new()); + } + self.language.as_mut().unwrap() + } + + // Take field + pub fn take_language(&mut self) -> ::std::string::String { + self.language.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string label = 5; + + pub fn label(&self) -> &str { + match self.label.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_label(&mut self) { + self.label = ::std::option::Option::None; + } + + pub fn has_label(&self) -> bool { + self.label.is_some() + } + + // Param is passed by value, moved + pub fn set_label(&mut self, v: ::std::string::String) { + self.label = ::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_label(&mut self) -> &mut ::std::string::String { + if self.label.is_none() { + self.label = ::std::option::Option::Some(::std::string::String::new()); + } + self.label.as_mut().unwrap() + } + + // Take field + pub fn take_label(&mut self) -> ::std::string::String { + self.label.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bool enforce_wordlist = 6; + + pub fn enforce_wordlist(&self) -> bool { + self.enforce_wordlist.unwrap_or(false) + } + + pub fn clear_enforce_wordlist(&mut self) { + self.enforce_wordlist = ::std::option::Option::None; + } + + pub fn has_enforce_wordlist(&self) -> bool { + self.enforce_wordlist.is_some() + } + + // Param is passed by value, moved + pub fn set_enforce_wordlist(&mut self, v: bool) { + self.enforce_wordlist = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.management.RecoveryDevice.RecoveryDeviceType type = 8; + + pub fn type_(&self) -> recovery_device::RecoveryDeviceType { + match self.type_ { + Some(e) => e.enum_value_or(recovery_device::RecoveryDeviceType::RecoveryDeviceType_ScrambledWords), + None => recovery_device::RecoveryDeviceType::RecoveryDeviceType_ScrambledWords, + } + } + + pub fn clear_type_(&mut self) { + self.type_ = ::std::option::Option::None; + } + + pub fn has_type(&self) -> bool { + self.type_.is_some() + } + + // Param is passed by value, moved + pub fn set_type(&mut self, v: recovery_device::RecoveryDeviceType) { + self.type_ = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional uint32 u2f_counter = 9; + + pub fn u2f_counter(&self) -> u32 { + self.u2f_counter.unwrap_or(0) + } + + pub fn clear_u2f_counter(&mut self) { + self.u2f_counter = ::std::option::Option::None; + } + + pub fn has_u2f_counter(&self) -> bool { + self.u2f_counter.is_some() + } + + // Param is passed by value, moved + pub fn set_u2f_counter(&mut self, v: u32) { + self.u2f_counter = ::std::option::Option::Some(v); + } + + // optional bool dry_run = 10; + + pub fn dry_run(&self) -> bool { + self.dry_run.unwrap_or(false) + } + + pub fn clear_dry_run(&mut self) { + self.dry_run = ::std::option::Option::None; + } + + pub fn has_dry_run(&self) -> bool { + self.dry_run.is_some() + } + + // Param is passed by value, moved + pub fn set_dry_run(&mut self, v: bool) { + self.dry_run = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(9); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "word_count", + |m: &RecoveryDevice| { &m.word_count }, + |m: &mut RecoveryDevice| { &mut m.word_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "passphrase_protection", + |m: &RecoveryDevice| { &m.passphrase_protection }, + |m: &mut RecoveryDevice| { &mut m.passphrase_protection }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pin_protection", + |m: &RecoveryDevice| { &m.pin_protection }, + |m: &mut RecoveryDevice| { &mut m.pin_protection }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "language", + |m: &RecoveryDevice| { &m.language }, + |m: &mut RecoveryDevice| { &mut m.language }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "label", + |m: &RecoveryDevice| { &m.label }, + |m: &mut RecoveryDevice| { &mut m.label }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "enforce_wordlist", + |m: &RecoveryDevice| { &m.enforce_wordlist }, + |m: &mut RecoveryDevice| { &mut m.enforce_wordlist }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "type", + |m: &RecoveryDevice| { &m.type_ }, + |m: &mut RecoveryDevice| { &mut m.type_ }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "u2f_counter", + |m: &RecoveryDevice| { &m.u2f_counter }, + |m: &mut RecoveryDevice| { &mut m.u2f_counter }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "dry_run", + |m: &RecoveryDevice| { &m.dry_run }, + |m: &mut RecoveryDevice| { &mut m.dry_run }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "RecoveryDevice", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for RecoveryDevice { + const NAME: &'static str = "RecoveryDevice"; + + 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 { + 8 => { + self.word_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 16 => { + self.passphrase_protection = ::std::option::Option::Some(is.read_bool()?); + }, + 24 => { + self.pin_protection = ::std::option::Option::Some(is.read_bool()?); + }, + 34 => { + self.language = ::std::option::Option::Some(is.read_string()?); + }, + 42 => { + self.label = ::std::option::Option::Some(is.read_string()?); + }, + 48 => { + self.enforce_wordlist = ::std::option::Option::Some(is.read_bool()?); + }, + 64 => { + self.type_ = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 72 => { + self.u2f_counter = ::std::option::Option::Some(is.read_uint32()?); + }, + 80 => { + self.dry_run = ::std::option::Option::Some(is.read_bool()?); + }, + 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.word_count { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.passphrase_protection { + my_size += 1 + 1; + } + if let Some(v) = self.pin_protection { + my_size += 1 + 1; + } + if let Some(v) = self.language.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(v) = self.label.as_ref() { + my_size += ::protobuf::rt::string_size(5, &v); + } + if let Some(v) = self.enforce_wordlist { + my_size += 1 + 1; + } + if let Some(v) = self.type_ { + my_size += ::protobuf::rt::int32_size(8, v.value()); + } + if let Some(v) = self.u2f_counter { + my_size += ::protobuf::rt::uint32_size(9, v); + } + if let Some(v) = self.dry_run { + my_size += 1 + 1; + } + 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.word_count { + os.write_uint32(1, v)?; + } + if let Some(v) = self.passphrase_protection { + os.write_bool(2, v)?; + } + if let Some(v) = self.pin_protection { + os.write_bool(3, v)?; + } + if let Some(v) = self.language.as_ref() { + os.write_string(4, v)?; + } + if let Some(v) = self.label.as_ref() { + os.write_string(5, v)?; + } + if let Some(v) = self.enforce_wordlist { + os.write_bool(6, v)?; + } + if let Some(v) = self.type_ { + os.write_enum(8, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.u2f_counter { + os.write_uint32(9, v)?; + } + if let Some(v) = self.dry_run { + os.write_bool(10, 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() -> RecoveryDevice { + RecoveryDevice::new() + } + + fn clear(&mut self) { + self.word_count = ::std::option::Option::None; + self.passphrase_protection = ::std::option::Option::None; + self.pin_protection = ::std::option::Option::None; + self.language = ::std::option::Option::None; + self.label = ::std::option::Option::None; + self.enforce_wordlist = ::std::option::Option::None; + self.type_ = ::std::option::Option::None; + self.u2f_counter = ::std::option::Option::None; + self.dry_run = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static RecoveryDevice { + static instance: RecoveryDevice = RecoveryDevice { + word_count: ::std::option::Option::None, + passphrase_protection: ::std::option::Option::None, + pin_protection: ::std::option::Option::None, + language: ::std::option::Option::None, + label: ::std::option::Option::None, + enforce_wordlist: ::std::option::Option::None, + type_: ::std::option::Option::None, + u2f_counter: ::std::option::Option::None, + dry_run: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for RecoveryDevice { + 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("RecoveryDevice").unwrap()).clone() + } +} + +impl ::std::fmt::Display for RecoveryDevice { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RecoveryDevice { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `RecoveryDevice` +pub mod recovery_device { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.management.RecoveryDevice.RecoveryDeviceType) + pub enum RecoveryDeviceType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.RecoveryDevice.RecoveryDeviceType.RecoveryDeviceType_ScrambledWords) + RecoveryDeviceType_ScrambledWords = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.RecoveryDevice.RecoveryDeviceType.RecoveryDeviceType_Matrix) + RecoveryDeviceType_Matrix = 1, + } + + impl ::protobuf::Enum for RecoveryDeviceType { + const NAME: &'static str = "RecoveryDeviceType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(RecoveryDeviceType::RecoveryDeviceType_ScrambledWords), + 1 => ::std::option::Option::Some(RecoveryDeviceType::RecoveryDeviceType_Matrix), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "RecoveryDeviceType_ScrambledWords" => ::std::option::Option::Some(RecoveryDeviceType::RecoveryDeviceType_ScrambledWords), + "RecoveryDeviceType_Matrix" => ::std::option::Option::Some(RecoveryDeviceType::RecoveryDeviceType_Matrix), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [RecoveryDeviceType] = &[ + RecoveryDeviceType::RecoveryDeviceType_ScrambledWords, + RecoveryDeviceType::RecoveryDeviceType_Matrix, + ]; + } + + impl ::protobuf::EnumFull for RecoveryDeviceType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("RecoveryDevice.RecoveryDeviceType").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 RecoveryDeviceType { + fn default() -> Self { + RecoveryDeviceType::RecoveryDeviceType_ScrambledWords + } + } + + impl RecoveryDeviceType { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("RecoveryDevice.RecoveryDeviceType") + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.WordRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct WordRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.WordRequest.type) + pub type_: ::std::option::Option<::protobuf::EnumOrUnknown>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.WordRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a WordRequest { + fn default() -> &'a WordRequest { + ::default_instance() + } +} + +impl WordRequest { + pub fn new() -> WordRequest { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.management.WordRequest.WordRequestType type = 1; + + pub fn type_(&self) -> word_request::WordRequestType { + match self.type_ { + Some(e) => e.enum_value_or(word_request::WordRequestType::WordRequestType_Plain), + None => word_request::WordRequestType::WordRequestType_Plain, + } + } + + pub fn clear_type_(&mut self) { + self.type_ = ::std::option::Option::None; + } + + pub fn has_type(&self) -> bool { + self.type_.is_some() + } + + // Param is passed by value, moved + pub fn set_type(&mut self, v: word_request::WordRequestType) { + self.type_ = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "type", + |m: &WordRequest| { &m.type_ }, + |m: &mut WordRequest| { &mut m.type_ }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "WordRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for WordRequest { + const NAME: &'static str = "WordRequest"; + + fn is_initialized(&self) -> bool { + if self.type_.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.type_ = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 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.type_ { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + 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.type_ { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&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() -> WordRequest { + WordRequest::new() + } + + fn clear(&mut self) { + self.type_ = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static WordRequest { + static instance: WordRequest = WordRequest { + type_: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for WordRequest { + 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("WordRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for WordRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for WordRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `WordRequest` +pub mod word_request { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.management.WordRequest.WordRequestType) + pub enum WordRequestType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.WordRequest.WordRequestType.WordRequestType_Plain) + WordRequestType_Plain = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.WordRequest.WordRequestType.WordRequestType_Matrix9) + WordRequestType_Matrix9 = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.WordRequest.WordRequestType.WordRequestType_Matrix6) + WordRequestType_Matrix6 = 2, + } + + impl ::protobuf::Enum for WordRequestType { + const NAME: &'static str = "WordRequestType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(WordRequestType::WordRequestType_Plain), + 1 => ::std::option::Option::Some(WordRequestType::WordRequestType_Matrix9), + 2 => ::std::option::Option::Some(WordRequestType::WordRequestType_Matrix6), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "WordRequestType_Plain" => ::std::option::Option::Some(WordRequestType::WordRequestType_Plain), + "WordRequestType_Matrix9" => ::std::option::Option::Some(WordRequestType::WordRequestType_Matrix9), + "WordRequestType_Matrix6" => ::std::option::Option::Some(WordRequestType::WordRequestType_Matrix6), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [WordRequestType] = &[ + WordRequestType::WordRequestType_Plain, + WordRequestType::WordRequestType_Matrix9, + WordRequestType::WordRequestType_Matrix6, + ]; + } + + impl ::protobuf::EnumFull for WordRequestType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("WordRequest.WordRequestType").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 WordRequestType { + fn default() -> Self { + WordRequestType::WordRequestType_Plain + } + } + + impl WordRequestType { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("WordRequest.WordRequestType") + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.WordAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct WordAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.WordAck.word) + pub word: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.WordAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a WordAck { + fn default() -> &'a WordAck { + ::default_instance() + } +} + +impl WordAck { + pub fn new() -> WordAck { + ::std::default::Default::default() + } + + // required string word = 1; + + pub fn word(&self) -> &str { + match self.word.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_word(&mut self) { + self.word = ::std::option::Option::None; + } + + pub fn has_word(&self) -> bool { + self.word.is_some() + } + + // Param is passed by value, moved + pub fn set_word(&mut self, v: ::std::string::String) { + self.word = ::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_word(&mut self) -> &mut ::std::string::String { + if self.word.is_none() { + self.word = ::std::option::Option::Some(::std::string::String::new()); + } + self.word.as_mut().unwrap() + } + + // Take field + pub fn take_word(&mut self) -> ::std::string::String { + self.word.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "word", + |m: &WordAck| { &m.word }, + |m: &mut WordAck| { &mut m.word }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "WordAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for WordAck { + const NAME: &'static str = "WordAck"; + + fn is_initialized(&self) -> bool { + if self.word.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.word = ::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.word.as_ref() { + my_size += ::protobuf::rt::string_size(1, &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.word.as_ref() { + os.write_string(1, 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() -> WordAck { + WordAck::new() + } + + fn clear(&mut self) { + self.word = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static WordAck { + static instance: WordAck = WordAck { + word: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for WordAck { + 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("WordAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for WordAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for WordAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.SetU2FCounter) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SetU2FCounter { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.SetU2FCounter.u2f_counter) + pub u2f_counter: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.SetU2FCounter.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SetU2FCounter { + fn default() -> &'a SetU2FCounter { + ::default_instance() + } +} + +impl SetU2FCounter { + pub fn new() -> SetU2FCounter { + ::std::default::Default::default() + } + + // required uint32 u2f_counter = 1; + + pub fn u2f_counter(&self) -> u32 { + self.u2f_counter.unwrap_or(0) + } + + pub fn clear_u2f_counter(&mut self) { + self.u2f_counter = ::std::option::Option::None; + } + + pub fn has_u2f_counter(&self) -> bool { + self.u2f_counter.is_some() + } + + // Param is passed by value, moved + pub fn set_u2f_counter(&mut self, v: u32) { + self.u2f_counter = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "u2f_counter", + |m: &SetU2FCounter| { &m.u2f_counter }, + |m: &mut SetU2FCounter| { &mut m.u2f_counter }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SetU2FCounter", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SetU2FCounter { + const NAME: &'static str = "SetU2FCounter"; + + fn is_initialized(&self) -> bool { + if self.u2f_counter.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.u2f_counter = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.u2f_counter { + my_size += ::protobuf::rt::uint32_size(1, 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.u2f_counter { + os.write_uint32(1, 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() -> SetU2FCounter { + SetU2FCounter::new() + } + + fn clear(&mut self) { + self.u2f_counter = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static SetU2FCounter { + static instance: SetU2FCounter = SetU2FCounter { + u2f_counter: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SetU2FCounter { + 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("SetU2FCounter").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SetU2FCounter { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SetU2FCounter { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.GetNextU2FCounter) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct GetNextU2FCounter { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.GetNextU2FCounter.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a GetNextU2FCounter { + fn default() -> &'a GetNextU2FCounter { + ::default_instance() + } +} + +impl GetNextU2FCounter { + pub fn new() -> GetNextU2FCounter { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "GetNextU2FCounter", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for GetNextU2FCounter { + const NAME: &'static str = "GetNextU2FCounter"; + + 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 { + 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; + 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<()> { + 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() -> GetNextU2FCounter { + GetNextU2FCounter::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static GetNextU2FCounter { + static instance: GetNextU2FCounter = GetNextU2FCounter { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for GetNextU2FCounter { + 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("GetNextU2FCounter").unwrap()).clone() + } +} + +impl ::std::fmt::Display for GetNextU2FCounter { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GetNextU2FCounter { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.NextU2FCounter) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct NextU2FCounter { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.NextU2FCounter.u2f_counter) + pub u2f_counter: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.NextU2FCounter.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a NextU2FCounter { + fn default() -> &'a NextU2FCounter { + ::default_instance() + } +} + +impl NextU2FCounter { + pub fn new() -> NextU2FCounter { + ::std::default::Default::default() + } + + // required uint32 u2f_counter = 1; + + pub fn u2f_counter(&self) -> u32 { + self.u2f_counter.unwrap_or(0) + } + + pub fn clear_u2f_counter(&mut self) { + self.u2f_counter = ::std::option::Option::None; + } + + pub fn has_u2f_counter(&self) -> bool { + self.u2f_counter.is_some() + } + + // Param is passed by value, moved + pub fn set_u2f_counter(&mut self, v: u32) { + self.u2f_counter = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "u2f_counter", + |m: &NextU2FCounter| { &m.u2f_counter }, + |m: &mut NextU2FCounter| { &mut m.u2f_counter }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NextU2FCounter", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for NextU2FCounter { + const NAME: &'static str = "NextU2FCounter"; + + fn is_initialized(&self) -> bool { + if self.u2f_counter.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.u2f_counter = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.u2f_counter { + my_size += ::protobuf::rt::uint32_size(1, 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.u2f_counter { + os.write_uint32(1, 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() -> NextU2FCounter { + NextU2FCounter::new() + } + + fn clear(&mut self) { + self.u2f_counter = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static NextU2FCounter { + static instance: NextU2FCounter = NextU2FCounter { + u2f_counter: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for NextU2FCounter { + 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("NextU2FCounter").unwrap()).clone() + } +} + +impl ::std::fmt::Display for NextU2FCounter { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for NextU2FCounter { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.DoPreauthorized) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DoPreauthorized { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.DoPreauthorized.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DoPreauthorized { + fn default() -> &'a DoPreauthorized { + ::default_instance() + } +} + +impl DoPreauthorized { + pub fn new() -> DoPreauthorized { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DoPreauthorized", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DoPreauthorized { + const NAME: &'static str = "DoPreauthorized"; + + 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 { + 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; + 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<()> { + 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() -> DoPreauthorized { + DoPreauthorized::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static DoPreauthorized { + static instance: DoPreauthorized = DoPreauthorized { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DoPreauthorized { + 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("DoPreauthorized").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DoPreauthorized { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DoPreauthorized { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.PreauthorizedRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct PreauthorizedRequest { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.PreauthorizedRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a PreauthorizedRequest { + fn default() -> &'a PreauthorizedRequest { + ::default_instance() + } +} + +impl PreauthorizedRequest { + pub fn new() -> PreauthorizedRequest { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "PreauthorizedRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for PreauthorizedRequest { + const NAME: &'static str = "PreauthorizedRequest"; + + 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 { + 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; + 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<()> { + 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() -> PreauthorizedRequest { + PreauthorizedRequest::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static PreauthorizedRequest { + static instance: PreauthorizedRequest = PreauthorizedRequest { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for PreauthorizedRequest { + 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("PreauthorizedRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for PreauthorizedRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PreauthorizedRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.CancelAuthorization) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct CancelAuthorization { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.CancelAuthorization.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a CancelAuthorization { + fn default() -> &'a CancelAuthorization { + ::default_instance() + } +} + +impl CancelAuthorization { + pub fn new() -> CancelAuthorization { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "CancelAuthorization", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for CancelAuthorization { + const NAME: &'static str = "CancelAuthorization"; + + 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 { + 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; + 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<()> { + 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() -> CancelAuthorization { + CancelAuthorization::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static CancelAuthorization { + static instance: CancelAuthorization = CancelAuthorization { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for CancelAuthorization { + 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("CancelAuthorization").unwrap()).clone() + } +} + +impl ::std::fmt::Display for CancelAuthorization { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CancelAuthorization { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.RebootToBootloader) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct RebootToBootloader { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.RebootToBootloader.boot_command) + pub boot_command: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.RebootToBootloader.firmware_header) + pub firmware_header: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.management.RebootToBootloader.language_data_length) + pub language_data_length: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.RebootToBootloader.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a RebootToBootloader { + fn default() -> &'a RebootToBootloader { + ::default_instance() + } +} + +impl RebootToBootloader { + pub fn new() -> RebootToBootloader { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.management.RebootToBootloader.BootCommand boot_command = 1; + + pub fn boot_command(&self) -> reboot_to_bootloader::BootCommand { + match self.boot_command { + Some(e) => e.enum_value_or(reboot_to_bootloader::BootCommand::STOP_AND_WAIT), + None => reboot_to_bootloader::BootCommand::STOP_AND_WAIT, + } + } + + pub fn clear_boot_command(&mut self) { + self.boot_command = ::std::option::Option::None; + } + + pub fn has_boot_command(&self) -> bool { + self.boot_command.is_some() + } + + // Param is passed by value, moved + pub fn set_boot_command(&mut self, v: reboot_to_bootloader::BootCommand) { + self.boot_command = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bytes firmware_header = 2; + + pub fn firmware_header(&self) -> &[u8] { + match self.firmware_header.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_firmware_header(&mut self) { + self.firmware_header = ::std::option::Option::None; + } + + pub fn has_firmware_header(&self) -> bool { + self.firmware_header.is_some() + } + + // Param is passed by value, moved + pub fn set_firmware_header(&mut self, v: ::std::vec::Vec) { + self.firmware_header = ::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_firmware_header(&mut self) -> &mut ::std::vec::Vec { + if self.firmware_header.is_none() { + self.firmware_header = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.firmware_header.as_mut().unwrap() + } + + // Take field + pub fn take_firmware_header(&mut self) -> ::std::vec::Vec { + self.firmware_header.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 language_data_length = 3; + + pub fn language_data_length(&self) -> u32 { + self.language_data_length.unwrap_or(0u32) + } + + pub fn clear_language_data_length(&mut self) { + self.language_data_length = ::std::option::Option::None; + } + + pub fn has_language_data_length(&self) -> bool { + self.language_data_length.is_some() + } + + // Param is passed by value, moved + pub fn set_language_data_length(&mut self, v: u32) { + self.language_data_length = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "boot_command", + |m: &RebootToBootloader| { &m.boot_command }, + |m: &mut RebootToBootloader| { &mut m.boot_command }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "firmware_header", + |m: &RebootToBootloader| { &m.firmware_header }, + |m: &mut RebootToBootloader| { &mut m.firmware_header }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "language_data_length", + |m: &RebootToBootloader| { &m.language_data_length }, + |m: &mut RebootToBootloader| { &mut m.language_data_length }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "RebootToBootloader", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for RebootToBootloader { + const NAME: &'static str = "RebootToBootloader"; + + 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 { + 8 => { + self.boot_command = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 18 => { + self.firmware_header = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.language_data_length = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.boot_command { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + if let Some(v) = self.firmware_header.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.language_data_length { + my_size += ::protobuf::rt::uint32_size(3, 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.boot_command { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.firmware_header.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.language_data_length { + os.write_uint32(3, 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() -> RebootToBootloader { + RebootToBootloader::new() + } + + fn clear(&mut self) { + self.boot_command = ::std::option::Option::None; + self.firmware_header = ::std::option::Option::None; + self.language_data_length = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static RebootToBootloader { + static instance: RebootToBootloader = RebootToBootloader { + boot_command: ::std::option::Option::None, + firmware_header: ::std::option::Option::None, + language_data_length: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for RebootToBootloader { + 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("RebootToBootloader").unwrap()).clone() + } +} + +impl ::std::fmt::Display for RebootToBootloader { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RebootToBootloader { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `RebootToBootloader` +pub mod reboot_to_bootloader { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.management.RebootToBootloader.BootCommand) + pub enum BootCommand { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.RebootToBootloader.BootCommand.STOP_AND_WAIT) + STOP_AND_WAIT = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.RebootToBootloader.BootCommand.INSTALL_UPGRADE) + INSTALL_UPGRADE = 1, + } + + impl ::protobuf::Enum for BootCommand { + const NAME: &'static str = "BootCommand"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(BootCommand::STOP_AND_WAIT), + 1 => ::std::option::Option::Some(BootCommand::INSTALL_UPGRADE), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "STOP_AND_WAIT" => ::std::option::Option::Some(BootCommand::STOP_AND_WAIT), + "INSTALL_UPGRADE" => ::std::option::Option::Some(BootCommand::INSTALL_UPGRADE), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [BootCommand] = &[ + BootCommand::STOP_AND_WAIT, + BootCommand::INSTALL_UPGRADE, + ]; + } + + impl ::protobuf::EnumFull for BootCommand { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("RebootToBootloader.BootCommand").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 BootCommand { + fn default() -> Self { + BootCommand::STOP_AND_WAIT + } + } + + impl BootCommand { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("RebootToBootloader.BootCommand") + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.GetNonce) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct GetNonce { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.GetNonce.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a GetNonce { + fn default() -> &'a GetNonce { + ::default_instance() + } +} + +impl GetNonce { + pub fn new() -> GetNonce { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "GetNonce", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for GetNonce { + const NAME: &'static str = "GetNonce"; + + 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 { + 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; + 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<()> { + 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() -> GetNonce { + GetNonce::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static GetNonce { + static instance: GetNonce = GetNonce { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for GetNonce { + 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("GetNonce").unwrap()).clone() + } +} + +impl ::std::fmt::Display for GetNonce { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GetNonce { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.Nonce) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct Nonce { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.Nonce.nonce) + pub nonce: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.Nonce.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Nonce { + fn default() -> &'a Nonce { + ::default_instance() + } +} + +impl Nonce { + pub fn new() -> Nonce { + ::std::default::Default::default() + } + + // required bytes nonce = 1; + + pub fn nonce(&self) -> &[u8] { + match self.nonce.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_nonce(&mut self) { + self.nonce = ::std::option::Option::None; + } + + pub fn has_nonce(&self) -> bool { + self.nonce.is_some() + } + + // Param is passed by value, moved + pub fn set_nonce(&mut self, v: ::std::vec::Vec) { + self.nonce = ::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_nonce(&mut self) -> &mut ::std::vec::Vec { + if self.nonce.is_none() { + self.nonce = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.nonce.as_mut().unwrap() + } + + // Take field + pub fn take_nonce(&mut self) -> ::std::vec::Vec { + self.nonce.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "nonce", + |m: &Nonce| { &m.nonce }, + |m: &mut Nonce| { &mut m.nonce }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Nonce", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Nonce { + const NAME: &'static str = "Nonce"; + + fn is_initialized(&self) -> bool { + if self.nonce.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.nonce = ::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.nonce.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.nonce.as_ref() { + os.write_bytes(1, 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() -> Nonce { + Nonce::new() + } + + fn clear(&mut self) { + self.nonce = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static Nonce { + static instance: Nonce = Nonce { + nonce: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Nonce { + 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("Nonce").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Nonce { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Nonce { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.UnlockPath) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct UnlockPath { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.UnlockPath.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.management.UnlockPath.mac) + pub mac: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.UnlockPath.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a UnlockPath { + fn default() -> &'a UnlockPath { + ::default_instance() + } +} + +impl UnlockPath { + pub fn new() -> UnlockPath { + ::std::default::Default::default() + } + + // optional bytes mac = 2; + + pub fn mac(&self) -> &[u8] { + match self.mac.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_mac(&mut self) { + self.mac = ::std::option::Option::None; + } + + pub fn has_mac(&self) -> bool { + self.mac.is_some() + } + + // Param is passed by value, moved + pub fn set_mac(&mut self, v: ::std::vec::Vec) { + self.mac = ::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_mac(&mut self) -> &mut ::std::vec::Vec { + if self.mac.is_none() { + self.mac = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.mac.as_mut().unwrap() + } + + // Take field + pub fn take_mac(&mut self) -> ::std::vec::Vec { + self.mac.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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &UnlockPath| { &m.address_n }, + |m: &mut UnlockPath| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "mac", + |m: &UnlockPath| { &m.mac }, + |m: &mut UnlockPath| { &mut m.mac }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "UnlockPath", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for UnlockPath { + const NAME: &'static str = "UnlockPath"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.mac = ::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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.mac.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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.mac.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() -> UnlockPath { + UnlockPath::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.mac = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static UnlockPath { + static instance: UnlockPath = UnlockPath { + address_n: ::std::vec::Vec::new(), + mac: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for UnlockPath { + 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("UnlockPath").unwrap()).clone() + } +} + +impl ::std::fmt::Display for UnlockPath { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for UnlockPath { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.UnlockedPathRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct UnlockedPathRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.management.UnlockedPathRequest.mac) + pub mac: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.UnlockedPathRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a UnlockedPathRequest { + fn default() -> &'a UnlockedPathRequest { + ::default_instance() + } +} + +impl UnlockedPathRequest { + pub fn new() -> UnlockedPathRequest { + ::std::default::Default::default() + } + + // optional bytes mac = 1; + + pub fn mac(&self) -> &[u8] { + match self.mac.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_mac(&mut self) { + self.mac = ::std::option::Option::None; + } + + pub fn has_mac(&self) -> bool { + self.mac.is_some() + } + + // Param is passed by value, moved + pub fn set_mac(&mut self, v: ::std::vec::Vec) { + self.mac = ::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_mac(&mut self) -> &mut ::std::vec::Vec { + if self.mac.is_none() { + self.mac = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.mac.as_mut().unwrap() + } + + // Take field + pub fn take_mac(&mut self) -> ::std::vec::Vec { + self.mac.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "mac", + |m: &UnlockedPathRequest| { &m.mac }, + |m: &mut UnlockedPathRequest| { &mut m.mac }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "UnlockedPathRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for UnlockedPathRequest { + const NAME: &'static str = "UnlockedPathRequest"; + + 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.mac = ::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.mac.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.mac.as_ref() { + os.write_bytes(1, 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() -> UnlockedPathRequest { + UnlockedPathRequest::new() + } + + fn clear(&mut self) { + self.mac = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static UnlockedPathRequest { + static instance: UnlockedPathRequest = UnlockedPathRequest { + mac: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for UnlockedPathRequest { + 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("UnlockedPathRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for UnlockedPathRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for UnlockedPathRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.ShowDeviceTutorial) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct ShowDeviceTutorial { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.ShowDeviceTutorial.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a ShowDeviceTutorial { + fn default() -> &'a ShowDeviceTutorial { + ::default_instance() + } +} + +impl ShowDeviceTutorial { + pub fn new() -> ShowDeviceTutorial { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "ShowDeviceTutorial", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for ShowDeviceTutorial { + const NAME: &'static str = "ShowDeviceTutorial"; + + 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 { + 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; + 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<()> { + 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() -> ShowDeviceTutorial { + ShowDeviceTutorial::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static ShowDeviceTutorial { + static instance: ShowDeviceTutorial = ShowDeviceTutorial { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for ShowDeviceTutorial { + 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("ShowDeviceTutorial").unwrap()).clone() + } +} + +impl ::std::fmt::Display for ShowDeviceTutorial { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ShowDeviceTutorial { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.management.UnlockBootloader) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct UnlockBootloader { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.management.UnlockBootloader.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a UnlockBootloader { + fn default() -> &'a UnlockBootloader { + ::default_instance() + } +} + +impl UnlockBootloader { + pub fn new() -> UnlockBootloader { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "UnlockBootloader", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for UnlockBootloader { + const NAME: &'static str = "UnlockBootloader"; + + 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 { + 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; + 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<()> { + 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() -> UnlockBootloader { + UnlockBootloader::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static UnlockBootloader { + static instance: UnlockBootloader = UnlockBootloader { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for UnlockBootloader { + 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("UnlockBootloader").unwrap()).clone() + } +} + +impl ::std::fmt::Display for UnlockBootloader { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for UnlockBootloader { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.management.BackupType) +pub enum BackupType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.BackupType.Bip39) + Bip39 = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.BackupType.Slip39_Basic) + Slip39_Basic = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.BackupType.Slip39_Advanced) + Slip39_Advanced = 2, +} + +impl ::protobuf::Enum for BackupType { + const NAME: &'static str = "BackupType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(BackupType::Bip39), + 1 => ::std::option::Option::Some(BackupType::Slip39_Basic), + 2 => ::std::option::Option::Some(BackupType::Slip39_Advanced), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "Bip39" => ::std::option::Option::Some(BackupType::Bip39), + "Slip39_Basic" => ::std::option::Option::Some(BackupType::Slip39_Basic), + "Slip39_Advanced" => ::std::option::Option::Some(BackupType::Slip39_Advanced), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [BackupType] = &[ + BackupType::Bip39, + BackupType::Slip39_Basic, + BackupType::Slip39_Advanced, + ]; +} + +impl ::protobuf::EnumFull for BackupType { + 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("BackupType").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 BackupType { + fn default() -> Self { + BackupType::Bip39 + } +} + +impl BackupType { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("BackupType") + } +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.management.SafetyCheckLevel) +pub enum SafetyCheckLevel { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.SafetyCheckLevel.Strict) + Strict = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.SafetyCheckLevel.PromptAlways) + PromptAlways = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.SafetyCheckLevel.PromptTemporarily) + PromptTemporarily = 2, +} + +impl ::protobuf::Enum for SafetyCheckLevel { + const NAME: &'static str = "SafetyCheckLevel"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(SafetyCheckLevel::Strict), + 1 => ::std::option::Option::Some(SafetyCheckLevel::PromptAlways), + 2 => ::std::option::Option::Some(SafetyCheckLevel::PromptTemporarily), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "Strict" => ::std::option::Option::Some(SafetyCheckLevel::Strict), + "PromptAlways" => ::std::option::Option::Some(SafetyCheckLevel::PromptAlways), + "PromptTemporarily" => ::std::option::Option::Some(SafetyCheckLevel::PromptTemporarily), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [SafetyCheckLevel] = &[ + SafetyCheckLevel::Strict, + SafetyCheckLevel::PromptAlways, + SafetyCheckLevel::PromptTemporarily, + ]; +} + +impl ::protobuf::EnumFull for SafetyCheckLevel { + 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("SafetyCheckLevel").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 SafetyCheckLevel { + fn default() -> Self { + SafetyCheckLevel::Strict + } +} + +impl SafetyCheckLevel { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("SafetyCheckLevel") + } +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.management.HomescreenFormat) +pub enum HomescreenFormat { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.HomescreenFormat.Toif) + Toif = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.HomescreenFormat.Jpeg) + Jpeg = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.management.HomescreenFormat.ToiG) + ToiG = 3, +} + +impl ::protobuf::Enum for HomescreenFormat { + const NAME: &'static str = "HomescreenFormat"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 1 => ::std::option::Option::Some(HomescreenFormat::Toif), + 2 => ::std::option::Option::Some(HomescreenFormat::Jpeg), + 3 => ::std::option::Option::Some(HomescreenFormat::ToiG), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "Toif" => ::std::option::Option::Some(HomescreenFormat::Toif), + "Jpeg" => ::std::option::Option::Some(HomescreenFormat::Jpeg), + "ToiG" => ::std::option::Option::Some(HomescreenFormat::ToiG), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [HomescreenFormat] = &[ + HomescreenFormat::Toif, + HomescreenFormat::Jpeg, + HomescreenFormat::ToiG, + ]; +} + +impl ::protobuf::EnumFull for HomescreenFormat { + 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("HomescreenFormat").unwrap()).clone() + } + + fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { + let index = match self { + HomescreenFormat::Toif => 0, + HomescreenFormat::Jpeg => 1, + HomescreenFormat::ToiG => 2, + }; + Self::enum_descriptor().value_by_index(index) + } +} + +// Note, `Default` is implemented although default value is not 0 +impl ::std::default::Default for HomescreenFormat { + fn default() -> Self { + HomescreenFormat::Toif + } +} + +impl HomescreenFormat { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("HomescreenFormat") + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x19messages-management.proto\x12\x1dhw.trezor.messages.management\x1a\ + \x0emessages.proto\"\x80\x01\n\nInitialize\x12\x1d\n\nsession_id\x18\x01\ + \x20\x01(\x0cR\tsessionId\x12,\n\x10_skip_passphrase\x18\x02\x20\x01(\ + \x08R\x0eSkipPassphraseB\x02\x18\x01\x12%\n\x0ederive_cardano\x18\x03\ + \x20\x01(\x08R\rderiveCardano\"\r\n\x0bGetFeatures\"\x94\x14\n\x08Featur\ + es\x12\x16\n\x06vendor\x18\x01\x20\x01(\tR\x06vendor\x12#\n\rmajor_versi\ + on\x18\x02\x20\x02(\rR\x0cmajorVersion\x12#\n\rminor_version\x18\x03\x20\ + \x02(\rR\x0cminorVersion\x12#\n\rpatch_version\x18\x04\x20\x02(\rR\x0cpa\ + tchVersion\x12'\n\x0fbootloader_mode\x18\x05\x20\x01(\x08R\x0ebootloader\ + Mode\x12\x1b\n\tdevice_id\x18\x06\x20\x01(\tR\x08deviceId\x12%\n\x0epin_\ + protection\x18\x07\x20\x01(\x08R\rpinProtection\x123\n\x15passphrase_pro\ + tection\x18\x08\x20\x01(\x08R\x14passphraseProtection\x12\x1a\n\x08langu\ + age\x18\t\x20\x01(\tR\x08language\x12\x14\n\x05label\x18\n\x20\x01(\tR\ + \x05label\x12\x20\n\x0binitialized\x18\x0c\x20\x01(\x08R\x0binitialized\ + \x12\x1a\n\x08revision\x18\r\x20\x01(\x0cR\x08revision\x12'\n\x0fbootloa\ + der_hash\x18\x0e\x20\x01(\x0cR\x0ebootloaderHash\x12\x1a\n\x08imported\ + \x18\x0f\x20\x01(\x08R\x08imported\x12\x1a\n\x08unlocked\x18\x10\x20\x01\ + (\x08R\x08unlocked\x120\n\x12_passphrase_cached\x18\x11\x20\x01(\x08R\ + \x10PassphraseCachedB\x02\x18\x01\x12)\n\x10firmware_present\x18\x12\x20\ + \x01(\x08R\x0ffirmwarePresent\x12!\n\x0cneeds_backup\x18\x13\x20\x01(\ + \x08R\x0bneedsBackup\x12\x14\n\x05flags\x18\x14\x20\x01(\rR\x05flags\x12\ + \x14\n\x05model\x18\x15\x20\x01(\tR\x05model\x12\x19\n\x08fw_major\x18\ + \x16\x20\x01(\rR\x07fwMajor\x12\x19\n\x08fw_minor\x18\x17\x20\x01(\rR\ + \x07fwMinor\x12\x19\n\x08fw_patch\x18\x18\x20\x01(\rR\x07fwPatch\x12\x1b\ + \n\tfw_vendor\x18\x19\x20\x01(\tR\x08fwVendor\x12+\n\x11unfinished_backu\ + p\x18\x1b\x20\x01(\x08R\x10unfinishedBackup\x12\x1b\n\tno_backup\x18\x1c\ + \x20\x01(\x08R\x08noBackup\x12#\n\rrecovery_mode\x18\x1d\x20\x01(\x08R\ + \x0crecoveryMode\x12V\n\x0ccapabilities\x18\x1e\x20\x03(\x0e22.hw.trezor\ + .messages.management.Features.CapabilityR\x0ccapabilities\x12J\n\x0bback\ + up_type\x18\x1f\x20\x01(\x0e2).hw.trezor.messages.management.BackupTypeR\ + \nbackupType\x12&\n\x0fsd_card_present\x18\x20\x20\x01(\x08R\rsdCardPres\ + ent\x12#\n\rsd_protection\x18!\x20\x01(\x08R\x0csdProtection\x120\n\x14w\ + ipe_code_protection\x18\"\x20\x01(\x08R\x12wipeCodeProtection\x12\x1d\n\ + \nsession_id\x18#\x20\x01(\x0cR\tsessionId\x12=\n\x1bpassphrase_always_o\ + n_device\x18$\x20\x01(\x08R\x18passphraseAlwaysOnDevice\x12T\n\rsafety_c\ + hecks\x18%\x20\x01(\x0e2/.hw.trezor.messages.management.SafetyCheckLevel\ + R\x0csafetyChecks\x12+\n\x12auto_lock_delay_ms\x18&\x20\x01(\rR\x0fautoL\ + ockDelayMs\x12)\n\x10display_rotation\x18'\x20\x01(\rR\x0fdisplayRotatio\ + n\x123\n\x15experimental_features\x18(\x20\x01(\x08R\x14experimentalFeat\ + ures\x12\x12\n\x04busy\x18)\x20\x01(\x08R\x04busy\x12\\\n\x11homescreen_\ + format\x18*\x20\x01(\x0e2/.hw.trezor.messages.management.HomescreenForma\ + tR\x10homescreenFormat\x129\n\x19hide_passphrase_from_host\x18+\x20\x01(\ + \x08R\x16hidePassphraseFromHost\x12%\n\x0einternal_model\x18,\x20\x01(\t\ + R\rinternalModel\x12\x1d\n\nunit_color\x18-\x20\x01(\rR\tunitColor\x12!\ + \n\x0cunit_btconly\x18.\x20\x01(\x08R\x0bunitBtconly\x12)\n\x10homescree\ + n_width\x18/\x20\x01(\rR\x0fhomescreenWidth\x12+\n\x11homescreen_height\ + \x180\x20\x01(\rR\x10homescreenHeight\x12+\n\x11bootloader_locked\x181\ + \x20\x01(\x08R\x10bootloaderLocked\x12>\n\x18language_version_matches\ + \x182\x20\x01(\x08:\x04trueR\x16languageVersionMatches\x12%\n\x0eunit_pa\ + ckaging\x183\x20\x01(\rR\runitPackaging\"\x9e\x04\n\nCapability\x12\x1c\ + \n\x12Capability_Bitcoin\x10\x01\x1a\x04\x80\xa6\x1d\x01\x12\x1b\n\x17Ca\ + pability_Bitcoin_like\x10\x02\x12\x16\n\x12Capability_Binance\x10\x03\ + \x12\x16\n\x12Capability_Cardano\x10\x04\x12\x1b\n\x11Capability_Crypto\ + \x10\x05\x1a\x04\x80\xa6\x1d\x01\x12\x12\n\x0eCapability_EOS\x10\x06\x12\ + \x17\n\x13Capability_Ethereum\x10\x07\x12\x17\n\x0fCapability_Lisk\x10\ + \x08\x1a\x02\x08\x01\x12\x15\n\x11Capability_Monero\x10\t\x12\x12\n\x0eC\ + apability_NEM\x10\n\x12\x15\n\x11Capability_Ripple\x10\x0b\x12\x16\n\x12\ + Capability_Stellar\x10\x0c\x12\x14\n\x10Capability_Tezos\x10\r\x12\x12\n\ + \x0eCapability_U2F\x10\x0e\x12\x1b\n\x11Capability_Shamir\x10\x0f\x1a\ + \x04\x80\xa6\x1d\x01\x12!\n\x17Capability_ShamirGroups\x10\x10\x1a\x04\ + \x80\xa6\x1d\x01\x12$\n\x1aCapability_PassphraseEntry\x10\x11\x1a\x04\ + \x80\xa6\x1d\x01\x12\x15\n\x11Capability_Solana\x10\x12\x12!\n\x17Capabi\ + lity_Translations\x10\x13\x1a\x04\x80\xa6\x1d\x01\x12\x18\n\x14Capabilit\ + y_Mintlayer\x10\x14\x1a\x04\xc8\xf3\x18\x01\"\x0c\n\nLockDevice\"&\n\x07\ + SetBusy\x12\x1b\n\texpiry_ms\x18\x01\x20\x01(\rR\x08expiryMs\"\x0c\n\nEn\ + dSession\"\x9b\x04\n\rApplySettings\x12\x1e\n\x08language\x18\x01\x20\ + \x01(\tR\x08languageB\x02\x18\x01\x12\x14\n\x05label\x18\x02\x20\x01(\tR\ + \x05label\x12%\n\x0euse_passphrase\x18\x03\x20\x01(\x08R\rusePassphrase\ + \x12\x1e\n\nhomescreen\x18\x04\x20\x01(\x0cR\nhomescreen\x120\n\x12_pass\ + phrase_source\x18\x05\x20\x01(\rR\x10PassphraseSourceB\x02\x18\x01\x12+\ + \n\x12auto_lock_delay_ms\x18\x06\x20\x01(\rR\x0fautoLockDelayMs\x12)\n\ + \x10display_rotation\x18\x07\x20\x01(\rR\x0fdisplayRotation\x12=\n\x1bpa\ + ssphrase_always_on_device\x18\x08\x20\x01(\x08R\x18passphraseAlwaysOnDev\ + ice\x12T\n\rsafety_checks\x18\t\x20\x01(\x0e2/.hw.trezor.messages.manage\ + ment.SafetyCheckLevelR\x0csafetyChecks\x123\n\x15experimental_features\ + \x18\n\x20\x01(\x08R\x14experimentalFeatures\x129\n\x19hide_passphrase_f\ + rom_host\x18\x0b\x20\x01(\x08R\x16hidePassphraseFromHost\"T\n\x0eChangeL\ + anguage\x12\x1f\n\x0bdata_length\x18\x01\x20\x02(\rR\ndataLength\x12!\n\ + \x0cshow_display\x18\x02\x20\x01(\x08R\x0bshowDisplay\"Z\n\x16Translatio\ + nDataRequest\x12\x1f\n\x0bdata_length\x18\x01\x20\x02(\rR\ndataLength\ + \x12\x1f\n\x0bdata_offset\x18\x02\x20\x02(\rR\ndataOffset\"3\n\x12Transl\ + ationDataAck\x12\x1d\n\ndata_chunk\x18\x01\x20\x02(\x0cR\tdataChunk\"\"\ + \n\nApplyFlags\x12\x14\n\x05flags\x18\x01\x20\x02(\rR\x05flags\"#\n\tCha\ + ngePin\x12\x16\n\x06remove\x18\x01\x20\x01(\x08R\x06remove\"(\n\x0eChang\ + eWipeCode\x12\x16\n\x06remove\x18\x01\x20\x01(\x08R\x06remove\"\xaa\x01\ + \n\tSdProtect\x12]\n\toperation\x18\x01\x20\x02(\x0e2?.hw.trezor.message\ + s.management.SdProtect.SdProtectOperationTypeR\toperation\">\n\x16SdProt\ + ectOperationType\x12\x0b\n\x07DISABLE\x10\0\x12\n\n\x06ENABLE\x10\x01\ + \x12\x0b\n\x07REFRESH\x10\x02\"O\n\x04Ping\x12\x1a\n\x07message\x18\x01\ + \x20\x01(\t:\0R\x07message\x12+\n\x11button_protection\x18\x02\x20\x01(\ + \x08R\x10buttonProtection\"\x08\n\x06Cancel\"\x20\n\nGetEntropy\x12\x12\ + \n\x04size\x18\x01\x20\x02(\rR\x04size\"#\n\x07Entropy\x12\x18\n\x07entr\ + opy\x18\x01\x20\x02(\x0cR\x07entropy\"/\n\x0fGetFirmwareHash\x12\x1c\n\t\ + challenge\x18\x01\x20\x01(\x0cR\tchallenge\"\"\n\x0cFirmwareHash\x12\x12\ + \n\x04hash\x18\x01\x20\x02(\x0cR\x04hash\"2\n\x12AuthenticateDevice\x12\ + \x1c\n\tchallenge\x18\x01\x20\x02(\x0cR\tchallenge\"U\n\x11AuthenticityP\ + roof\x12\"\n\x0ccertificates\x18\x01\x20\x03(\x0cR\x0ccertificates\x12\ + \x1c\n\tsignature\x18\x02\x20\x02(\x0cR\tsignature\"\x0c\n\nWipeDevice\"\ + \xad\x02\n\nLoadDevice\x12\x1c\n\tmnemonics\x18\x01\x20\x03(\tR\tmnemoni\ + cs\x12\x10\n\x03pin\x18\x03\x20\x01(\tR\x03pin\x123\n\x15passphrase_prot\ + ection\x18\x04\x20\x01(\x08R\x14passphraseProtection\x12\x1e\n\x08langua\ + ge\x18\x05\x20\x01(\tR\x08languageB\x02\x18\x01\x12\x14\n\x05label\x18\ + \x06\x20\x01(\tR\x05label\x12#\n\rskip_checksum\x18\x07\x20\x01(\x08R\ + \x0cskipChecksum\x12\x1f\n\x0bu2f_counter\x18\x08\x20\x01(\rR\nu2fCounte\ + r\x12!\n\x0cneeds_backup\x18\t\x20\x01(\x08R\x0bneedsBackup\x12\x1b\n\tn\ + o_backup\x18\n\x20\x01(\x08R\x08noBackup\"\x99\x03\n\x0bResetDevice\x12%\ + \n\x0edisplay_random\x18\x01\x20\x01(\x08R\rdisplayRandom\x12\x1f\n\x08s\ + trength\x18\x02\x20\x01(\r:\x03256R\x08strength\x123\n\x15passphrase_pro\ + tection\x18\x03\x20\x01(\x08R\x14passphraseProtection\x12%\n\x0epin_prot\ + ection\x18\x04\x20\x01(\x08R\rpinProtection\x12\x1e\n\x08language\x18\ + \x05\x20\x01(\tR\x08languageB\x02\x18\x01\x12\x14\n\x05label\x18\x06\x20\ + \x01(\tR\x05label\x12\x1f\n\x0bu2f_counter\x18\x07\x20\x01(\rR\nu2fCount\ + er\x12\x1f\n\x0bskip_backup\x18\x08\x20\x01(\x08R\nskipBackup\x12\x1b\n\ + \tno_backup\x18\t\x20\x01(\x08R\x08noBackup\x12Q\n\x0bbackup_type\x18\n\ + \x20\x01(\x0e2).hw.trezor.messages.management.BackupType:\x05Bip39R\nbac\ + kupType\"\xe5\x01\n\x0cBackupDevice\x12'\n\x0fgroup_threshold\x18\x01\ + \x20\x01(\rR\x0egroupThreshold\x12O\n\x06groups\x18\x02\x20\x03(\x0b27.h\ + w.trezor.messages.management.BackupDevice.Slip39GroupR\x06groups\x1a[\n\ + \x0bSlip39Group\x12)\n\x10member_threshold\x18\x01\x20\x02(\rR\x0fmember\ + Threshold\x12!\n\x0cmember_count\x18\x02\x20\x02(\rR\x0bmemberCount\"\ + \x10\n\x0eEntropyRequest\"&\n\nEntropyAck\x12\x18\n\x07entropy\x18\x01\ + \x20\x02(\x0cR\x07entropy\"\xd8\x03\n\x0eRecoveryDevice\x12\x1d\n\nword_\ + count\x18\x01\x20\x01(\rR\twordCount\x123\n\x15passphrase_protection\x18\ + \x02\x20\x01(\x08R\x14passphraseProtection\x12%\n\x0epin_protection\x18\ + \x03\x20\x01(\x08R\rpinProtection\x12\x1e\n\x08language\x18\x04\x20\x01(\ + \tR\x08languageB\x02\x18\x01\x12\x14\n\x05label\x18\x05\x20\x01(\tR\x05l\ + abel\x12)\n\x10enforce_wordlist\x18\x06\x20\x01(\x08R\x0fenforceWordlist\ + \x12T\n\x04type\x18\x08\x20\x01(\x0e2@.hw.trezor.messages.management.Rec\ + overyDevice.RecoveryDeviceTypeR\x04type\x12\x1f\n\x0bu2f_counter\x18\t\ + \x20\x01(\rR\nu2fCounter\x12\x17\n\x07dry_run\x18\n\x20\x01(\x08R\x06dry\ + Run\"Z\n\x12RecoveryDeviceType\x12%\n!RecoveryDeviceType_ScrambledWords\ + \x10\0\x12\x1d\n\x19RecoveryDeviceType_Matrix\x10\x01\"\xc5\x01\n\x0bWor\ + dRequest\x12N\n\x04type\x18\x01\x20\x02(\x0e2:.hw.trezor.messages.manage\ + ment.WordRequest.WordRequestTypeR\x04type\"f\n\x0fWordRequestType\x12\ + \x19\n\x15WordRequestType_Plain\x10\0\x12\x1b\n\x17WordRequestType_Matri\ + x9\x10\x01\x12\x1b\n\x17WordRequestType_Matrix6\x10\x02\"\x1d\n\x07WordA\ + ck\x12\x12\n\x04word\x18\x01\x20\x02(\tR\x04word\"0\n\rSetU2FCounter\x12\ + \x1f\n\x0bu2f_counter\x18\x01\x20\x02(\rR\nu2fCounter\"\x13\n\x11GetNext\ + U2FCounter\"1\n\x0eNextU2FCounter\x12\x1f\n\x0bu2f_counter\x18\x01\x20\ + \x02(\rR\nu2fCounter\"\x11\n\x0fDoPreauthorized\"\x16\n\x14Preauthorized\ + Request\"\x15\n\x13CancelAuthorization\"\x9a\x02\n\x12RebootToBootloader\ + \x12o\n\x0cboot_command\x18\x01\x20\x01(\x0e2=.hw.trezor.messages.manage\ + ment.RebootToBootloader.BootCommand:\rSTOP_AND_WAITR\x0bbootCommand\x12'\ + \n\x0ffirmware_header\x18\x02\x20\x01(\x0cR\x0efirmwareHeader\x123\n\x14\ + language_data_length\x18\x03\x20\x01(\r:\x010R\x12languageDataLength\"5\ + \n\x0bBootCommand\x12\x11\n\rSTOP_AND_WAIT\x10\0\x12\x13\n\x0fINSTALL_UP\ + GRADE\x10\x01\"\x10\n\x08GetNonce:\x04\x88\xb2\x19\x01\"#\n\x05Nonce\x12\ + \x14\n\x05nonce\x18\x01\x20\x02(\x0cR\x05nonce:\x04\x88\xb2\x19\x01\";\n\ + \nUnlockPath\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\ + \x10\n\x03mac\x18\x02\x20\x01(\x0cR\x03mac\"'\n\x13UnlockedPathRequest\ + \x12\x10\n\x03mac\x18\x01\x20\x01(\x0cR\x03mac\"\x14\n\x12ShowDeviceTuto\ + rial\"\x12\n\x10UnlockBootloader*>\n\nBackupType\x12\t\n\x05Bip39\x10\0\ + \x12\x10\n\x0cSlip39_Basic\x10\x01\x12\x13\n\x0fSlip39_Advanced\x10\x02*\ + G\n\x10SafetyCheckLevel\x12\n\n\x06Strict\x10\0\x12\x10\n\x0cPromptAlway\ + s\x10\x01\x12\x15\n\x11PromptTemporarily\x10\x02*0\n\x10HomescreenFormat\ + \x12\x08\n\x04Toif\x10\x01\x12\x08\n\x04Jpeg\x10\x02\x12\x08\n\x04ToiG\ + \x10\x03BB\n#com.satoshilabs.trezor.lib.protobufB\x17TrezorMessageManage\ + ment\x80\xa6\x1d\x01\ +"; + +/// `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(1); + deps.push(super::messages::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(45); + messages.push(Initialize::generated_message_descriptor_data()); + messages.push(GetFeatures::generated_message_descriptor_data()); + messages.push(Features::generated_message_descriptor_data()); + messages.push(LockDevice::generated_message_descriptor_data()); + messages.push(SetBusy::generated_message_descriptor_data()); + messages.push(EndSession::generated_message_descriptor_data()); + messages.push(ApplySettings::generated_message_descriptor_data()); + messages.push(ChangeLanguage::generated_message_descriptor_data()); + messages.push(TranslationDataRequest::generated_message_descriptor_data()); + messages.push(TranslationDataAck::generated_message_descriptor_data()); + messages.push(ApplyFlags::generated_message_descriptor_data()); + messages.push(ChangePin::generated_message_descriptor_data()); + messages.push(ChangeWipeCode::generated_message_descriptor_data()); + messages.push(SdProtect::generated_message_descriptor_data()); + messages.push(Ping::generated_message_descriptor_data()); + messages.push(Cancel::generated_message_descriptor_data()); + messages.push(GetEntropy::generated_message_descriptor_data()); + messages.push(Entropy::generated_message_descriptor_data()); + messages.push(GetFirmwareHash::generated_message_descriptor_data()); + messages.push(FirmwareHash::generated_message_descriptor_data()); + messages.push(AuthenticateDevice::generated_message_descriptor_data()); + messages.push(AuthenticityProof::generated_message_descriptor_data()); + messages.push(WipeDevice::generated_message_descriptor_data()); + messages.push(LoadDevice::generated_message_descriptor_data()); + messages.push(ResetDevice::generated_message_descriptor_data()); + messages.push(BackupDevice::generated_message_descriptor_data()); + messages.push(EntropyRequest::generated_message_descriptor_data()); + messages.push(EntropyAck::generated_message_descriptor_data()); + messages.push(RecoveryDevice::generated_message_descriptor_data()); + messages.push(WordRequest::generated_message_descriptor_data()); + messages.push(WordAck::generated_message_descriptor_data()); + messages.push(SetU2FCounter::generated_message_descriptor_data()); + messages.push(GetNextU2FCounter::generated_message_descriptor_data()); + messages.push(NextU2FCounter::generated_message_descriptor_data()); + messages.push(DoPreauthorized::generated_message_descriptor_data()); + messages.push(PreauthorizedRequest::generated_message_descriptor_data()); + messages.push(CancelAuthorization::generated_message_descriptor_data()); + messages.push(RebootToBootloader::generated_message_descriptor_data()); + messages.push(GetNonce::generated_message_descriptor_data()); + messages.push(Nonce::generated_message_descriptor_data()); + messages.push(UnlockPath::generated_message_descriptor_data()); + messages.push(UnlockedPathRequest::generated_message_descriptor_data()); + messages.push(ShowDeviceTutorial::generated_message_descriptor_data()); + messages.push(UnlockBootloader::generated_message_descriptor_data()); + messages.push(backup_device::Slip39Group::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(8); + enums.push(BackupType::generated_enum_descriptor_data()); + enums.push(SafetyCheckLevel::generated_enum_descriptor_data()); + enums.push(HomescreenFormat::generated_enum_descriptor_data()); + enums.push(features::Capability::generated_enum_descriptor_data()); + enums.push(sd_protect::SdProtectOperationType::generated_enum_descriptor_data()); + enums.push(recovery_device::RecoveryDeviceType::generated_enum_descriptor_data()); + enums.push(word_request::WordRequestType::generated_enum_descriptor_data()); + enums.push(reboot_to_bootloader::BootCommand::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_mintlayer.rs b/wallet/trezor-client/src/protos/generated/messages_mintlayer.rs new file mode 100644 index 0000000000..3ea293f348 --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_mintlayer.rs @@ -0,0 +1,3772 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-mintlayer.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerGetAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MintlayerGetAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerGetAddress.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerGetAddress.show_display) + pub show_display: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerGetAddress.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerGetAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MintlayerGetAddress { + fn default() -> &'a MintlayerGetAddress { + ::default_instance() + } +} + +impl MintlayerGetAddress { + pub fn new() -> MintlayerGetAddress { + ::std::default::Default::default() + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 3; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &MintlayerGetAddress| { &m.address_n }, + |m: &mut MintlayerGetAddress| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &MintlayerGetAddress| { &m.show_display }, + |m: &mut MintlayerGetAddress| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &MintlayerGetAddress| { &m.chunkify }, + |m: &mut MintlayerGetAddress| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerGetAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MintlayerGetAddress { + const NAME: &'static str = "MintlayerGetAddress"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 24 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.show_display { + os.write_bool(2, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(3, 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() -> MintlayerGetAddress { + MintlayerGetAddress::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.show_display = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerGetAddress { + static instance: MintlayerGetAddress = MintlayerGetAddress { + address_n: ::std::vec::Vec::new(), + show_display: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MintlayerGetAddress { + 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("MintlayerGetAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MintlayerGetAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MintlayerGetAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MintlayerAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerAddress.address) + pub address: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MintlayerAddress { + fn default() -> &'a MintlayerAddress { + ::default_instance() + } +} + +impl MintlayerAddress { + pub fn new() -> MintlayerAddress { + ::std::default::Default::default() + } + + // required string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &MintlayerAddress| { &m.address }, + |m: &mut MintlayerAddress| { &mut m.address }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MintlayerAddress { + const NAME: &'static str = "MintlayerAddress"; + + fn is_initialized(&self) -> bool { + if self.address.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_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::string_size(1, &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_string(1, 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() -> MintlayerAddress { + MintlayerAddress::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerAddress { + static instance: MintlayerAddress = MintlayerAddress { + address: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MintlayerAddress { + 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("MintlayerAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MintlayerAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MintlayerAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerGetPublicKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MintlayerGetPublicKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerGetPublicKey.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerGetPublicKey.show_display) + pub show_display: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerGetPublicKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MintlayerGetPublicKey { + fn default() -> &'a MintlayerGetPublicKey { + ::default_instance() + } +} + +impl MintlayerGetPublicKey { + pub fn new() -> MintlayerGetPublicKey { + ::std::default::Default::default() + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + 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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &MintlayerGetPublicKey| { &m.address_n }, + |m: &mut MintlayerGetPublicKey| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &MintlayerGetPublicKey| { &m.show_display }, + |m: &mut MintlayerGetPublicKey| { &mut m.show_display }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerGetPublicKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MintlayerGetPublicKey { + const NAME: &'static str = "MintlayerGetPublicKey"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.show_display { + os.write_bool(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() -> MintlayerGetPublicKey { + MintlayerGetPublicKey::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.show_display = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerGetPublicKey { + static instance: MintlayerGetPublicKey = MintlayerGetPublicKey { + address_n: ::std::vec::Vec::new(), + show_display: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MintlayerGetPublicKey { + 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("MintlayerGetPublicKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MintlayerGetPublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MintlayerGetPublicKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerPublicKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MintlayerPublicKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerPublicKey.public_key) + pub public_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerPublicKey.chain_code) + pub chain_code: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerPublicKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MintlayerPublicKey { + fn default() -> &'a MintlayerPublicKey { + ::default_instance() + } +} + +impl MintlayerPublicKey { + pub fn new() -> MintlayerPublicKey { + ::std::default::Default::default() + } + + // required bytes public_key = 1; + + pub fn public_key(&self) -> &[u8] { + match self.public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_public_key(&mut self) { + self.public_key = ::std::option::Option::None; + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: ::std::vec::Vec) { + self.public_key = ::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_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.public_key.is_none() { + self.public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> ::std::vec::Vec { + self.public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes chain_code = 2; + + pub fn chain_code(&self) -> &[u8] { + match self.chain_code.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_chain_code(&mut self) { + self.chain_code = ::std::option::Option::None; + } + + pub fn has_chain_code(&self) -> bool { + self.chain_code.is_some() + } + + // Param is passed by value, moved + pub fn set_chain_code(&mut self, v: ::std::vec::Vec) { + self.chain_code = ::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_chain_code(&mut self) -> &mut ::std::vec::Vec { + if self.chain_code.is_none() { + self.chain_code = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.chain_code.as_mut().unwrap() + } + + // Take field + pub fn take_chain_code(&mut self) -> ::std::vec::Vec { + self.chain_code.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::<_, _>( + "public_key", + |m: &MintlayerPublicKey| { &m.public_key }, + |m: &mut MintlayerPublicKey| { &mut m.public_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chain_code", + |m: &MintlayerPublicKey| { &m.chain_code }, + |m: &mut MintlayerPublicKey| { &mut m.chain_code }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerPublicKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MintlayerPublicKey { + const NAME: &'static str = "MintlayerPublicKey"; + + fn is_initialized(&self) -> bool { + if self.public_key.is_none() { + return false; + } + if self.chain_code.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.public_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.chain_code = ::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.public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.chain_code.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.public_key.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.chain_code.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() -> MintlayerPublicKey { + MintlayerPublicKey::new() + } + + fn clear(&mut self) { + self.public_key = ::std::option::Option::None; + self.chain_code = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerPublicKey { + static instance: MintlayerPublicKey = MintlayerPublicKey { + public_key: ::std::option::Option::None, + chain_code: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MintlayerPublicKey { + 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("MintlayerPublicKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MintlayerPublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MintlayerPublicKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerVerifySig) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MintlayerVerifySig { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerVerifySig.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerVerifySig.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerVerifySig.message) + pub message: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerVerifySig.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MintlayerVerifySig { + fn default() -> &'a MintlayerVerifySig { + ::default_instance() + } +} + +impl MintlayerVerifySig { + pub fn new() -> MintlayerVerifySig { + ::std::default::Default::default() + } + + // required bytes signature = 2; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes message = 3; + + pub fn message(&self) -> &[u8] { + match self.message.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_message(&mut self) { + self.message = ::std::option::Option::None; + } + + pub fn has_message(&self) -> bool { + self.message.is_some() + } + + // Param is passed by value, moved + pub fn set_message(&mut self, v: ::std::vec::Vec) { + self.message = ::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_message(&mut self) -> &mut ::std::vec::Vec { + if self.message.is_none() { + self.message = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.message.as_mut().unwrap() + } + + // Take field + pub fn take_message(&mut self) -> ::std::vec::Vec { + self.message.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &MintlayerVerifySig| { &m.address_n }, + |m: &mut MintlayerVerifySig| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &MintlayerVerifySig| { &m.signature }, + |m: &mut MintlayerVerifySig| { &mut m.signature }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "message", + |m: &MintlayerVerifySig| { &m.message }, + |m: &mut MintlayerVerifySig| { &mut m.message }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerVerifySig", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MintlayerVerifySig { + const NAME: &'static str = "MintlayerVerifySig"; + + fn is_initialized(&self) -> bool { + if self.signature.is_none() { + return false; + } + if self.message.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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.signature = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.message = ::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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.message.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.signature.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.message.as_ref() { + os.write_bytes(3, 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() -> MintlayerVerifySig { + MintlayerVerifySig::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.signature = ::std::option::Option::None; + self.message = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerVerifySig { + static instance: MintlayerVerifySig = MintlayerVerifySig { + address_n: ::std::vec::Vec::new(), + signature: ::std::option::Option::None, + message: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MintlayerVerifySig { + 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("MintlayerVerifySig").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MintlayerVerifySig { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MintlayerVerifySig { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerSignTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MintlayerSignTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerSignTx.outputs_count) + pub outputs_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerSignTx.inputs_count) + pub inputs_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerSignTx.version) + pub version: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerSignTx.serialize) + pub serialize: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerSignTx.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerSignTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MintlayerSignTx { + fn default() -> &'a MintlayerSignTx { + ::default_instance() + } +} + +impl MintlayerSignTx { + pub fn new() -> MintlayerSignTx { + ::std::default::Default::default() + } + + // required uint32 outputs_count = 1; + + pub fn outputs_count(&self) -> u32 { + self.outputs_count.unwrap_or(0) + } + + pub fn clear_outputs_count(&mut self) { + self.outputs_count = ::std::option::Option::None; + } + + pub fn has_outputs_count(&self) -> bool { + self.outputs_count.is_some() + } + + // Param is passed by value, moved + pub fn set_outputs_count(&mut self, v: u32) { + self.outputs_count = ::std::option::Option::Some(v); + } + + // required uint32 inputs_count = 2; + + pub fn inputs_count(&self) -> u32 { + self.inputs_count.unwrap_or(0) + } + + pub fn clear_inputs_count(&mut self) { + self.inputs_count = ::std::option::Option::None; + } + + pub fn has_inputs_count(&self) -> bool { + self.inputs_count.is_some() + } + + // Param is passed by value, moved + pub fn set_inputs_count(&mut self, v: u32) { + self.inputs_count = ::std::option::Option::Some(v); + } + + // optional uint32 version = 3; + + pub fn version(&self) -> u32 { + self.version.unwrap_or(1u32) + } + + pub fn clear_version(&mut self) { + self.version = ::std::option::Option::None; + } + + pub fn has_version(&self) -> bool { + self.version.is_some() + } + + // Param is passed by value, moved + pub fn set_version(&mut self, v: u32) { + self.version = ::std::option::Option::Some(v); + } + + // optional bool serialize = 4; + + pub fn serialize(&self) -> bool { + self.serialize.unwrap_or(true) + } + + pub fn clear_serialize(&mut self) { + self.serialize = ::std::option::Option::None; + } + + pub fn has_serialize(&self) -> bool { + self.serialize.is_some() + } + + // Param is passed by value, moved + pub fn set_serialize(&mut self, v: bool) { + self.serialize = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 5; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "outputs_count", + |m: &MintlayerSignTx| { &m.outputs_count }, + |m: &mut MintlayerSignTx| { &mut m.outputs_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "inputs_count", + |m: &MintlayerSignTx| { &m.inputs_count }, + |m: &mut MintlayerSignTx| { &mut m.inputs_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "version", + |m: &MintlayerSignTx| { &m.version }, + |m: &mut MintlayerSignTx| { &mut m.version }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "serialize", + |m: &MintlayerSignTx| { &m.serialize }, + |m: &mut MintlayerSignTx| { &mut m.serialize }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &MintlayerSignTx| { &m.chunkify }, + |m: &mut MintlayerSignTx| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerSignTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MintlayerSignTx { + const NAME: &'static str = "MintlayerSignTx"; + + fn is_initialized(&self) -> bool { + if self.outputs_count.is_none() { + return false; + } + if self.inputs_count.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.outputs_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 16 => { + self.inputs_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 24 => { + self.version = ::std::option::Option::Some(is.read_uint32()?); + }, + 32 => { + self.serialize = ::std::option::Option::Some(is.read_bool()?); + }, + 40 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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.outputs_count { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.inputs_count { + my_size += ::protobuf::rt::uint32_size(2, v); + } + if let Some(v) = self.version { + my_size += ::protobuf::rt::uint32_size(3, v); + } + if let Some(v) = self.serialize { + my_size += 1 + 1; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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.outputs_count { + os.write_uint32(1, v)?; + } + if let Some(v) = self.inputs_count { + os.write_uint32(2, v)?; + } + if let Some(v) = self.version { + os.write_uint32(3, v)?; + } + if let Some(v) = self.serialize { + os.write_bool(4, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(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() -> MintlayerSignTx { + MintlayerSignTx::new() + } + + fn clear(&mut self) { + self.outputs_count = ::std::option::Option::None; + self.inputs_count = ::std::option::Option::None; + self.version = ::std::option::Option::None; + self.serialize = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerSignTx { + static instance: MintlayerSignTx = MintlayerSignTx { + outputs_count: ::std::option::Option::None, + inputs_count: ::std::option::Option::None, + version: ::std::option::Option::None, + serialize: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MintlayerSignTx { + 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("MintlayerSignTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MintlayerSignTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MintlayerSignTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerTxRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MintlayerTxRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerTxRequest.request_type) + pub request_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerTxRequest.details) + pub details: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerTxRequest.serialized) + pub serialized: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerTxRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MintlayerTxRequest { + fn default() -> &'a MintlayerTxRequest { + ::default_instance() + } +} + +impl MintlayerTxRequest { + pub fn new() -> MintlayerTxRequest { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.mintlayer.MintlayerTxRequest.MintlayerRequestType request_type = 1; + + pub fn request_type(&self) -> mintlayer_tx_request::MintlayerRequestType { + match self.request_type { + Some(e) => e.enum_value_or(mintlayer_tx_request::MintlayerRequestType::TXINPUT), + None => mintlayer_tx_request::MintlayerRequestType::TXINPUT, + } + } + + pub fn clear_request_type(&mut self) { + self.request_type = ::std::option::Option::None; + } + + pub fn has_request_type(&self) -> bool { + self.request_type.is_some() + } + + // Param is passed by value, moved + pub fn set_request_type(&mut self, v: mintlayer_tx_request::MintlayerRequestType) { + self.request_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "request_type", + |m: &MintlayerTxRequest| { &m.request_type }, + |m: &mut MintlayerTxRequest| { &mut m.request_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, mintlayer_tx_request::MintlayerTxRequestDetailsType>( + "details", + |m: &MintlayerTxRequest| { &m.details }, + |m: &mut MintlayerTxRequest| { &mut m.details }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "serialized", + |m: &MintlayerTxRequest| { &m.serialized }, + |m: &mut MintlayerTxRequest| { &mut m.serialized }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerTxRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MintlayerTxRequest { + const NAME: &'static str = "MintlayerTxRequest"; + + 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 { + 8 => { + self.request_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.details)?; + }, + 26 => { + self.serialized.push(is.read_message()?); + }, + 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.request_type { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + if let Some(v) = self.details.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + for value in &self.serialized { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + 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.request_type { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.details.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + for v in &self.serialized { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + }; + 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() -> MintlayerTxRequest { + MintlayerTxRequest::new() + } + + fn clear(&mut self) { + self.request_type = ::std::option::Option::None; + self.details.clear(); + self.serialized.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerTxRequest { + static instance: MintlayerTxRequest = MintlayerTxRequest { + request_type: ::std::option::Option::None, + details: ::protobuf::MessageField::none(), + serialized: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MintlayerTxRequest { + 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("MintlayerTxRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MintlayerTxRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MintlayerTxRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `MintlayerTxRequest` +pub mod mintlayer_tx_request { + // @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerTxRequest.MintlayerTxRequestDetailsType) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct MintlayerTxRequestDetailsType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerTxRequest.MintlayerTxRequestDetailsType.request_index) + pub request_index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerTxRequest.MintlayerTxRequestDetailsType.tx_hash) + pub tx_hash: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerTxRequest.MintlayerTxRequestDetailsType.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a MintlayerTxRequestDetailsType { + fn default() -> &'a MintlayerTxRequestDetailsType { + ::default_instance() + } + } + + impl MintlayerTxRequestDetailsType { + pub fn new() -> MintlayerTxRequestDetailsType { + ::std::default::Default::default() + } + + // optional uint32 request_index = 1; + + pub fn request_index(&self) -> u32 { + self.request_index.unwrap_or(0) + } + + pub fn clear_request_index(&mut self) { + self.request_index = ::std::option::Option::None; + } + + pub fn has_request_index(&self) -> bool { + self.request_index.is_some() + } + + // Param is passed by value, moved + pub fn set_request_index(&mut self, v: u32) { + self.request_index = ::std::option::Option::Some(v); + } + + // optional bytes tx_hash = 2; + + pub fn tx_hash(&self) -> &[u8] { + match self.tx_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_tx_hash(&mut self) { + self.tx_hash = ::std::option::Option::None; + } + + pub fn has_tx_hash(&self) -> bool { + self.tx_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_tx_hash(&mut self, v: ::std::vec::Vec) { + self.tx_hash = ::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_tx_hash(&mut self) -> &mut ::std::vec::Vec { + if self.tx_hash.is_none() { + self.tx_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.tx_hash.as_mut().unwrap() + } + + // Take field + pub fn take_tx_hash(&mut self) -> ::std::vec::Vec { + self.tx_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) 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::<_, _>( + "request_index", + |m: &MintlayerTxRequestDetailsType| { &m.request_index }, + |m: &mut MintlayerTxRequestDetailsType| { &mut m.request_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "tx_hash", + |m: &MintlayerTxRequestDetailsType| { &m.tx_hash }, + |m: &mut MintlayerTxRequestDetailsType| { &mut m.tx_hash }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerTxRequest.MintlayerTxRequestDetailsType", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for MintlayerTxRequestDetailsType { + const NAME: &'static str = "MintlayerTxRequestDetailsType"; + + 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 { + 8 => { + self.request_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 18 => { + self.tx_hash = ::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.request_index { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.tx_hash.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.request_index { + os.write_uint32(1, v)?; + } + if let Some(v) = self.tx_hash.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() -> MintlayerTxRequestDetailsType { + MintlayerTxRequestDetailsType::new() + } + + fn clear(&mut self) { + self.request_index = ::std::option::Option::None; + self.tx_hash = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerTxRequestDetailsType { + static instance: MintlayerTxRequestDetailsType = MintlayerTxRequestDetailsType { + request_index: ::std::option::Option::None, + tx_hash: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for MintlayerTxRequestDetailsType { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("MintlayerTxRequest.MintlayerTxRequestDetailsType").unwrap()).clone() + } + } + + impl ::std::fmt::Display for MintlayerTxRequestDetailsType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for MintlayerTxRequestDetailsType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerTxRequest.MintlayerTxRequestSerializedType) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct MintlayerTxRequestSerializedType { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerTxRequest.MintlayerTxRequestSerializedType.signature_index) + pub signature_index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerTxRequest.MintlayerTxRequestSerializedType.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerTxRequest.MintlayerTxRequestSerializedType.serialized_tx) + pub serialized_tx: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerTxRequest.MintlayerTxRequestSerializedType.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a MintlayerTxRequestSerializedType { + fn default() -> &'a MintlayerTxRequestSerializedType { + ::default_instance() + } + } + + impl MintlayerTxRequestSerializedType { + pub fn new() -> MintlayerTxRequestSerializedType { + ::std::default::Default::default() + } + + // optional uint32 signature_index = 1; + + pub fn signature_index(&self) -> u32 { + self.signature_index.unwrap_or(0) + } + + pub fn clear_signature_index(&mut self) { + self.signature_index = ::std::option::Option::None; + } + + pub fn has_signature_index(&self) -> bool { + self.signature_index.is_some() + } + + // Param is passed by value, moved + pub fn set_signature_index(&mut self, v: u32) { + self.signature_index = ::std::option::Option::Some(v); + } + + // optional bytes signature = 2; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes serialized_tx = 3; + + pub fn serialized_tx(&self) -> &[u8] { + match self.serialized_tx.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_serialized_tx(&mut self) { + self.serialized_tx = ::std::option::Option::None; + } + + pub fn has_serialized_tx(&self) -> bool { + self.serialized_tx.is_some() + } + + // Param is passed by value, moved + pub fn set_serialized_tx(&mut self, v: ::std::vec::Vec) { + self.serialized_tx = ::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_serialized_tx(&mut self) -> &mut ::std::vec::Vec { + if self.serialized_tx.is_none() { + self.serialized_tx = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.serialized_tx.as_mut().unwrap() + } + + // Take field + pub fn take_serialized_tx(&mut self) -> ::std::vec::Vec { + self.serialized_tx.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature_index", + |m: &MintlayerTxRequestSerializedType| { &m.signature_index }, + |m: &mut MintlayerTxRequestSerializedType| { &mut m.signature_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &MintlayerTxRequestSerializedType| { &m.signature }, + |m: &mut MintlayerTxRequestSerializedType| { &mut m.signature }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "serialized_tx", + |m: &MintlayerTxRequestSerializedType| { &m.serialized_tx }, + |m: &mut MintlayerTxRequestSerializedType| { &mut m.serialized_tx }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerTxRequest.MintlayerTxRequestSerializedType", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for MintlayerTxRequestSerializedType { + const NAME: &'static str = "MintlayerTxRequestSerializedType"; + + 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 { + 8 => { + self.signature_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 18 => { + self.signature = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.serialized_tx = ::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.signature_index { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.serialized_tx.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &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.signature_index { + os.write_uint32(1, v)?; + } + if let Some(v) = self.signature.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.serialized_tx.as_ref() { + os.write_bytes(3, 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() -> MintlayerTxRequestSerializedType { + MintlayerTxRequestSerializedType::new() + } + + fn clear(&mut self) { + self.signature_index = ::std::option::Option::None; + self.signature = ::std::option::Option::None; + self.serialized_tx = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerTxRequestSerializedType { + static instance: MintlayerTxRequestSerializedType = MintlayerTxRequestSerializedType { + signature_index: ::std::option::Option::None, + signature: ::std::option::Option::None, + serialized_tx: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for MintlayerTxRequestSerializedType { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("MintlayerTxRequest.MintlayerTxRequestSerializedType").unwrap()).clone() + } + } + + impl ::std::fmt::Display for MintlayerTxRequestSerializedType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for MintlayerTxRequestSerializedType { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.mintlayer.MintlayerTxRequest.MintlayerRequestType) + pub enum MintlayerRequestType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.mintlayer.MintlayerTxRequest.MintlayerRequestType.TXINPUT) + TXINPUT = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.mintlayer.MintlayerTxRequest.MintlayerRequestType.TXOUTPUT) + TXOUTPUT = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.mintlayer.MintlayerTxRequest.MintlayerRequestType.TXMETA) + TXMETA = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.mintlayer.MintlayerTxRequest.MintlayerRequestType.TXFINISHED) + TXFINISHED = 3, + } + + impl ::protobuf::Enum for MintlayerRequestType { + const NAME: &'static str = "MintlayerRequestType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(MintlayerRequestType::TXINPUT), + 1 => ::std::option::Option::Some(MintlayerRequestType::TXOUTPUT), + 2 => ::std::option::Option::Some(MintlayerRequestType::TXMETA), + 3 => ::std::option::Option::Some(MintlayerRequestType::TXFINISHED), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "TXINPUT" => ::std::option::Option::Some(MintlayerRequestType::TXINPUT), + "TXOUTPUT" => ::std::option::Option::Some(MintlayerRequestType::TXOUTPUT), + "TXMETA" => ::std::option::Option::Some(MintlayerRequestType::TXMETA), + "TXFINISHED" => ::std::option::Option::Some(MintlayerRequestType::TXFINISHED), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [MintlayerRequestType] = &[ + MintlayerRequestType::TXINPUT, + MintlayerRequestType::TXOUTPUT, + MintlayerRequestType::TXMETA, + MintlayerRequestType::TXFINISHED, + ]; + } + + impl ::protobuf::EnumFull for MintlayerRequestType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("MintlayerTxRequest.MintlayerRequestType").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 MintlayerRequestType { + fn default() -> Self { + MintlayerRequestType::TXINPUT + } + } + + impl MintlayerRequestType { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("MintlayerTxRequest.MintlayerRequestType") + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerUtxoTxInput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MintlayerUtxoTxInput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerUtxoTxInput.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerUtxoTxInput.prev_hash) + pub prev_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerUtxoTxInput.prev_index) + pub prev_index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerUtxoTxInput.sequence) + pub sequence: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerUtxoTxInput.amount) + pub amount: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerUtxoTxInput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MintlayerUtxoTxInput { + fn default() -> &'a MintlayerUtxoTxInput { + ::default_instance() + } +} + +impl MintlayerUtxoTxInput { + pub fn new() -> MintlayerUtxoTxInput { + ::std::default::Default::default() + } + + // required bytes prev_hash = 2; + + pub fn prev_hash(&self) -> &[u8] { + match self.prev_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_prev_hash(&mut self) { + self.prev_hash = ::std::option::Option::None; + } + + pub fn has_prev_hash(&self) -> bool { + self.prev_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_hash(&mut self, v: ::std::vec::Vec) { + self.prev_hash = ::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_prev_hash(&mut self) -> &mut ::std::vec::Vec { + if self.prev_hash.is_none() { + self.prev_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.prev_hash.as_mut().unwrap() + } + + // Take field + pub fn take_prev_hash(&mut self) -> ::std::vec::Vec { + self.prev_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint32 prev_index = 3; + + pub fn prev_index(&self) -> u32 { + self.prev_index.unwrap_or(0) + } + + pub fn clear_prev_index(&mut self) { + self.prev_index = ::std::option::Option::None; + } + + pub fn has_prev_index(&self) -> bool { + self.prev_index.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_index(&mut self, v: u32) { + self.prev_index = ::std::option::Option::Some(v); + } + + // optional uint32 sequence = 4; + + pub fn sequence(&self) -> u32 { + self.sequence.unwrap_or(4294967295u32) + } + + pub fn clear_sequence(&mut self) { + self.sequence = ::std::option::Option::None; + } + + pub fn has_sequence(&self) -> bool { + self.sequence.is_some() + } + + // Param is passed by value, moved + pub fn set_sequence(&mut self, v: u32) { + self.sequence = ::std::option::Option::Some(v); + } + + // required bytes amount = 5; + + pub fn amount(&self) -> &[u8] { + match self.amount.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: ::std::vec::Vec) { + self.amount = ::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_amount(&mut self) -> &mut ::std::vec::Vec { + if self.amount.is_none() { + self.amount = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.amount.as_mut().unwrap() + } + + // Take field + pub fn take_amount(&mut self) -> ::std::vec::Vec { + self.amount.take().unwrap_or_else(|| ::std::vec::Vec::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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &MintlayerUtxoTxInput| { &m.address_n }, + |m: &mut MintlayerUtxoTxInput| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "prev_hash", + |m: &MintlayerUtxoTxInput| { &m.prev_hash }, + |m: &mut MintlayerUtxoTxInput| { &mut m.prev_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "prev_index", + |m: &MintlayerUtxoTxInput| { &m.prev_index }, + |m: &mut MintlayerUtxoTxInput| { &mut m.prev_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sequence", + |m: &MintlayerUtxoTxInput| { &m.sequence }, + |m: &mut MintlayerUtxoTxInput| { &mut m.sequence }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &MintlayerUtxoTxInput| { &m.amount }, + |m: &mut MintlayerUtxoTxInput| { &mut m.amount }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerUtxoTxInput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MintlayerUtxoTxInput { + const NAME: &'static str = "MintlayerUtxoTxInput"; + + fn is_initialized(&self) -> bool { + if self.prev_hash.is_none() { + return false; + } + if self.prev_index.is_none() { + return false; + } + if self.amount.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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.prev_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.prev_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 32 => { + self.sequence = ::std::option::Option::Some(is.read_uint32()?); + }, + 42 => { + self.amount = ::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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.prev_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.prev_index { + my_size += ::protobuf::rt::uint32_size(3, v); + } + if let Some(v) = self.sequence { + my_size += ::protobuf::rt::uint32_size(4, v); + } + if let Some(v) = self.amount.as_ref() { + my_size += ::protobuf::rt::bytes_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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.prev_hash.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.prev_index { + os.write_uint32(3, v)?; + } + if let Some(v) = self.sequence { + os.write_uint32(4, v)?; + } + if let Some(v) = self.amount.as_ref() { + os.write_bytes(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() -> MintlayerUtxoTxInput { + MintlayerUtxoTxInput::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.prev_hash = ::std::option::Option::None; + self.prev_index = ::std::option::Option::None; + self.sequence = ::std::option::Option::None; + self.amount = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerUtxoTxInput { + static instance: MintlayerUtxoTxInput = MintlayerUtxoTxInput { + address_n: ::std::vec::Vec::new(), + prev_hash: ::std::option::Option::None, + prev_index: ::std::option::Option::None, + sequence: ::std::option::Option::None, + amount: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MintlayerUtxoTxInput { + 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("MintlayerUtxoTxInput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MintlayerUtxoTxInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MintlayerUtxoTxInput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerTransferTxOutput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MintlayerTransferTxOutput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerTransferTxOutput.address) + pub address: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerTransferTxOutput.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerTransferTxOutput.amount) + pub amount: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerTransferTxOutput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MintlayerTransferTxOutput { + fn default() -> &'a MintlayerTransferTxOutput { + ::default_instance() + } +} + +impl MintlayerTransferTxOutput { + pub fn new() -> MintlayerTransferTxOutput { + ::std::default::Default::default() + } + + // optional string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required bytes amount = 3; + + pub fn amount(&self) -> &[u8] { + match self.amount.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: ::std::vec::Vec) { + self.amount = ::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_amount(&mut self) -> &mut ::std::vec::Vec { + if self.amount.is_none() { + self.amount = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.amount.as_mut().unwrap() + } + + // Take field + pub fn take_amount(&mut self) -> ::std::vec::Vec { + self.amount.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &MintlayerTransferTxOutput| { &m.address }, + |m: &mut MintlayerTransferTxOutput| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &MintlayerTransferTxOutput| { &m.address_n }, + |m: &mut MintlayerTransferTxOutput| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &MintlayerTransferTxOutput| { &m.amount }, + |m: &mut MintlayerTransferTxOutput| { &mut m.amount }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerTransferTxOutput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MintlayerTransferTxOutput { + const NAME: &'static str = "MintlayerTransferTxOutput"; + + fn is_initialized(&self) -> bool { + if self.amount.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_string()?); + }, + 18 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 16 => { + self.address_n.push(is.read_uint32()?); + }, + 26 => { + self.amount = ::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.address.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(2, *value); + }; + if let Some(v) = self.amount.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &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_string(1, v)?; + } + for v in &self.address_n { + os.write_uint32(2, *v)?; + }; + if let Some(v) = self.amount.as_ref() { + os.write_bytes(3, 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() -> MintlayerTransferTxOutput { + MintlayerTransferTxOutput::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.address_n.clear(); + self.amount = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerTransferTxOutput { + static instance: MintlayerTransferTxOutput = MintlayerTransferTxOutput { + address: ::std::option::Option::None, + address_n: ::std::vec::Vec::new(), + amount: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MintlayerTransferTxOutput { + 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("MintlayerTransferTxOutput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MintlayerTransferTxOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MintlayerTransferTxOutput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerPrevTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MintlayerPrevTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerPrevTx.version) + pub version: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerPrevTx.inputs_count) + pub inputs_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerPrevTx.outputs_count) + pub outputs_count: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerPrevTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MintlayerPrevTx { + fn default() -> &'a MintlayerPrevTx { + ::default_instance() + } +} + +impl MintlayerPrevTx { + pub fn new() -> MintlayerPrevTx { + ::std::default::Default::default() + } + + // required uint32 version = 1; + + pub fn version(&self) -> u32 { + self.version.unwrap_or(0) + } + + pub fn clear_version(&mut self) { + self.version = ::std::option::Option::None; + } + + pub fn has_version(&self) -> bool { + self.version.is_some() + } + + // Param is passed by value, moved + pub fn set_version(&mut self, v: u32) { + self.version = ::std::option::Option::Some(v); + } + + // required uint32 inputs_count = 6; + + pub fn inputs_count(&self) -> u32 { + self.inputs_count.unwrap_or(0) + } + + pub fn clear_inputs_count(&mut self) { + self.inputs_count = ::std::option::Option::None; + } + + pub fn has_inputs_count(&self) -> bool { + self.inputs_count.is_some() + } + + // Param is passed by value, moved + pub fn set_inputs_count(&mut self, v: u32) { + self.inputs_count = ::std::option::Option::Some(v); + } + + // required uint32 outputs_count = 7; + + pub fn outputs_count(&self) -> u32 { + self.outputs_count.unwrap_or(0) + } + + pub fn clear_outputs_count(&mut self) { + self.outputs_count = ::std::option::Option::None; + } + + pub fn has_outputs_count(&self) -> bool { + self.outputs_count.is_some() + } + + // Param is passed by value, moved + pub fn set_outputs_count(&mut self, v: u32) { + self.outputs_count = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "version", + |m: &MintlayerPrevTx| { &m.version }, + |m: &mut MintlayerPrevTx| { &mut m.version }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "inputs_count", + |m: &MintlayerPrevTx| { &m.inputs_count }, + |m: &mut MintlayerPrevTx| { &mut m.inputs_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "outputs_count", + |m: &MintlayerPrevTx| { &m.outputs_count }, + |m: &mut MintlayerPrevTx| { &mut m.outputs_count }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerPrevTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MintlayerPrevTx { + const NAME: &'static str = "MintlayerPrevTx"; + + fn is_initialized(&self) -> bool { + if self.version.is_none() { + return false; + } + if self.inputs_count.is_none() { + return false; + } + if self.outputs_count.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.version = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.inputs_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 56 => { + self.outputs_count = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.version { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.inputs_count { + my_size += ::protobuf::rt::uint32_size(6, v); + } + if let Some(v) = self.outputs_count { + my_size += ::protobuf::rt::uint32_size(7, 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.version { + os.write_uint32(1, v)?; + } + if let Some(v) = self.inputs_count { + os.write_uint32(6, v)?; + } + if let Some(v) = self.outputs_count { + os.write_uint32(7, 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() -> MintlayerPrevTx { + MintlayerPrevTx::new() + } + + fn clear(&mut self) { + self.version = ::std::option::Option::None; + self.inputs_count = ::std::option::Option::None; + self.outputs_count = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerPrevTx { + static instance: MintlayerPrevTx = MintlayerPrevTx { + version: ::std::option::Option::None, + inputs_count: ::std::option::Option::None, + outputs_count: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MintlayerPrevTx { + 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("MintlayerPrevTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MintlayerPrevTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MintlayerPrevTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerPrevInput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MintlayerPrevInput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerPrevInput.prev_hash) + pub prev_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerPrevInput.prev_index) + pub prev_index: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerPrevInput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MintlayerPrevInput { + fn default() -> &'a MintlayerPrevInput { + ::default_instance() + } +} + +impl MintlayerPrevInput { + pub fn new() -> MintlayerPrevInput { + ::std::default::Default::default() + } + + // required bytes prev_hash = 2; + + pub fn prev_hash(&self) -> &[u8] { + match self.prev_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_prev_hash(&mut self) { + self.prev_hash = ::std::option::Option::None; + } + + pub fn has_prev_hash(&self) -> bool { + self.prev_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_hash(&mut self, v: ::std::vec::Vec) { + self.prev_hash = ::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_prev_hash(&mut self) -> &mut ::std::vec::Vec { + if self.prev_hash.is_none() { + self.prev_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.prev_hash.as_mut().unwrap() + } + + // Take field + pub fn take_prev_hash(&mut self) -> ::std::vec::Vec { + self.prev_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint32 prev_index = 3; + + pub fn prev_index(&self) -> u32 { + self.prev_index.unwrap_or(0) + } + + pub fn clear_prev_index(&mut self) { + self.prev_index = ::std::option::Option::None; + } + + pub fn has_prev_index(&self) -> bool { + self.prev_index.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_index(&mut self, v: u32) { + self.prev_index = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "prev_hash", + |m: &MintlayerPrevInput| { &m.prev_hash }, + |m: &mut MintlayerPrevInput| { &mut m.prev_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "prev_index", + |m: &MintlayerPrevInput| { &m.prev_index }, + |m: &mut MintlayerPrevInput| { &mut m.prev_index }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerPrevInput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MintlayerPrevInput { + const NAME: &'static str = "MintlayerPrevInput"; + + fn is_initialized(&self) -> bool { + if self.prev_hash.is_none() { + return false; + } + if self.prev_index.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 { + 18 => { + self.prev_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.prev_index = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.prev_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.prev_index { + my_size += ::protobuf::rt::uint32_size(3, 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.prev_hash.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.prev_index { + os.write_uint32(3, 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() -> MintlayerPrevInput { + MintlayerPrevInput::new() + } + + fn clear(&mut self) { + self.prev_hash = ::std::option::Option::None; + self.prev_index = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerPrevInput { + static instance: MintlayerPrevInput = MintlayerPrevInput { + prev_hash: ::std::option::Option::None, + prev_index: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MintlayerPrevInput { + 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("MintlayerPrevInput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MintlayerPrevInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MintlayerPrevInput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerPrevTransferOutput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MintlayerPrevTransferOutput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerPrevTransferOutput.amount) + pub amount: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerPrevTransferOutput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MintlayerPrevTransferOutput { + fn default() -> &'a MintlayerPrevTransferOutput { + ::default_instance() + } +} + +impl MintlayerPrevTransferOutput { + pub fn new() -> MintlayerPrevTransferOutput { + ::std::default::Default::default() + } + + // required bytes amount = 1; + + pub fn amount(&self) -> &[u8] { + match self.amount.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: ::std::vec::Vec) { + self.amount = ::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_amount(&mut self) -> &mut ::std::vec::Vec { + if self.amount.is_none() { + self.amount = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.amount.as_mut().unwrap() + } + + // Take field + pub fn take_amount(&mut self) -> ::std::vec::Vec { + self.amount.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &MintlayerPrevTransferOutput| { &m.amount }, + |m: &mut MintlayerPrevTransferOutput| { &mut m.amount }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerPrevTransferOutput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MintlayerPrevTransferOutput { + const NAME: &'static str = "MintlayerPrevTransferOutput"; + + fn is_initialized(&self) -> bool { + if self.amount.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.amount = ::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.amount.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.amount.as_ref() { + os.write_bytes(1, 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() -> MintlayerPrevTransferOutput { + MintlayerPrevTransferOutput::new() + } + + fn clear(&mut self) { + self.amount = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerPrevTransferOutput { + static instance: MintlayerPrevTransferOutput = MintlayerPrevTransferOutput { + amount: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MintlayerPrevTransferOutput { + 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("MintlayerPrevTransferOutput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MintlayerPrevTransferOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MintlayerPrevTransferOutput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerTxAckUtxoInput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MintlayerTxAckUtxoInput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerTxAckUtxoInput.tx) + pub tx: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerTxAckUtxoInput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MintlayerTxAckUtxoInput { + fn default() -> &'a MintlayerTxAckUtxoInput { + ::default_instance() + } +} + +impl MintlayerTxAckUtxoInput { + pub fn new() -> MintlayerTxAckUtxoInput { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, mintlayer_tx_ack_utxo_input::MintlayerTxAckInputWrapper>( + "tx", + |m: &MintlayerTxAckUtxoInput| { &m.tx }, + |m: &mut MintlayerTxAckUtxoInput| { &mut m.tx }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerTxAckUtxoInput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MintlayerTxAckUtxoInput { + const NAME: &'static str = "MintlayerTxAckUtxoInput"; + + fn is_initialized(&self) -> bool { + if self.tx.is_none() { + return false; + } + for v in &self.tx { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.tx)?; + }, + 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.tx.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.tx.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + 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() -> MintlayerTxAckUtxoInput { + MintlayerTxAckUtxoInput::new() + } + + fn clear(&mut self) { + self.tx.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerTxAckUtxoInput { + static instance: MintlayerTxAckUtxoInput = MintlayerTxAckUtxoInput { + tx: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MintlayerTxAckUtxoInput { + 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("MintlayerTxAckUtxoInput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MintlayerTxAckUtxoInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MintlayerTxAckUtxoInput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `MintlayerTxAckUtxoInput` +pub mod mintlayer_tx_ack_utxo_input { + // @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerTxAckUtxoInput.MintlayerTxAckInputWrapper) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct MintlayerTxAckInputWrapper { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerTxAckUtxoInput.MintlayerTxAckInputWrapper.input) + pub input: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerTxAckUtxoInput.MintlayerTxAckInputWrapper.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a MintlayerTxAckInputWrapper { + fn default() -> &'a MintlayerTxAckInputWrapper { + ::default_instance() + } + } + + impl MintlayerTxAckInputWrapper { + pub fn new() -> MintlayerTxAckInputWrapper { + ::std::default::Default::default() + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::MintlayerUtxoTxInput>( + "input", + |m: &MintlayerTxAckInputWrapper| { &m.input }, + |m: &mut MintlayerTxAckInputWrapper| { &mut m.input }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerTxAckUtxoInput.MintlayerTxAckInputWrapper", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for MintlayerTxAckInputWrapper { + const NAME: &'static str = "MintlayerTxAckInputWrapper"; + + fn is_initialized(&self) -> bool { + if self.input.is_none() { + return false; + } + for v in &self.input { + if !v.is_initialized() { + 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 { + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.input)?; + }, + 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.input.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.input.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + 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() -> MintlayerTxAckInputWrapper { + MintlayerTxAckInputWrapper::new() + } + + fn clear(&mut self) { + self.input.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerTxAckInputWrapper { + static instance: MintlayerTxAckInputWrapper = MintlayerTxAckInputWrapper { + input: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for MintlayerTxAckInputWrapper { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("MintlayerTxAckUtxoInput.MintlayerTxAckInputWrapper").unwrap()).clone() + } + } + + impl ::std::fmt::Display for MintlayerTxAckInputWrapper { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for MintlayerTxAckInputWrapper { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerTxAckOutput) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MintlayerTxAckOutput { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerTxAckOutput.tx) + pub tx: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerTxAckOutput.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MintlayerTxAckOutput { + fn default() -> &'a MintlayerTxAckOutput { + ::default_instance() + } +} + +impl MintlayerTxAckOutput { + pub fn new() -> MintlayerTxAckOutput { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, mintlayer_tx_ack_output::MintlayerTxAckOutputWrapper>( + "tx", + |m: &MintlayerTxAckOutput| { &m.tx }, + |m: &mut MintlayerTxAckOutput| { &mut m.tx }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerTxAckOutput", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MintlayerTxAckOutput { + const NAME: &'static str = "MintlayerTxAckOutput"; + + fn is_initialized(&self) -> bool { + if self.tx.is_none() { + return false; + } + for v in &self.tx { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.tx)?; + }, + 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.tx.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.tx.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + 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() -> MintlayerTxAckOutput { + MintlayerTxAckOutput::new() + } + + fn clear(&mut self) { + self.tx.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerTxAckOutput { + static instance: MintlayerTxAckOutput = MintlayerTxAckOutput { + tx: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MintlayerTxAckOutput { + 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("MintlayerTxAckOutput").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MintlayerTxAckOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MintlayerTxAckOutput { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `MintlayerTxAckOutput` +pub mod mintlayer_tx_ack_output { + // @@protoc_insertion_point(message:hw.trezor.messages.mintlayer.MintlayerTxAckOutput.MintlayerTxAckOutputWrapper) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct MintlayerTxAckOutputWrapper { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.mintlayer.MintlayerTxAckOutput.MintlayerTxAckOutputWrapper.output) + pub output: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.mintlayer.MintlayerTxAckOutput.MintlayerTxAckOutputWrapper.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a MintlayerTxAckOutputWrapper { + fn default() -> &'a MintlayerTxAckOutputWrapper { + ::default_instance() + } + } + + impl MintlayerTxAckOutputWrapper { + pub fn new() -> MintlayerTxAckOutputWrapper { + ::std::default::Default::default() + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::MintlayerTransferTxOutput>( + "output", + |m: &MintlayerTxAckOutputWrapper| { &m.output }, + |m: &mut MintlayerTxAckOutputWrapper| { &mut m.output }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MintlayerTxAckOutput.MintlayerTxAckOutputWrapper", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for MintlayerTxAckOutputWrapper { + const NAME: &'static str = "MintlayerTxAckOutputWrapper"; + + fn is_initialized(&self) -> bool { + if self.output.is_none() { + return false; + } + for v in &self.output { + if !v.is_initialized() { + 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 { + 42 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.output)?; + }, + 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.output.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.output.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + } + 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() -> MintlayerTxAckOutputWrapper { + MintlayerTxAckOutputWrapper::new() + } + + fn clear(&mut self) { + self.output.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MintlayerTxAckOutputWrapper { + static instance: MintlayerTxAckOutputWrapper = MintlayerTxAckOutputWrapper { + output: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for MintlayerTxAckOutputWrapper { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("MintlayerTxAckOutput.MintlayerTxAckOutputWrapper").unwrap()).clone() + } + } + + impl ::std::fmt::Display for MintlayerTxAckOutputWrapper { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for MintlayerTxAckOutputWrapper { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x18messages-mintlayer.proto\x12\x1chw.trezor.messages.mintlayer\"q\n\ + \x13MintlayerGetAddress\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addr\ + essN\x12!\n\x0cshow_display\x18\x02\x20\x01(\x08R\x0bshowDisplay\x12\x1a\ + \n\x08chunkify\x18\x03\x20\x01(\x08R\x08chunkify\",\n\x10MintlayerAddres\ + s\x12\x18\n\x07address\x18\x01\x20\x02(\tR\x07address\"W\n\x15MintlayerG\ + etPublicKey\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12!\n\ + \x0cshow_display\x18\x02\x20\x01(\x08R\x0bshowDisplay\"R\n\x12MintlayerP\ + ublicKey\x12\x1d\n\npublic_key\x18\x01\x20\x02(\x0cR\tpublicKey\x12\x1d\ + \n\nchain_code\x18\x02\x20\x02(\x0cR\tchainCode\"i\n\x12MintlayerVerifyS\ + ig\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\x1c\n\tsigna\ + ture\x18\x02\x20\x02(\x0cR\tsignature\x12\x18\n\x07message\x18\x03\x20\ + \x02(\x0cR\x07message\"\xb6\x01\n\x0fMintlayerSignTx\x12#\n\routputs_cou\ + nt\x18\x01\x20\x02(\rR\x0coutputsCount\x12!\n\x0cinputs_count\x18\x02\ + \x20\x02(\rR\x0binputsCount\x12\x1b\n\x07version\x18\x03\x20\x01(\r:\x01\ + 1R\x07version\x12\"\n\tserialize\x18\x04\x20\x01(\x08:\x04trueR\tseriali\ + ze\x12\x1a\n\x08chunkify\x18\x05\x20\x01(\x08R\x08chunkify\"\x9a\x05\n\ + \x12MintlayerTxRequest\x12h\n\x0crequest_type\x18\x01\x20\x01(\x0e2E.hw.\ + trezor.messages.mintlayer.MintlayerTxRequest.MintlayerRequestTypeR\x0bre\ + questType\x12h\n\x07details\x18\x02\x20\x01(\x0b2N.hw.trezor.messages.mi\ + ntlayer.MintlayerTxRequest.MintlayerTxRequestDetailsTypeR\x07details\x12\ + q\n\nserialized\x18\x03\x20\x03(\x0b2Q.hw.trezor.messages.mintlayer.Mint\ + layerTxRequest.MintlayerTxRequestSerializedTypeR\nserialized\x1a]\n\x1dM\ + intlayerTxRequestDetailsType\x12#\n\rrequest_index\x18\x01\x20\x01(\rR\ + \x0crequestIndex\x12\x17\n\x07tx_hash\x18\x02\x20\x01(\x0cR\x06txHash\ + \x1a\x8e\x01\n\x20MintlayerTxRequestSerializedType\x12'\n\x0fsignature_i\ + ndex\x18\x01\x20\x01(\rR\x0esignatureIndex\x12\x1c\n\tsignature\x18\x02\ + \x20\x01(\x0cR\tsignature\x12#\n\rserialized_tx\x18\x03\x20\x01(\x0cR\ + \x0cserializedTx\"M\n\x14MintlayerRequestType\x12\x0b\n\x07TXINPUT\x10\0\ + \x12\x0c\n\x08TXOUTPUT\x10\x01\x12\n\n\x06TXMETA\x10\x02\x12\x0e\n\nTXFI\ + NISHED\x10\x03\"\xaf\x01\n\x14MintlayerUtxoTxInput\x12\x1b\n\taddress_n\ + \x18\x01\x20\x03(\rR\x08addressN\x12\x1b\n\tprev_hash\x18\x02\x20\x02(\ + \x0cR\x08prevHash\x12\x1d\n\nprev_index\x18\x03\x20\x02(\rR\tprevIndex\ + \x12&\n\x08sequence\x18\x04\x20\x01(\r:\n4294967295R\x08sequence\x12\x16\ + \n\x06amount\x18\x05\x20\x02(\x0cR\x06amount\"j\n\x19MintlayerTransferTx\ + Output\x12\x18\n\x07address\x18\x01\x20\x01(\tR\x07address\x12\x1b\n\tad\ + dress_n\x18\x02\x20\x03(\rR\x08addressN\x12\x16\n\x06amount\x18\x03\x20\ + \x02(\x0cR\x06amount\"s\n\x0fMintlayerPrevTx\x12\x18\n\x07version\x18\ + \x01\x20\x02(\rR\x07version\x12!\n\x0cinputs_count\x18\x06\x20\x02(\rR\ + \x0binputsCount\x12#\n\routputs_count\x18\x07\x20\x02(\rR\x0coutputsCoun\ + t\"b\n\x12MintlayerPrevInput\x12\x1b\n\tprev_hash\x18\x02\x20\x02(\x0cR\ + \x08prevHash\x12\x1d\n\nprev_index\x18\x03\x20\x02(\rR\tprevIndexJ\x04\ + \x08\x01\x10\x02J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06\"5\n\x1bMintl\ + ayerPrevTransferOutput\x12\x16\n\x06amount\x18\x01\x20\x02(\x0cR\x06amou\ + nt\"\xe3\x01\n\x17MintlayerTxAckUtxoInput\x12`\n\x02tx\x18\x01\x20\x02(\ + \x0b2P.hw.trezor.messages.mintlayer.MintlayerTxAckUtxoInput.MintlayerTxA\ + ckInputWrapperR\x02tx\x1af\n\x1aMintlayerTxAckInputWrapper\x12H\n\x05inp\ + ut\x18\x02\x20\x02(\x0b22.hw.trezor.messages.mintlayer.MintlayerUtxoTxIn\ + putR\x05input\"\xe6\x01\n\x14MintlayerTxAckOutput\x12^\n\x02tx\x18\x01\ + \x20\x02(\x0b2N.hw.trezor.messages.mintlayer.MintlayerTxAckOutput.Mintla\ + yerTxAckOutputWrapperR\x02tx\x1an\n\x1bMintlayerTxAckOutputWrapper\x12O\ + \n\x06output\x18\x05\x20\x02(\x0b27.hw.trezor.messages.mintlayer.Mintlay\ + erTransferTxOutputR\x06outputB=\n#com.satoshilabs.trezor.lib.protobufB\ + \x16TrezorMessageMintlayer\ +"; + +/// `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(18); + messages.push(MintlayerGetAddress::generated_message_descriptor_data()); + messages.push(MintlayerAddress::generated_message_descriptor_data()); + messages.push(MintlayerGetPublicKey::generated_message_descriptor_data()); + messages.push(MintlayerPublicKey::generated_message_descriptor_data()); + messages.push(MintlayerVerifySig::generated_message_descriptor_data()); + messages.push(MintlayerSignTx::generated_message_descriptor_data()); + messages.push(MintlayerTxRequest::generated_message_descriptor_data()); + messages.push(MintlayerUtxoTxInput::generated_message_descriptor_data()); + messages.push(MintlayerTransferTxOutput::generated_message_descriptor_data()); + messages.push(MintlayerPrevTx::generated_message_descriptor_data()); + messages.push(MintlayerPrevInput::generated_message_descriptor_data()); + messages.push(MintlayerPrevTransferOutput::generated_message_descriptor_data()); + messages.push(MintlayerTxAckUtxoInput::generated_message_descriptor_data()); + messages.push(MintlayerTxAckOutput::generated_message_descriptor_data()); + messages.push(mintlayer_tx_request::MintlayerTxRequestDetailsType::generated_message_descriptor_data()); + messages.push(mintlayer_tx_request::MintlayerTxRequestSerializedType::generated_message_descriptor_data()); + messages.push(mintlayer_tx_ack_utxo_input::MintlayerTxAckInputWrapper::generated_message_descriptor_data()); + messages.push(mintlayer_tx_ack_output::MintlayerTxAckOutputWrapper::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(1); + enums.push(mintlayer_tx_request::MintlayerRequestType::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_monero.rs b/wallet/trezor-client/src/protos/generated/messages_monero.rs new file mode 100644 index 0000000000..e3827e178d --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_monero.rs @@ -0,0 +1,12061 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-monero.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionSourceEntry) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionSourceEntry { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.outputs) + pub outputs: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.real_output) + pub real_output: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.real_out_tx_key) + pub real_out_tx_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.real_out_additional_tx_keys) + pub real_out_additional_tx_keys: ::std::vec::Vec<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.real_output_in_tx_index) + pub real_output_in_tx_index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.rct) + pub rct: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.mask) + pub mask: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.multisig_kLRki) + pub multisig_kLRki: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.subaddr_minor) + pub subaddr_minor: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionSourceEntry { + fn default() -> &'a MoneroTransactionSourceEntry { + ::default_instance() + } +} + +impl MoneroTransactionSourceEntry { + pub fn new() -> MoneroTransactionSourceEntry { + ::std::default::Default::default() + } + + // optional uint64 real_output = 2; + + pub fn real_output(&self) -> u64 { + self.real_output.unwrap_or(0) + } + + pub fn clear_real_output(&mut self) { + self.real_output = ::std::option::Option::None; + } + + pub fn has_real_output(&self) -> bool { + self.real_output.is_some() + } + + // Param is passed by value, moved + pub fn set_real_output(&mut self, v: u64) { + self.real_output = ::std::option::Option::Some(v); + } + + // optional bytes real_out_tx_key = 3; + + pub fn real_out_tx_key(&self) -> &[u8] { + match self.real_out_tx_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_real_out_tx_key(&mut self) { + self.real_out_tx_key = ::std::option::Option::None; + } + + pub fn has_real_out_tx_key(&self) -> bool { + self.real_out_tx_key.is_some() + } + + // Param is passed by value, moved + pub fn set_real_out_tx_key(&mut self, v: ::std::vec::Vec) { + self.real_out_tx_key = ::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_real_out_tx_key(&mut self) -> &mut ::std::vec::Vec { + if self.real_out_tx_key.is_none() { + self.real_out_tx_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.real_out_tx_key.as_mut().unwrap() + } + + // Take field + pub fn take_real_out_tx_key(&mut self) -> ::std::vec::Vec { + self.real_out_tx_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint64 real_output_in_tx_index = 5; + + pub fn real_output_in_tx_index(&self) -> u64 { + self.real_output_in_tx_index.unwrap_or(0) + } + + pub fn clear_real_output_in_tx_index(&mut self) { + self.real_output_in_tx_index = ::std::option::Option::None; + } + + pub fn has_real_output_in_tx_index(&self) -> bool { + self.real_output_in_tx_index.is_some() + } + + // Param is passed by value, moved + pub fn set_real_output_in_tx_index(&mut self, v: u64) { + self.real_output_in_tx_index = ::std::option::Option::Some(v); + } + + // optional uint64 amount = 6; + + pub fn amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + // optional bool rct = 7; + + pub fn rct(&self) -> bool { + self.rct.unwrap_or(false) + } + + pub fn clear_rct(&mut self) { + self.rct = ::std::option::Option::None; + } + + pub fn has_rct(&self) -> bool { + self.rct.is_some() + } + + // Param is passed by value, moved + pub fn set_rct(&mut self, v: bool) { + self.rct = ::std::option::Option::Some(v); + } + + // optional bytes mask = 8; + + pub fn mask(&self) -> &[u8] { + match self.mask.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_mask(&mut self) { + self.mask = ::std::option::Option::None; + } + + pub fn has_mask(&self) -> bool { + self.mask.is_some() + } + + // Param is passed by value, moved + pub fn set_mask(&mut self, v: ::std::vec::Vec) { + self.mask = ::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_mask(&mut self) -> &mut ::std::vec::Vec { + if self.mask.is_none() { + self.mask = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.mask.as_mut().unwrap() + } + + // Take field + pub fn take_mask(&mut self) -> ::std::vec::Vec { + self.mask.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 subaddr_minor = 10; + + pub fn subaddr_minor(&self) -> u32 { + self.subaddr_minor.unwrap_or(0) + } + + pub fn clear_subaddr_minor(&mut self) { + self.subaddr_minor = ::std::option::Option::None; + } + + pub fn has_subaddr_minor(&self) -> bool { + self.subaddr_minor.is_some() + } + + // Param is passed by value, moved + pub fn set_subaddr_minor(&mut self, v: u32) { + self.subaddr_minor = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(10); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "outputs", + |m: &MoneroTransactionSourceEntry| { &m.outputs }, + |m: &mut MoneroTransactionSourceEntry| { &mut m.outputs }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "real_output", + |m: &MoneroTransactionSourceEntry| { &m.real_output }, + |m: &mut MoneroTransactionSourceEntry| { &mut m.real_output }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "real_out_tx_key", + |m: &MoneroTransactionSourceEntry| { &m.real_out_tx_key }, + |m: &mut MoneroTransactionSourceEntry| { &mut m.real_out_tx_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "real_out_additional_tx_keys", + |m: &MoneroTransactionSourceEntry| { &m.real_out_additional_tx_keys }, + |m: &mut MoneroTransactionSourceEntry| { &mut m.real_out_additional_tx_keys }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "real_output_in_tx_index", + |m: &MoneroTransactionSourceEntry| { &m.real_output_in_tx_index }, + |m: &mut MoneroTransactionSourceEntry| { &mut m.real_output_in_tx_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &MoneroTransactionSourceEntry| { &m.amount }, + |m: &mut MoneroTransactionSourceEntry| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "rct", + |m: &MoneroTransactionSourceEntry| { &m.rct }, + |m: &mut MoneroTransactionSourceEntry| { &mut m.rct }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "mask", + |m: &MoneroTransactionSourceEntry| { &m.mask }, + |m: &mut MoneroTransactionSourceEntry| { &mut m.mask }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, monero_transaction_source_entry::MoneroMultisigKLRki>( + "multisig_kLRki", + |m: &MoneroTransactionSourceEntry| { &m.multisig_kLRki }, + |m: &mut MoneroTransactionSourceEntry| { &mut m.multisig_kLRki }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "subaddr_minor", + |m: &MoneroTransactionSourceEntry| { &m.subaddr_minor }, + |m: &mut MoneroTransactionSourceEntry| { &mut m.subaddr_minor }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionSourceEntry", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionSourceEntry { + const NAME: &'static str = "MoneroTransactionSourceEntry"; + + fn is_initialized(&self) -> bool { + for v in &self.outputs { + if !v.is_initialized() { + return false; + } + }; + for v in &self.multisig_kLRki { + if !v.is_initialized() { + 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.outputs.push(is.read_message()?); + }, + 16 => { + self.real_output = ::std::option::Option::Some(is.read_uint64()?); + }, + 26 => { + self.real_out_tx_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.real_out_additional_tx_keys.push(is.read_bytes()?); + }, + 40 => { + self.real_output_in_tx_index = ::std::option::Option::Some(is.read_uint64()?); + }, + 48 => { + self.amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 56 => { + self.rct = ::std::option::Option::Some(is.read_bool()?); + }, + 66 => { + self.mask = ::std::option::Option::Some(is.read_bytes()?); + }, + 74 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.multisig_kLRki)?; + }, + 80 => { + self.subaddr_minor = ::std::option::Option::Some(is.read_uint32()?); + }, + 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; + for value in &self.outputs { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + if let Some(v) = self.real_output { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.real_out_tx_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + for value in &self.real_out_additional_tx_keys { + my_size += ::protobuf::rt::bytes_size(4, &value); + }; + if let Some(v) = self.real_output_in_tx_index { + my_size += ::protobuf::rt::uint64_size(5, v); + } + if let Some(v) = self.amount { + my_size += ::protobuf::rt::uint64_size(6, v); + } + if let Some(v) = self.rct { + my_size += 1 + 1; + } + if let Some(v) = self.mask.as_ref() { + my_size += ::protobuf::rt::bytes_size(8, &v); + } + if let Some(v) = self.multisig_kLRki.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.subaddr_minor { + my_size += ::protobuf::rt::uint32_size(10, 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<()> { + for v in &self.outputs { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + }; + if let Some(v) = self.real_output { + os.write_uint64(2, v)?; + } + if let Some(v) = self.real_out_tx_key.as_ref() { + os.write_bytes(3, v)?; + } + for v in &self.real_out_additional_tx_keys { + os.write_bytes(4, &v)?; + }; + if let Some(v) = self.real_output_in_tx_index { + os.write_uint64(5, v)?; + } + if let Some(v) = self.amount { + os.write_uint64(6, v)?; + } + if let Some(v) = self.rct { + os.write_bool(7, v)?; + } + if let Some(v) = self.mask.as_ref() { + os.write_bytes(8, v)?; + } + if let Some(v) = self.multisig_kLRki.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(9, v, os)?; + } + if let Some(v) = self.subaddr_minor { + os.write_uint32(10, 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() -> MoneroTransactionSourceEntry { + MoneroTransactionSourceEntry::new() + } + + fn clear(&mut self) { + self.outputs.clear(); + self.real_output = ::std::option::Option::None; + self.real_out_tx_key = ::std::option::Option::None; + self.real_out_additional_tx_keys.clear(); + self.real_output_in_tx_index = ::std::option::Option::None; + self.amount = ::std::option::Option::None; + self.rct = ::std::option::Option::None; + self.mask = ::std::option::Option::None; + self.multisig_kLRki.clear(); + self.subaddr_minor = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionSourceEntry { + static instance: MoneroTransactionSourceEntry = MoneroTransactionSourceEntry { + outputs: ::std::vec::Vec::new(), + real_output: ::std::option::Option::None, + real_out_tx_key: ::std::option::Option::None, + real_out_additional_tx_keys: ::std::vec::Vec::new(), + real_output_in_tx_index: ::std::option::Option::None, + amount: ::std::option::Option::None, + rct: ::std::option::Option::None, + mask: ::std::option::Option::None, + multisig_kLRki: ::protobuf::MessageField::none(), + subaddr_minor: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionSourceEntry { + 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("MoneroTransactionSourceEntry").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionSourceEntry { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionSourceEntry { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `MoneroTransactionSourceEntry` +pub mod monero_transaction_source_entry { + // @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionSourceEntry.MoneroOutputEntry) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct MoneroOutputEntry { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.MoneroOutputEntry.idx) + pub idx: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.MoneroOutputEntry.key) + pub key: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.MoneroOutputEntry.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a MoneroOutputEntry { + fn default() -> &'a MoneroOutputEntry { + ::default_instance() + } + } + + impl MoneroOutputEntry { + pub fn new() -> MoneroOutputEntry { + ::std::default::Default::default() + } + + // optional uint64 idx = 1; + + pub fn idx(&self) -> u64 { + self.idx.unwrap_or(0) + } + + pub fn clear_idx(&mut self) { + self.idx = ::std::option::Option::None; + } + + pub fn has_idx(&self) -> bool { + self.idx.is_some() + } + + // Param is passed by value, moved + pub fn set_idx(&mut self, v: u64) { + self.idx = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "idx", + |m: &MoneroOutputEntry| { &m.idx }, + |m: &mut MoneroOutputEntry| { &mut m.idx }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, monero_output_entry::MoneroRctKeyPublic>( + "key", + |m: &MoneroOutputEntry| { &m.key }, + |m: &mut MoneroOutputEntry| { &mut m.key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionSourceEntry.MoneroOutputEntry", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for MoneroOutputEntry { + const NAME: &'static str = "MoneroOutputEntry"; + + fn is_initialized(&self) -> bool { + for v in &self.key { + if !v.is_initialized() { + 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.idx = ::std::option::Option::Some(is.read_uint64()?); + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.key)?; + }, + 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.idx { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.key.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.idx { + os.write_uint64(1, v)?; + } + if let Some(v) = self.key.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + 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() -> MoneroOutputEntry { + MoneroOutputEntry::new() + } + + fn clear(&mut self) { + self.idx = ::std::option::Option::None; + self.key.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroOutputEntry { + static instance: MoneroOutputEntry = MoneroOutputEntry { + idx: ::std::option::Option::None, + key: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for MoneroOutputEntry { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("MoneroTransactionSourceEntry.MoneroOutputEntry").unwrap()).clone() + } + } + + impl ::std::fmt::Display for MoneroOutputEntry { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for MoneroOutputEntry { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + /// Nested message and enums of message `MoneroOutputEntry` + pub mod monero_output_entry { + // @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionSourceEntry.MoneroOutputEntry.MoneroRctKeyPublic) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct MoneroRctKeyPublic { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.MoneroOutputEntry.MoneroRctKeyPublic.dest) + pub dest: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.MoneroOutputEntry.MoneroRctKeyPublic.commitment) + pub commitment: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.MoneroOutputEntry.MoneroRctKeyPublic.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a MoneroRctKeyPublic { + fn default() -> &'a MoneroRctKeyPublic { + ::default_instance() + } + } + + impl MoneroRctKeyPublic { + pub fn new() -> MoneroRctKeyPublic { + ::std::default::Default::default() + } + + // required bytes dest = 1; + + pub fn dest(&self) -> &[u8] { + match self.dest.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_dest(&mut self) { + self.dest = ::std::option::Option::None; + } + + pub fn has_dest(&self) -> bool { + self.dest.is_some() + } + + // Param is passed by value, moved + pub fn set_dest(&mut self, v: ::std::vec::Vec) { + self.dest = ::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_dest(&mut self) -> &mut ::std::vec::Vec { + if self.dest.is_none() { + self.dest = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.dest.as_mut().unwrap() + } + + // Take field + pub fn take_dest(&mut self) -> ::std::vec::Vec { + self.dest.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes commitment = 2; + + pub fn commitment(&self) -> &[u8] { + match self.commitment.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_commitment(&mut self) { + self.commitment = ::std::option::Option::None; + } + + pub fn has_commitment(&self) -> bool { + self.commitment.is_some() + } + + // Param is passed by value, moved + pub fn set_commitment(&mut self, v: ::std::vec::Vec) { + self.commitment = ::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_commitment(&mut self) -> &mut ::std::vec::Vec { + if self.commitment.is_none() { + self.commitment = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.commitment.as_mut().unwrap() + } + + // Take field + pub fn take_commitment(&mut self) -> ::std::vec::Vec { + self.commitment.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super::super) 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::<_, _>( + "dest", + |m: &MoneroRctKeyPublic| { &m.dest }, + |m: &mut MoneroRctKeyPublic| { &mut m.dest }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "commitment", + |m: &MoneroRctKeyPublic| { &m.commitment }, + |m: &mut MoneroRctKeyPublic| { &mut m.commitment }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionSourceEntry.MoneroOutputEntry.MoneroRctKeyPublic", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for MoneroRctKeyPublic { + const NAME: &'static str = "MoneroRctKeyPublic"; + + fn is_initialized(&self) -> bool { + if self.dest.is_none() { + return false; + } + if self.commitment.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.dest = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.commitment = ::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.dest.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.commitment.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.dest.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.commitment.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() -> MoneroRctKeyPublic { + MoneroRctKeyPublic::new() + } + + fn clear(&mut self) { + self.dest = ::std::option::Option::None; + self.commitment = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroRctKeyPublic { + static instance: MoneroRctKeyPublic = MoneroRctKeyPublic { + dest: ::std::option::Option::None, + commitment: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for MoneroRctKeyPublic { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::super::file_descriptor().message_by_package_relative_name("MoneroTransactionSourceEntry.MoneroOutputEntry.MoneroRctKeyPublic").unwrap()).clone() + } + } + + impl ::std::fmt::Display for MoneroRctKeyPublic { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for MoneroRctKeyPublic { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + } + + // @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionSourceEntry.MoneroMultisigKLRki) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct MoneroMultisigKLRki { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.MoneroMultisigKLRki.K) + pub K: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.MoneroMultisigKLRki.L) + pub L: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.MoneroMultisigKLRki.R) + pub R: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.MoneroMultisigKLRki.ki) + pub ki: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionSourceEntry.MoneroMultisigKLRki.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a MoneroMultisigKLRki { + fn default() -> &'a MoneroMultisigKLRki { + ::default_instance() + } + } + + impl MoneroMultisigKLRki { + pub fn new() -> MoneroMultisigKLRki { + ::std::default::Default::default() + } + + // optional bytes K = 1; + + pub fn K(&self) -> &[u8] { + match self.K.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_K(&mut self) { + self.K = ::std::option::Option::None; + } + + pub fn has_K(&self) -> bool { + self.K.is_some() + } + + // Param is passed by value, moved + pub fn set_K(&mut self, v: ::std::vec::Vec) { + self.K = ::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_K(&mut self) -> &mut ::std::vec::Vec { + if self.K.is_none() { + self.K = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.K.as_mut().unwrap() + } + + // Take field + pub fn take_K(&mut self) -> ::std::vec::Vec { + self.K.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes L = 2; + + pub fn L(&self) -> &[u8] { + match self.L.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_L(&mut self) { + self.L = ::std::option::Option::None; + } + + pub fn has_L(&self) -> bool { + self.L.is_some() + } + + // Param is passed by value, moved + pub fn set_L(&mut self, v: ::std::vec::Vec) { + self.L = ::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_L(&mut self) -> &mut ::std::vec::Vec { + if self.L.is_none() { + self.L = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.L.as_mut().unwrap() + } + + // Take field + pub fn take_L(&mut self) -> ::std::vec::Vec { + self.L.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes R = 3; + + pub fn R(&self) -> &[u8] { + match self.R.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_R(&mut self) { + self.R = ::std::option::Option::None; + } + + pub fn has_R(&self) -> bool { + self.R.is_some() + } + + // Param is passed by value, moved + pub fn set_R(&mut self, v: ::std::vec::Vec) { + self.R = ::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_R(&mut self) -> &mut ::std::vec::Vec { + if self.R.is_none() { + self.R = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.R.as_mut().unwrap() + } + + // Take field + pub fn take_R(&mut self) -> ::std::vec::Vec { + self.R.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes ki = 4; + + pub fn ki(&self) -> &[u8] { + match self.ki.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_ki(&mut self) { + self.ki = ::std::option::Option::None; + } + + pub fn has_ki(&self) -> bool { + self.ki.is_some() + } + + // Param is passed by value, moved + pub fn set_ki(&mut self, v: ::std::vec::Vec) { + self.ki = ::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_ki(&mut self) -> &mut ::std::vec::Vec { + if self.ki.is_none() { + self.ki = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.ki.as_mut().unwrap() + } + + // Take field + pub fn take_ki(&mut self) -> ::std::vec::Vec { + self.ki.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) 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::<_, _>( + "K", + |m: &MoneroMultisigKLRki| { &m.K }, + |m: &mut MoneroMultisigKLRki| { &mut m.K }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "L", + |m: &MoneroMultisigKLRki| { &m.L }, + |m: &mut MoneroMultisigKLRki| { &mut m.L }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "R", + |m: &MoneroMultisigKLRki| { &m.R }, + |m: &mut MoneroMultisigKLRki| { &mut m.R }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ki", + |m: &MoneroMultisigKLRki| { &m.ki }, + |m: &mut MoneroMultisigKLRki| { &mut m.ki }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionSourceEntry.MoneroMultisigKLRki", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for MoneroMultisigKLRki { + const NAME: &'static str = "MoneroMultisigKLRki"; + + 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.K = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.L = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.R = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.ki = ::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.K.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.L.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.R.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.ki.as_ref() { + my_size += ::protobuf::rt::bytes_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.K.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.L.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.R.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.ki.as_ref() { + os.write_bytes(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() -> MoneroMultisigKLRki { + MoneroMultisigKLRki::new() + } + + fn clear(&mut self) { + self.K = ::std::option::Option::None; + self.L = ::std::option::Option::None; + self.R = ::std::option::Option::None; + self.ki = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroMultisigKLRki { + static instance: MoneroMultisigKLRki = MoneroMultisigKLRki { + K: ::std::option::Option::None, + L: ::std::option::Option::None, + R: ::std::option::Option::None, + ki: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for MoneroMultisigKLRki { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("MoneroTransactionSourceEntry.MoneroMultisigKLRki").unwrap()).clone() + } + } + + impl ::std::fmt::Display for MoneroMultisigKLRki { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for MoneroMultisigKLRki { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionDestinationEntry) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionDestinationEntry { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionDestinationEntry.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionDestinationEntry.addr) + pub addr: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionDestinationEntry.is_subaddress) + pub is_subaddress: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionDestinationEntry.original) + pub original: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionDestinationEntry.is_integrated) + pub is_integrated: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionDestinationEntry.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionDestinationEntry { + fn default() -> &'a MoneroTransactionDestinationEntry { + ::default_instance() + } +} + +impl MoneroTransactionDestinationEntry { + pub fn new() -> MoneroTransactionDestinationEntry { + ::std::default::Default::default() + } + + // optional uint64 amount = 1; + + pub fn amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + // optional bool is_subaddress = 3; + + pub fn is_subaddress(&self) -> bool { + self.is_subaddress.unwrap_or(false) + } + + pub fn clear_is_subaddress(&mut self) { + self.is_subaddress = ::std::option::Option::None; + } + + pub fn has_is_subaddress(&self) -> bool { + self.is_subaddress.is_some() + } + + // Param is passed by value, moved + pub fn set_is_subaddress(&mut self, v: bool) { + self.is_subaddress = ::std::option::Option::Some(v); + } + + // optional bytes original = 4; + + pub fn original(&self) -> &[u8] { + match self.original.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_original(&mut self) { + self.original = ::std::option::Option::None; + } + + pub fn has_original(&self) -> bool { + self.original.is_some() + } + + // Param is passed by value, moved + pub fn set_original(&mut self, v: ::std::vec::Vec) { + self.original = ::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_original(&mut self) -> &mut ::std::vec::Vec { + if self.original.is_none() { + self.original = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.original.as_mut().unwrap() + } + + // Take field + pub fn take_original(&mut self) -> ::std::vec::Vec { + self.original.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool is_integrated = 5; + + pub fn is_integrated(&self) -> bool { + self.is_integrated.unwrap_or(false) + } + + pub fn clear_is_integrated(&mut self) { + self.is_integrated = ::std::option::Option::None; + } + + pub fn has_is_integrated(&self) -> bool { + self.is_integrated.is_some() + } + + // Param is passed by value, moved + pub fn set_is_integrated(&mut self, v: bool) { + self.is_integrated = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "amount", + |m: &MoneroTransactionDestinationEntry| { &m.amount }, + |m: &mut MoneroTransactionDestinationEntry| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, monero_transaction_destination_entry::MoneroAccountPublicAddress>( + "addr", + |m: &MoneroTransactionDestinationEntry| { &m.addr }, + |m: &mut MoneroTransactionDestinationEntry| { &mut m.addr }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "is_subaddress", + |m: &MoneroTransactionDestinationEntry| { &m.is_subaddress }, + |m: &mut MoneroTransactionDestinationEntry| { &mut m.is_subaddress }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "original", + |m: &MoneroTransactionDestinationEntry| { &m.original }, + |m: &mut MoneroTransactionDestinationEntry| { &mut m.original }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "is_integrated", + |m: &MoneroTransactionDestinationEntry| { &m.is_integrated }, + |m: &mut MoneroTransactionDestinationEntry| { &mut m.is_integrated }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionDestinationEntry", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionDestinationEntry { + const NAME: &'static str = "MoneroTransactionDestinationEntry"; + + 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 { + 8 => { + self.amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.addr)?; + }, + 24 => { + self.is_subaddress = ::std::option::Option::Some(is.read_bool()?); + }, + 34 => { + self.original = ::std::option::Option::Some(is.read_bytes()?); + }, + 40 => { + self.is_integrated = ::std::option::Option::Some(is.read_bool()?); + }, + 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.amount { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.addr.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.is_subaddress { + my_size += 1 + 1; + } + if let Some(v) = self.original.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.is_integrated { + my_size += 1 + 1; + } + 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.amount { + os.write_uint64(1, v)?; + } + if let Some(v) = self.addr.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + if let Some(v) = self.is_subaddress { + os.write_bool(3, v)?; + } + if let Some(v) = self.original.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.is_integrated { + os.write_bool(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() -> MoneroTransactionDestinationEntry { + MoneroTransactionDestinationEntry::new() + } + + fn clear(&mut self) { + self.amount = ::std::option::Option::None; + self.addr.clear(); + self.is_subaddress = ::std::option::Option::None; + self.original = ::std::option::Option::None; + self.is_integrated = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionDestinationEntry { + static instance: MoneroTransactionDestinationEntry = MoneroTransactionDestinationEntry { + amount: ::std::option::Option::None, + addr: ::protobuf::MessageField::none(), + is_subaddress: ::std::option::Option::None, + original: ::std::option::Option::None, + is_integrated: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionDestinationEntry { + 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("MoneroTransactionDestinationEntry").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionDestinationEntry { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionDestinationEntry { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `MoneroTransactionDestinationEntry` +pub mod monero_transaction_destination_entry { + // @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionDestinationEntry.MoneroAccountPublicAddress) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct MoneroAccountPublicAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionDestinationEntry.MoneroAccountPublicAddress.spend_public_key) + pub spend_public_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionDestinationEntry.MoneroAccountPublicAddress.view_public_key) + pub view_public_key: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionDestinationEntry.MoneroAccountPublicAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a MoneroAccountPublicAddress { + fn default() -> &'a MoneroAccountPublicAddress { + ::default_instance() + } + } + + impl MoneroAccountPublicAddress { + pub fn new() -> MoneroAccountPublicAddress { + ::std::default::Default::default() + } + + // optional bytes spend_public_key = 1; + + pub fn spend_public_key(&self) -> &[u8] { + match self.spend_public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_spend_public_key(&mut self) { + self.spend_public_key = ::std::option::Option::None; + } + + pub fn has_spend_public_key(&self) -> bool { + self.spend_public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_spend_public_key(&mut self, v: ::std::vec::Vec) { + self.spend_public_key = ::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_spend_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.spend_public_key.is_none() { + self.spend_public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.spend_public_key.as_mut().unwrap() + } + + // Take field + pub fn take_spend_public_key(&mut self) -> ::std::vec::Vec { + self.spend_public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes view_public_key = 2; + + pub fn view_public_key(&self) -> &[u8] { + match self.view_public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_view_public_key(&mut self) { + self.view_public_key = ::std::option::Option::None; + } + + pub fn has_view_public_key(&self) -> bool { + self.view_public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_view_public_key(&mut self, v: ::std::vec::Vec) { + self.view_public_key = ::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_view_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.view_public_key.is_none() { + self.view_public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.view_public_key.as_mut().unwrap() + } + + // Take field + pub fn take_view_public_key(&mut self) -> ::std::vec::Vec { + self.view_public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) 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::<_, _>( + "spend_public_key", + |m: &MoneroAccountPublicAddress| { &m.spend_public_key }, + |m: &mut MoneroAccountPublicAddress| { &mut m.spend_public_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "view_public_key", + |m: &MoneroAccountPublicAddress| { &m.view_public_key }, + |m: &mut MoneroAccountPublicAddress| { &mut m.view_public_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionDestinationEntry.MoneroAccountPublicAddress", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for MoneroAccountPublicAddress { + const NAME: &'static str = "MoneroAccountPublicAddress"; + + 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.spend_public_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.view_public_key = ::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.spend_public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.view_public_key.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.spend_public_key.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.view_public_key.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() -> MoneroAccountPublicAddress { + MoneroAccountPublicAddress::new() + } + + fn clear(&mut self) { + self.spend_public_key = ::std::option::Option::None; + self.view_public_key = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroAccountPublicAddress { + static instance: MoneroAccountPublicAddress = MoneroAccountPublicAddress { + spend_public_key: ::std::option::Option::None, + view_public_key: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for MoneroAccountPublicAddress { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("MoneroTransactionDestinationEntry.MoneroAccountPublicAddress").unwrap()).clone() + } + } + + impl ::std::fmt::Display for MoneroAccountPublicAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for MoneroAccountPublicAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionRsigData) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionRsigData { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionRsigData.rsig_type) + pub rsig_type: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionRsigData.offload_type) + pub offload_type: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionRsigData.grouping) + pub grouping: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionRsigData.mask) + pub mask: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionRsigData.rsig) + pub rsig: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionRsigData.rsig_parts) + pub rsig_parts: ::std::vec::Vec<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionRsigData.bp_version) + pub bp_version: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionRsigData.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionRsigData { + fn default() -> &'a MoneroTransactionRsigData { + ::default_instance() + } +} + +impl MoneroTransactionRsigData { + pub fn new() -> MoneroTransactionRsigData { + ::std::default::Default::default() + } + + // optional uint32 rsig_type = 1; + + pub fn rsig_type(&self) -> u32 { + self.rsig_type.unwrap_or(0) + } + + pub fn clear_rsig_type(&mut self) { + self.rsig_type = ::std::option::Option::None; + } + + pub fn has_rsig_type(&self) -> bool { + self.rsig_type.is_some() + } + + // Param is passed by value, moved + pub fn set_rsig_type(&mut self, v: u32) { + self.rsig_type = ::std::option::Option::Some(v); + } + + // optional uint32 offload_type = 2; + + pub fn offload_type(&self) -> u32 { + self.offload_type.unwrap_or(0) + } + + pub fn clear_offload_type(&mut self) { + self.offload_type = ::std::option::Option::None; + } + + pub fn has_offload_type(&self) -> bool { + self.offload_type.is_some() + } + + // Param is passed by value, moved + pub fn set_offload_type(&mut self, v: u32) { + self.offload_type = ::std::option::Option::Some(v); + } + + // optional bytes mask = 4; + + pub fn mask(&self) -> &[u8] { + match self.mask.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_mask(&mut self) { + self.mask = ::std::option::Option::None; + } + + pub fn has_mask(&self) -> bool { + self.mask.is_some() + } + + // Param is passed by value, moved + pub fn set_mask(&mut self, v: ::std::vec::Vec) { + self.mask = ::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_mask(&mut self) -> &mut ::std::vec::Vec { + if self.mask.is_none() { + self.mask = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.mask.as_mut().unwrap() + } + + // Take field + pub fn take_mask(&mut self) -> ::std::vec::Vec { + self.mask.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes rsig = 5; + + pub fn rsig(&self) -> &[u8] { + match self.rsig.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_rsig(&mut self) { + self.rsig = ::std::option::Option::None; + } + + pub fn has_rsig(&self) -> bool { + self.rsig.is_some() + } + + // Param is passed by value, moved + pub fn set_rsig(&mut self, v: ::std::vec::Vec) { + self.rsig = ::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_rsig(&mut self) -> &mut ::std::vec::Vec { + if self.rsig.is_none() { + self.rsig = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.rsig.as_mut().unwrap() + } + + // Take field + pub fn take_rsig(&mut self) -> ::std::vec::Vec { + self.rsig.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 bp_version = 7; + + pub fn bp_version(&self) -> u32 { + self.bp_version.unwrap_or(0) + } + + pub fn clear_bp_version(&mut self) { + self.bp_version = ::std::option::Option::None; + } + + pub fn has_bp_version(&self) -> bool { + self.bp_version.is_some() + } + + // Param is passed by value, moved + pub fn set_bp_version(&mut self, v: u32) { + self.bp_version = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(7); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "rsig_type", + |m: &MoneroTransactionRsigData| { &m.rsig_type }, + |m: &mut MoneroTransactionRsigData| { &mut m.rsig_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "offload_type", + |m: &MoneroTransactionRsigData| { &m.offload_type }, + |m: &mut MoneroTransactionRsigData| { &mut m.offload_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "grouping", + |m: &MoneroTransactionRsigData| { &m.grouping }, + |m: &mut MoneroTransactionRsigData| { &mut m.grouping }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "mask", + |m: &MoneroTransactionRsigData| { &m.mask }, + |m: &mut MoneroTransactionRsigData| { &mut m.mask }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "rsig", + |m: &MoneroTransactionRsigData| { &m.rsig }, + |m: &mut MoneroTransactionRsigData| { &mut m.rsig }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "rsig_parts", + |m: &MoneroTransactionRsigData| { &m.rsig_parts }, + |m: &mut MoneroTransactionRsigData| { &mut m.rsig_parts }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "bp_version", + |m: &MoneroTransactionRsigData| { &m.bp_version }, + |m: &mut MoneroTransactionRsigData| { &mut m.bp_version }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionRsigData", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionRsigData { + const NAME: &'static str = "MoneroTransactionRsigData"; + + 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 { + 8 => { + self.rsig_type = ::std::option::Option::Some(is.read_uint32()?); + }, + 16 => { + self.offload_type = ::std::option::Option::Some(is.read_uint32()?); + }, + 26 => { + is.read_repeated_packed_uint64_into(&mut self.grouping)?; + }, + 24 => { + self.grouping.push(is.read_uint64()?); + }, + 34 => { + self.mask = ::std::option::Option::Some(is.read_bytes()?); + }, + 42 => { + self.rsig = ::std::option::Option::Some(is.read_bytes()?); + }, + 50 => { + self.rsig_parts.push(is.read_bytes()?); + }, + 56 => { + self.bp_version = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.rsig_type { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.offload_type { + my_size += ::protobuf::rt::uint32_size(2, v); + } + for value in &self.grouping { + my_size += ::protobuf::rt::uint64_size(3, *value); + }; + if let Some(v) = self.mask.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.rsig.as_ref() { + my_size += ::protobuf::rt::bytes_size(5, &v); + } + for value in &self.rsig_parts { + my_size += ::protobuf::rt::bytes_size(6, &value); + }; + if let Some(v) = self.bp_version { + my_size += ::protobuf::rt::uint32_size(7, 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.rsig_type { + os.write_uint32(1, v)?; + } + if let Some(v) = self.offload_type { + os.write_uint32(2, v)?; + } + for v in &self.grouping { + os.write_uint64(3, *v)?; + }; + if let Some(v) = self.mask.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.rsig.as_ref() { + os.write_bytes(5, v)?; + } + for v in &self.rsig_parts { + os.write_bytes(6, &v)?; + }; + if let Some(v) = self.bp_version { + os.write_uint32(7, 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() -> MoneroTransactionRsigData { + MoneroTransactionRsigData::new() + } + + fn clear(&mut self) { + self.rsig_type = ::std::option::Option::None; + self.offload_type = ::std::option::Option::None; + self.grouping.clear(); + self.mask = ::std::option::Option::None; + self.rsig = ::std::option::Option::None; + self.rsig_parts.clear(); + self.bp_version = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionRsigData { + static instance: MoneroTransactionRsigData = MoneroTransactionRsigData { + rsig_type: ::std::option::Option::None, + offload_type: ::std::option::Option::None, + grouping: ::std::vec::Vec::new(), + mask: ::std::option::Option::None, + rsig: ::std::option::Option::None, + rsig_parts: ::std::vec::Vec::new(), + bp_version: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionRsigData { + 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("MoneroTransactionRsigData").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionRsigData { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionRsigData { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroGetAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroGetAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetAddress.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetAddress.show_display) + pub show_display: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetAddress.network_type) + pub network_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetAddress.account) + pub account: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetAddress.minor) + pub minor: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetAddress.payment_id) + pub payment_id: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetAddress.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroGetAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroGetAddress { + fn default() -> &'a MoneroGetAddress { + ::default_instance() + } +} + +impl MoneroGetAddress { + pub fn new() -> MoneroGetAddress { + ::std::default::Default::default() + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.monero.MoneroNetworkType network_type = 3; + + pub fn network_type(&self) -> MoneroNetworkType { + match self.network_type { + Some(e) => e.enum_value_or(MoneroNetworkType::MAINNET), + None => MoneroNetworkType::MAINNET, + } + } + + pub fn clear_network_type(&mut self) { + self.network_type = ::std::option::Option::None; + } + + pub fn has_network_type(&self) -> bool { + self.network_type.is_some() + } + + // Param is passed by value, moved + pub fn set_network_type(&mut self, v: MoneroNetworkType) { + self.network_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional uint32 account = 4; + + pub fn account(&self) -> u32 { + self.account.unwrap_or(0) + } + + pub fn clear_account(&mut self) { + self.account = ::std::option::Option::None; + } + + pub fn has_account(&self) -> bool { + self.account.is_some() + } + + // Param is passed by value, moved + pub fn set_account(&mut self, v: u32) { + self.account = ::std::option::Option::Some(v); + } + + // optional uint32 minor = 5; + + pub fn minor(&self) -> u32 { + self.minor.unwrap_or(0) + } + + pub fn clear_minor(&mut self) { + self.minor = ::std::option::Option::None; + } + + pub fn has_minor(&self) -> bool { + self.minor.is_some() + } + + // Param is passed by value, moved + pub fn set_minor(&mut self, v: u32) { + self.minor = ::std::option::Option::Some(v); + } + + // optional bytes payment_id = 6; + + pub fn payment_id(&self) -> &[u8] { + match self.payment_id.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_payment_id(&mut self) { + self.payment_id = ::std::option::Option::None; + } + + pub fn has_payment_id(&self) -> bool { + self.payment_id.is_some() + } + + // Param is passed by value, moved + pub fn set_payment_id(&mut self, v: ::std::vec::Vec) { + self.payment_id = ::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_payment_id(&mut self) -> &mut ::std::vec::Vec { + if self.payment_id.is_none() { + self.payment_id = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.payment_id.as_mut().unwrap() + } + + // Take field + pub fn take_payment_id(&mut self) -> ::std::vec::Vec { + self.payment_id.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool chunkify = 7; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(7); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &MoneroGetAddress| { &m.address_n }, + |m: &mut MoneroGetAddress| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &MoneroGetAddress| { &m.show_display }, + |m: &mut MoneroGetAddress| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "network_type", + |m: &MoneroGetAddress| { &m.network_type }, + |m: &mut MoneroGetAddress| { &mut m.network_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "account", + |m: &MoneroGetAddress| { &m.account }, + |m: &mut MoneroGetAddress| { &mut m.account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "minor", + |m: &MoneroGetAddress| { &m.minor }, + |m: &mut MoneroGetAddress| { &mut m.minor }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "payment_id", + |m: &MoneroGetAddress| { &m.payment_id }, + |m: &mut MoneroGetAddress| { &mut m.payment_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &MoneroGetAddress| { &m.chunkify }, + |m: &mut MoneroGetAddress| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroGetAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroGetAddress { + const NAME: &'static str = "MoneroGetAddress"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 24 => { + self.network_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 32 => { + self.account = ::std::option::Option::Some(is.read_uint32()?); + }, + 40 => { + self.minor = ::std::option::Option::Some(is.read_uint32()?); + }, + 50 => { + self.payment_id = ::std::option::Option::Some(is.read_bytes()?); + }, + 56 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + if let Some(v) = self.network_type { + my_size += ::protobuf::rt::int32_size(3, v.value()); + } + if let Some(v) = self.account { + my_size += ::protobuf::rt::uint32_size(4, v); + } + if let Some(v) = self.minor { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.payment_id.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &v); + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.show_display { + os.write_bool(2, v)?; + } + if let Some(v) = self.network_type { + os.write_enum(3, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.account { + os.write_uint32(4, v)?; + } + if let Some(v) = self.minor { + os.write_uint32(5, v)?; + } + if let Some(v) = self.payment_id.as_ref() { + os.write_bytes(6, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(7, 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() -> MoneroGetAddress { + MoneroGetAddress::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.show_display = ::std::option::Option::None; + self.network_type = ::std::option::Option::None; + self.account = ::std::option::Option::None; + self.minor = ::std::option::Option::None; + self.payment_id = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroGetAddress { + static instance: MoneroGetAddress = MoneroGetAddress { + address_n: ::std::vec::Vec::new(), + show_display: ::std::option::Option::None, + network_type: ::std::option::Option::None, + account: ::std::option::Option::None, + minor: ::std::option::Option::None, + payment_id: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroGetAddress { + 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("MoneroGetAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroGetAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroGetAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroAddress.address) + pub address: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroAddress { + fn default() -> &'a MoneroAddress { + ::default_instance() + } +} + +impl MoneroAddress { + pub fn new() -> MoneroAddress { + ::std::default::Default::default() + } + + // optional 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) { + 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 { + 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 { + self.address.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &MoneroAddress| { &m.address }, + |m: &mut MoneroAddress| { &mut m.address }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroAddress { + const NAME: &'static str = "MoneroAddress"; + + 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.address = ::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.address.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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)?; + } + 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() -> MoneroAddress { + MoneroAddress::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroAddress { + static instance: MoneroAddress = MoneroAddress { + address: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroAddress { + 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("MoneroAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroGetWatchKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroGetWatchKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetWatchKey.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetWatchKey.network_type) + pub network_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroGetWatchKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroGetWatchKey { + fn default() -> &'a MoneroGetWatchKey { + ::default_instance() + } +} + +impl MoneroGetWatchKey { + pub fn new() -> MoneroGetWatchKey { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.monero.MoneroNetworkType network_type = 2; + + pub fn network_type(&self) -> MoneroNetworkType { + match self.network_type { + Some(e) => e.enum_value_or(MoneroNetworkType::MAINNET), + None => MoneroNetworkType::MAINNET, + } + } + + pub fn clear_network_type(&mut self) { + self.network_type = ::std::option::Option::None; + } + + pub fn has_network_type(&self) -> bool { + self.network_type.is_some() + } + + // Param is passed by value, moved + pub fn set_network_type(&mut self, v: MoneroNetworkType) { + self.network_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + 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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &MoneroGetWatchKey| { &m.address_n }, + |m: &mut MoneroGetWatchKey| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "network_type", + |m: &MoneroGetWatchKey| { &m.network_type }, + |m: &mut MoneroGetWatchKey| { &mut m.network_type }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroGetWatchKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroGetWatchKey { + const NAME: &'static str = "MoneroGetWatchKey"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.network_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.network_type { + my_size += ::protobuf::rt::int32_size(2, v.value()); + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.network_type { + os.write_enum(2, ::protobuf::EnumOrUnknown::value(&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() -> MoneroGetWatchKey { + MoneroGetWatchKey::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.network_type = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroGetWatchKey { + static instance: MoneroGetWatchKey = MoneroGetWatchKey { + address_n: ::std::vec::Vec::new(), + network_type: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroGetWatchKey { + 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("MoneroGetWatchKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroGetWatchKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroGetWatchKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroWatchKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroWatchKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroWatchKey.watch_key) + pub watch_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroWatchKey.address) + pub address: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroWatchKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroWatchKey { + fn default() -> &'a MoneroWatchKey { + ::default_instance() + } +} + +impl MoneroWatchKey { + pub fn new() -> MoneroWatchKey { + ::std::default::Default::default() + } + + // optional bytes watch_key = 1; + + pub fn watch_key(&self) -> &[u8] { + match self.watch_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_watch_key(&mut self) { + self.watch_key = ::std::option::Option::None; + } + + pub fn has_watch_key(&self) -> bool { + self.watch_key.is_some() + } + + // Param is passed by value, moved + pub fn set_watch_key(&mut self, v: ::std::vec::Vec) { + self.watch_key = ::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_watch_key(&mut self) -> &mut ::std::vec::Vec { + if self.watch_key.is_none() { + self.watch_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.watch_key.as_mut().unwrap() + } + + // Take field + pub fn take_watch_key(&mut self) -> ::std::vec::Vec { + self.watch_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes address = 2; + + 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) { + 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 { + 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 { + self.address.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::<_, _>( + "watch_key", + |m: &MoneroWatchKey| { &m.watch_key }, + |m: &mut MoneroWatchKey| { &mut m.watch_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &MoneroWatchKey| { &m.address }, + |m: &mut MoneroWatchKey| { &mut m.address }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroWatchKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroWatchKey { + const NAME: &'static str = "MoneroWatchKey"; + + 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.watch_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.address = ::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.watch_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.address.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.watch_key.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.address.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() -> MoneroWatchKey { + MoneroWatchKey::new() + } + + fn clear(&mut self) { + self.watch_key = ::std::option::Option::None; + self.address = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroWatchKey { + static instance: MoneroWatchKey = MoneroWatchKey { + watch_key: ::std::option::Option::None, + address: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroWatchKey { + 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("MoneroWatchKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroWatchKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroWatchKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionInitRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionInitRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.version) + pub version: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.network_type) + pub network_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.tsx_data) + pub tsx_data: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionInitRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionInitRequest { + fn default() -> &'a MoneroTransactionInitRequest { + ::default_instance() + } +} + +impl MoneroTransactionInitRequest { + pub fn new() -> MoneroTransactionInitRequest { + ::std::default::Default::default() + } + + // optional uint32 version = 1; + + pub fn version(&self) -> u32 { + self.version.unwrap_or(0) + } + + pub fn clear_version(&mut self) { + self.version = ::std::option::Option::None; + } + + pub fn has_version(&self) -> bool { + self.version.is_some() + } + + // Param is passed by value, moved + pub fn set_version(&mut self, v: u32) { + self.version = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.monero.MoneroNetworkType network_type = 3; + + pub fn network_type(&self) -> MoneroNetworkType { + match self.network_type { + Some(e) => e.enum_value_or(MoneroNetworkType::MAINNET), + None => MoneroNetworkType::MAINNET, + } + } + + pub fn clear_network_type(&mut self) { + self.network_type = ::std::option::Option::None; + } + + pub fn has_network_type(&self) -> bool { + self.network_type.is_some() + } + + // Param is passed by value, moved + pub fn set_network_type(&mut self, v: MoneroNetworkType) { + self.network_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + 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::<_, _>( + "version", + |m: &MoneroTransactionInitRequest| { &m.version }, + |m: &mut MoneroTransactionInitRequest| { &mut m.version }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &MoneroTransactionInitRequest| { &m.address_n }, + |m: &mut MoneroTransactionInitRequest| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "network_type", + |m: &MoneroTransactionInitRequest| { &m.network_type }, + |m: &mut MoneroTransactionInitRequest| { &mut m.network_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, monero_transaction_init_request::MoneroTransactionData>( + "tsx_data", + |m: &MoneroTransactionInitRequest| { &m.tsx_data }, + |m: &mut MoneroTransactionInitRequest| { &mut m.tsx_data }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionInitRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionInitRequest { + const NAME: &'static str = "MoneroTransactionInitRequest"; + + 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 { + 8 => { + self.version = ::std::option::Option::Some(is.read_uint32()?); + }, + 18 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 16 => { + self.address_n.push(is.read_uint32()?); + }, + 24 => { + self.network_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 34 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.tsx_data)?; + }, + 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.version { + my_size += ::protobuf::rt::uint32_size(1, v); + } + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(2, *value); + }; + if let Some(v) = self.network_type { + my_size += ::protobuf::rt::int32_size(3, v.value()); + } + if let Some(v) = self.tsx_data.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.version { + os.write_uint32(1, v)?; + } + for v in &self.address_n { + os.write_uint32(2, *v)?; + }; + if let Some(v) = self.network_type { + os.write_enum(3, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.tsx_data.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + } + 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() -> MoneroTransactionInitRequest { + MoneroTransactionInitRequest::new() + } + + fn clear(&mut self) { + self.version = ::std::option::Option::None; + self.address_n.clear(); + self.network_type = ::std::option::Option::None; + self.tsx_data.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionInitRequest { + static instance: MoneroTransactionInitRequest = MoneroTransactionInitRequest { + version: ::std::option::Option::None, + address_n: ::std::vec::Vec::new(), + network_type: ::std::option::Option::None, + tsx_data: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionInitRequest { + 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("MoneroTransactionInitRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionInitRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionInitRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `MoneroTransactionInitRequest` +pub mod monero_transaction_init_request { + // @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct MoneroTransactionData { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.version) + pub version: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.payment_id) + pub payment_id: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.unlock_time) + pub unlock_time: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.outputs) + pub outputs: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.change_dts) + pub change_dts: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.num_inputs) + pub num_inputs: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.mixin) + pub mixin: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.fee) + pub fee: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.account) + pub account: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.minor_indices) + pub minor_indices: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.rsig_data) + pub rsig_data: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.integrated_indices) + pub integrated_indices: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.client_version) + pub client_version: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.hard_fork) + pub hard_fork: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.monero_version) + pub monero_version: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionInitRequest.MoneroTransactionData.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a MoneroTransactionData { + fn default() -> &'a MoneroTransactionData { + ::default_instance() + } + } + + impl MoneroTransactionData { + pub fn new() -> MoneroTransactionData { + ::std::default::Default::default() + } + + // optional uint32 version = 1; + + pub fn version(&self) -> u32 { + self.version.unwrap_or(0) + } + + pub fn clear_version(&mut self) { + self.version = ::std::option::Option::None; + } + + pub fn has_version(&self) -> bool { + self.version.is_some() + } + + // Param is passed by value, moved + pub fn set_version(&mut self, v: u32) { + self.version = ::std::option::Option::Some(v); + } + + // optional bytes payment_id = 2; + + pub fn payment_id(&self) -> &[u8] { + match self.payment_id.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_payment_id(&mut self) { + self.payment_id = ::std::option::Option::None; + } + + pub fn has_payment_id(&self) -> bool { + self.payment_id.is_some() + } + + // Param is passed by value, moved + pub fn set_payment_id(&mut self, v: ::std::vec::Vec) { + self.payment_id = ::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_payment_id(&mut self) -> &mut ::std::vec::Vec { + if self.payment_id.is_none() { + self.payment_id = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.payment_id.as_mut().unwrap() + } + + // Take field + pub fn take_payment_id(&mut self) -> ::std::vec::Vec { + self.payment_id.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint64 unlock_time = 3; + + pub fn unlock_time(&self) -> u64 { + self.unlock_time.unwrap_or(0) + } + + pub fn clear_unlock_time(&mut self) { + self.unlock_time = ::std::option::Option::None; + } + + pub fn has_unlock_time(&self) -> bool { + self.unlock_time.is_some() + } + + // Param is passed by value, moved + pub fn set_unlock_time(&mut self, v: u64) { + self.unlock_time = ::std::option::Option::Some(v); + } + + // optional uint32 num_inputs = 6; + + pub fn num_inputs(&self) -> u32 { + self.num_inputs.unwrap_or(0) + } + + pub fn clear_num_inputs(&mut self) { + self.num_inputs = ::std::option::Option::None; + } + + pub fn has_num_inputs(&self) -> bool { + self.num_inputs.is_some() + } + + // Param is passed by value, moved + pub fn set_num_inputs(&mut self, v: u32) { + self.num_inputs = ::std::option::Option::Some(v); + } + + // optional uint32 mixin = 7; + + pub fn mixin(&self) -> u32 { + self.mixin.unwrap_or(0) + } + + pub fn clear_mixin(&mut self) { + self.mixin = ::std::option::Option::None; + } + + pub fn has_mixin(&self) -> bool { + self.mixin.is_some() + } + + // Param is passed by value, moved + pub fn set_mixin(&mut self, v: u32) { + self.mixin = ::std::option::Option::Some(v); + } + + // optional uint64 fee = 8; + + pub fn fee(&self) -> u64 { + self.fee.unwrap_or(0) + } + + pub fn clear_fee(&mut self) { + self.fee = ::std::option::Option::None; + } + + pub fn has_fee(&self) -> bool { + self.fee.is_some() + } + + // Param is passed by value, moved + pub fn set_fee(&mut self, v: u64) { + self.fee = ::std::option::Option::Some(v); + } + + // optional uint32 account = 9; + + pub fn account(&self) -> u32 { + self.account.unwrap_or(0) + } + + pub fn clear_account(&mut self) { + self.account = ::std::option::Option::None; + } + + pub fn has_account(&self) -> bool { + self.account.is_some() + } + + // Param is passed by value, moved + pub fn set_account(&mut self, v: u32) { + self.account = ::std::option::Option::Some(v); + } + + // optional uint32 client_version = 13; + + pub fn client_version(&self) -> u32 { + self.client_version.unwrap_or(0) + } + + pub fn clear_client_version(&mut self) { + self.client_version = ::std::option::Option::None; + } + + pub fn has_client_version(&self) -> bool { + self.client_version.is_some() + } + + // Param is passed by value, moved + pub fn set_client_version(&mut self, v: u32) { + self.client_version = ::std::option::Option::Some(v); + } + + // optional uint32 hard_fork = 14; + + pub fn hard_fork(&self) -> u32 { + self.hard_fork.unwrap_or(0) + } + + pub fn clear_hard_fork(&mut self) { + self.hard_fork = ::std::option::Option::None; + } + + pub fn has_hard_fork(&self) -> bool { + self.hard_fork.is_some() + } + + // Param is passed by value, moved + pub fn set_hard_fork(&mut self, v: u32) { + self.hard_fork = ::std::option::Option::Some(v); + } + + // optional bytes monero_version = 15; + + pub fn monero_version(&self) -> &[u8] { + match self.monero_version.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_monero_version(&mut self) { + self.monero_version = ::std::option::Option::None; + } + + pub fn has_monero_version(&self) -> bool { + self.monero_version.is_some() + } + + // Param is passed by value, moved + pub fn set_monero_version(&mut self, v: ::std::vec::Vec) { + self.monero_version = ::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_monero_version(&mut self) -> &mut ::std::vec::Vec { + if self.monero_version.is_none() { + self.monero_version = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.monero_version.as_mut().unwrap() + } + + // Take field + pub fn take_monero_version(&mut self) -> ::std::vec::Vec { + self.monero_version.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool chunkify = 16; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(16); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "version", + |m: &MoneroTransactionData| { &m.version }, + |m: &mut MoneroTransactionData| { &mut m.version }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "payment_id", + |m: &MoneroTransactionData| { &m.payment_id }, + |m: &mut MoneroTransactionData| { &mut m.payment_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "unlock_time", + |m: &MoneroTransactionData| { &m.unlock_time }, + |m: &mut MoneroTransactionData| { &mut m.unlock_time }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "outputs", + |m: &MoneroTransactionData| { &m.outputs }, + |m: &mut MoneroTransactionData| { &mut m.outputs }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::MoneroTransactionDestinationEntry>( + "change_dts", + |m: &MoneroTransactionData| { &m.change_dts }, + |m: &mut MoneroTransactionData| { &mut m.change_dts }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "num_inputs", + |m: &MoneroTransactionData| { &m.num_inputs }, + |m: &mut MoneroTransactionData| { &mut m.num_inputs }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "mixin", + |m: &MoneroTransactionData| { &m.mixin }, + |m: &mut MoneroTransactionData| { &mut m.mixin }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fee", + |m: &MoneroTransactionData| { &m.fee }, + |m: &mut MoneroTransactionData| { &mut m.fee }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "account", + |m: &MoneroTransactionData| { &m.account }, + |m: &mut MoneroTransactionData| { &mut m.account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "minor_indices", + |m: &MoneroTransactionData| { &m.minor_indices }, + |m: &mut MoneroTransactionData| { &mut m.minor_indices }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::MoneroTransactionRsigData>( + "rsig_data", + |m: &MoneroTransactionData| { &m.rsig_data }, + |m: &mut MoneroTransactionData| { &mut m.rsig_data }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "integrated_indices", + |m: &MoneroTransactionData| { &m.integrated_indices }, + |m: &mut MoneroTransactionData| { &mut m.integrated_indices }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "client_version", + |m: &MoneroTransactionData| { &m.client_version }, + |m: &mut MoneroTransactionData| { &mut m.client_version }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "hard_fork", + |m: &MoneroTransactionData| { &m.hard_fork }, + |m: &mut MoneroTransactionData| { &mut m.hard_fork }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "monero_version", + |m: &MoneroTransactionData| { &m.monero_version }, + |m: &mut MoneroTransactionData| { &mut m.monero_version }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &MoneroTransactionData| { &m.chunkify }, + |m: &mut MoneroTransactionData| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionInitRequest.MoneroTransactionData", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for MoneroTransactionData { + const NAME: &'static str = "MoneroTransactionData"; + + 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 { + 8 => { + self.version = ::std::option::Option::Some(is.read_uint32()?); + }, + 18 => { + self.payment_id = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.unlock_time = ::std::option::Option::Some(is.read_uint64()?); + }, + 34 => { + self.outputs.push(is.read_message()?); + }, + 42 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.change_dts)?; + }, + 48 => { + self.num_inputs = ::std::option::Option::Some(is.read_uint32()?); + }, + 56 => { + self.mixin = ::std::option::Option::Some(is.read_uint32()?); + }, + 64 => { + self.fee = ::std::option::Option::Some(is.read_uint64()?); + }, + 72 => { + self.account = ::std::option::Option::Some(is.read_uint32()?); + }, + 82 => { + is.read_repeated_packed_uint32_into(&mut self.minor_indices)?; + }, + 80 => { + self.minor_indices.push(is.read_uint32()?); + }, + 90 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.rsig_data)?; + }, + 98 => { + is.read_repeated_packed_uint32_into(&mut self.integrated_indices)?; + }, + 96 => { + self.integrated_indices.push(is.read_uint32()?); + }, + 104 => { + self.client_version = ::std::option::Option::Some(is.read_uint32()?); + }, + 112 => { + self.hard_fork = ::std::option::Option::Some(is.read_uint32()?); + }, + 122 => { + self.monero_version = ::std::option::Option::Some(is.read_bytes()?); + }, + 128 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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.version { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.payment_id.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.unlock_time { + my_size += ::protobuf::rt::uint64_size(3, v); + } + for value in &self.outputs { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + if let Some(v) = self.change_dts.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.num_inputs { + my_size += ::protobuf::rt::uint32_size(6, v); + } + if let Some(v) = self.mixin { + my_size += ::protobuf::rt::uint32_size(7, v); + } + if let Some(v) = self.fee { + my_size += ::protobuf::rt::uint64_size(8, v); + } + if let Some(v) = self.account { + my_size += ::protobuf::rt::uint32_size(9, v); + } + for value in &self.minor_indices { + my_size += ::protobuf::rt::uint32_size(10, *value); + }; + if let Some(v) = self.rsig_data.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + for value in &self.integrated_indices { + my_size += ::protobuf::rt::uint32_size(12, *value); + }; + if let Some(v) = self.client_version { + my_size += ::protobuf::rt::uint32_size(13, v); + } + if let Some(v) = self.hard_fork { + my_size += ::protobuf::rt::uint32_size(14, v); + } + if let Some(v) = self.monero_version.as_ref() { + my_size += ::protobuf::rt::bytes_size(15, &v); + } + if let Some(v) = self.chunkify { + my_size += 2 + 1; + } + 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.version { + os.write_uint32(1, v)?; + } + if let Some(v) = self.payment_id.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.unlock_time { + os.write_uint64(3, v)?; + } + for v in &self.outputs { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + }; + if let Some(v) = self.change_dts.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + } + if let Some(v) = self.num_inputs { + os.write_uint32(6, v)?; + } + if let Some(v) = self.mixin { + os.write_uint32(7, v)?; + } + if let Some(v) = self.fee { + os.write_uint64(8, v)?; + } + if let Some(v) = self.account { + os.write_uint32(9, v)?; + } + for v in &self.minor_indices { + os.write_uint32(10, *v)?; + }; + if let Some(v) = self.rsig_data.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(11, v, os)?; + } + for v in &self.integrated_indices { + os.write_uint32(12, *v)?; + }; + if let Some(v) = self.client_version { + os.write_uint32(13, v)?; + } + if let Some(v) = self.hard_fork { + os.write_uint32(14, v)?; + } + if let Some(v) = self.monero_version.as_ref() { + os.write_bytes(15, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(16, 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() -> MoneroTransactionData { + MoneroTransactionData::new() + } + + fn clear(&mut self) { + self.version = ::std::option::Option::None; + self.payment_id = ::std::option::Option::None; + self.unlock_time = ::std::option::Option::None; + self.outputs.clear(); + self.change_dts.clear(); + self.num_inputs = ::std::option::Option::None; + self.mixin = ::std::option::Option::None; + self.fee = ::std::option::Option::None; + self.account = ::std::option::Option::None; + self.minor_indices.clear(); + self.rsig_data.clear(); + self.integrated_indices.clear(); + self.client_version = ::std::option::Option::None; + self.hard_fork = ::std::option::Option::None; + self.monero_version = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionData { + static instance: MoneroTransactionData = MoneroTransactionData { + version: ::std::option::Option::None, + payment_id: ::std::option::Option::None, + unlock_time: ::std::option::Option::None, + outputs: ::std::vec::Vec::new(), + change_dts: ::protobuf::MessageField::none(), + num_inputs: ::std::option::Option::None, + mixin: ::std::option::Option::None, + fee: ::std::option::Option::None, + account: ::std::option::Option::None, + minor_indices: ::std::vec::Vec::new(), + rsig_data: ::protobuf::MessageField::none(), + integrated_indices: ::std::vec::Vec::new(), + client_version: ::std::option::Option::None, + hard_fork: ::std::option::Option::None, + monero_version: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for MoneroTransactionData { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("MoneroTransactionInitRequest.MoneroTransactionData").unwrap()).clone() + } + } + + impl ::std::fmt::Display for MoneroTransactionData { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for MoneroTransactionData { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionInitAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionInitAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitAck.hmacs) + pub hmacs: ::std::vec::Vec<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInitAck.rsig_data) + pub rsig_data: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionInitAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionInitAck { + fn default() -> &'a MoneroTransactionInitAck { + ::default_instance() + } +} + +impl MoneroTransactionInitAck { + pub fn new() -> MoneroTransactionInitAck { + ::std::default::Default::default() + } + + 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_vec_simpler_accessor::<_, _>( + "hmacs", + |m: &MoneroTransactionInitAck| { &m.hmacs }, + |m: &mut MoneroTransactionInitAck| { &mut m.hmacs }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, MoneroTransactionRsigData>( + "rsig_data", + |m: &MoneroTransactionInitAck| { &m.rsig_data }, + |m: &mut MoneroTransactionInitAck| { &mut m.rsig_data }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionInitAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionInitAck { + const NAME: &'static str = "MoneroTransactionInitAck"; + + 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.hmacs.push(is.read_bytes()?); + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.rsig_data)?; + }, + 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; + for value in &self.hmacs { + my_size += ::protobuf::rt::bytes_size(1, &value); + }; + if let Some(v) = self.rsig_data.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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<()> { + for v in &self.hmacs { + os.write_bytes(1, &v)?; + }; + if let Some(v) = self.rsig_data.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + 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() -> MoneroTransactionInitAck { + MoneroTransactionInitAck::new() + } + + fn clear(&mut self) { + self.hmacs.clear(); + self.rsig_data.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionInitAck { + static instance: MoneroTransactionInitAck = MoneroTransactionInitAck { + hmacs: ::std::vec::Vec::new(), + rsig_data: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionInitAck { + 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("MoneroTransactionInitAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionInitAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionInitAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionSetInputRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionSetInputRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSetInputRequest.src_entr) + pub src_entr: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionSetInputRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionSetInputRequest { + fn default() -> &'a MoneroTransactionSetInputRequest { + ::default_instance() + } +} + +impl MoneroTransactionSetInputRequest { + pub fn new() -> MoneroTransactionSetInputRequest { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, MoneroTransactionSourceEntry>( + "src_entr", + |m: &MoneroTransactionSetInputRequest| { &m.src_entr }, + |m: &mut MoneroTransactionSetInputRequest| { &mut m.src_entr }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionSetInputRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionSetInputRequest { + const NAME: &'static str = "MoneroTransactionSetInputRequest"; + + fn is_initialized(&self) -> bool { + for v in &self.src_entr { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.src_entr)?; + }, + 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.src_entr.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.src_entr.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + 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() -> MoneroTransactionSetInputRequest { + MoneroTransactionSetInputRequest::new() + } + + fn clear(&mut self) { + self.src_entr.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionSetInputRequest { + static instance: MoneroTransactionSetInputRequest = MoneroTransactionSetInputRequest { + src_entr: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionSetInputRequest { + 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("MoneroTransactionSetInputRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionSetInputRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionSetInputRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionSetInputAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionSetInputAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSetInputAck.vini) + pub vini: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSetInputAck.vini_hmac) + pub vini_hmac: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSetInputAck.pseudo_out) + pub pseudo_out: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSetInputAck.pseudo_out_hmac) + pub pseudo_out_hmac: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSetInputAck.pseudo_out_alpha) + pub pseudo_out_alpha: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSetInputAck.spend_key) + pub spend_key: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionSetInputAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionSetInputAck { + fn default() -> &'a MoneroTransactionSetInputAck { + ::default_instance() + } +} + +impl MoneroTransactionSetInputAck { + pub fn new() -> MoneroTransactionSetInputAck { + ::std::default::Default::default() + } + + // optional bytes vini = 1; + + pub fn vini(&self) -> &[u8] { + match self.vini.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_vini(&mut self) { + self.vini = ::std::option::Option::None; + } + + pub fn has_vini(&self) -> bool { + self.vini.is_some() + } + + // Param is passed by value, moved + pub fn set_vini(&mut self, v: ::std::vec::Vec) { + self.vini = ::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_vini(&mut self) -> &mut ::std::vec::Vec { + if self.vini.is_none() { + self.vini = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.vini.as_mut().unwrap() + } + + // Take field + pub fn take_vini(&mut self) -> ::std::vec::Vec { + self.vini.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes vini_hmac = 2; + + pub fn vini_hmac(&self) -> &[u8] { + match self.vini_hmac.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_vini_hmac(&mut self) { + self.vini_hmac = ::std::option::Option::None; + } + + pub fn has_vini_hmac(&self) -> bool { + self.vini_hmac.is_some() + } + + // Param is passed by value, moved + pub fn set_vini_hmac(&mut self, v: ::std::vec::Vec) { + self.vini_hmac = ::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_vini_hmac(&mut self) -> &mut ::std::vec::Vec { + if self.vini_hmac.is_none() { + self.vini_hmac = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.vini_hmac.as_mut().unwrap() + } + + // Take field + pub fn take_vini_hmac(&mut self) -> ::std::vec::Vec { + self.vini_hmac.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes pseudo_out = 3; + + pub fn pseudo_out(&self) -> &[u8] { + match self.pseudo_out.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_pseudo_out(&mut self) { + self.pseudo_out = ::std::option::Option::None; + } + + pub fn has_pseudo_out(&self) -> bool { + self.pseudo_out.is_some() + } + + // Param is passed by value, moved + pub fn set_pseudo_out(&mut self, v: ::std::vec::Vec) { + self.pseudo_out = ::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_pseudo_out(&mut self) -> &mut ::std::vec::Vec { + if self.pseudo_out.is_none() { + self.pseudo_out = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.pseudo_out.as_mut().unwrap() + } + + // Take field + pub fn take_pseudo_out(&mut self) -> ::std::vec::Vec { + self.pseudo_out.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes pseudo_out_hmac = 4; + + pub fn pseudo_out_hmac(&self) -> &[u8] { + match self.pseudo_out_hmac.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_pseudo_out_hmac(&mut self) { + self.pseudo_out_hmac = ::std::option::Option::None; + } + + pub fn has_pseudo_out_hmac(&self) -> bool { + self.pseudo_out_hmac.is_some() + } + + // Param is passed by value, moved + pub fn set_pseudo_out_hmac(&mut self, v: ::std::vec::Vec) { + self.pseudo_out_hmac = ::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_pseudo_out_hmac(&mut self) -> &mut ::std::vec::Vec { + if self.pseudo_out_hmac.is_none() { + self.pseudo_out_hmac = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.pseudo_out_hmac.as_mut().unwrap() + } + + // Take field + pub fn take_pseudo_out_hmac(&mut self) -> ::std::vec::Vec { + self.pseudo_out_hmac.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes pseudo_out_alpha = 5; + + pub fn pseudo_out_alpha(&self) -> &[u8] { + match self.pseudo_out_alpha.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_pseudo_out_alpha(&mut self) { + self.pseudo_out_alpha = ::std::option::Option::None; + } + + pub fn has_pseudo_out_alpha(&self) -> bool { + self.pseudo_out_alpha.is_some() + } + + // Param is passed by value, moved + pub fn set_pseudo_out_alpha(&mut self, v: ::std::vec::Vec) { + self.pseudo_out_alpha = ::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_pseudo_out_alpha(&mut self) -> &mut ::std::vec::Vec { + if self.pseudo_out_alpha.is_none() { + self.pseudo_out_alpha = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.pseudo_out_alpha.as_mut().unwrap() + } + + // Take field + pub fn take_pseudo_out_alpha(&mut self) -> ::std::vec::Vec { + self.pseudo_out_alpha.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes spend_key = 6; + + pub fn spend_key(&self) -> &[u8] { + match self.spend_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_spend_key(&mut self) { + self.spend_key = ::std::option::Option::None; + } + + pub fn has_spend_key(&self) -> bool { + self.spend_key.is_some() + } + + // Param is passed by value, moved + pub fn set_spend_key(&mut self, v: ::std::vec::Vec) { + self.spend_key = ::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_spend_key(&mut self) -> &mut ::std::vec::Vec { + if self.spend_key.is_none() { + self.spend_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.spend_key.as_mut().unwrap() + } + + // Take field + pub fn take_spend_key(&mut self) -> ::std::vec::Vec { + self.spend_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "vini", + |m: &MoneroTransactionSetInputAck| { &m.vini }, + |m: &mut MoneroTransactionSetInputAck| { &mut m.vini }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "vini_hmac", + |m: &MoneroTransactionSetInputAck| { &m.vini_hmac }, + |m: &mut MoneroTransactionSetInputAck| { &mut m.vini_hmac }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pseudo_out", + |m: &MoneroTransactionSetInputAck| { &m.pseudo_out }, + |m: &mut MoneroTransactionSetInputAck| { &mut m.pseudo_out }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pseudo_out_hmac", + |m: &MoneroTransactionSetInputAck| { &m.pseudo_out_hmac }, + |m: &mut MoneroTransactionSetInputAck| { &mut m.pseudo_out_hmac }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pseudo_out_alpha", + |m: &MoneroTransactionSetInputAck| { &m.pseudo_out_alpha }, + |m: &mut MoneroTransactionSetInputAck| { &mut m.pseudo_out_alpha }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "spend_key", + |m: &MoneroTransactionSetInputAck| { &m.spend_key }, + |m: &mut MoneroTransactionSetInputAck| { &mut m.spend_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionSetInputAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionSetInputAck { + const NAME: &'static str = "MoneroTransactionSetInputAck"; + + 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.vini = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.vini_hmac = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.pseudo_out = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.pseudo_out_hmac = ::std::option::Option::Some(is.read_bytes()?); + }, + 42 => { + self.pseudo_out_alpha = ::std::option::Option::Some(is.read_bytes()?); + }, + 50 => { + self.spend_key = ::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.vini.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.vini_hmac.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.pseudo_out.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.pseudo_out_hmac.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.pseudo_out_alpha.as_ref() { + my_size += ::protobuf::rt::bytes_size(5, &v); + } + if let Some(v) = self.spend_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &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.vini.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.vini_hmac.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.pseudo_out.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.pseudo_out_hmac.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.pseudo_out_alpha.as_ref() { + os.write_bytes(5, v)?; + } + if let Some(v) = self.spend_key.as_ref() { + os.write_bytes(6, 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() -> MoneroTransactionSetInputAck { + MoneroTransactionSetInputAck::new() + } + + fn clear(&mut self) { + self.vini = ::std::option::Option::None; + self.vini_hmac = ::std::option::Option::None; + self.pseudo_out = ::std::option::Option::None; + self.pseudo_out_hmac = ::std::option::Option::None; + self.pseudo_out_alpha = ::std::option::Option::None; + self.spend_key = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionSetInputAck { + static instance: MoneroTransactionSetInputAck = MoneroTransactionSetInputAck { + vini: ::std::option::Option::None, + vini_hmac: ::std::option::Option::None, + pseudo_out: ::std::option::Option::None, + pseudo_out_hmac: ::std::option::Option::None, + pseudo_out_alpha: ::std::option::Option::None, + spend_key: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionSetInputAck { + 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("MoneroTransactionSetInputAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionSetInputAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionSetInputAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionInputViniRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionInputViniRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInputViniRequest.src_entr) + pub src_entr: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInputViniRequest.vini) + pub vini: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInputViniRequest.vini_hmac) + pub vini_hmac: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInputViniRequest.pseudo_out) + pub pseudo_out: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInputViniRequest.pseudo_out_hmac) + pub pseudo_out_hmac: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionInputViniRequest.orig_idx) + pub orig_idx: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionInputViniRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionInputViniRequest { + fn default() -> &'a MoneroTransactionInputViniRequest { + ::default_instance() + } +} + +impl MoneroTransactionInputViniRequest { + pub fn new() -> MoneroTransactionInputViniRequest { + ::std::default::Default::default() + } + + // optional bytes vini = 2; + + pub fn vini(&self) -> &[u8] { + match self.vini.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_vini(&mut self) { + self.vini = ::std::option::Option::None; + } + + pub fn has_vini(&self) -> bool { + self.vini.is_some() + } + + // Param is passed by value, moved + pub fn set_vini(&mut self, v: ::std::vec::Vec) { + self.vini = ::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_vini(&mut self) -> &mut ::std::vec::Vec { + if self.vini.is_none() { + self.vini = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.vini.as_mut().unwrap() + } + + // Take field + pub fn take_vini(&mut self) -> ::std::vec::Vec { + self.vini.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes vini_hmac = 3; + + pub fn vini_hmac(&self) -> &[u8] { + match self.vini_hmac.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_vini_hmac(&mut self) { + self.vini_hmac = ::std::option::Option::None; + } + + pub fn has_vini_hmac(&self) -> bool { + self.vini_hmac.is_some() + } + + // Param is passed by value, moved + pub fn set_vini_hmac(&mut self, v: ::std::vec::Vec) { + self.vini_hmac = ::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_vini_hmac(&mut self) -> &mut ::std::vec::Vec { + if self.vini_hmac.is_none() { + self.vini_hmac = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.vini_hmac.as_mut().unwrap() + } + + // Take field + pub fn take_vini_hmac(&mut self) -> ::std::vec::Vec { + self.vini_hmac.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes pseudo_out = 4; + + pub fn pseudo_out(&self) -> &[u8] { + match self.pseudo_out.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_pseudo_out(&mut self) { + self.pseudo_out = ::std::option::Option::None; + } + + pub fn has_pseudo_out(&self) -> bool { + self.pseudo_out.is_some() + } + + // Param is passed by value, moved + pub fn set_pseudo_out(&mut self, v: ::std::vec::Vec) { + self.pseudo_out = ::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_pseudo_out(&mut self) -> &mut ::std::vec::Vec { + if self.pseudo_out.is_none() { + self.pseudo_out = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.pseudo_out.as_mut().unwrap() + } + + // Take field + pub fn take_pseudo_out(&mut self) -> ::std::vec::Vec { + self.pseudo_out.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes pseudo_out_hmac = 5; + + pub fn pseudo_out_hmac(&self) -> &[u8] { + match self.pseudo_out_hmac.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_pseudo_out_hmac(&mut self) { + self.pseudo_out_hmac = ::std::option::Option::None; + } + + pub fn has_pseudo_out_hmac(&self) -> bool { + self.pseudo_out_hmac.is_some() + } + + // Param is passed by value, moved + pub fn set_pseudo_out_hmac(&mut self, v: ::std::vec::Vec) { + self.pseudo_out_hmac = ::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_pseudo_out_hmac(&mut self) -> &mut ::std::vec::Vec { + if self.pseudo_out_hmac.is_none() { + self.pseudo_out_hmac = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.pseudo_out_hmac.as_mut().unwrap() + } + + // Take field + pub fn take_pseudo_out_hmac(&mut self) -> ::std::vec::Vec { + self.pseudo_out_hmac.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 orig_idx = 6; + + pub fn orig_idx(&self) -> u32 { + self.orig_idx.unwrap_or(0) + } + + pub fn clear_orig_idx(&mut self) { + self.orig_idx = ::std::option::Option::None; + } + + pub fn has_orig_idx(&self) -> bool { + self.orig_idx.is_some() + } + + // Param is passed by value, moved + pub fn set_orig_idx(&mut self, v: u32) { + self.orig_idx = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, MoneroTransactionSourceEntry>( + "src_entr", + |m: &MoneroTransactionInputViniRequest| { &m.src_entr }, + |m: &mut MoneroTransactionInputViniRequest| { &mut m.src_entr }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "vini", + |m: &MoneroTransactionInputViniRequest| { &m.vini }, + |m: &mut MoneroTransactionInputViniRequest| { &mut m.vini }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "vini_hmac", + |m: &MoneroTransactionInputViniRequest| { &m.vini_hmac }, + |m: &mut MoneroTransactionInputViniRequest| { &mut m.vini_hmac }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pseudo_out", + |m: &MoneroTransactionInputViniRequest| { &m.pseudo_out }, + |m: &mut MoneroTransactionInputViniRequest| { &mut m.pseudo_out }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pseudo_out_hmac", + |m: &MoneroTransactionInputViniRequest| { &m.pseudo_out_hmac }, + |m: &mut MoneroTransactionInputViniRequest| { &mut m.pseudo_out_hmac }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "orig_idx", + |m: &MoneroTransactionInputViniRequest| { &m.orig_idx }, + |m: &mut MoneroTransactionInputViniRequest| { &mut m.orig_idx }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionInputViniRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionInputViniRequest { + const NAME: &'static str = "MoneroTransactionInputViniRequest"; + + fn is_initialized(&self) -> bool { + for v in &self.src_entr { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.src_entr)?; + }, + 18 => { + self.vini = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.vini_hmac = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.pseudo_out = ::std::option::Option::Some(is.read_bytes()?); + }, + 42 => { + self.pseudo_out_hmac = ::std::option::Option::Some(is.read_bytes()?); + }, + 48 => { + self.orig_idx = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.src_entr.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.vini.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.vini_hmac.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.pseudo_out.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.pseudo_out_hmac.as_ref() { + my_size += ::protobuf::rt::bytes_size(5, &v); + } + if let Some(v) = self.orig_idx { + my_size += ::protobuf::rt::uint32_size(6, 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.src_entr.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.vini.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.vini_hmac.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.pseudo_out.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.pseudo_out_hmac.as_ref() { + os.write_bytes(5, v)?; + } + if let Some(v) = self.orig_idx { + os.write_uint32(6, 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() -> MoneroTransactionInputViniRequest { + MoneroTransactionInputViniRequest::new() + } + + fn clear(&mut self) { + self.src_entr.clear(); + self.vini = ::std::option::Option::None; + self.vini_hmac = ::std::option::Option::None; + self.pseudo_out = ::std::option::Option::None; + self.pseudo_out_hmac = ::std::option::Option::None; + self.orig_idx = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionInputViniRequest { + static instance: MoneroTransactionInputViniRequest = MoneroTransactionInputViniRequest { + src_entr: ::protobuf::MessageField::none(), + vini: ::std::option::Option::None, + vini_hmac: ::std::option::Option::None, + pseudo_out: ::std::option::Option::None, + pseudo_out_hmac: ::std::option::Option::None, + orig_idx: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionInputViniRequest { + 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("MoneroTransactionInputViniRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionInputViniRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionInputViniRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionInputViniAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionInputViniAck { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionInputViniAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionInputViniAck { + fn default() -> &'a MoneroTransactionInputViniAck { + ::default_instance() + } +} + +impl MoneroTransactionInputViniAck { + pub fn new() -> MoneroTransactionInputViniAck { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionInputViniAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionInputViniAck { + const NAME: &'static str = "MoneroTransactionInputViniAck"; + + 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 { + 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; + 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<()> { + 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() -> MoneroTransactionInputViniAck { + MoneroTransactionInputViniAck::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionInputViniAck { + static instance: MoneroTransactionInputViniAck = MoneroTransactionInputViniAck { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionInputViniAck { + 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("MoneroTransactionInputViniAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionInputViniAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionInputViniAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionAllInputsSetRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionAllInputsSetRequest { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionAllInputsSetRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionAllInputsSetRequest { + fn default() -> &'a MoneroTransactionAllInputsSetRequest { + ::default_instance() + } +} + +impl MoneroTransactionAllInputsSetRequest { + pub fn new() -> MoneroTransactionAllInputsSetRequest { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionAllInputsSetRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionAllInputsSetRequest { + const NAME: &'static str = "MoneroTransactionAllInputsSetRequest"; + + 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 { + 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; + 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<()> { + 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() -> MoneroTransactionAllInputsSetRequest { + MoneroTransactionAllInputsSetRequest::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionAllInputsSetRequest { + static instance: MoneroTransactionAllInputsSetRequest = MoneroTransactionAllInputsSetRequest { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionAllInputsSetRequest { + 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("MoneroTransactionAllInputsSetRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionAllInputsSetRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionAllInputsSetRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionAllInputsSetAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionAllInputsSetAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionAllInputsSetAck.rsig_data) + pub rsig_data: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionAllInputsSetAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionAllInputsSetAck { + fn default() -> &'a MoneroTransactionAllInputsSetAck { + ::default_instance() + } +} + +impl MoneroTransactionAllInputsSetAck { + pub fn new() -> MoneroTransactionAllInputsSetAck { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, MoneroTransactionRsigData>( + "rsig_data", + |m: &MoneroTransactionAllInputsSetAck| { &m.rsig_data }, + |m: &mut MoneroTransactionAllInputsSetAck| { &mut m.rsig_data }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionAllInputsSetAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionAllInputsSetAck { + const NAME: &'static str = "MoneroTransactionAllInputsSetAck"; + + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.rsig_data)?; + }, + 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.rsig_data.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.rsig_data.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + 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() -> MoneroTransactionAllInputsSetAck { + MoneroTransactionAllInputsSetAck::new() + } + + fn clear(&mut self) { + self.rsig_data.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionAllInputsSetAck { + static instance: MoneroTransactionAllInputsSetAck = MoneroTransactionAllInputsSetAck { + rsig_data: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionAllInputsSetAck { + 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("MoneroTransactionAllInputsSetAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionAllInputsSetAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionAllInputsSetAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionSetOutputRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionSetOutputRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSetOutputRequest.dst_entr) + pub dst_entr: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSetOutputRequest.dst_entr_hmac) + pub dst_entr_hmac: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSetOutputRequest.rsig_data) + pub rsig_data: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSetOutputRequest.is_offloaded_bp) + pub is_offloaded_bp: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionSetOutputRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionSetOutputRequest { + fn default() -> &'a MoneroTransactionSetOutputRequest { + ::default_instance() + } +} + +impl MoneroTransactionSetOutputRequest { + pub fn new() -> MoneroTransactionSetOutputRequest { + ::std::default::Default::default() + } + + // optional bytes dst_entr_hmac = 2; + + pub fn dst_entr_hmac(&self) -> &[u8] { + match self.dst_entr_hmac.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_dst_entr_hmac(&mut self) { + self.dst_entr_hmac = ::std::option::Option::None; + } + + pub fn has_dst_entr_hmac(&self) -> bool { + self.dst_entr_hmac.is_some() + } + + // Param is passed by value, moved + pub fn set_dst_entr_hmac(&mut self, v: ::std::vec::Vec) { + self.dst_entr_hmac = ::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_dst_entr_hmac(&mut self) -> &mut ::std::vec::Vec { + if self.dst_entr_hmac.is_none() { + self.dst_entr_hmac = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.dst_entr_hmac.as_mut().unwrap() + } + + // Take field + pub fn take_dst_entr_hmac(&mut self) -> ::std::vec::Vec { + self.dst_entr_hmac.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool is_offloaded_bp = 4; + + pub fn is_offloaded_bp(&self) -> bool { + self.is_offloaded_bp.unwrap_or(false) + } + + pub fn clear_is_offloaded_bp(&mut self) { + self.is_offloaded_bp = ::std::option::Option::None; + } + + pub fn has_is_offloaded_bp(&self) -> bool { + self.is_offloaded_bp.is_some() + } + + // Param is passed by value, moved + pub fn set_is_offloaded_bp(&mut self, v: bool) { + self.is_offloaded_bp = ::std::option::Option::Some(v); + } + + 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_message_field_accessor::<_, MoneroTransactionDestinationEntry>( + "dst_entr", + |m: &MoneroTransactionSetOutputRequest| { &m.dst_entr }, + |m: &mut MoneroTransactionSetOutputRequest| { &mut m.dst_entr }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "dst_entr_hmac", + |m: &MoneroTransactionSetOutputRequest| { &m.dst_entr_hmac }, + |m: &mut MoneroTransactionSetOutputRequest| { &mut m.dst_entr_hmac }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, MoneroTransactionRsigData>( + "rsig_data", + |m: &MoneroTransactionSetOutputRequest| { &m.rsig_data }, + |m: &mut MoneroTransactionSetOutputRequest| { &mut m.rsig_data }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "is_offloaded_bp", + |m: &MoneroTransactionSetOutputRequest| { &m.is_offloaded_bp }, + |m: &mut MoneroTransactionSetOutputRequest| { &mut m.is_offloaded_bp }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionSetOutputRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionSetOutputRequest { + const NAME: &'static str = "MoneroTransactionSetOutputRequest"; + + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.dst_entr)?; + }, + 18 => { + self.dst_entr_hmac = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.rsig_data)?; + }, + 32 => { + self.is_offloaded_bp = ::std::option::Option::Some(is.read_bool()?); + }, + 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.dst_entr.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.dst_entr_hmac.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.rsig_data.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.is_offloaded_bp { + my_size += 1 + 1; + } + 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.dst_entr.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.dst_entr_hmac.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.rsig_data.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.is_offloaded_bp { + os.write_bool(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() -> MoneroTransactionSetOutputRequest { + MoneroTransactionSetOutputRequest::new() + } + + fn clear(&mut self) { + self.dst_entr.clear(); + self.dst_entr_hmac = ::std::option::Option::None; + self.rsig_data.clear(); + self.is_offloaded_bp = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionSetOutputRequest { + static instance: MoneroTransactionSetOutputRequest = MoneroTransactionSetOutputRequest { + dst_entr: ::protobuf::MessageField::none(), + dst_entr_hmac: ::std::option::Option::None, + rsig_data: ::protobuf::MessageField::none(), + is_offloaded_bp: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionSetOutputRequest { + 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("MoneroTransactionSetOutputRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionSetOutputRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionSetOutputRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionSetOutputAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionSetOutputAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSetOutputAck.tx_out) + pub tx_out: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSetOutputAck.vouti_hmac) + pub vouti_hmac: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSetOutputAck.rsig_data) + pub rsig_data: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSetOutputAck.out_pk) + pub out_pk: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSetOutputAck.ecdh_info) + pub ecdh_info: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionSetOutputAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionSetOutputAck { + fn default() -> &'a MoneroTransactionSetOutputAck { + ::default_instance() + } +} + +impl MoneroTransactionSetOutputAck { + pub fn new() -> MoneroTransactionSetOutputAck { + ::std::default::Default::default() + } + + // optional bytes tx_out = 1; + + pub fn tx_out(&self) -> &[u8] { + match self.tx_out.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_tx_out(&mut self) { + self.tx_out = ::std::option::Option::None; + } + + pub fn has_tx_out(&self) -> bool { + self.tx_out.is_some() + } + + // Param is passed by value, moved + pub fn set_tx_out(&mut self, v: ::std::vec::Vec) { + self.tx_out = ::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_tx_out(&mut self) -> &mut ::std::vec::Vec { + if self.tx_out.is_none() { + self.tx_out = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.tx_out.as_mut().unwrap() + } + + // Take field + pub fn take_tx_out(&mut self) -> ::std::vec::Vec { + self.tx_out.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes vouti_hmac = 2; + + pub fn vouti_hmac(&self) -> &[u8] { + match self.vouti_hmac.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_vouti_hmac(&mut self) { + self.vouti_hmac = ::std::option::Option::None; + } + + pub fn has_vouti_hmac(&self) -> bool { + self.vouti_hmac.is_some() + } + + // Param is passed by value, moved + pub fn set_vouti_hmac(&mut self, v: ::std::vec::Vec) { + self.vouti_hmac = ::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_vouti_hmac(&mut self) -> &mut ::std::vec::Vec { + if self.vouti_hmac.is_none() { + self.vouti_hmac = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.vouti_hmac.as_mut().unwrap() + } + + // Take field + pub fn take_vouti_hmac(&mut self) -> ::std::vec::Vec { + self.vouti_hmac.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes out_pk = 4; + + pub fn out_pk(&self) -> &[u8] { + match self.out_pk.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_out_pk(&mut self) { + self.out_pk = ::std::option::Option::None; + } + + pub fn has_out_pk(&self) -> bool { + self.out_pk.is_some() + } + + // Param is passed by value, moved + pub fn set_out_pk(&mut self, v: ::std::vec::Vec) { + self.out_pk = ::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_out_pk(&mut self) -> &mut ::std::vec::Vec { + if self.out_pk.is_none() { + self.out_pk = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.out_pk.as_mut().unwrap() + } + + // Take field + pub fn take_out_pk(&mut self) -> ::std::vec::Vec { + self.out_pk.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes ecdh_info = 5; + + pub fn ecdh_info(&self) -> &[u8] { + match self.ecdh_info.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_ecdh_info(&mut self) { + self.ecdh_info = ::std::option::Option::None; + } + + pub fn has_ecdh_info(&self) -> bool { + self.ecdh_info.is_some() + } + + // Param is passed by value, moved + pub fn set_ecdh_info(&mut self, v: ::std::vec::Vec) { + self.ecdh_info = ::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_ecdh_info(&mut self) -> &mut ::std::vec::Vec { + if self.ecdh_info.is_none() { + self.ecdh_info = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.ecdh_info.as_mut().unwrap() + } + + // Take field + pub fn take_ecdh_info(&mut self) -> ::std::vec::Vec { + self.ecdh_info.take().unwrap_or_else(|| ::std::vec::Vec::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::<_, _>( + "tx_out", + |m: &MoneroTransactionSetOutputAck| { &m.tx_out }, + |m: &mut MoneroTransactionSetOutputAck| { &mut m.tx_out }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "vouti_hmac", + |m: &MoneroTransactionSetOutputAck| { &m.vouti_hmac }, + |m: &mut MoneroTransactionSetOutputAck| { &mut m.vouti_hmac }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, MoneroTransactionRsigData>( + "rsig_data", + |m: &MoneroTransactionSetOutputAck| { &m.rsig_data }, + |m: &mut MoneroTransactionSetOutputAck| { &mut m.rsig_data }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "out_pk", + |m: &MoneroTransactionSetOutputAck| { &m.out_pk }, + |m: &mut MoneroTransactionSetOutputAck| { &mut m.out_pk }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ecdh_info", + |m: &MoneroTransactionSetOutputAck| { &m.ecdh_info }, + |m: &mut MoneroTransactionSetOutputAck| { &mut m.ecdh_info }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionSetOutputAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionSetOutputAck { + const NAME: &'static str = "MoneroTransactionSetOutputAck"; + + 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.tx_out = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.vouti_hmac = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.rsig_data)?; + }, + 34 => { + self.out_pk = ::std::option::Option::Some(is.read_bytes()?); + }, + 42 => { + self.ecdh_info = ::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.tx_out.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.vouti_hmac.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.rsig_data.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.out_pk.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.ecdh_info.as_ref() { + my_size += ::protobuf::rt::bytes_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.tx_out.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.vouti_hmac.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.rsig_data.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.out_pk.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.ecdh_info.as_ref() { + os.write_bytes(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() -> MoneroTransactionSetOutputAck { + MoneroTransactionSetOutputAck::new() + } + + fn clear(&mut self) { + self.tx_out = ::std::option::Option::None; + self.vouti_hmac = ::std::option::Option::None; + self.rsig_data.clear(); + self.out_pk = ::std::option::Option::None; + self.ecdh_info = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionSetOutputAck { + static instance: MoneroTransactionSetOutputAck = MoneroTransactionSetOutputAck { + tx_out: ::std::option::Option::None, + vouti_hmac: ::std::option::Option::None, + rsig_data: ::protobuf::MessageField::none(), + out_pk: ::std::option::Option::None, + ecdh_info: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionSetOutputAck { + 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("MoneroTransactionSetOutputAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionSetOutputAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionSetOutputAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionAllOutSetRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionAllOutSetRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionAllOutSetRequest.rsig_data) + pub rsig_data: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionAllOutSetRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionAllOutSetRequest { + fn default() -> &'a MoneroTransactionAllOutSetRequest { + ::default_instance() + } +} + +impl MoneroTransactionAllOutSetRequest { + pub fn new() -> MoneroTransactionAllOutSetRequest { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, MoneroTransactionRsigData>( + "rsig_data", + |m: &MoneroTransactionAllOutSetRequest| { &m.rsig_data }, + |m: &mut MoneroTransactionAllOutSetRequest| { &mut m.rsig_data }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionAllOutSetRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionAllOutSetRequest { + const NAME: &'static str = "MoneroTransactionAllOutSetRequest"; + + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.rsig_data)?; + }, + 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.rsig_data.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.rsig_data.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + 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() -> MoneroTransactionAllOutSetRequest { + MoneroTransactionAllOutSetRequest::new() + } + + fn clear(&mut self) { + self.rsig_data.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionAllOutSetRequest { + static instance: MoneroTransactionAllOutSetRequest = MoneroTransactionAllOutSetRequest { + rsig_data: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionAllOutSetRequest { + 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("MoneroTransactionAllOutSetRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionAllOutSetRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionAllOutSetRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionAllOutSetAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionAllOutSetAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionAllOutSetAck.extra) + pub extra: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionAllOutSetAck.tx_prefix_hash) + pub tx_prefix_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionAllOutSetAck.rv) + pub rv: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionAllOutSetAck.full_message_hash) + pub full_message_hash: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionAllOutSetAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionAllOutSetAck { + fn default() -> &'a MoneroTransactionAllOutSetAck { + ::default_instance() + } +} + +impl MoneroTransactionAllOutSetAck { + pub fn new() -> MoneroTransactionAllOutSetAck { + ::std::default::Default::default() + } + + // optional bytes extra = 1; + + pub fn extra(&self) -> &[u8] { + match self.extra.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_extra(&mut self) { + self.extra = ::std::option::Option::None; + } + + pub fn has_extra(&self) -> bool { + self.extra.is_some() + } + + // Param is passed by value, moved + pub fn set_extra(&mut self, v: ::std::vec::Vec) { + self.extra = ::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_extra(&mut self) -> &mut ::std::vec::Vec { + if self.extra.is_none() { + self.extra = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.extra.as_mut().unwrap() + } + + // Take field + pub fn take_extra(&mut self) -> ::std::vec::Vec { + self.extra.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes tx_prefix_hash = 2; + + pub fn tx_prefix_hash(&self) -> &[u8] { + match self.tx_prefix_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_tx_prefix_hash(&mut self) { + self.tx_prefix_hash = ::std::option::Option::None; + } + + pub fn has_tx_prefix_hash(&self) -> bool { + self.tx_prefix_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_tx_prefix_hash(&mut self, v: ::std::vec::Vec) { + self.tx_prefix_hash = ::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_tx_prefix_hash(&mut self) -> &mut ::std::vec::Vec { + if self.tx_prefix_hash.is_none() { + self.tx_prefix_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.tx_prefix_hash.as_mut().unwrap() + } + + // Take field + pub fn take_tx_prefix_hash(&mut self) -> ::std::vec::Vec { + self.tx_prefix_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes full_message_hash = 5; + + pub fn full_message_hash(&self) -> &[u8] { + match self.full_message_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_full_message_hash(&mut self) { + self.full_message_hash = ::std::option::Option::None; + } + + pub fn has_full_message_hash(&self) -> bool { + self.full_message_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_full_message_hash(&mut self, v: ::std::vec::Vec) { + self.full_message_hash = ::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_full_message_hash(&mut self) -> &mut ::std::vec::Vec { + if self.full_message_hash.is_none() { + self.full_message_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.full_message_hash.as_mut().unwrap() + } + + // Take field + pub fn take_full_message_hash(&mut self) -> ::std::vec::Vec { + self.full_message_hash.take().unwrap_or_else(|| ::std::vec::Vec::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::<_, _>( + "extra", + |m: &MoneroTransactionAllOutSetAck| { &m.extra }, + |m: &mut MoneroTransactionAllOutSetAck| { &mut m.extra }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "tx_prefix_hash", + |m: &MoneroTransactionAllOutSetAck| { &m.tx_prefix_hash }, + |m: &mut MoneroTransactionAllOutSetAck| { &mut m.tx_prefix_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, monero_transaction_all_out_set_ack::MoneroRingCtSig>( + "rv", + |m: &MoneroTransactionAllOutSetAck| { &m.rv }, + |m: &mut MoneroTransactionAllOutSetAck| { &mut m.rv }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "full_message_hash", + |m: &MoneroTransactionAllOutSetAck| { &m.full_message_hash }, + |m: &mut MoneroTransactionAllOutSetAck| { &mut m.full_message_hash }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionAllOutSetAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionAllOutSetAck { + const NAME: &'static str = "MoneroTransactionAllOutSetAck"; + + 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.extra = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.tx_prefix_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.rv)?; + }, + 42 => { + self.full_message_hash = ::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.extra.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.tx_prefix_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.rv.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.full_message_hash.as_ref() { + my_size += ::protobuf::rt::bytes_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.extra.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.tx_prefix_hash.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.rv.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + } + if let Some(v) = self.full_message_hash.as_ref() { + os.write_bytes(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() -> MoneroTransactionAllOutSetAck { + MoneroTransactionAllOutSetAck::new() + } + + fn clear(&mut self) { + self.extra = ::std::option::Option::None; + self.tx_prefix_hash = ::std::option::Option::None; + self.rv.clear(); + self.full_message_hash = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionAllOutSetAck { + static instance: MoneroTransactionAllOutSetAck = MoneroTransactionAllOutSetAck { + extra: ::std::option::Option::None, + tx_prefix_hash: ::std::option::Option::None, + rv: ::protobuf::MessageField::none(), + full_message_hash: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionAllOutSetAck { + 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("MoneroTransactionAllOutSetAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionAllOutSetAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionAllOutSetAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `MoneroTransactionAllOutSetAck` +pub mod monero_transaction_all_out_set_ack { + // @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionAllOutSetAck.MoneroRingCtSig) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct MoneroRingCtSig { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionAllOutSetAck.MoneroRingCtSig.txn_fee) + pub txn_fee: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionAllOutSetAck.MoneroRingCtSig.message) + pub message: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionAllOutSetAck.MoneroRingCtSig.rv_type) + pub rv_type: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionAllOutSetAck.MoneroRingCtSig.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a MoneroRingCtSig { + fn default() -> &'a MoneroRingCtSig { + ::default_instance() + } + } + + impl MoneroRingCtSig { + pub fn new() -> MoneroRingCtSig { + ::std::default::Default::default() + } + + // optional uint64 txn_fee = 1; + + pub fn txn_fee(&self) -> u64 { + self.txn_fee.unwrap_or(0) + } + + pub fn clear_txn_fee(&mut self) { + self.txn_fee = ::std::option::Option::None; + } + + pub fn has_txn_fee(&self) -> bool { + self.txn_fee.is_some() + } + + // Param is passed by value, moved + pub fn set_txn_fee(&mut self, v: u64) { + self.txn_fee = ::std::option::Option::Some(v); + } + + // optional bytes message = 2; + + pub fn message(&self) -> &[u8] { + match self.message.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_message(&mut self) { + self.message = ::std::option::Option::None; + } + + pub fn has_message(&self) -> bool { + self.message.is_some() + } + + // Param is passed by value, moved + pub fn set_message(&mut self, v: ::std::vec::Vec) { + self.message = ::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_message(&mut self) -> &mut ::std::vec::Vec { + if self.message.is_none() { + self.message = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.message.as_mut().unwrap() + } + + // Take field + pub fn take_message(&mut self) -> ::std::vec::Vec { + self.message.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 rv_type = 3; + + pub fn rv_type(&self) -> u32 { + self.rv_type.unwrap_or(0) + } + + pub fn clear_rv_type(&mut self) { + self.rv_type = ::std::option::Option::None; + } + + pub fn has_rv_type(&self) -> bool { + self.rv_type.is_some() + } + + // Param is passed by value, moved + pub fn set_rv_type(&mut self, v: u32) { + self.rv_type = ::std::option::Option::Some(v); + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "txn_fee", + |m: &MoneroRingCtSig| { &m.txn_fee }, + |m: &mut MoneroRingCtSig| { &mut m.txn_fee }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "message", + |m: &MoneroRingCtSig| { &m.message }, + |m: &mut MoneroRingCtSig| { &mut m.message }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "rv_type", + |m: &MoneroRingCtSig| { &m.rv_type }, + |m: &mut MoneroRingCtSig| { &mut m.rv_type }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionAllOutSetAck.MoneroRingCtSig", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for MoneroRingCtSig { + const NAME: &'static str = "MoneroRingCtSig"; + + 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 { + 8 => { + self.txn_fee = ::std::option::Option::Some(is.read_uint64()?); + }, + 18 => { + self.message = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.rv_type = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.txn_fee { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.message.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.rv_type { + my_size += ::protobuf::rt::uint32_size(3, 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.txn_fee { + os.write_uint64(1, v)?; + } + if let Some(v) = self.message.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.rv_type { + os.write_uint32(3, 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() -> MoneroRingCtSig { + MoneroRingCtSig::new() + } + + fn clear(&mut self) { + self.txn_fee = ::std::option::Option::None; + self.message = ::std::option::Option::None; + self.rv_type = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroRingCtSig { + static instance: MoneroRingCtSig = MoneroRingCtSig { + txn_fee: ::std::option::Option::None, + message: ::std::option::Option::None, + rv_type: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for MoneroRingCtSig { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("MoneroTransactionAllOutSetAck.MoneroRingCtSig").unwrap()).clone() + } + } + + impl ::std::fmt::Display for MoneroRingCtSig { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for MoneroRingCtSig { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionSignInputRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionSignInputRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSignInputRequest.src_entr) + pub src_entr: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSignInputRequest.vini) + pub vini: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSignInputRequest.vini_hmac) + pub vini_hmac: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSignInputRequest.pseudo_out) + pub pseudo_out: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSignInputRequest.pseudo_out_hmac) + pub pseudo_out_hmac: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSignInputRequest.pseudo_out_alpha) + pub pseudo_out_alpha: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSignInputRequest.spend_key) + pub spend_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSignInputRequest.orig_idx) + pub orig_idx: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionSignInputRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionSignInputRequest { + fn default() -> &'a MoneroTransactionSignInputRequest { + ::default_instance() + } +} + +impl MoneroTransactionSignInputRequest { + pub fn new() -> MoneroTransactionSignInputRequest { + ::std::default::Default::default() + } + + // optional bytes vini = 2; + + pub fn vini(&self) -> &[u8] { + match self.vini.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_vini(&mut self) { + self.vini = ::std::option::Option::None; + } + + pub fn has_vini(&self) -> bool { + self.vini.is_some() + } + + // Param is passed by value, moved + pub fn set_vini(&mut self, v: ::std::vec::Vec) { + self.vini = ::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_vini(&mut self) -> &mut ::std::vec::Vec { + if self.vini.is_none() { + self.vini = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.vini.as_mut().unwrap() + } + + // Take field + pub fn take_vini(&mut self) -> ::std::vec::Vec { + self.vini.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes vini_hmac = 3; + + pub fn vini_hmac(&self) -> &[u8] { + match self.vini_hmac.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_vini_hmac(&mut self) { + self.vini_hmac = ::std::option::Option::None; + } + + pub fn has_vini_hmac(&self) -> bool { + self.vini_hmac.is_some() + } + + // Param is passed by value, moved + pub fn set_vini_hmac(&mut self, v: ::std::vec::Vec) { + self.vini_hmac = ::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_vini_hmac(&mut self) -> &mut ::std::vec::Vec { + if self.vini_hmac.is_none() { + self.vini_hmac = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.vini_hmac.as_mut().unwrap() + } + + // Take field + pub fn take_vini_hmac(&mut self) -> ::std::vec::Vec { + self.vini_hmac.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes pseudo_out = 4; + + pub fn pseudo_out(&self) -> &[u8] { + match self.pseudo_out.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_pseudo_out(&mut self) { + self.pseudo_out = ::std::option::Option::None; + } + + pub fn has_pseudo_out(&self) -> bool { + self.pseudo_out.is_some() + } + + // Param is passed by value, moved + pub fn set_pseudo_out(&mut self, v: ::std::vec::Vec) { + self.pseudo_out = ::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_pseudo_out(&mut self) -> &mut ::std::vec::Vec { + if self.pseudo_out.is_none() { + self.pseudo_out = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.pseudo_out.as_mut().unwrap() + } + + // Take field + pub fn take_pseudo_out(&mut self) -> ::std::vec::Vec { + self.pseudo_out.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes pseudo_out_hmac = 5; + + pub fn pseudo_out_hmac(&self) -> &[u8] { + match self.pseudo_out_hmac.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_pseudo_out_hmac(&mut self) { + self.pseudo_out_hmac = ::std::option::Option::None; + } + + pub fn has_pseudo_out_hmac(&self) -> bool { + self.pseudo_out_hmac.is_some() + } + + // Param is passed by value, moved + pub fn set_pseudo_out_hmac(&mut self, v: ::std::vec::Vec) { + self.pseudo_out_hmac = ::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_pseudo_out_hmac(&mut self) -> &mut ::std::vec::Vec { + if self.pseudo_out_hmac.is_none() { + self.pseudo_out_hmac = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.pseudo_out_hmac.as_mut().unwrap() + } + + // Take field + pub fn take_pseudo_out_hmac(&mut self) -> ::std::vec::Vec { + self.pseudo_out_hmac.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes pseudo_out_alpha = 6; + + pub fn pseudo_out_alpha(&self) -> &[u8] { + match self.pseudo_out_alpha.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_pseudo_out_alpha(&mut self) { + self.pseudo_out_alpha = ::std::option::Option::None; + } + + pub fn has_pseudo_out_alpha(&self) -> bool { + self.pseudo_out_alpha.is_some() + } + + // Param is passed by value, moved + pub fn set_pseudo_out_alpha(&mut self, v: ::std::vec::Vec) { + self.pseudo_out_alpha = ::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_pseudo_out_alpha(&mut self) -> &mut ::std::vec::Vec { + if self.pseudo_out_alpha.is_none() { + self.pseudo_out_alpha = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.pseudo_out_alpha.as_mut().unwrap() + } + + // Take field + pub fn take_pseudo_out_alpha(&mut self) -> ::std::vec::Vec { + self.pseudo_out_alpha.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes spend_key = 7; + + pub fn spend_key(&self) -> &[u8] { + match self.spend_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_spend_key(&mut self) { + self.spend_key = ::std::option::Option::None; + } + + pub fn has_spend_key(&self) -> bool { + self.spend_key.is_some() + } + + // Param is passed by value, moved + pub fn set_spend_key(&mut self, v: ::std::vec::Vec) { + self.spend_key = ::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_spend_key(&mut self) -> &mut ::std::vec::Vec { + if self.spend_key.is_none() { + self.spend_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.spend_key.as_mut().unwrap() + } + + // Take field + pub fn take_spend_key(&mut self) -> ::std::vec::Vec { + self.spend_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 orig_idx = 8; + + pub fn orig_idx(&self) -> u32 { + self.orig_idx.unwrap_or(0) + } + + pub fn clear_orig_idx(&mut self) { + self.orig_idx = ::std::option::Option::None; + } + + pub fn has_orig_idx(&self) -> bool { + self.orig_idx.is_some() + } + + // Param is passed by value, moved + pub fn set_orig_idx(&mut self, v: u32) { + self.orig_idx = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(8); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, MoneroTransactionSourceEntry>( + "src_entr", + |m: &MoneroTransactionSignInputRequest| { &m.src_entr }, + |m: &mut MoneroTransactionSignInputRequest| { &mut m.src_entr }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "vini", + |m: &MoneroTransactionSignInputRequest| { &m.vini }, + |m: &mut MoneroTransactionSignInputRequest| { &mut m.vini }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "vini_hmac", + |m: &MoneroTransactionSignInputRequest| { &m.vini_hmac }, + |m: &mut MoneroTransactionSignInputRequest| { &mut m.vini_hmac }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pseudo_out", + |m: &MoneroTransactionSignInputRequest| { &m.pseudo_out }, + |m: &mut MoneroTransactionSignInputRequest| { &mut m.pseudo_out }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pseudo_out_hmac", + |m: &MoneroTransactionSignInputRequest| { &m.pseudo_out_hmac }, + |m: &mut MoneroTransactionSignInputRequest| { &mut m.pseudo_out_hmac }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pseudo_out_alpha", + |m: &MoneroTransactionSignInputRequest| { &m.pseudo_out_alpha }, + |m: &mut MoneroTransactionSignInputRequest| { &mut m.pseudo_out_alpha }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "spend_key", + |m: &MoneroTransactionSignInputRequest| { &m.spend_key }, + |m: &mut MoneroTransactionSignInputRequest| { &mut m.spend_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "orig_idx", + |m: &MoneroTransactionSignInputRequest| { &m.orig_idx }, + |m: &mut MoneroTransactionSignInputRequest| { &mut m.orig_idx }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionSignInputRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionSignInputRequest { + const NAME: &'static str = "MoneroTransactionSignInputRequest"; + + fn is_initialized(&self) -> bool { + for v in &self.src_entr { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.src_entr)?; + }, + 18 => { + self.vini = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.vini_hmac = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.pseudo_out = ::std::option::Option::Some(is.read_bytes()?); + }, + 42 => { + self.pseudo_out_hmac = ::std::option::Option::Some(is.read_bytes()?); + }, + 50 => { + self.pseudo_out_alpha = ::std::option::Option::Some(is.read_bytes()?); + }, + 58 => { + self.spend_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 64 => { + self.orig_idx = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.src_entr.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.vini.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.vini_hmac.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.pseudo_out.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.pseudo_out_hmac.as_ref() { + my_size += ::protobuf::rt::bytes_size(5, &v); + } + if let Some(v) = self.pseudo_out_alpha.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &v); + } + if let Some(v) = self.spend_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(7, &v); + } + if let Some(v) = self.orig_idx { + my_size += ::protobuf::rt::uint32_size(8, 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.src_entr.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.vini.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.vini_hmac.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.pseudo_out.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.pseudo_out_hmac.as_ref() { + os.write_bytes(5, v)?; + } + if let Some(v) = self.pseudo_out_alpha.as_ref() { + os.write_bytes(6, v)?; + } + if let Some(v) = self.spend_key.as_ref() { + os.write_bytes(7, v)?; + } + if let Some(v) = self.orig_idx { + os.write_uint32(8, 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() -> MoneroTransactionSignInputRequest { + MoneroTransactionSignInputRequest::new() + } + + fn clear(&mut self) { + self.src_entr.clear(); + self.vini = ::std::option::Option::None; + self.vini_hmac = ::std::option::Option::None; + self.pseudo_out = ::std::option::Option::None; + self.pseudo_out_hmac = ::std::option::Option::None; + self.pseudo_out_alpha = ::std::option::Option::None; + self.spend_key = ::std::option::Option::None; + self.orig_idx = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionSignInputRequest { + static instance: MoneroTransactionSignInputRequest = MoneroTransactionSignInputRequest { + src_entr: ::protobuf::MessageField::none(), + vini: ::std::option::Option::None, + vini_hmac: ::std::option::Option::None, + pseudo_out: ::std::option::Option::None, + pseudo_out_hmac: ::std::option::Option::None, + pseudo_out_alpha: ::std::option::Option::None, + spend_key: ::std::option::Option::None, + orig_idx: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionSignInputRequest { + 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("MoneroTransactionSignInputRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionSignInputRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionSignInputRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionSignInputAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionSignInputAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSignInputAck.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionSignInputAck.pseudo_out) + pub pseudo_out: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionSignInputAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionSignInputAck { + fn default() -> &'a MoneroTransactionSignInputAck { + ::default_instance() + } +} + +impl MoneroTransactionSignInputAck { + pub fn new() -> MoneroTransactionSignInputAck { + ::std::default::Default::default() + } + + // optional bytes signature = 1; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes pseudo_out = 2; + + pub fn pseudo_out(&self) -> &[u8] { + match self.pseudo_out.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_pseudo_out(&mut self) { + self.pseudo_out = ::std::option::Option::None; + } + + pub fn has_pseudo_out(&self) -> bool { + self.pseudo_out.is_some() + } + + // Param is passed by value, moved + pub fn set_pseudo_out(&mut self, v: ::std::vec::Vec) { + self.pseudo_out = ::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_pseudo_out(&mut self) -> &mut ::std::vec::Vec { + if self.pseudo_out.is_none() { + self.pseudo_out = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.pseudo_out.as_mut().unwrap() + } + + // Take field + pub fn take_pseudo_out(&mut self) -> ::std::vec::Vec { + self.pseudo_out.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::<_, _>( + "signature", + |m: &MoneroTransactionSignInputAck| { &m.signature }, + |m: &mut MoneroTransactionSignInputAck| { &mut m.signature }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "pseudo_out", + |m: &MoneroTransactionSignInputAck| { &m.pseudo_out }, + |m: &mut MoneroTransactionSignInputAck| { &mut m.pseudo_out }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionSignInputAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionSignInputAck { + const NAME: &'static str = "MoneroTransactionSignInputAck"; + + 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.signature = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.pseudo_out = ::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.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.pseudo_out.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.signature.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.pseudo_out.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() -> MoneroTransactionSignInputAck { + MoneroTransactionSignInputAck::new() + } + + fn clear(&mut self) { + self.signature = ::std::option::Option::None; + self.pseudo_out = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionSignInputAck { + static instance: MoneroTransactionSignInputAck = MoneroTransactionSignInputAck { + signature: ::std::option::Option::None, + pseudo_out: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionSignInputAck { + 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("MoneroTransactionSignInputAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionSignInputAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionSignInputAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionFinalRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionFinalRequest { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionFinalRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionFinalRequest { + fn default() -> &'a MoneroTransactionFinalRequest { + ::default_instance() + } +} + +impl MoneroTransactionFinalRequest { + pub fn new() -> MoneroTransactionFinalRequest { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionFinalRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionFinalRequest { + const NAME: &'static str = "MoneroTransactionFinalRequest"; + + 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 { + 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; + 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<()> { + 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() -> MoneroTransactionFinalRequest { + MoneroTransactionFinalRequest::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionFinalRequest { + static instance: MoneroTransactionFinalRequest = MoneroTransactionFinalRequest { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionFinalRequest { + 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("MoneroTransactionFinalRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionFinalRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionFinalRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroTransactionFinalAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroTransactionFinalAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionFinalAck.cout_key) + pub cout_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionFinalAck.salt) + pub salt: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionFinalAck.rand_mult) + pub rand_mult: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionFinalAck.tx_enc_keys) + pub tx_enc_keys: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroTransactionFinalAck.opening_key) + pub opening_key: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroTransactionFinalAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroTransactionFinalAck { + fn default() -> &'a MoneroTransactionFinalAck { + ::default_instance() + } +} + +impl MoneroTransactionFinalAck { + pub fn new() -> MoneroTransactionFinalAck { + ::std::default::Default::default() + } + + // optional bytes cout_key = 1; + + pub fn cout_key(&self) -> &[u8] { + match self.cout_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_cout_key(&mut self) { + self.cout_key = ::std::option::Option::None; + } + + pub fn has_cout_key(&self) -> bool { + self.cout_key.is_some() + } + + // Param is passed by value, moved + pub fn set_cout_key(&mut self, v: ::std::vec::Vec) { + self.cout_key = ::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_cout_key(&mut self) -> &mut ::std::vec::Vec { + if self.cout_key.is_none() { + self.cout_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.cout_key.as_mut().unwrap() + } + + // Take field + pub fn take_cout_key(&mut self) -> ::std::vec::Vec { + self.cout_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes salt = 2; + + pub fn salt(&self) -> &[u8] { + match self.salt.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_salt(&mut self) { + self.salt = ::std::option::Option::None; + } + + pub fn has_salt(&self) -> bool { + self.salt.is_some() + } + + // Param is passed by value, moved + pub fn set_salt(&mut self, v: ::std::vec::Vec) { + self.salt = ::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_salt(&mut self) -> &mut ::std::vec::Vec { + if self.salt.is_none() { + self.salt = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.salt.as_mut().unwrap() + } + + // Take field + pub fn take_salt(&mut self) -> ::std::vec::Vec { + self.salt.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes rand_mult = 3; + + pub fn rand_mult(&self) -> &[u8] { + match self.rand_mult.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_rand_mult(&mut self) { + self.rand_mult = ::std::option::Option::None; + } + + pub fn has_rand_mult(&self) -> bool { + self.rand_mult.is_some() + } + + // Param is passed by value, moved + pub fn set_rand_mult(&mut self, v: ::std::vec::Vec) { + self.rand_mult = ::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_rand_mult(&mut self) -> &mut ::std::vec::Vec { + if self.rand_mult.is_none() { + self.rand_mult = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.rand_mult.as_mut().unwrap() + } + + // Take field + pub fn take_rand_mult(&mut self) -> ::std::vec::Vec { + self.rand_mult.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes tx_enc_keys = 4; + + pub fn tx_enc_keys(&self) -> &[u8] { + match self.tx_enc_keys.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_tx_enc_keys(&mut self) { + self.tx_enc_keys = ::std::option::Option::None; + } + + pub fn has_tx_enc_keys(&self) -> bool { + self.tx_enc_keys.is_some() + } + + // Param is passed by value, moved + pub fn set_tx_enc_keys(&mut self, v: ::std::vec::Vec) { + self.tx_enc_keys = ::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_tx_enc_keys(&mut self) -> &mut ::std::vec::Vec { + if self.tx_enc_keys.is_none() { + self.tx_enc_keys = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.tx_enc_keys.as_mut().unwrap() + } + + // Take field + pub fn take_tx_enc_keys(&mut self) -> ::std::vec::Vec { + self.tx_enc_keys.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes opening_key = 5; + + pub fn opening_key(&self) -> &[u8] { + match self.opening_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_opening_key(&mut self) { + self.opening_key = ::std::option::Option::None; + } + + pub fn has_opening_key(&self) -> bool { + self.opening_key.is_some() + } + + // Param is passed by value, moved + pub fn set_opening_key(&mut self, v: ::std::vec::Vec) { + self.opening_key = ::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_opening_key(&mut self) -> &mut ::std::vec::Vec { + if self.opening_key.is_none() { + self.opening_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.opening_key.as_mut().unwrap() + } + + // Take field + pub fn take_opening_key(&mut self) -> ::std::vec::Vec { + self.opening_key.take().unwrap_or_else(|| ::std::vec::Vec::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::<_, _>( + "cout_key", + |m: &MoneroTransactionFinalAck| { &m.cout_key }, + |m: &mut MoneroTransactionFinalAck| { &mut m.cout_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "salt", + |m: &MoneroTransactionFinalAck| { &m.salt }, + |m: &mut MoneroTransactionFinalAck| { &mut m.salt }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "rand_mult", + |m: &MoneroTransactionFinalAck| { &m.rand_mult }, + |m: &mut MoneroTransactionFinalAck| { &mut m.rand_mult }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "tx_enc_keys", + |m: &MoneroTransactionFinalAck| { &m.tx_enc_keys }, + |m: &mut MoneroTransactionFinalAck| { &mut m.tx_enc_keys }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "opening_key", + |m: &MoneroTransactionFinalAck| { &m.opening_key }, + |m: &mut MoneroTransactionFinalAck| { &mut m.opening_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroTransactionFinalAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroTransactionFinalAck { + const NAME: &'static str = "MoneroTransactionFinalAck"; + + 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.cout_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.salt = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.rand_mult = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.tx_enc_keys = ::std::option::Option::Some(is.read_bytes()?); + }, + 42 => { + self.opening_key = ::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.cout_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.salt.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.rand_mult.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.tx_enc_keys.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.opening_key.as_ref() { + my_size += ::protobuf::rt::bytes_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.cout_key.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.salt.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.rand_mult.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.tx_enc_keys.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.opening_key.as_ref() { + os.write_bytes(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() -> MoneroTransactionFinalAck { + MoneroTransactionFinalAck::new() + } + + fn clear(&mut self) { + self.cout_key = ::std::option::Option::None; + self.salt = ::std::option::Option::None; + self.rand_mult = ::std::option::Option::None; + self.tx_enc_keys = ::std::option::Option::None; + self.opening_key = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransactionFinalAck { + static instance: MoneroTransactionFinalAck = MoneroTransactionFinalAck { + cout_key: ::std::option::Option::None, + salt: ::std::option::Option::None, + rand_mult: ::std::option::Option::None, + tx_enc_keys: ::std::option::Option::None, + opening_key: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroTransactionFinalAck { + 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("MoneroTransactionFinalAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroTransactionFinalAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroTransactionFinalAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroKeyImageExportInitRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroKeyImageExportInitRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageExportInitRequest.num) + pub num: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageExportInitRequest.hash) + pub hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageExportInitRequest.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageExportInitRequest.network_type) + pub network_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageExportInitRequest.subs) + pub subs: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroKeyImageExportInitRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroKeyImageExportInitRequest { + fn default() -> &'a MoneroKeyImageExportInitRequest { + ::default_instance() + } +} + +impl MoneroKeyImageExportInitRequest { + pub fn new() -> MoneroKeyImageExportInitRequest { + ::std::default::Default::default() + } + + // required uint64 num = 1; + + pub fn num(&self) -> u64 { + self.num.unwrap_or(0) + } + + pub fn clear_num(&mut self) { + self.num = ::std::option::Option::None; + } + + pub fn has_num(&self) -> bool { + self.num.is_some() + } + + // Param is passed by value, moved + pub fn set_num(&mut self, v: u64) { + self.num = ::std::option::Option::Some(v); + } + + // required bytes hash = 2; + + pub fn hash(&self) -> &[u8] { + match self.hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_hash(&mut self) { + self.hash = ::std::option::Option::None; + } + + pub fn has_hash(&self) -> bool { + self.hash.is_some() + } + + // Param is passed by value, moved + pub fn set_hash(&mut self, v: ::std::vec::Vec) { + self.hash = ::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_hash(&mut self) -> &mut ::std::vec::Vec { + if self.hash.is_none() { + self.hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.hash.as_mut().unwrap() + } + + // Take field + pub fn take_hash(&mut self) -> ::std::vec::Vec { + self.hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional .hw.trezor.messages.monero.MoneroNetworkType network_type = 4; + + pub fn network_type(&self) -> MoneroNetworkType { + match self.network_type { + Some(e) => e.enum_value_or(MoneroNetworkType::MAINNET), + None => MoneroNetworkType::MAINNET, + } + } + + pub fn clear_network_type(&mut self) { + self.network_type = ::std::option::Option::None; + } + + pub fn has_network_type(&self) -> bool { + self.network_type.is_some() + } + + // Param is passed by value, moved + pub fn set_network_type(&mut self, v: MoneroNetworkType) { + self.network_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + 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::<_, _>( + "num", + |m: &MoneroKeyImageExportInitRequest| { &m.num }, + |m: &mut MoneroKeyImageExportInitRequest| { &mut m.num }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "hash", + |m: &MoneroKeyImageExportInitRequest| { &m.hash }, + |m: &mut MoneroKeyImageExportInitRequest| { &mut m.hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &MoneroKeyImageExportInitRequest| { &m.address_n }, + |m: &mut MoneroKeyImageExportInitRequest| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "network_type", + |m: &MoneroKeyImageExportInitRequest| { &m.network_type }, + |m: &mut MoneroKeyImageExportInitRequest| { &mut m.network_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "subs", + |m: &MoneroKeyImageExportInitRequest| { &m.subs }, + |m: &mut MoneroKeyImageExportInitRequest| { &mut m.subs }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroKeyImageExportInitRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroKeyImageExportInitRequest { + const NAME: &'static str = "MoneroKeyImageExportInitRequest"; + + fn is_initialized(&self) -> bool { + if self.num.is_none() { + return false; + } + if self.hash.is_none() { + return false; + } + for v in &self.subs { + if !v.is_initialized() { + 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.num = ::std::option::Option::Some(is.read_uint64()?); + }, + 18 => { + self.hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 24 => { + self.address_n.push(is.read_uint32()?); + }, + 32 => { + self.network_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 42 => { + self.subs.push(is.read_message()?); + }, + 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.num { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(3, *value); + }; + if let Some(v) = self.network_type { + my_size += ::protobuf::rt::int32_size(4, v.value()); + } + for value in &self.subs { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + 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.num { + os.write_uint64(1, v)?; + } + if let Some(v) = self.hash.as_ref() { + os.write_bytes(2, v)?; + } + for v in &self.address_n { + os.write_uint32(3, *v)?; + }; + if let Some(v) = self.network_type { + os.write_enum(4, ::protobuf::EnumOrUnknown::value(&v))?; + } + for v in &self.subs { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + }; + 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() -> MoneroKeyImageExportInitRequest { + MoneroKeyImageExportInitRequest::new() + } + + fn clear(&mut self) { + self.num = ::std::option::Option::None; + self.hash = ::std::option::Option::None; + self.address_n.clear(); + self.network_type = ::std::option::Option::None; + self.subs.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroKeyImageExportInitRequest { + static instance: MoneroKeyImageExportInitRequest = MoneroKeyImageExportInitRequest { + num: ::std::option::Option::None, + hash: ::std::option::Option::None, + address_n: ::std::vec::Vec::new(), + network_type: ::std::option::Option::None, + subs: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroKeyImageExportInitRequest { + 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("MoneroKeyImageExportInitRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroKeyImageExportInitRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroKeyImageExportInitRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `MoneroKeyImageExportInitRequest` +pub mod monero_key_image_export_init_request { + // @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroKeyImageExportInitRequest.MoneroSubAddressIndicesList) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct MoneroSubAddressIndicesList { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageExportInitRequest.MoneroSubAddressIndicesList.account) + pub account: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageExportInitRequest.MoneroSubAddressIndicesList.minor_indices) + pub minor_indices: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroKeyImageExportInitRequest.MoneroSubAddressIndicesList.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a MoneroSubAddressIndicesList { + fn default() -> &'a MoneroSubAddressIndicesList { + ::default_instance() + } + } + + impl MoneroSubAddressIndicesList { + pub fn new() -> MoneroSubAddressIndicesList { + ::std::default::Default::default() + } + + // required uint32 account = 1; + + pub fn account(&self) -> u32 { + self.account.unwrap_or(0) + } + + pub fn clear_account(&mut self) { + self.account = ::std::option::Option::None; + } + + pub fn has_account(&self) -> bool { + self.account.is_some() + } + + // Param is passed by value, moved + pub fn set_account(&mut self, v: u32) { + self.account = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "account", + |m: &MoneroSubAddressIndicesList| { &m.account }, + |m: &mut MoneroSubAddressIndicesList| { &mut m.account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "minor_indices", + |m: &MoneroSubAddressIndicesList| { &m.minor_indices }, + |m: &mut MoneroSubAddressIndicesList| { &mut m.minor_indices }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroKeyImageExportInitRequest.MoneroSubAddressIndicesList", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for MoneroSubAddressIndicesList { + const NAME: &'static str = "MoneroSubAddressIndicesList"; + + fn is_initialized(&self) -> bool { + if self.account.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.account = ::std::option::Option::Some(is.read_uint32()?); + }, + 18 => { + is.read_repeated_packed_uint32_into(&mut self.minor_indices)?; + }, + 16 => { + self.minor_indices.push(is.read_uint32()?); + }, + 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.account { + my_size += ::protobuf::rt::uint32_size(1, v); + } + for value in &self.minor_indices { + my_size += ::protobuf::rt::uint32_size(2, *value); + }; + 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.account { + os.write_uint32(1, v)?; + } + for v in &self.minor_indices { + os.write_uint32(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() -> MoneroSubAddressIndicesList { + MoneroSubAddressIndicesList::new() + } + + fn clear(&mut self) { + self.account = ::std::option::Option::None; + self.minor_indices.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroSubAddressIndicesList { + static instance: MoneroSubAddressIndicesList = MoneroSubAddressIndicesList { + account: ::std::option::Option::None, + minor_indices: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for MoneroSubAddressIndicesList { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("MoneroKeyImageExportInitRequest.MoneroSubAddressIndicesList").unwrap()).clone() + } + } + + impl ::std::fmt::Display for MoneroSubAddressIndicesList { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for MoneroSubAddressIndicesList { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroKeyImageExportInitAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroKeyImageExportInitAck { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroKeyImageExportInitAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroKeyImageExportInitAck { + fn default() -> &'a MoneroKeyImageExportInitAck { + ::default_instance() + } +} + +impl MoneroKeyImageExportInitAck { + pub fn new() -> MoneroKeyImageExportInitAck { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroKeyImageExportInitAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroKeyImageExportInitAck { + const NAME: &'static str = "MoneroKeyImageExportInitAck"; + + 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 { + 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; + 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<()> { + 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() -> MoneroKeyImageExportInitAck { + MoneroKeyImageExportInitAck::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroKeyImageExportInitAck { + static instance: MoneroKeyImageExportInitAck = MoneroKeyImageExportInitAck { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroKeyImageExportInitAck { + 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("MoneroKeyImageExportInitAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroKeyImageExportInitAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroKeyImageExportInitAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroKeyImageSyncStepRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroKeyImageSyncStepRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageSyncStepRequest.tdis) + pub tdis: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroKeyImageSyncStepRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroKeyImageSyncStepRequest { + fn default() -> &'a MoneroKeyImageSyncStepRequest { + ::default_instance() + } +} + +impl MoneroKeyImageSyncStepRequest { + pub fn new() -> MoneroKeyImageSyncStepRequest { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "tdis", + |m: &MoneroKeyImageSyncStepRequest| { &m.tdis }, + |m: &mut MoneroKeyImageSyncStepRequest| { &mut m.tdis }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroKeyImageSyncStepRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroKeyImageSyncStepRequest { + const NAME: &'static str = "MoneroKeyImageSyncStepRequest"; + + fn is_initialized(&self) -> bool { + for v in &self.tdis { + if !v.is_initialized() { + 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.tdis.push(is.read_message()?); + }, + 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; + for value in &self.tdis { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + 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<()> { + for v in &self.tdis { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + }; + 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() -> MoneroKeyImageSyncStepRequest { + MoneroKeyImageSyncStepRequest::new() + } + + fn clear(&mut self) { + self.tdis.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroKeyImageSyncStepRequest { + static instance: MoneroKeyImageSyncStepRequest = MoneroKeyImageSyncStepRequest { + tdis: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroKeyImageSyncStepRequest { + 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("MoneroKeyImageSyncStepRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroKeyImageSyncStepRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroKeyImageSyncStepRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `MoneroKeyImageSyncStepRequest` +pub mod monero_key_image_sync_step_request { + // @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroKeyImageSyncStepRequest.MoneroTransferDetails) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct MoneroTransferDetails { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageSyncStepRequest.MoneroTransferDetails.out_key) + pub out_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageSyncStepRequest.MoneroTransferDetails.tx_pub_key) + pub tx_pub_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageSyncStepRequest.MoneroTransferDetails.additional_tx_pub_keys) + pub additional_tx_pub_keys: ::std::vec::Vec<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageSyncStepRequest.MoneroTransferDetails.internal_output_index) + pub internal_output_index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageSyncStepRequest.MoneroTransferDetails.sub_addr_major) + pub sub_addr_major: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageSyncStepRequest.MoneroTransferDetails.sub_addr_minor) + pub sub_addr_minor: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroKeyImageSyncStepRequest.MoneroTransferDetails.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a MoneroTransferDetails { + fn default() -> &'a MoneroTransferDetails { + ::default_instance() + } + } + + impl MoneroTransferDetails { + pub fn new() -> MoneroTransferDetails { + ::std::default::Default::default() + } + + // required bytes out_key = 1; + + pub fn out_key(&self) -> &[u8] { + match self.out_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_out_key(&mut self) { + self.out_key = ::std::option::Option::None; + } + + pub fn has_out_key(&self) -> bool { + self.out_key.is_some() + } + + // Param is passed by value, moved + pub fn set_out_key(&mut self, v: ::std::vec::Vec) { + self.out_key = ::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_out_key(&mut self) -> &mut ::std::vec::Vec { + if self.out_key.is_none() { + self.out_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.out_key.as_mut().unwrap() + } + + // Take field + pub fn take_out_key(&mut self) -> ::std::vec::Vec { + self.out_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes tx_pub_key = 2; + + pub fn tx_pub_key(&self) -> &[u8] { + match self.tx_pub_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_tx_pub_key(&mut self) { + self.tx_pub_key = ::std::option::Option::None; + } + + pub fn has_tx_pub_key(&self) -> bool { + self.tx_pub_key.is_some() + } + + // Param is passed by value, moved + pub fn set_tx_pub_key(&mut self, v: ::std::vec::Vec) { + self.tx_pub_key = ::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_tx_pub_key(&mut self) -> &mut ::std::vec::Vec { + if self.tx_pub_key.is_none() { + self.tx_pub_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.tx_pub_key.as_mut().unwrap() + } + + // Take field + pub fn take_tx_pub_key(&mut self) -> ::std::vec::Vec { + self.tx_pub_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint64 internal_output_index = 4; + + pub fn internal_output_index(&self) -> u64 { + self.internal_output_index.unwrap_or(0) + } + + pub fn clear_internal_output_index(&mut self) { + self.internal_output_index = ::std::option::Option::None; + } + + pub fn has_internal_output_index(&self) -> bool { + self.internal_output_index.is_some() + } + + // Param is passed by value, moved + pub fn set_internal_output_index(&mut self, v: u64) { + self.internal_output_index = ::std::option::Option::Some(v); + } + + // optional uint32 sub_addr_major = 5; + + pub fn sub_addr_major(&self) -> u32 { + self.sub_addr_major.unwrap_or(0) + } + + pub fn clear_sub_addr_major(&mut self) { + self.sub_addr_major = ::std::option::Option::None; + } + + pub fn has_sub_addr_major(&self) -> bool { + self.sub_addr_major.is_some() + } + + // Param is passed by value, moved + pub fn set_sub_addr_major(&mut self, v: u32) { + self.sub_addr_major = ::std::option::Option::Some(v); + } + + // optional uint32 sub_addr_minor = 6; + + pub fn sub_addr_minor(&self) -> u32 { + self.sub_addr_minor.unwrap_or(0) + } + + pub fn clear_sub_addr_minor(&mut self) { + self.sub_addr_minor = ::std::option::Option::None; + } + + pub fn has_sub_addr_minor(&self) -> bool { + self.sub_addr_minor.is_some() + } + + // Param is passed by value, moved + pub fn set_sub_addr_minor(&mut self, v: u32) { + self.sub_addr_minor = ::std::option::Option::Some(v); + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "out_key", + |m: &MoneroTransferDetails| { &m.out_key }, + |m: &mut MoneroTransferDetails| { &mut m.out_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "tx_pub_key", + |m: &MoneroTransferDetails| { &m.tx_pub_key }, + |m: &mut MoneroTransferDetails| { &mut m.tx_pub_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "additional_tx_pub_keys", + |m: &MoneroTransferDetails| { &m.additional_tx_pub_keys }, + |m: &mut MoneroTransferDetails| { &mut m.additional_tx_pub_keys }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "internal_output_index", + |m: &MoneroTransferDetails| { &m.internal_output_index }, + |m: &mut MoneroTransferDetails| { &mut m.internal_output_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sub_addr_major", + |m: &MoneroTransferDetails| { &m.sub_addr_major }, + |m: &mut MoneroTransferDetails| { &mut m.sub_addr_major }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sub_addr_minor", + |m: &MoneroTransferDetails| { &m.sub_addr_minor }, + |m: &mut MoneroTransferDetails| { &mut m.sub_addr_minor }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroKeyImageSyncStepRequest.MoneroTransferDetails", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for MoneroTransferDetails { + const NAME: &'static str = "MoneroTransferDetails"; + + fn is_initialized(&self) -> bool { + if self.out_key.is_none() { + return false; + } + if self.tx_pub_key.is_none() { + return false; + } + if self.internal_output_index.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.out_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.tx_pub_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.additional_tx_pub_keys.push(is.read_bytes()?); + }, + 32 => { + self.internal_output_index = ::std::option::Option::Some(is.read_uint64()?); + }, + 40 => { + self.sub_addr_major = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.sub_addr_minor = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.out_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.tx_pub_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + for value in &self.additional_tx_pub_keys { + my_size += ::protobuf::rt::bytes_size(3, &value); + }; + if let Some(v) = self.internal_output_index { + my_size += ::protobuf::rt::uint64_size(4, v); + } + if let Some(v) = self.sub_addr_major { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.sub_addr_minor { + my_size += ::protobuf::rt::uint32_size(6, 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.out_key.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.tx_pub_key.as_ref() { + os.write_bytes(2, v)?; + } + for v in &self.additional_tx_pub_keys { + os.write_bytes(3, &v)?; + }; + if let Some(v) = self.internal_output_index { + os.write_uint64(4, v)?; + } + if let Some(v) = self.sub_addr_major { + os.write_uint32(5, v)?; + } + if let Some(v) = self.sub_addr_minor { + os.write_uint32(6, 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() -> MoneroTransferDetails { + MoneroTransferDetails::new() + } + + fn clear(&mut self) { + self.out_key = ::std::option::Option::None; + self.tx_pub_key = ::std::option::Option::None; + self.additional_tx_pub_keys.clear(); + self.internal_output_index = ::std::option::Option::None; + self.sub_addr_major = ::std::option::Option::None; + self.sub_addr_minor = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroTransferDetails { + static instance: MoneroTransferDetails = MoneroTransferDetails { + out_key: ::std::option::Option::None, + tx_pub_key: ::std::option::Option::None, + additional_tx_pub_keys: ::std::vec::Vec::new(), + internal_output_index: ::std::option::Option::None, + sub_addr_major: ::std::option::Option::None, + sub_addr_minor: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for MoneroTransferDetails { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("MoneroKeyImageSyncStepRequest.MoneroTransferDetails").unwrap()).clone() + } + } + + impl ::std::fmt::Display for MoneroTransferDetails { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for MoneroTransferDetails { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroKeyImageSyncStepAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroKeyImageSyncStepAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageSyncStepAck.kis) + pub kis: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroKeyImageSyncStepAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroKeyImageSyncStepAck { + fn default() -> &'a MoneroKeyImageSyncStepAck { + ::default_instance() + } +} + +impl MoneroKeyImageSyncStepAck { + pub fn new() -> MoneroKeyImageSyncStepAck { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "kis", + |m: &MoneroKeyImageSyncStepAck| { &m.kis }, + |m: &mut MoneroKeyImageSyncStepAck| { &mut m.kis }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroKeyImageSyncStepAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroKeyImageSyncStepAck { + const NAME: &'static str = "MoneroKeyImageSyncStepAck"; + + 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.kis.push(is.read_message()?); + }, + 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; + for value in &self.kis { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + 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<()> { + for v in &self.kis { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + }; + 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() -> MoneroKeyImageSyncStepAck { + MoneroKeyImageSyncStepAck::new() + } + + fn clear(&mut self) { + self.kis.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroKeyImageSyncStepAck { + static instance: MoneroKeyImageSyncStepAck = MoneroKeyImageSyncStepAck { + kis: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroKeyImageSyncStepAck { + 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("MoneroKeyImageSyncStepAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroKeyImageSyncStepAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroKeyImageSyncStepAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `MoneroKeyImageSyncStepAck` +pub mod monero_key_image_sync_step_ack { + // @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroKeyImageSyncStepAck.MoneroExportedKeyImage) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct MoneroExportedKeyImage { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageSyncStepAck.MoneroExportedKeyImage.iv) + pub iv: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageSyncStepAck.MoneroExportedKeyImage.blob) + pub blob: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroKeyImageSyncStepAck.MoneroExportedKeyImage.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a MoneroExportedKeyImage { + fn default() -> &'a MoneroExportedKeyImage { + ::default_instance() + } + } + + impl MoneroExportedKeyImage { + pub fn new() -> MoneroExportedKeyImage { + ::std::default::Default::default() + } + + // optional bytes iv = 1; + + pub fn iv(&self) -> &[u8] { + match self.iv.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_iv(&mut self) { + self.iv = ::std::option::Option::None; + } + + pub fn has_iv(&self) -> bool { + self.iv.is_some() + } + + // Param is passed by value, moved + pub fn set_iv(&mut self, v: ::std::vec::Vec) { + self.iv = ::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_iv(&mut self) -> &mut ::std::vec::Vec { + if self.iv.is_none() { + self.iv = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.iv.as_mut().unwrap() + } + + // Take field + pub fn take_iv(&mut self) -> ::std::vec::Vec { + self.iv.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes blob = 3; + + pub fn blob(&self) -> &[u8] { + match self.blob.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_blob(&mut self) { + self.blob = ::std::option::Option::None; + } + + pub fn has_blob(&self) -> bool { + self.blob.is_some() + } + + // Param is passed by value, moved + pub fn set_blob(&mut self, v: ::std::vec::Vec) { + self.blob = ::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_blob(&mut self) -> &mut ::std::vec::Vec { + if self.blob.is_none() { + self.blob = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.blob.as_mut().unwrap() + } + + // Take field + pub fn take_blob(&mut self) -> ::std::vec::Vec { + self.blob.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) 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::<_, _>( + "iv", + |m: &MoneroExportedKeyImage| { &m.iv }, + |m: &mut MoneroExportedKeyImage| { &mut m.iv }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "blob", + |m: &MoneroExportedKeyImage| { &m.blob }, + |m: &mut MoneroExportedKeyImage| { &mut m.blob }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroKeyImageSyncStepAck.MoneroExportedKeyImage", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for MoneroExportedKeyImage { + const NAME: &'static str = "MoneroExportedKeyImage"; + + 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.iv = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.blob = ::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.iv.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.blob.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &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.iv.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.blob.as_ref() { + os.write_bytes(3, 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() -> MoneroExportedKeyImage { + MoneroExportedKeyImage::new() + } + + fn clear(&mut self) { + self.iv = ::std::option::Option::None; + self.blob = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroExportedKeyImage { + static instance: MoneroExportedKeyImage = MoneroExportedKeyImage { + iv: ::std::option::Option::None, + blob: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for MoneroExportedKeyImage { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("MoneroKeyImageSyncStepAck.MoneroExportedKeyImage").unwrap()).clone() + } + } + + impl ::std::fmt::Display for MoneroExportedKeyImage { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for MoneroExportedKeyImage { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroKeyImageSyncFinalRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroKeyImageSyncFinalRequest { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroKeyImageSyncFinalRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroKeyImageSyncFinalRequest { + fn default() -> &'a MoneroKeyImageSyncFinalRequest { + ::default_instance() + } +} + +impl MoneroKeyImageSyncFinalRequest { + pub fn new() -> MoneroKeyImageSyncFinalRequest { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroKeyImageSyncFinalRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroKeyImageSyncFinalRequest { + const NAME: &'static str = "MoneroKeyImageSyncFinalRequest"; + + 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 { + 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; + 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<()> { + 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() -> MoneroKeyImageSyncFinalRequest { + MoneroKeyImageSyncFinalRequest::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroKeyImageSyncFinalRequest { + static instance: MoneroKeyImageSyncFinalRequest = MoneroKeyImageSyncFinalRequest { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroKeyImageSyncFinalRequest { + 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("MoneroKeyImageSyncFinalRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroKeyImageSyncFinalRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroKeyImageSyncFinalRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroKeyImageSyncFinalAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroKeyImageSyncFinalAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroKeyImageSyncFinalAck.enc_key) + pub enc_key: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroKeyImageSyncFinalAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroKeyImageSyncFinalAck { + fn default() -> &'a MoneroKeyImageSyncFinalAck { + ::default_instance() + } +} + +impl MoneroKeyImageSyncFinalAck { + pub fn new() -> MoneroKeyImageSyncFinalAck { + ::std::default::Default::default() + } + + // optional bytes enc_key = 1; + + pub fn enc_key(&self) -> &[u8] { + match self.enc_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_enc_key(&mut self) { + self.enc_key = ::std::option::Option::None; + } + + pub fn has_enc_key(&self) -> bool { + self.enc_key.is_some() + } + + // Param is passed by value, moved + pub fn set_enc_key(&mut self, v: ::std::vec::Vec) { + self.enc_key = ::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_enc_key(&mut self) -> &mut ::std::vec::Vec { + if self.enc_key.is_none() { + self.enc_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.enc_key.as_mut().unwrap() + } + + // Take field + pub fn take_enc_key(&mut self) -> ::std::vec::Vec { + self.enc_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "enc_key", + |m: &MoneroKeyImageSyncFinalAck| { &m.enc_key }, + |m: &mut MoneroKeyImageSyncFinalAck| { &mut m.enc_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroKeyImageSyncFinalAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroKeyImageSyncFinalAck { + const NAME: &'static str = "MoneroKeyImageSyncFinalAck"; + + 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.enc_key = ::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.enc_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.enc_key.as_ref() { + os.write_bytes(1, 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() -> MoneroKeyImageSyncFinalAck { + MoneroKeyImageSyncFinalAck::new() + } + + fn clear(&mut self) { + self.enc_key = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroKeyImageSyncFinalAck { + static instance: MoneroKeyImageSyncFinalAck = MoneroKeyImageSyncFinalAck { + enc_key: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroKeyImageSyncFinalAck { + 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("MoneroKeyImageSyncFinalAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroKeyImageSyncFinalAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroKeyImageSyncFinalAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroGetTxKeyRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroGetTxKeyRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetTxKeyRequest.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetTxKeyRequest.network_type) + pub network_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetTxKeyRequest.salt1) + pub salt1: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetTxKeyRequest.salt2) + pub salt2: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetTxKeyRequest.tx_enc_keys) + pub tx_enc_keys: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetTxKeyRequest.tx_prefix_hash) + pub tx_prefix_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetTxKeyRequest.reason) + pub reason: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetTxKeyRequest.view_public_key) + pub view_public_key: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroGetTxKeyRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroGetTxKeyRequest { + fn default() -> &'a MoneroGetTxKeyRequest { + ::default_instance() + } +} + +impl MoneroGetTxKeyRequest { + pub fn new() -> MoneroGetTxKeyRequest { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.monero.MoneroNetworkType network_type = 2; + + pub fn network_type(&self) -> MoneroNetworkType { + match self.network_type { + Some(e) => e.enum_value_or(MoneroNetworkType::MAINNET), + None => MoneroNetworkType::MAINNET, + } + } + + pub fn clear_network_type(&mut self) { + self.network_type = ::std::option::Option::None; + } + + pub fn has_network_type(&self) -> bool { + self.network_type.is_some() + } + + // Param is passed by value, moved + pub fn set_network_type(&mut self, v: MoneroNetworkType) { + self.network_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // required bytes salt1 = 3; + + pub fn salt1(&self) -> &[u8] { + match self.salt1.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_salt1(&mut self) { + self.salt1 = ::std::option::Option::None; + } + + pub fn has_salt1(&self) -> bool { + self.salt1.is_some() + } + + // Param is passed by value, moved + pub fn set_salt1(&mut self, v: ::std::vec::Vec) { + self.salt1 = ::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_salt1(&mut self) -> &mut ::std::vec::Vec { + if self.salt1.is_none() { + self.salt1 = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.salt1.as_mut().unwrap() + } + + // Take field + pub fn take_salt1(&mut self) -> ::std::vec::Vec { + self.salt1.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes salt2 = 4; + + pub fn salt2(&self) -> &[u8] { + match self.salt2.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_salt2(&mut self) { + self.salt2 = ::std::option::Option::None; + } + + pub fn has_salt2(&self) -> bool { + self.salt2.is_some() + } + + // Param is passed by value, moved + pub fn set_salt2(&mut self, v: ::std::vec::Vec) { + self.salt2 = ::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_salt2(&mut self) -> &mut ::std::vec::Vec { + if self.salt2.is_none() { + self.salt2 = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.salt2.as_mut().unwrap() + } + + // Take field + pub fn take_salt2(&mut self) -> ::std::vec::Vec { + self.salt2.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes tx_enc_keys = 5; + + pub fn tx_enc_keys(&self) -> &[u8] { + match self.tx_enc_keys.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_tx_enc_keys(&mut self) { + self.tx_enc_keys = ::std::option::Option::None; + } + + pub fn has_tx_enc_keys(&self) -> bool { + self.tx_enc_keys.is_some() + } + + // Param is passed by value, moved + pub fn set_tx_enc_keys(&mut self, v: ::std::vec::Vec) { + self.tx_enc_keys = ::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_tx_enc_keys(&mut self) -> &mut ::std::vec::Vec { + if self.tx_enc_keys.is_none() { + self.tx_enc_keys = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.tx_enc_keys.as_mut().unwrap() + } + + // Take field + pub fn take_tx_enc_keys(&mut self) -> ::std::vec::Vec { + self.tx_enc_keys.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes tx_prefix_hash = 6; + + pub fn tx_prefix_hash(&self) -> &[u8] { + match self.tx_prefix_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_tx_prefix_hash(&mut self) { + self.tx_prefix_hash = ::std::option::Option::None; + } + + pub fn has_tx_prefix_hash(&self) -> bool { + self.tx_prefix_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_tx_prefix_hash(&mut self, v: ::std::vec::Vec) { + self.tx_prefix_hash = ::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_tx_prefix_hash(&mut self) -> &mut ::std::vec::Vec { + if self.tx_prefix_hash.is_none() { + self.tx_prefix_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.tx_prefix_hash.as_mut().unwrap() + } + + // Take field + pub fn take_tx_prefix_hash(&mut self) -> ::std::vec::Vec { + self.tx_prefix_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 reason = 7; + + pub fn reason(&self) -> u32 { + self.reason.unwrap_or(0) + } + + pub fn clear_reason(&mut self) { + self.reason = ::std::option::Option::None; + } + + pub fn has_reason(&self) -> bool { + self.reason.is_some() + } + + // Param is passed by value, moved + pub fn set_reason(&mut self, v: u32) { + self.reason = ::std::option::Option::Some(v); + } + + // optional bytes view_public_key = 8; + + pub fn view_public_key(&self) -> &[u8] { + match self.view_public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_view_public_key(&mut self) { + self.view_public_key = ::std::option::Option::None; + } + + pub fn has_view_public_key(&self) -> bool { + self.view_public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_view_public_key(&mut self, v: ::std::vec::Vec) { + self.view_public_key = ::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_view_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.view_public_key.is_none() { + self.view_public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.view_public_key.as_mut().unwrap() + } + + // Take field + pub fn take_view_public_key(&mut self) -> ::std::vec::Vec { + self.view_public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(8); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &MoneroGetTxKeyRequest| { &m.address_n }, + |m: &mut MoneroGetTxKeyRequest| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "network_type", + |m: &MoneroGetTxKeyRequest| { &m.network_type }, + |m: &mut MoneroGetTxKeyRequest| { &mut m.network_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "salt1", + |m: &MoneroGetTxKeyRequest| { &m.salt1 }, + |m: &mut MoneroGetTxKeyRequest| { &mut m.salt1 }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "salt2", + |m: &MoneroGetTxKeyRequest| { &m.salt2 }, + |m: &mut MoneroGetTxKeyRequest| { &mut m.salt2 }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "tx_enc_keys", + |m: &MoneroGetTxKeyRequest| { &m.tx_enc_keys }, + |m: &mut MoneroGetTxKeyRequest| { &mut m.tx_enc_keys }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "tx_prefix_hash", + |m: &MoneroGetTxKeyRequest| { &m.tx_prefix_hash }, + |m: &mut MoneroGetTxKeyRequest| { &mut m.tx_prefix_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "reason", + |m: &MoneroGetTxKeyRequest| { &m.reason }, + |m: &mut MoneroGetTxKeyRequest| { &mut m.reason }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "view_public_key", + |m: &MoneroGetTxKeyRequest| { &m.view_public_key }, + |m: &mut MoneroGetTxKeyRequest| { &mut m.view_public_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroGetTxKeyRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroGetTxKeyRequest { + const NAME: &'static str = "MoneroGetTxKeyRequest"; + + fn is_initialized(&self) -> bool { + if self.salt1.is_none() { + return false; + } + if self.salt2.is_none() { + return false; + } + if self.tx_enc_keys.is_none() { + return false; + } + if self.tx_prefix_hash.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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.network_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 26 => { + self.salt1 = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.salt2 = ::std::option::Option::Some(is.read_bytes()?); + }, + 42 => { + self.tx_enc_keys = ::std::option::Option::Some(is.read_bytes()?); + }, + 50 => { + self.tx_prefix_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 56 => { + self.reason = ::std::option::Option::Some(is.read_uint32()?); + }, + 66 => { + self.view_public_key = ::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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.network_type { + my_size += ::protobuf::rt::int32_size(2, v.value()); + } + if let Some(v) = self.salt1.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.salt2.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.tx_enc_keys.as_ref() { + my_size += ::protobuf::rt::bytes_size(5, &v); + } + if let Some(v) = self.tx_prefix_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &v); + } + if let Some(v) = self.reason { + my_size += ::protobuf::rt::uint32_size(7, v); + } + if let Some(v) = self.view_public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(8, &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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.network_type { + os.write_enum(2, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.salt1.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.salt2.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.tx_enc_keys.as_ref() { + os.write_bytes(5, v)?; + } + if let Some(v) = self.tx_prefix_hash.as_ref() { + os.write_bytes(6, v)?; + } + if let Some(v) = self.reason { + os.write_uint32(7, v)?; + } + if let Some(v) = self.view_public_key.as_ref() { + os.write_bytes(8, 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() -> MoneroGetTxKeyRequest { + MoneroGetTxKeyRequest::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.network_type = ::std::option::Option::None; + self.salt1 = ::std::option::Option::None; + self.salt2 = ::std::option::Option::None; + self.tx_enc_keys = ::std::option::Option::None; + self.tx_prefix_hash = ::std::option::Option::None; + self.reason = ::std::option::Option::None; + self.view_public_key = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroGetTxKeyRequest { + static instance: MoneroGetTxKeyRequest = MoneroGetTxKeyRequest { + address_n: ::std::vec::Vec::new(), + network_type: ::std::option::Option::None, + salt1: ::std::option::Option::None, + salt2: ::std::option::Option::None, + tx_enc_keys: ::std::option::Option::None, + tx_prefix_hash: ::std::option::Option::None, + reason: ::std::option::Option::None, + view_public_key: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroGetTxKeyRequest { + 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("MoneroGetTxKeyRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroGetTxKeyRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroGetTxKeyRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroGetTxKeyAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroGetTxKeyAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetTxKeyAck.salt) + pub salt: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetTxKeyAck.tx_keys) + pub tx_keys: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroGetTxKeyAck.tx_derivations) + pub tx_derivations: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroGetTxKeyAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroGetTxKeyAck { + fn default() -> &'a MoneroGetTxKeyAck { + ::default_instance() + } +} + +impl MoneroGetTxKeyAck { + pub fn new() -> MoneroGetTxKeyAck { + ::std::default::Default::default() + } + + // optional bytes salt = 1; + + pub fn salt(&self) -> &[u8] { + match self.salt.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_salt(&mut self) { + self.salt = ::std::option::Option::None; + } + + pub fn has_salt(&self) -> bool { + self.salt.is_some() + } + + // Param is passed by value, moved + pub fn set_salt(&mut self, v: ::std::vec::Vec) { + self.salt = ::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_salt(&mut self) -> &mut ::std::vec::Vec { + if self.salt.is_none() { + self.salt = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.salt.as_mut().unwrap() + } + + // Take field + pub fn take_salt(&mut self) -> ::std::vec::Vec { + self.salt.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes tx_keys = 2; + + pub fn tx_keys(&self) -> &[u8] { + match self.tx_keys.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_tx_keys(&mut self) { + self.tx_keys = ::std::option::Option::None; + } + + pub fn has_tx_keys(&self) -> bool { + self.tx_keys.is_some() + } + + // Param is passed by value, moved + pub fn set_tx_keys(&mut self, v: ::std::vec::Vec) { + self.tx_keys = ::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_tx_keys(&mut self) -> &mut ::std::vec::Vec { + if self.tx_keys.is_none() { + self.tx_keys = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.tx_keys.as_mut().unwrap() + } + + // Take field + pub fn take_tx_keys(&mut self) -> ::std::vec::Vec { + self.tx_keys.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes tx_derivations = 3; + + pub fn tx_derivations(&self) -> &[u8] { + match self.tx_derivations.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_tx_derivations(&mut self) { + self.tx_derivations = ::std::option::Option::None; + } + + pub fn has_tx_derivations(&self) -> bool { + self.tx_derivations.is_some() + } + + // Param is passed by value, moved + pub fn set_tx_derivations(&mut self, v: ::std::vec::Vec) { + self.tx_derivations = ::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_tx_derivations(&mut self) -> &mut ::std::vec::Vec { + if self.tx_derivations.is_none() { + self.tx_derivations = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.tx_derivations.as_mut().unwrap() + } + + // Take field + pub fn take_tx_derivations(&mut self) -> ::std::vec::Vec { + self.tx_derivations.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "salt", + |m: &MoneroGetTxKeyAck| { &m.salt }, + |m: &mut MoneroGetTxKeyAck| { &mut m.salt }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "tx_keys", + |m: &MoneroGetTxKeyAck| { &m.tx_keys }, + |m: &mut MoneroGetTxKeyAck| { &mut m.tx_keys }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "tx_derivations", + |m: &MoneroGetTxKeyAck| { &m.tx_derivations }, + |m: &mut MoneroGetTxKeyAck| { &mut m.tx_derivations }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroGetTxKeyAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroGetTxKeyAck { + const NAME: &'static str = "MoneroGetTxKeyAck"; + + 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.salt = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.tx_keys = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.tx_derivations = ::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.salt.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.tx_keys.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.tx_derivations.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &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.salt.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.tx_keys.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.tx_derivations.as_ref() { + os.write_bytes(3, 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() -> MoneroGetTxKeyAck { + MoneroGetTxKeyAck::new() + } + + fn clear(&mut self) { + self.salt = ::std::option::Option::None; + self.tx_keys = ::std::option::Option::None; + self.tx_derivations = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroGetTxKeyAck { + static instance: MoneroGetTxKeyAck = MoneroGetTxKeyAck { + salt: ::std::option::Option::None, + tx_keys: ::std::option::Option::None, + tx_derivations: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroGetTxKeyAck { + 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("MoneroGetTxKeyAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroGetTxKeyAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroGetTxKeyAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroLiveRefreshStartRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroLiveRefreshStartRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroLiveRefreshStartRequest.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroLiveRefreshStartRequest.network_type) + pub network_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroLiveRefreshStartRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroLiveRefreshStartRequest { + fn default() -> &'a MoneroLiveRefreshStartRequest { + ::default_instance() + } +} + +impl MoneroLiveRefreshStartRequest { + pub fn new() -> MoneroLiveRefreshStartRequest { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.monero.MoneroNetworkType network_type = 2; + + pub fn network_type(&self) -> MoneroNetworkType { + match self.network_type { + Some(e) => e.enum_value_or(MoneroNetworkType::MAINNET), + None => MoneroNetworkType::MAINNET, + } + } + + pub fn clear_network_type(&mut self) { + self.network_type = ::std::option::Option::None; + } + + pub fn has_network_type(&self) -> bool { + self.network_type.is_some() + } + + // Param is passed by value, moved + pub fn set_network_type(&mut self, v: MoneroNetworkType) { + self.network_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + 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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &MoneroLiveRefreshStartRequest| { &m.address_n }, + |m: &mut MoneroLiveRefreshStartRequest| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "network_type", + |m: &MoneroLiveRefreshStartRequest| { &m.network_type }, + |m: &mut MoneroLiveRefreshStartRequest| { &mut m.network_type }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroLiveRefreshStartRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroLiveRefreshStartRequest { + const NAME: &'static str = "MoneroLiveRefreshStartRequest"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.network_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.network_type { + my_size += ::protobuf::rt::int32_size(2, v.value()); + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.network_type { + os.write_enum(2, ::protobuf::EnumOrUnknown::value(&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() -> MoneroLiveRefreshStartRequest { + MoneroLiveRefreshStartRequest::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.network_type = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroLiveRefreshStartRequest { + static instance: MoneroLiveRefreshStartRequest = MoneroLiveRefreshStartRequest { + address_n: ::std::vec::Vec::new(), + network_type: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroLiveRefreshStartRequest { + 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("MoneroLiveRefreshStartRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroLiveRefreshStartRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroLiveRefreshStartRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroLiveRefreshStartAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroLiveRefreshStartAck { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroLiveRefreshStartAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroLiveRefreshStartAck { + fn default() -> &'a MoneroLiveRefreshStartAck { + ::default_instance() + } +} + +impl MoneroLiveRefreshStartAck { + pub fn new() -> MoneroLiveRefreshStartAck { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroLiveRefreshStartAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroLiveRefreshStartAck { + const NAME: &'static str = "MoneroLiveRefreshStartAck"; + + 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 { + 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; + 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<()> { + 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() -> MoneroLiveRefreshStartAck { + MoneroLiveRefreshStartAck::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroLiveRefreshStartAck { + static instance: MoneroLiveRefreshStartAck = MoneroLiveRefreshStartAck { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroLiveRefreshStartAck { + 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("MoneroLiveRefreshStartAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroLiveRefreshStartAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroLiveRefreshStartAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroLiveRefreshStepRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroLiveRefreshStepRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroLiveRefreshStepRequest.out_key) + pub out_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroLiveRefreshStepRequest.recv_deriv) + pub recv_deriv: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroLiveRefreshStepRequest.real_out_idx) + pub real_out_idx: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroLiveRefreshStepRequest.sub_addr_major) + pub sub_addr_major: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroLiveRefreshStepRequest.sub_addr_minor) + pub sub_addr_minor: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroLiveRefreshStepRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroLiveRefreshStepRequest { + fn default() -> &'a MoneroLiveRefreshStepRequest { + ::default_instance() + } +} + +impl MoneroLiveRefreshStepRequest { + pub fn new() -> MoneroLiveRefreshStepRequest { + ::std::default::Default::default() + } + + // required bytes out_key = 1; + + pub fn out_key(&self) -> &[u8] { + match self.out_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_out_key(&mut self) { + self.out_key = ::std::option::Option::None; + } + + pub fn has_out_key(&self) -> bool { + self.out_key.is_some() + } + + // Param is passed by value, moved + pub fn set_out_key(&mut self, v: ::std::vec::Vec) { + self.out_key = ::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_out_key(&mut self) -> &mut ::std::vec::Vec { + if self.out_key.is_none() { + self.out_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.out_key.as_mut().unwrap() + } + + // Take field + pub fn take_out_key(&mut self) -> ::std::vec::Vec { + self.out_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes recv_deriv = 2; + + pub fn recv_deriv(&self) -> &[u8] { + match self.recv_deriv.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_recv_deriv(&mut self) { + self.recv_deriv = ::std::option::Option::None; + } + + pub fn has_recv_deriv(&self) -> bool { + self.recv_deriv.is_some() + } + + // Param is passed by value, moved + pub fn set_recv_deriv(&mut self, v: ::std::vec::Vec) { + self.recv_deriv = ::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_recv_deriv(&mut self) -> &mut ::std::vec::Vec { + if self.recv_deriv.is_none() { + self.recv_deriv = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.recv_deriv.as_mut().unwrap() + } + + // Take field + pub fn take_recv_deriv(&mut self) -> ::std::vec::Vec { + self.recv_deriv.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint64 real_out_idx = 3; + + pub fn real_out_idx(&self) -> u64 { + self.real_out_idx.unwrap_or(0) + } + + pub fn clear_real_out_idx(&mut self) { + self.real_out_idx = ::std::option::Option::None; + } + + pub fn has_real_out_idx(&self) -> bool { + self.real_out_idx.is_some() + } + + // Param is passed by value, moved + pub fn set_real_out_idx(&mut self, v: u64) { + self.real_out_idx = ::std::option::Option::Some(v); + } + + // required uint32 sub_addr_major = 4; + + pub fn sub_addr_major(&self) -> u32 { + self.sub_addr_major.unwrap_or(0) + } + + pub fn clear_sub_addr_major(&mut self) { + self.sub_addr_major = ::std::option::Option::None; + } + + pub fn has_sub_addr_major(&self) -> bool { + self.sub_addr_major.is_some() + } + + // Param is passed by value, moved + pub fn set_sub_addr_major(&mut self, v: u32) { + self.sub_addr_major = ::std::option::Option::Some(v); + } + + // required uint32 sub_addr_minor = 5; + + pub fn sub_addr_minor(&self) -> u32 { + self.sub_addr_minor.unwrap_or(0) + } + + pub fn clear_sub_addr_minor(&mut self) { + self.sub_addr_minor = ::std::option::Option::None; + } + + pub fn has_sub_addr_minor(&self) -> bool { + self.sub_addr_minor.is_some() + } + + // Param is passed by value, moved + pub fn set_sub_addr_minor(&mut self, v: u32) { + self.sub_addr_minor = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "out_key", + |m: &MoneroLiveRefreshStepRequest| { &m.out_key }, + |m: &mut MoneroLiveRefreshStepRequest| { &mut m.out_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "recv_deriv", + |m: &MoneroLiveRefreshStepRequest| { &m.recv_deriv }, + |m: &mut MoneroLiveRefreshStepRequest| { &mut m.recv_deriv }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "real_out_idx", + |m: &MoneroLiveRefreshStepRequest| { &m.real_out_idx }, + |m: &mut MoneroLiveRefreshStepRequest| { &mut m.real_out_idx }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sub_addr_major", + |m: &MoneroLiveRefreshStepRequest| { &m.sub_addr_major }, + |m: &mut MoneroLiveRefreshStepRequest| { &mut m.sub_addr_major }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sub_addr_minor", + |m: &MoneroLiveRefreshStepRequest| { &m.sub_addr_minor }, + |m: &mut MoneroLiveRefreshStepRequest| { &mut m.sub_addr_minor }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroLiveRefreshStepRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroLiveRefreshStepRequest { + const NAME: &'static str = "MoneroLiveRefreshStepRequest"; + + fn is_initialized(&self) -> bool { + if self.out_key.is_none() { + return false; + } + if self.recv_deriv.is_none() { + return false; + } + if self.real_out_idx.is_none() { + return false; + } + if self.sub_addr_major.is_none() { + return false; + } + if self.sub_addr_minor.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.out_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.recv_deriv = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.real_out_idx = ::std::option::Option::Some(is.read_uint64()?); + }, + 32 => { + self.sub_addr_major = ::std::option::Option::Some(is.read_uint32()?); + }, + 40 => { + self.sub_addr_minor = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.out_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.recv_deriv.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.real_out_idx { + my_size += ::protobuf::rt::uint64_size(3, v); + } + if let Some(v) = self.sub_addr_major { + my_size += ::protobuf::rt::uint32_size(4, v); + } + if let Some(v) = self.sub_addr_minor { + my_size += ::protobuf::rt::uint32_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.out_key.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.recv_deriv.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.real_out_idx { + os.write_uint64(3, v)?; + } + if let Some(v) = self.sub_addr_major { + os.write_uint32(4, v)?; + } + if let Some(v) = self.sub_addr_minor { + os.write_uint32(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() -> MoneroLiveRefreshStepRequest { + MoneroLiveRefreshStepRequest::new() + } + + fn clear(&mut self) { + self.out_key = ::std::option::Option::None; + self.recv_deriv = ::std::option::Option::None; + self.real_out_idx = ::std::option::Option::None; + self.sub_addr_major = ::std::option::Option::None; + self.sub_addr_minor = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroLiveRefreshStepRequest { + static instance: MoneroLiveRefreshStepRequest = MoneroLiveRefreshStepRequest { + out_key: ::std::option::Option::None, + recv_deriv: ::std::option::Option::None, + real_out_idx: ::std::option::Option::None, + sub_addr_major: ::std::option::Option::None, + sub_addr_minor: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroLiveRefreshStepRequest { + 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("MoneroLiveRefreshStepRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroLiveRefreshStepRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroLiveRefreshStepRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroLiveRefreshStepAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroLiveRefreshStepAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroLiveRefreshStepAck.salt) + pub salt: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.MoneroLiveRefreshStepAck.key_image) + pub key_image: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroLiveRefreshStepAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroLiveRefreshStepAck { + fn default() -> &'a MoneroLiveRefreshStepAck { + ::default_instance() + } +} + +impl MoneroLiveRefreshStepAck { + pub fn new() -> MoneroLiveRefreshStepAck { + ::std::default::Default::default() + } + + // optional bytes salt = 1; + + pub fn salt(&self) -> &[u8] { + match self.salt.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_salt(&mut self) { + self.salt = ::std::option::Option::None; + } + + pub fn has_salt(&self) -> bool { + self.salt.is_some() + } + + // Param is passed by value, moved + pub fn set_salt(&mut self, v: ::std::vec::Vec) { + self.salt = ::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_salt(&mut self) -> &mut ::std::vec::Vec { + if self.salt.is_none() { + self.salt = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.salt.as_mut().unwrap() + } + + // Take field + pub fn take_salt(&mut self) -> ::std::vec::Vec { + self.salt.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes key_image = 2; + + pub fn key_image(&self) -> &[u8] { + match self.key_image.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_key_image(&mut self) { + self.key_image = ::std::option::Option::None; + } + + pub fn has_key_image(&self) -> bool { + self.key_image.is_some() + } + + // Param is passed by value, moved + pub fn set_key_image(&mut self, v: ::std::vec::Vec) { + self.key_image = ::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_key_image(&mut self) -> &mut ::std::vec::Vec { + if self.key_image.is_none() { + self.key_image = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.key_image.as_mut().unwrap() + } + + // Take field + pub fn take_key_image(&mut self) -> ::std::vec::Vec { + self.key_image.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::<_, _>( + "salt", + |m: &MoneroLiveRefreshStepAck| { &m.salt }, + |m: &mut MoneroLiveRefreshStepAck| { &mut m.salt }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "key_image", + |m: &MoneroLiveRefreshStepAck| { &m.key_image }, + |m: &mut MoneroLiveRefreshStepAck| { &mut m.key_image }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroLiveRefreshStepAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroLiveRefreshStepAck { + const NAME: &'static str = "MoneroLiveRefreshStepAck"; + + 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.salt = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.key_image = ::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.salt.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.key_image.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.salt.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.key_image.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() -> MoneroLiveRefreshStepAck { + MoneroLiveRefreshStepAck::new() + } + + fn clear(&mut self) { + self.salt = ::std::option::Option::None; + self.key_image = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroLiveRefreshStepAck { + static instance: MoneroLiveRefreshStepAck = MoneroLiveRefreshStepAck { + salt: ::std::option::Option::None, + key_image: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroLiveRefreshStepAck { + 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("MoneroLiveRefreshStepAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroLiveRefreshStepAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroLiveRefreshStepAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroLiveRefreshFinalRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroLiveRefreshFinalRequest { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroLiveRefreshFinalRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroLiveRefreshFinalRequest { + fn default() -> &'a MoneroLiveRefreshFinalRequest { + ::default_instance() + } +} + +impl MoneroLiveRefreshFinalRequest { + pub fn new() -> MoneroLiveRefreshFinalRequest { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroLiveRefreshFinalRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroLiveRefreshFinalRequest { + const NAME: &'static str = "MoneroLiveRefreshFinalRequest"; + + 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 { + 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; + 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<()> { + 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() -> MoneroLiveRefreshFinalRequest { + MoneroLiveRefreshFinalRequest::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroLiveRefreshFinalRequest { + static instance: MoneroLiveRefreshFinalRequest = MoneroLiveRefreshFinalRequest { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroLiveRefreshFinalRequest { + 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("MoneroLiveRefreshFinalRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroLiveRefreshFinalRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroLiveRefreshFinalRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.MoneroLiveRefreshFinalAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct MoneroLiveRefreshFinalAck { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.MoneroLiveRefreshFinalAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MoneroLiveRefreshFinalAck { + fn default() -> &'a MoneroLiveRefreshFinalAck { + ::default_instance() + } +} + +impl MoneroLiveRefreshFinalAck { + pub fn new() -> MoneroLiveRefreshFinalAck { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MoneroLiveRefreshFinalAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MoneroLiveRefreshFinalAck { + const NAME: &'static str = "MoneroLiveRefreshFinalAck"; + + 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 { + 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; + 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<()> { + 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() -> MoneroLiveRefreshFinalAck { + MoneroLiveRefreshFinalAck::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static MoneroLiveRefreshFinalAck { + static instance: MoneroLiveRefreshFinalAck = MoneroLiveRefreshFinalAck { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MoneroLiveRefreshFinalAck { + 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("MoneroLiveRefreshFinalAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MoneroLiveRefreshFinalAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MoneroLiveRefreshFinalAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.DebugMoneroDiagRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugMoneroDiagRequest { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.DebugMoneroDiagRequest.ins) + pub ins: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.DebugMoneroDiagRequest.p1) + pub p1: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.DebugMoneroDiagRequest.p2) + pub p2: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.DebugMoneroDiagRequest.pd) + pub pd: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.DebugMoneroDiagRequest.data1) + pub data1: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.DebugMoneroDiagRequest.data2) + pub data2: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.DebugMoneroDiagRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugMoneroDiagRequest { + fn default() -> &'a DebugMoneroDiagRequest { + ::default_instance() + } +} + +impl DebugMoneroDiagRequest { + pub fn new() -> DebugMoneroDiagRequest { + ::std::default::Default::default() + } + + // optional uint64 ins = 1; + + pub fn ins(&self) -> u64 { + self.ins.unwrap_or(0) + } + + pub fn clear_ins(&mut self) { + self.ins = ::std::option::Option::None; + } + + pub fn has_ins(&self) -> bool { + self.ins.is_some() + } + + // Param is passed by value, moved + pub fn set_ins(&mut self, v: u64) { + self.ins = ::std::option::Option::Some(v); + } + + // optional uint64 p1 = 2; + + pub fn p1(&self) -> u64 { + self.p1.unwrap_or(0) + } + + pub fn clear_p1(&mut self) { + self.p1 = ::std::option::Option::None; + } + + pub fn has_p1(&self) -> bool { + self.p1.is_some() + } + + // Param is passed by value, moved + pub fn set_p1(&mut self, v: u64) { + self.p1 = ::std::option::Option::Some(v); + } + + // optional uint64 p2 = 3; + + pub fn p2(&self) -> u64 { + self.p2.unwrap_or(0) + } + + pub fn clear_p2(&mut self) { + self.p2 = ::std::option::Option::None; + } + + pub fn has_p2(&self) -> bool { + self.p2.is_some() + } + + // Param is passed by value, moved + pub fn set_p2(&mut self, v: u64) { + self.p2 = ::std::option::Option::Some(v); + } + + // optional bytes data1 = 5; + + pub fn data1(&self) -> &[u8] { + match self.data1.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_data1(&mut self) { + self.data1 = ::std::option::Option::None; + } + + pub fn has_data1(&self) -> bool { + self.data1.is_some() + } + + // Param is passed by value, moved + pub fn set_data1(&mut self, v: ::std::vec::Vec) { + self.data1 = ::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_data1(&mut self) -> &mut ::std::vec::Vec { + if self.data1.is_none() { + self.data1 = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.data1.as_mut().unwrap() + } + + // Take field + pub fn take_data1(&mut self) -> ::std::vec::Vec { + self.data1.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes data2 = 6; + + pub fn data2(&self) -> &[u8] { + match self.data2.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_data2(&mut self) { + self.data2 = ::std::option::Option::None; + } + + pub fn has_data2(&self) -> bool { + self.data2.is_some() + } + + // Param is passed by value, moved + pub fn set_data2(&mut self, v: ::std::vec::Vec) { + self.data2 = ::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_data2(&mut self) -> &mut ::std::vec::Vec { + if self.data2.is_none() { + self.data2 = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.data2.as_mut().unwrap() + } + + // Take field + pub fn take_data2(&mut self) -> ::std::vec::Vec { + self.data2.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ins", + |m: &DebugMoneroDiagRequest| { &m.ins }, + |m: &mut DebugMoneroDiagRequest| { &mut m.ins }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "p1", + |m: &DebugMoneroDiagRequest| { &m.p1 }, + |m: &mut DebugMoneroDiagRequest| { &mut m.p1 }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "p2", + |m: &DebugMoneroDiagRequest| { &m.p2 }, + |m: &mut DebugMoneroDiagRequest| { &mut m.p2 }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "pd", + |m: &DebugMoneroDiagRequest| { &m.pd }, + |m: &mut DebugMoneroDiagRequest| { &mut m.pd }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data1", + |m: &DebugMoneroDiagRequest| { &m.data1 }, + |m: &mut DebugMoneroDiagRequest| { &mut m.data1 }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data2", + |m: &DebugMoneroDiagRequest| { &m.data2 }, + |m: &mut DebugMoneroDiagRequest| { &mut m.data2 }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugMoneroDiagRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugMoneroDiagRequest { + const NAME: &'static str = "DebugMoneroDiagRequest"; + + 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 { + 8 => { + self.ins = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.p1 = ::std::option::Option::Some(is.read_uint64()?); + }, + 24 => { + self.p2 = ::std::option::Option::Some(is.read_uint64()?); + }, + 34 => { + is.read_repeated_packed_uint64_into(&mut self.pd)?; + }, + 32 => { + self.pd.push(is.read_uint64()?); + }, + 42 => { + self.data1 = ::std::option::Option::Some(is.read_bytes()?); + }, + 50 => { + self.data2 = ::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.ins { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.p1 { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.p2 { + my_size += ::protobuf::rt::uint64_size(3, v); + } + for value in &self.pd { + my_size += ::protobuf::rt::uint64_size(4, *value); + }; + if let Some(v) = self.data1.as_ref() { + my_size += ::protobuf::rt::bytes_size(5, &v); + } + if let Some(v) = self.data2.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &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.ins { + os.write_uint64(1, v)?; + } + if let Some(v) = self.p1 { + os.write_uint64(2, v)?; + } + if let Some(v) = self.p2 { + os.write_uint64(3, v)?; + } + for v in &self.pd { + os.write_uint64(4, *v)?; + }; + if let Some(v) = self.data1.as_ref() { + os.write_bytes(5, v)?; + } + if let Some(v) = self.data2.as_ref() { + os.write_bytes(6, 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() -> DebugMoneroDiagRequest { + DebugMoneroDiagRequest::new() + } + + fn clear(&mut self) { + self.ins = ::std::option::Option::None; + self.p1 = ::std::option::Option::None; + self.p2 = ::std::option::Option::None; + self.pd.clear(); + self.data1 = ::std::option::Option::None; + self.data2 = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugMoneroDiagRequest { + static instance: DebugMoneroDiagRequest = DebugMoneroDiagRequest { + ins: ::std::option::Option::None, + p1: ::std::option::Option::None, + p2: ::std::option::Option::None, + pd: ::std::vec::Vec::new(), + data1: ::std::option::Option::None, + data2: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugMoneroDiagRequest { + 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("DebugMoneroDiagRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugMoneroDiagRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugMoneroDiagRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.monero.DebugMoneroDiagAck) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DebugMoneroDiagAck { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.monero.DebugMoneroDiagAck.ins) + pub ins: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.DebugMoneroDiagAck.p1) + pub p1: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.DebugMoneroDiagAck.p2) + pub p2: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.DebugMoneroDiagAck.pd) + pub pd: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.DebugMoneroDiagAck.data1) + pub data1: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.monero.DebugMoneroDiagAck.data2) + pub data2: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.monero.DebugMoneroDiagAck.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DebugMoneroDiagAck { + fn default() -> &'a DebugMoneroDiagAck { + ::default_instance() + } +} + +impl DebugMoneroDiagAck { + pub fn new() -> DebugMoneroDiagAck { + ::std::default::Default::default() + } + + // optional uint64 ins = 1; + + pub fn ins(&self) -> u64 { + self.ins.unwrap_or(0) + } + + pub fn clear_ins(&mut self) { + self.ins = ::std::option::Option::None; + } + + pub fn has_ins(&self) -> bool { + self.ins.is_some() + } + + // Param is passed by value, moved + pub fn set_ins(&mut self, v: u64) { + self.ins = ::std::option::Option::Some(v); + } + + // optional uint64 p1 = 2; + + pub fn p1(&self) -> u64 { + self.p1.unwrap_or(0) + } + + pub fn clear_p1(&mut self) { + self.p1 = ::std::option::Option::None; + } + + pub fn has_p1(&self) -> bool { + self.p1.is_some() + } + + // Param is passed by value, moved + pub fn set_p1(&mut self, v: u64) { + self.p1 = ::std::option::Option::Some(v); + } + + // optional uint64 p2 = 3; + + pub fn p2(&self) -> u64 { + self.p2.unwrap_or(0) + } + + pub fn clear_p2(&mut self) { + self.p2 = ::std::option::Option::None; + } + + pub fn has_p2(&self) -> bool { + self.p2.is_some() + } + + // Param is passed by value, moved + pub fn set_p2(&mut self, v: u64) { + self.p2 = ::std::option::Option::Some(v); + } + + // optional bytes data1 = 5; + + pub fn data1(&self) -> &[u8] { + match self.data1.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_data1(&mut self) { + self.data1 = ::std::option::Option::None; + } + + pub fn has_data1(&self) -> bool { + self.data1.is_some() + } + + // Param is passed by value, moved + pub fn set_data1(&mut self, v: ::std::vec::Vec) { + self.data1 = ::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_data1(&mut self) -> &mut ::std::vec::Vec { + if self.data1.is_none() { + self.data1 = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.data1.as_mut().unwrap() + } + + // Take field + pub fn take_data1(&mut self) -> ::std::vec::Vec { + self.data1.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes data2 = 6; + + pub fn data2(&self) -> &[u8] { + match self.data2.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_data2(&mut self) { + self.data2 = ::std::option::Option::None; + } + + pub fn has_data2(&self) -> bool { + self.data2.is_some() + } + + // Param is passed by value, moved + pub fn set_data2(&mut self, v: ::std::vec::Vec) { + self.data2 = ::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_data2(&mut self) -> &mut ::std::vec::Vec { + if self.data2.is_none() { + self.data2 = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.data2.as_mut().unwrap() + } + + // Take field + pub fn take_data2(&mut self) -> ::std::vec::Vec { + self.data2.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ins", + |m: &DebugMoneroDiagAck| { &m.ins }, + |m: &mut DebugMoneroDiagAck| { &mut m.ins }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "p1", + |m: &DebugMoneroDiagAck| { &m.p1 }, + |m: &mut DebugMoneroDiagAck| { &mut m.p1 }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "p2", + |m: &DebugMoneroDiagAck| { &m.p2 }, + |m: &mut DebugMoneroDiagAck| { &mut m.p2 }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "pd", + |m: &DebugMoneroDiagAck| { &m.pd }, + |m: &mut DebugMoneroDiagAck| { &mut m.pd }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data1", + |m: &DebugMoneroDiagAck| { &m.data1 }, + |m: &mut DebugMoneroDiagAck| { &mut m.data1 }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "data2", + |m: &DebugMoneroDiagAck| { &m.data2 }, + |m: &mut DebugMoneroDiagAck| { &mut m.data2 }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DebugMoneroDiagAck", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DebugMoneroDiagAck { + const NAME: &'static str = "DebugMoneroDiagAck"; + + 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 { + 8 => { + self.ins = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.p1 = ::std::option::Option::Some(is.read_uint64()?); + }, + 24 => { + self.p2 = ::std::option::Option::Some(is.read_uint64()?); + }, + 34 => { + is.read_repeated_packed_uint64_into(&mut self.pd)?; + }, + 32 => { + self.pd.push(is.read_uint64()?); + }, + 42 => { + self.data1 = ::std::option::Option::Some(is.read_bytes()?); + }, + 50 => { + self.data2 = ::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.ins { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.p1 { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.p2 { + my_size += ::protobuf::rt::uint64_size(3, v); + } + for value in &self.pd { + my_size += ::protobuf::rt::uint64_size(4, *value); + }; + if let Some(v) = self.data1.as_ref() { + my_size += ::protobuf::rt::bytes_size(5, &v); + } + if let Some(v) = self.data2.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &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.ins { + os.write_uint64(1, v)?; + } + if let Some(v) = self.p1 { + os.write_uint64(2, v)?; + } + if let Some(v) = self.p2 { + os.write_uint64(3, v)?; + } + for v in &self.pd { + os.write_uint64(4, *v)?; + }; + if let Some(v) = self.data1.as_ref() { + os.write_bytes(5, v)?; + } + if let Some(v) = self.data2.as_ref() { + os.write_bytes(6, 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() -> DebugMoneroDiagAck { + DebugMoneroDiagAck::new() + } + + fn clear(&mut self) { + self.ins = ::std::option::Option::None; + self.p1 = ::std::option::Option::None; + self.p2 = ::std::option::Option::None; + self.pd.clear(); + self.data1 = ::std::option::Option::None; + self.data2 = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DebugMoneroDiagAck { + static instance: DebugMoneroDiagAck = DebugMoneroDiagAck { + ins: ::std::option::Option::None, + p1: ::std::option::Option::None, + p2: ::std::option::Option::None, + pd: ::std::vec::Vec::new(), + data1: ::std::option::Option::None, + data2: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DebugMoneroDiagAck { + 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("DebugMoneroDiagAck").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DebugMoneroDiagAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugMoneroDiagAck { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.monero.MoneroNetworkType) +pub enum MoneroNetworkType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.monero.MoneroNetworkType.MAINNET) + MAINNET = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.monero.MoneroNetworkType.TESTNET) + TESTNET = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.monero.MoneroNetworkType.STAGENET) + STAGENET = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.monero.MoneroNetworkType.FAKECHAIN) + FAKECHAIN = 3, +} + +impl ::protobuf::Enum for MoneroNetworkType { + const NAME: &'static str = "MoneroNetworkType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(MoneroNetworkType::MAINNET), + 1 => ::std::option::Option::Some(MoneroNetworkType::TESTNET), + 2 => ::std::option::Option::Some(MoneroNetworkType::STAGENET), + 3 => ::std::option::Option::Some(MoneroNetworkType::FAKECHAIN), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "MAINNET" => ::std::option::Option::Some(MoneroNetworkType::MAINNET), + "TESTNET" => ::std::option::Option::Some(MoneroNetworkType::TESTNET), + "STAGENET" => ::std::option::Option::Some(MoneroNetworkType::STAGENET), + "FAKECHAIN" => ::std::option::Option::Some(MoneroNetworkType::FAKECHAIN), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [MoneroNetworkType] = &[ + MoneroNetworkType::MAINNET, + MoneroNetworkType::TESTNET, + MoneroNetworkType::STAGENET, + MoneroNetworkType::FAKECHAIN, + ]; +} + +impl ::protobuf::EnumFull for MoneroNetworkType { + 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("MoneroNetworkType").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 MoneroNetworkType { + fn default() -> Self { + MoneroNetworkType::MAINNET + } +} + +impl MoneroNetworkType { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("MoneroNetworkType") + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x15messages-monero.proto\x12\x19hw.trezor.messages.monero\"\xc9\x06\n\ + \x1cMoneroTransactionSourceEntry\x12c\n\x07outputs\x18\x01\x20\x03(\x0b2\ + I.hw.trezor.messages.monero.MoneroTransactionSourceEntry.MoneroOutputEnt\ + ryR\x07outputs\x12\x1f\n\x0breal_output\x18\x02\x20\x01(\x04R\nrealOutpu\ + t\x12%\n\x0freal_out_tx_key\x18\x03\x20\x01(\x0cR\x0crealOutTxKey\x12<\n\ + \x1breal_out_additional_tx_keys\x18\x04\x20\x03(\x0cR\x17realOutAddition\ + alTxKeys\x124\n\x17real_output_in_tx_index\x18\x05\x20\x01(\x04R\x13real\ + OutputInTxIndex\x12\x16\n\x06amount\x18\x06\x20\x01(\x04R\x06amount\x12\ + \x10\n\x03rct\x18\x07\x20\x01(\x08R\x03rct\x12\x12\n\x04mask\x18\x08\x20\ + \x01(\x0cR\x04mask\x12r\n\x0emultisig_kLRki\x18\t\x20\x01(\x0b2K.hw.trez\ + or.messages.monero.MoneroTransactionSourceEntry.MoneroMultisigKLRkiR\rmu\ + ltisigKLRki\x12#\n\rsubaddr_minor\x18\n\x20\x01(\rR\x0csubaddrMinor\x1a\ + \xdf\x01\n\x11MoneroOutputEntry\x12\x10\n\x03idx\x18\x01\x20\x01(\x04R\ + \x03idx\x12n\n\x03key\x18\x02\x20\x01(\x0b2\\.hw.trezor.messages.monero.\ + MoneroTransactionSourceEntry.MoneroOutputEntry.MoneroRctKeyPublicR\x03ke\ + y\x1aH\n\x12MoneroRctKeyPublic\x12\x12\n\x04dest\x18\x01\x20\x02(\x0cR\ + \x04dest\x12\x1e\n\ncommitment\x18\x02\x20\x02(\x0cR\ncommitment\x1aO\n\ + \x13MoneroMultisigKLRki\x12\x0c\n\x01K\x18\x01\x20\x01(\x0cR\x01K\x12\ + \x0c\n\x01L\x18\x02\x20\x01(\x0cR\x01L\x12\x0c\n\x01R\x18\x03\x20\x01(\ + \x0cR\x01R\x12\x0e\n\x02ki\x18\x04\x20\x01(\x0cR\x02ki\"\xfe\x02\n!Moner\ + oTransactionDestinationEntry\x12\x16\n\x06amount\x18\x01\x20\x01(\x04R\ + \x06amount\x12k\n\x04addr\x18\x02\x20\x01(\x0b2W.hw.trezor.messages.mone\ + ro.MoneroTransactionDestinationEntry.MoneroAccountPublicAddressR\x04addr\ + \x12#\n\ris_subaddress\x18\x03\x20\x01(\x08R\x0cisSubaddress\x12\x1a\n\ + \x08original\x18\x04\x20\x01(\x0cR\x08original\x12#\n\ris_integrated\x18\ + \x05\x20\x01(\x08R\x0cisIntegrated\x1an\n\x1aMoneroAccountPublicAddress\ + \x12(\n\x10spend_public_key\x18\x01\x20\x01(\x0cR\x0espendPublicKey\x12&\ + \n\x0fview_public_key\x18\x02\x20\x01(\x0cR\rviewPublicKey\"\xdd\x01\n\ + \x19MoneroTransactionRsigData\x12\x1b\n\trsig_type\x18\x01\x20\x01(\rR\ + \x08rsigType\x12!\n\x0coffload_type\x18\x02\x20\x01(\rR\x0boffloadType\ + \x12\x1a\n\x08grouping\x18\x03\x20\x03(\x04R\x08grouping\x12\x12\n\x04ma\ + sk\x18\x04\x20\x01(\x0cR\x04mask\x12\x12\n\x04rsig\x18\x05\x20\x01(\x0cR\ + \x04rsig\x12\x1d\n\nrsig_parts\x18\x06\x20\x03(\x0cR\trsigParts\x12\x1d\ + \n\nbp_version\x18\x07\x20\x01(\rR\tbpVersion\"\x97\x02\n\x10MoneroGetAd\ + dress\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12!\n\x0csho\ + w_display\x18\x02\x20\x01(\x08R\x0bshowDisplay\x12X\n\x0cnetwork_type\ + \x18\x03\x20\x01(\x0e2,.hw.trezor.messages.monero.MoneroNetworkType:\x07\ + MAINNETR\x0bnetworkType\x12\x18\n\x07account\x18\x04\x20\x01(\rR\x07acco\ + unt\x12\x14\n\x05minor\x18\x05\x20\x01(\rR\x05minor\x12\x1d\n\npayment_i\ + d\x18\x06\x20\x01(\x0cR\tpaymentId\x12\x1a\n\x08chunkify\x18\x07\x20\x01\ + (\x08R\x08chunkify\")\n\rMoneroAddress\x12\x18\n\x07address\x18\x01\x20\ + \x01(\x0cR\x07address\"\x8a\x01\n\x11MoneroGetWatchKey\x12\x1b\n\taddres\ + s_n\x18\x01\x20\x03(\rR\x08addressN\x12X\n\x0cnetwork_type\x18\x02\x20\ + \x01(\x0e2,.hw.trezor.messages.monero.MoneroNetworkType:\x07MAINNETR\x0b\ + networkType\"G\n\x0eMoneroWatchKey\x12\x1b\n\twatch_key\x18\x01\x20\x01(\ + \x0cR\x08watchKey\x12\x18\n\x07address\x18\x02\x20\x01(\x0cR\x07address\ + \"\xd1\x07\n\x1cMoneroTransactionInitRequest\x12\x18\n\x07version\x18\ + \x01\x20\x01(\rR\x07version\x12\x1b\n\taddress_n\x18\x02\x20\x03(\rR\x08\ + addressN\x12X\n\x0cnetwork_type\x18\x03\x20\x01(\x0e2,.hw.trezor.message\ + s.monero.MoneroNetworkType:\x07MAINNETR\x0bnetworkType\x12h\n\x08tsx_dat\ + a\x18\x04\x20\x01(\x0b2M.hw.trezor.messages.monero.MoneroTransactionInit\ + Request.MoneroTransactionDataR\x07tsxData\x1a\xb5\x05\n\x15MoneroTransac\ + tionData\x12\x18\n\x07version\x18\x01\x20\x01(\rR\x07version\x12\x1d\n\n\ + payment_id\x18\x02\x20\x01(\x0cR\tpaymentId\x12\x1f\n\x0bunlock_time\x18\ + \x03\x20\x01(\x04R\nunlockTime\x12V\n\x07outputs\x18\x04\x20\x03(\x0b2<.\ + hw.trezor.messages.monero.MoneroTransactionDestinationEntryR\x07outputs\ + \x12[\n\nchange_dts\x18\x05\x20\x01(\x0b2<.hw.trezor.messages.monero.Mon\ + eroTransactionDestinationEntryR\tchangeDts\x12\x1d\n\nnum_inputs\x18\x06\ + \x20\x01(\rR\tnumInputs\x12\x14\n\x05mixin\x18\x07\x20\x01(\rR\x05mixin\ + \x12\x10\n\x03fee\x18\x08\x20\x01(\x04R\x03fee\x12\x18\n\x07account\x18\ + \t\x20\x01(\rR\x07account\x12#\n\rminor_indices\x18\n\x20\x03(\rR\x0cmin\ + orIndices\x12Q\n\trsig_data\x18\x0b\x20\x01(\x0b24.hw.trezor.messages.mo\ + nero.MoneroTransactionRsigDataR\x08rsigData\x12-\n\x12integrated_indices\ + \x18\x0c\x20\x03(\rR\x11integratedIndices\x12%\n\x0eclient_version\x18\r\ + \x20\x01(\rR\rclientVersion\x12\x1b\n\thard_fork\x18\x0e\x20\x01(\rR\x08\ + hardFork\x12%\n\x0emonero_version\x18\x0f\x20\x01(\x0cR\rmoneroVersion\ + \x12\x1a\n\x08chunkify\x18\x10\x20\x01(\x08R\x08chunkify\"\x83\x01\n\x18\ + MoneroTransactionInitAck\x12\x14\n\x05hmacs\x18\x01\x20\x03(\x0cR\x05hma\ + cs\x12Q\n\trsig_data\x18\x02\x20\x01(\x0b24.hw.trezor.messages.monero.Mo\ + neroTransactionRsigDataR\x08rsigData\"v\n\x20MoneroTransactionSetInputRe\ + quest\x12R\n\x08src_entr\x18\x01\x20\x01(\x0b27.hw.trezor.messages.moner\ + o.MoneroTransactionSourceEntryR\x07srcEntr\"\xdd\x01\n\x1cMoneroTransact\ + ionSetInputAck\x12\x12\n\x04vini\x18\x01\x20\x01(\x0cR\x04vini\x12\x1b\n\ + \tvini_hmac\x18\x02\x20\x01(\x0cR\x08viniHmac\x12\x1d\n\npseudo_out\x18\ + \x03\x20\x01(\x0cR\tpseudoOut\x12&\n\x0fpseudo_out_hmac\x18\x04\x20\x01(\ + \x0cR\rpseudoOutHmac\x12(\n\x10pseudo_out_alpha\x18\x05\x20\x01(\x0cR\ + \x0epseudoOutAlpha\x12\x1b\n\tspend_key\x18\x06\x20\x01(\x0cR\x08spendKe\ + y\"\x8a\x02\n!MoneroTransactionInputViniRequest\x12R\n\x08src_entr\x18\ + \x01\x20\x01(\x0b27.hw.trezor.messages.monero.MoneroTransactionSourceEnt\ + ryR\x07srcEntr\x12\x12\n\x04vini\x18\x02\x20\x01(\x0cR\x04vini\x12\x1b\n\ + \tvini_hmac\x18\x03\x20\x01(\x0cR\x08viniHmac\x12\x1d\n\npseudo_out\x18\ + \x04\x20\x01(\x0cR\tpseudoOut\x12&\n\x0fpseudo_out_hmac\x18\x05\x20\x01(\ + \x0cR\rpseudoOutHmac\x12\x19\n\x08orig_idx\x18\x06\x20\x01(\rR\x07origId\ + x\"\x1f\n\x1dMoneroTransactionInputViniAck\"&\n$MoneroTransactionAllInpu\ + tsSetRequest\"u\n\x20MoneroTransactionAllInputsSetAck\x12Q\n\trsig_data\ + \x18\x01\x20\x01(\x0b24.hw.trezor.messages.monero.MoneroTransactionRsigD\ + ataR\x08rsigData\"\x9b\x02\n!MoneroTransactionSetOutputRequest\x12W\n\ + \x08dst_entr\x18\x01\x20\x01(\x0b2<.hw.trezor.messages.monero.MoneroTran\ + sactionDestinationEntryR\x07dstEntr\x12\"\n\rdst_entr_hmac\x18\x02\x20\ + \x01(\x0cR\x0bdstEntrHmac\x12Q\n\trsig_data\x18\x03\x20\x01(\x0b24.hw.tr\ + ezor.messages.monero.MoneroTransactionRsigDataR\x08rsigData\x12&\n\x0fis\ + _offloaded_bp\x18\x04\x20\x01(\x08R\risOffloadedBp\"\xdc\x01\n\x1dMonero\ + TransactionSetOutputAck\x12\x15\n\x06tx_out\x18\x01\x20\x01(\x0cR\x05txO\ + ut\x12\x1d\n\nvouti_hmac\x18\x02\x20\x01(\x0cR\tvoutiHmac\x12Q\n\trsig_d\ + ata\x18\x03\x20\x01(\x0b24.hw.trezor.messages.monero.MoneroTransactionRs\ + igDataR\x08rsigData\x12\x15\n\x06out_pk\x18\x04\x20\x01(\x0cR\x05outPk\ + \x12\x1b\n\tecdh_info\x18\x05\x20\x01(\x0cR\x08ecdhInfo\"v\n!MoneroTrans\ + actionAllOutSetRequest\x12Q\n\trsig_data\x18\x01\x20\x01(\x0b24.hw.trezo\ + r.messages.monero.MoneroTransactionRsigDataR\x08rsigData\"\xc0\x02\n\x1d\ + MoneroTransactionAllOutSetAck\x12\x14\n\x05extra\x18\x01\x20\x01(\x0cR\ + \x05extra\x12$\n\x0etx_prefix_hash\x18\x02\x20\x01(\x0cR\x0ctxPrefixHash\ + \x12X\n\x02rv\x18\x04\x20\x01(\x0b2H.hw.trezor.messages.monero.MoneroTra\ + nsactionAllOutSetAck.MoneroRingCtSigR\x02rv\x12*\n\x11full_message_hash\ + \x18\x05\x20\x01(\x0cR\x0ffullMessageHash\x1a]\n\x0fMoneroRingCtSig\x12\ + \x17\n\x07txn_fee\x18\x01\x20\x01(\x04R\x06txnFee\x12\x18\n\x07message\ + \x18\x02\x20\x01(\x0cR\x07message\x12\x17\n\x07rv_type\x18\x03\x20\x01(\ + \rR\x06rvType\"\xd1\x02\n!MoneroTransactionSignInputRequest\x12R\n\x08sr\ + c_entr\x18\x01\x20\x01(\x0b27.hw.trezor.messages.monero.MoneroTransactio\ + nSourceEntryR\x07srcEntr\x12\x12\n\x04vini\x18\x02\x20\x01(\x0cR\x04vini\ + \x12\x1b\n\tvini_hmac\x18\x03\x20\x01(\x0cR\x08viniHmac\x12\x1d\n\npseud\ + o_out\x18\x04\x20\x01(\x0cR\tpseudoOut\x12&\n\x0fpseudo_out_hmac\x18\x05\ + \x20\x01(\x0cR\rpseudoOutHmac\x12(\n\x10pseudo_out_alpha\x18\x06\x20\x01\ + (\x0cR\x0epseudoOutAlpha\x12\x1b\n\tspend_key\x18\x07\x20\x01(\x0cR\x08s\ + pendKey\x12\x19\n\x08orig_idx\x18\x08\x20\x01(\rR\x07origIdx\"\\\n\x1dMo\ + neroTransactionSignInputAck\x12\x1c\n\tsignature\x18\x01\x20\x01(\x0cR\t\ + signature\x12\x1d\n\npseudo_out\x18\x02\x20\x01(\x0cR\tpseudoOut\"\x1f\n\ + \x1dMoneroTransactionFinalRequest\"\xa8\x01\n\x19MoneroTransactionFinalA\ + ck\x12\x19\n\x08cout_key\x18\x01\x20\x01(\x0cR\x07coutKey\x12\x12\n\x04s\ + alt\x18\x02\x20\x01(\x0cR\x04salt\x12\x1b\n\trand_mult\x18\x03\x20\x01(\ + \x0cR\x08randMult\x12\x1e\n\x0btx_enc_keys\x18\x04\x20\x01(\x0cR\ttxEncK\ + eys\x12\x1f\n\x0bopening_key\x18\x05\x20\x01(\x0cR\nopeningKey\"\x88\x03\ + \n\x1fMoneroKeyImageExportInitRequest\x12\x10\n\x03num\x18\x01\x20\x02(\ + \x04R\x03num\x12\x12\n\x04hash\x18\x02\x20\x02(\x0cR\x04hash\x12\x1b\n\t\ + address_n\x18\x03\x20\x03(\rR\x08addressN\x12X\n\x0cnetwork_type\x18\x04\ + \x20\x01(\x0e2,.hw.trezor.messages.monero.MoneroNetworkType:\x07MAINNETR\ + \x0bnetworkType\x12j\n\x04subs\x18\x05\x20\x03(\x0b2V.hw.trezor.messages\ + .monero.MoneroKeyImageExportInitRequest.MoneroSubAddressIndicesListR\x04\ + subs\x1a\\\n\x1bMoneroSubAddressIndicesList\x12\x18\n\x07account\x18\x01\ + \x20\x02(\rR\x07account\x12#\n\rminor_indices\x18\x02\x20\x03(\rR\x0cmin\ + orIndices\"\x1d\n\x1bMoneroKeyImageExportInitAck\"\x89\x03\n\x1dMoneroKe\ + yImageSyncStepRequest\x12b\n\x04tdis\x18\x01\x20\x03(\x0b2N.hw.trezor.me\ + ssages.monero.MoneroKeyImageSyncStepRequest.MoneroTransferDetailsR\x04td\ + is\x1a\x83\x02\n\x15MoneroTransferDetails\x12\x17\n\x07out_key\x18\x01\ + \x20\x02(\x0cR\x06outKey\x12\x1c\n\ntx_pub_key\x18\x02\x20\x02(\x0cR\x08\ + txPubKey\x123\n\x16additional_tx_pub_keys\x18\x03\x20\x03(\x0cR\x13addit\ + ionalTxPubKeys\x122\n\x15internal_output_index\x18\x04\x20\x02(\x04R\x13\ + internalOutputIndex\x12$\n\x0esub_addr_major\x18\x05\x20\x01(\rR\x0csubA\ + ddrMajor\x12$\n\x0esub_addr_minor\x18\x06\x20\x01(\rR\x0csubAddrMinor\"\ + \xb8\x01\n\x19MoneroKeyImageSyncStepAck\x12]\n\x03kis\x18\x01\x20\x03(\ + \x0b2K.hw.trezor.messages.monero.MoneroKeyImageSyncStepAck.MoneroExporte\ + dKeyImageR\x03kis\x1a<\n\x16MoneroExportedKeyImage\x12\x0e\n\x02iv\x18\ + \x01\x20\x01(\x0cR\x02iv\x12\x12\n\x04blob\x18\x03\x20\x01(\x0cR\x04blob\ + \"\x20\n\x1eMoneroKeyImageSyncFinalRequest\"5\n\x1aMoneroKeyImageSyncFin\ + alAck\x12\x17\n\x07enc_key\x18\x01\x20\x01(\x0cR\x06encKey\"\xc0\x02\n\ + \x15MoneroGetTxKeyRequest\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08ad\ + dressN\x12X\n\x0cnetwork_type\x18\x02\x20\x01(\x0e2,.hw.trezor.messages.\ + monero.MoneroNetworkType:\x07MAINNETR\x0bnetworkType\x12\x14\n\x05salt1\ + \x18\x03\x20\x02(\x0cR\x05salt1\x12\x14\n\x05salt2\x18\x04\x20\x02(\x0cR\ + \x05salt2\x12\x1e\n\x0btx_enc_keys\x18\x05\x20\x02(\x0cR\ttxEncKeys\x12$\ + \n\x0etx_prefix_hash\x18\x06\x20\x02(\x0cR\x0ctxPrefixHash\x12\x16\n\x06\ + reason\x18\x07\x20\x01(\rR\x06reason\x12&\n\x0fview_public_key\x18\x08\ + \x20\x01(\x0cR\rviewPublicKey\"g\n\x11MoneroGetTxKeyAck\x12\x12\n\x04sal\ + t\x18\x01\x20\x01(\x0cR\x04salt\x12\x17\n\x07tx_keys\x18\x02\x20\x01(\ + \x0cR\x06txKeys\x12%\n\x0etx_derivations\x18\x03\x20\x01(\x0cR\rtxDeriva\ + tions\"\x96\x01\n\x1dMoneroLiveRefreshStartRequest\x12\x1b\n\taddress_n\ + \x18\x01\x20\x03(\rR\x08addressN\x12X\n\x0cnetwork_type\x18\x02\x20\x01(\ + \x0e2,.hw.trezor.messages.monero.MoneroNetworkType:\x07MAINNETR\x0bnetwo\ + rkType\"\x1b\n\x19MoneroLiveRefreshStartAck\"\xc4\x01\n\x1cMoneroLiveRef\ + reshStepRequest\x12\x17\n\x07out_key\x18\x01\x20\x02(\x0cR\x06outKey\x12\ + \x1d\n\nrecv_deriv\x18\x02\x20\x02(\x0cR\trecvDeriv\x12\x20\n\x0creal_ou\ + t_idx\x18\x03\x20\x02(\x04R\nrealOutIdx\x12$\n\x0esub_addr_major\x18\x04\ + \x20\x02(\rR\x0csubAddrMajor\x12$\n\x0esub_addr_minor\x18\x05\x20\x02(\r\ + R\x0csubAddrMinor\"K\n\x18MoneroLiveRefreshStepAck\x12\x12\n\x04salt\x18\ + \x01\x20\x01(\x0cR\x04salt\x12\x1b\n\tkey_image\x18\x02\x20\x01(\x0cR\ + \x08keyImage\"\x1f\n\x1dMoneroLiveRefreshFinalRequest\"\x1b\n\x19MoneroL\ + iveRefreshFinalAck\"\x86\x01\n\x16DebugMoneroDiagRequest\x12\x10\n\x03in\ + s\x18\x01\x20\x01(\x04R\x03ins\x12\x0e\n\x02p1\x18\x02\x20\x01(\x04R\x02\ + p1\x12\x0e\n\x02p2\x18\x03\x20\x01(\x04R\x02p2\x12\x0e\n\x02pd\x18\x04\ + \x20\x03(\x04R\x02pd\x12\x14\n\x05data1\x18\x05\x20\x01(\x0cR\x05data1\ + \x12\x14\n\x05data2\x18\x06\x20\x01(\x0cR\x05data2\"\x82\x01\n\x12DebugM\ + oneroDiagAck\x12\x10\n\x03ins\x18\x01\x20\x01(\x04R\x03ins\x12\x0e\n\x02\ + p1\x18\x02\x20\x01(\x04R\x02p1\x12\x0e\n\x02p2\x18\x03\x20\x01(\x04R\x02\ + p2\x12\x0e\n\x02pd\x18\x04\x20\x03(\x04R\x02pd\x12\x14\n\x05data1\x18\ + \x05\x20\x01(\x0cR\x05data1\x12\x14\n\x05data2\x18\x06\x20\x01(\x0cR\x05\ + data2*J\n\x11MoneroNetworkType\x12\x0b\n\x07MAINNET\x10\0\x12\x0b\n\x07T\ + ESTNET\x10\x01\x12\x0c\n\x08STAGENET\x10\x02\x12\r\n\tFAKECHAIN\x10\x03B\ + :\n#com.satoshilabs.trezor.lib.protobufB\x13TrezorMessageMonero\ +"; + +/// `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(48); + messages.push(MoneroTransactionSourceEntry::generated_message_descriptor_data()); + messages.push(MoneroTransactionDestinationEntry::generated_message_descriptor_data()); + messages.push(MoneroTransactionRsigData::generated_message_descriptor_data()); + messages.push(MoneroGetAddress::generated_message_descriptor_data()); + messages.push(MoneroAddress::generated_message_descriptor_data()); + messages.push(MoneroGetWatchKey::generated_message_descriptor_data()); + messages.push(MoneroWatchKey::generated_message_descriptor_data()); + messages.push(MoneroTransactionInitRequest::generated_message_descriptor_data()); + messages.push(MoneroTransactionInitAck::generated_message_descriptor_data()); + messages.push(MoneroTransactionSetInputRequest::generated_message_descriptor_data()); + messages.push(MoneroTransactionSetInputAck::generated_message_descriptor_data()); + messages.push(MoneroTransactionInputViniRequest::generated_message_descriptor_data()); + messages.push(MoneroTransactionInputViniAck::generated_message_descriptor_data()); + messages.push(MoneroTransactionAllInputsSetRequest::generated_message_descriptor_data()); + messages.push(MoneroTransactionAllInputsSetAck::generated_message_descriptor_data()); + messages.push(MoneroTransactionSetOutputRequest::generated_message_descriptor_data()); + messages.push(MoneroTransactionSetOutputAck::generated_message_descriptor_data()); + messages.push(MoneroTransactionAllOutSetRequest::generated_message_descriptor_data()); + messages.push(MoneroTransactionAllOutSetAck::generated_message_descriptor_data()); + messages.push(MoneroTransactionSignInputRequest::generated_message_descriptor_data()); + messages.push(MoneroTransactionSignInputAck::generated_message_descriptor_data()); + messages.push(MoneroTransactionFinalRequest::generated_message_descriptor_data()); + messages.push(MoneroTransactionFinalAck::generated_message_descriptor_data()); + messages.push(MoneroKeyImageExportInitRequest::generated_message_descriptor_data()); + messages.push(MoneroKeyImageExportInitAck::generated_message_descriptor_data()); + messages.push(MoneroKeyImageSyncStepRequest::generated_message_descriptor_data()); + messages.push(MoneroKeyImageSyncStepAck::generated_message_descriptor_data()); + messages.push(MoneroKeyImageSyncFinalRequest::generated_message_descriptor_data()); + messages.push(MoneroKeyImageSyncFinalAck::generated_message_descriptor_data()); + messages.push(MoneroGetTxKeyRequest::generated_message_descriptor_data()); + messages.push(MoneroGetTxKeyAck::generated_message_descriptor_data()); + messages.push(MoneroLiveRefreshStartRequest::generated_message_descriptor_data()); + messages.push(MoneroLiveRefreshStartAck::generated_message_descriptor_data()); + messages.push(MoneroLiveRefreshStepRequest::generated_message_descriptor_data()); + messages.push(MoneroLiveRefreshStepAck::generated_message_descriptor_data()); + messages.push(MoneroLiveRefreshFinalRequest::generated_message_descriptor_data()); + messages.push(MoneroLiveRefreshFinalAck::generated_message_descriptor_data()); + messages.push(DebugMoneroDiagRequest::generated_message_descriptor_data()); + messages.push(DebugMoneroDiagAck::generated_message_descriptor_data()); + messages.push(monero_transaction_source_entry::MoneroOutputEntry::generated_message_descriptor_data()); + messages.push(monero_transaction_source_entry::MoneroMultisigKLRki::generated_message_descriptor_data()); + messages.push(monero_transaction_source_entry::monero_output_entry::MoneroRctKeyPublic::generated_message_descriptor_data()); + messages.push(monero_transaction_destination_entry::MoneroAccountPublicAddress::generated_message_descriptor_data()); + messages.push(monero_transaction_init_request::MoneroTransactionData::generated_message_descriptor_data()); + messages.push(monero_transaction_all_out_set_ack::MoneroRingCtSig::generated_message_descriptor_data()); + messages.push(monero_key_image_export_init_request::MoneroSubAddressIndicesList::generated_message_descriptor_data()); + messages.push(monero_key_image_sync_step_request::MoneroTransferDetails::generated_message_descriptor_data()); + messages.push(monero_key_image_sync_step_ack::MoneroExportedKeyImage::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(1); + enums.push(MoneroNetworkType::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_nem.rs b/wallet/trezor-client/src/protos/generated/messages_nem.rs new file mode 100644 index 0000000000..e607f49f51 --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_nem.rs @@ -0,0 +1,4998 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-nem.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.nem.NEMGetAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct NEMGetAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMGetAddress.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMGetAddress.network) + pub network: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMGetAddress.show_display) + pub show_display: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMGetAddress.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.nem.NEMGetAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a NEMGetAddress { + fn default() -> &'a NEMGetAddress { + ::default_instance() + } +} + +impl NEMGetAddress { + pub fn new() -> NEMGetAddress { + ::std::default::Default::default() + } + + // optional uint32 network = 2; + + pub fn network(&self) -> u32 { + self.network.unwrap_or(104u32) + } + + pub fn clear_network(&mut self) { + self.network = ::std::option::Option::None; + } + + pub fn has_network(&self) -> bool { + self.network.is_some() + } + + // Param is passed by value, moved + pub fn set_network(&mut self, v: u32) { + self.network = ::std::option::Option::Some(v); + } + + // optional bool show_display = 3; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 4; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + 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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &NEMGetAddress| { &m.address_n }, + |m: &mut NEMGetAddress| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "network", + |m: &NEMGetAddress| { &m.network }, + |m: &mut NEMGetAddress| { &mut m.network }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &NEMGetAddress| { &m.show_display }, + |m: &mut NEMGetAddress| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &NEMGetAddress| { &m.chunkify }, + |m: &mut NEMGetAddress| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NEMGetAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for NEMGetAddress { + const NAME: &'static str = "NEMGetAddress"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.network = ::std::option::Option::Some(is.read_uint32()?); + }, + 24 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 32 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.network { + my_size += ::protobuf::rt::uint32_size(2, v); + } + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.network { + os.write_uint32(2, v)?; + } + if let Some(v) = self.show_display { + os.write_bool(3, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(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() -> NEMGetAddress { + NEMGetAddress::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.network = ::std::option::Option::None; + self.show_display = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static NEMGetAddress { + static instance: NEMGetAddress = NEMGetAddress { + address_n: ::std::vec::Vec::new(), + network: ::std::option::Option::None, + show_display: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for NEMGetAddress { + 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("NEMGetAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for NEMGetAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for NEMGetAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.nem.NEMAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct NEMAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMAddress.address) + pub address: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.nem.NEMAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a NEMAddress { + fn default() -> &'a NEMAddress { + ::default_instance() + } +} + +impl NEMAddress { + pub fn new() -> NEMAddress { + ::std::default::Default::default() + } + + // required string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &NEMAddress| { &m.address }, + |m: &mut NEMAddress| { &mut m.address }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NEMAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for NEMAddress { + const NAME: &'static str = "NEMAddress"; + + fn is_initialized(&self) -> bool { + if self.address.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_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::string_size(1, &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_string(1, 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() -> NEMAddress { + NEMAddress::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static NEMAddress { + static instance: NEMAddress = NEMAddress { + address: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for NEMAddress { + 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("NEMAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for NEMAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for NEMAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.nem.NEMSignTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct NEMSignTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.transaction) + pub transaction: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.multisig) + pub multisig: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.transfer) + pub transfer: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.cosigning) + pub cosigning: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.provision_namespace) + pub provision_namespace: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.mosaic_creation) + pub mosaic_creation: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.supply_change) + pub supply_change: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.aggregate_modification) + pub aggregate_modification: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.importance_transfer) + pub importance_transfer: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.nem.NEMSignTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a NEMSignTx { + fn default() -> &'a NEMSignTx { + ::default_instance() + } +} + +impl NEMSignTx { + pub fn new() -> NEMSignTx { + ::std::default::Default::default() + } + + // optional bool cosigning = 4; + + pub fn cosigning(&self) -> bool { + self.cosigning.unwrap_or(false) + } + + pub fn clear_cosigning(&mut self) { + self.cosigning = ::std::option::Option::None; + } + + pub fn has_cosigning(&self) -> bool { + self.cosigning.is_some() + } + + // Param is passed by value, moved + pub fn set_cosigning(&mut self, v: bool) { + self.cosigning = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 10; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(10); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, nemsign_tx::NEMTransactionCommon>( + "transaction", + |m: &NEMSignTx| { &m.transaction }, + |m: &mut NEMSignTx| { &mut m.transaction }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, nemsign_tx::NEMTransactionCommon>( + "multisig", + |m: &NEMSignTx| { &m.multisig }, + |m: &mut NEMSignTx| { &mut m.multisig }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, nemsign_tx::NEMTransfer>( + "transfer", + |m: &NEMSignTx| { &m.transfer }, + |m: &mut NEMSignTx| { &mut m.transfer }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "cosigning", + |m: &NEMSignTx| { &m.cosigning }, + |m: &mut NEMSignTx| { &mut m.cosigning }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, nemsign_tx::NEMProvisionNamespace>( + "provision_namespace", + |m: &NEMSignTx| { &m.provision_namespace }, + |m: &mut NEMSignTx| { &mut m.provision_namespace }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, nemsign_tx::NEMMosaicCreation>( + "mosaic_creation", + |m: &NEMSignTx| { &m.mosaic_creation }, + |m: &mut NEMSignTx| { &mut m.mosaic_creation }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, nemsign_tx::NEMMosaicSupplyChange>( + "supply_change", + |m: &NEMSignTx| { &m.supply_change }, + |m: &mut NEMSignTx| { &mut m.supply_change }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, nemsign_tx::NEMAggregateModification>( + "aggregate_modification", + |m: &NEMSignTx| { &m.aggregate_modification }, + |m: &mut NEMSignTx| { &mut m.aggregate_modification }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, nemsign_tx::NEMImportanceTransfer>( + "importance_transfer", + |m: &NEMSignTx| { &m.importance_transfer }, + |m: &mut NEMSignTx| { &mut m.importance_transfer }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &NEMSignTx| { &m.chunkify }, + |m: &mut NEMSignTx| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NEMSignTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for NEMSignTx { + const NAME: &'static str = "NEMSignTx"; + + fn is_initialized(&self) -> bool { + if self.transaction.is_none() { + return false; + } + for v in &self.transaction { + if !v.is_initialized() { + return false; + } + }; + for v in &self.multisig { + if !v.is_initialized() { + return false; + } + }; + for v in &self.transfer { + if !v.is_initialized() { + return false; + } + }; + for v in &self.provision_namespace { + if !v.is_initialized() { + return false; + } + }; + for v in &self.mosaic_creation { + if !v.is_initialized() { + return false; + } + }; + for v in &self.supply_change { + if !v.is_initialized() { + return false; + } + }; + for v in &self.aggregate_modification { + if !v.is_initialized() { + return false; + } + }; + for v in &self.importance_transfer { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.transaction)?; + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.multisig)?; + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.transfer)?; + }, + 32 => { + self.cosigning = ::std::option::Option::Some(is.read_bool()?); + }, + 42 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.provision_namespace)?; + }, + 50 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.mosaic_creation)?; + }, + 58 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.supply_change)?; + }, + 66 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.aggregate_modification)?; + }, + 74 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.importance_transfer)?; + }, + 80 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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.transaction.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.multisig.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.transfer.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.cosigning { + my_size += 1 + 1; + } + if let Some(v) = self.provision_namespace.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.mosaic_creation.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.supply_change.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.aggregate_modification.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.importance_transfer.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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.transaction.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.multisig.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + if let Some(v) = self.transfer.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.cosigning { + os.write_bool(4, v)?; + } + if let Some(v) = self.provision_namespace.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + } + if let Some(v) = self.mosaic_creation.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(6, v, os)?; + } + if let Some(v) = self.supply_change.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(7, v, os)?; + } + if let Some(v) = self.aggregate_modification.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(8, v, os)?; + } + if let Some(v) = self.importance_transfer.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(9, v, os)?; + } + if let Some(v) = self.chunkify { + os.write_bool(10, 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() -> NEMSignTx { + NEMSignTx::new() + } + + fn clear(&mut self) { + self.transaction.clear(); + self.multisig.clear(); + self.transfer.clear(); + self.cosigning = ::std::option::Option::None; + self.provision_namespace.clear(); + self.mosaic_creation.clear(); + self.supply_change.clear(); + self.aggregate_modification.clear(); + self.importance_transfer.clear(); + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static NEMSignTx { + static instance: NEMSignTx = NEMSignTx { + transaction: ::protobuf::MessageField::none(), + multisig: ::protobuf::MessageField::none(), + transfer: ::protobuf::MessageField::none(), + cosigning: ::std::option::Option::None, + provision_namespace: ::protobuf::MessageField::none(), + mosaic_creation: ::protobuf::MessageField::none(), + supply_change: ::protobuf::MessageField::none(), + aggregate_modification: ::protobuf::MessageField::none(), + importance_transfer: ::protobuf::MessageField::none(), + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for NEMSignTx { + 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("NEMSignTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for NEMSignTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for NEMSignTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `NEMSignTx` +pub mod nemsign_tx { + // @@protoc_insertion_point(message:hw.trezor.messages.nem.NEMSignTx.NEMTransactionCommon) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct NEMTransactionCommon { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMTransactionCommon.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMTransactionCommon.network) + pub network: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMTransactionCommon.timestamp) + pub timestamp: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMTransactionCommon.fee) + pub fee: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMTransactionCommon.deadline) + pub deadline: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMTransactionCommon.signer) + pub signer: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.nem.NEMSignTx.NEMTransactionCommon.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a NEMTransactionCommon { + fn default() -> &'a NEMTransactionCommon { + ::default_instance() + } + } + + impl NEMTransactionCommon { + pub fn new() -> NEMTransactionCommon { + ::std::default::Default::default() + } + + // optional uint32 network = 2; + + pub fn network(&self) -> u32 { + self.network.unwrap_or(104u32) + } + + pub fn clear_network(&mut self) { + self.network = ::std::option::Option::None; + } + + pub fn has_network(&self) -> bool { + self.network.is_some() + } + + // Param is passed by value, moved + pub fn set_network(&mut self, v: u32) { + self.network = ::std::option::Option::Some(v); + } + + // required uint32 timestamp = 3; + + pub fn timestamp(&self) -> u32 { + self.timestamp.unwrap_or(0) + } + + pub fn clear_timestamp(&mut self) { + self.timestamp = ::std::option::Option::None; + } + + pub fn has_timestamp(&self) -> bool { + self.timestamp.is_some() + } + + // Param is passed by value, moved + pub fn set_timestamp(&mut self, v: u32) { + self.timestamp = ::std::option::Option::Some(v); + } + + // required uint64 fee = 4; + + pub fn fee(&self) -> u64 { + self.fee.unwrap_or(0) + } + + pub fn clear_fee(&mut self) { + self.fee = ::std::option::Option::None; + } + + pub fn has_fee(&self) -> bool { + self.fee.is_some() + } + + // Param is passed by value, moved + pub fn set_fee(&mut self, v: u64) { + self.fee = ::std::option::Option::Some(v); + } + + // required uint32 deadline = 5; + + pub fn deadline(&self) -> u32 { + self.deadline.unwrap_or(0) + } + + pub fn clear_deadline(&mut self) { + self.deadline = ::std::option::Option::None; + } + + pub fn has_deadline(&self) -> bool { + self.deadline.is_some() + } + + // Param is passed by value, moved + pub fn set_deadline(&mut self, v: u32) { + self.deadline = ::std::option::Option::Some(v); + } + + // optional bytes signer = 6; + + pub fn signer(&self) -> &[u8] { + match self.signer.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signer(&mut self) { + self.signer = ::std::option::Option::None; + } + + pub fn has_signer(&self) -> bool { + self.signer.is_some() + } + + // Param is passed by value, moved + pub fn set_signer(&mut self, v: ::std::vec::Vec) { + self.signer = ::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_signer(&mut self) -> &mut ::std::vec::Vec { + if self.signer.is_none() { + self.signer = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signer.as_mut().unwrap() + } + + // Take field + pub fn take_signer(&mut self) -> ::std::vec::Vec { + self.signer.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &NEMTransactionCommon| { &m.address_n }, + |m: &mut NEMTransactionCommon| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "network", + |m: &NEMTransactionCommon| { &m.network }, + |m: &mut NEMTransactionCommon| { &mut m.network }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "timestamp", + |m: &NEMTransactionCommon| { &m.timestamp }, + |m: &mut NEMTransactionCommon| { &mut m.timestamp }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fee", + |m: &NEMTransactionCommon| { &m.fee }, + |m: &mut NEMTransactionCommon| { &mut m.fee }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "deadline", + |m: &NEMTransactionCommon| { &m.deadline }, + |m: &mut NEMTransactionCommon| { &mut m.deadline }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signer", + |m: &NEMTransactionCommon| { &m.signer }, + |m: &mut NEMTransactionCommon| { &mut m.signer }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NEMSignTx.NEMTransactionCommon", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for NEMTransactionCommon { + const NAME: &'static str = "NEMTransactionCommon"; + + fn is_initialized(&self) -> bool { + if self.timestamp.is_none() { + return false; + } + if self.fee.is_none() { + return false; + } + if self.deadline.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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.network = ::std::option::Option::Some(is.read_uint32()?); + }, + 24 => { + self.timestamp = ::std::option::Option::Some(is.read_uint32()?); + }, + 32 => { + self.fee = ::std::option::Option::Some(is.read_uint64()?); + }, + 40 => { + self.deadline = ::std::option::Option::Some(is.read_uint32()?); + }, + 50 => { + self.signer = ::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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.network { + my_size += ::protobuf::rt::uint32_size(2, v); + } + if let Some(v) = self.timestamp { + my_size += ::protobuf::rt::uint32_size(3, v); + } + if let Some(v) = self.fee { + my_size += ::protobuf::rt::uint64_size(4, v); + } + if let Some(v) = self.deadline { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.signer.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.network { + os.write_uint32(2, v)?; + } + if let Some(v) = self.timestamp { + os.write_uint32(3, v)?; + } + if let Some(v) = self.fee { + os.write_uint64(4, v)?; + } + if let Some(v) = self.deadline { + os.write_uint32(5, v)?; + } + if let Some(v) = self.signer.as_ref() { + os.write_bytes(6, 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() -> NEMTransactionCommon { + NEMTransactionCommon::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.network = ::std::option::Option::None; + self.timestamp = ::std::option::Option::None; + self.fee = ::std::option::Option::None; + self.deadline = ::std::option::Option::None; + self.signer = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static NEMTransactionCommon { + static instance: NEMTransactionCommon = NEMTransactionCommon { + address_n: ::std::vec::Vec::new(), + network: ::std::option::Option::None, + timestamp: ::std::option::Option::None, + fee: ::std::option::Option::None, + deadline: ::std::option::Option::None, + signer: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for NEMTransactionCommon { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("NEMSignTx.NEMTransactionCommon").unwrap()).clone() + } + } + + impl ::std::fmt::Display for NEMTransactionCommon { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for NEMTransactionCommon { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.nem.NEMSignTx.NEMTransfer) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct NEMTransfer { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMTransfer.recipient) + pub recipient: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMTransfer.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMTransfer.payload) + pub payload: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMTransfer.public_key) + pub public_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMTransfer.mosaics) + pub mosaics: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.nem.NEMSignTx.NEMTransfer.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a NEMTransfer { + fn default() -> &'a NEMTransfer { + ::default_instance() + } + } + + impl NEMTransfer { + pub fn new() -> NEMTransfer { + ::std::default::Default::default() + } + + // required string recipient = 1; + + pub fn recipient(&self) -> &str { + match self.recipient.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_recipient(&mut self) { + self.recipient = ::std::option::Option::None; + } + + pub fn has_recipient(&self) -> bool { + self.recipient.is_some() + } + + // Param is passed by value, moved + pub fn set_recipient(&mut self, v: ::std::string::String) { + self.recipient = ::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_recipient(&mut self) -> &mut ::std::string::String { + if self.recipient.is_none() { + self.recipient = ::std::option::Option::Some(::std::string::String::new()); + } + self.recipient.as_mut().unwrap() + } + + // Take field + pub fn take_recipient(&mut self) -> ::std::string::String { + self.recipient.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required uint64 amount = 2; + + pub fn amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + // optional bytes payload = 3; + + pub fn payload(&self) -> &[u8] { + match self.payload.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_payload(&mut self) { + self.payload = ::std::option::Option::None; + } + + pub fn has_payload(&self) -> bool { + self.payload.is_some() + } + + // Param is passed by value, moved + pub fn set_payload(&mut self, v: ::std::vec::Vec) { + self.payload = ::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_payload(&mut self) -> &mut ::std::vec::Vec { + if self.payload.is_none() { + self.payload = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.payload.as_mut().unwrap() + } + + // Take field + pub fn take_payload(&mut self) -> ::std::vec::Vec { + self.payload.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes public_key = 4; + + pub fn public_key(&self) -> &[u8] { + match self.public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_public_key(&mut self) { + self.public_key = ::std::option::Option::None; + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: ::std::vec::Vec) { + self.public_key = ::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_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.public_key.is_none() { + self.public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> ::std::vec::Vec { + self.public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) 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::<_, _>( + "recipient", + |m: &NEMTransfer| { &m.recipient }, + |m: &mut NEMTransfer| { &mut m.recipient }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &NEMTransfer| { &m.amount }, + |m: &mut NEMTransfer| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "payload", + |m: &NEMTransfer| { &m.payload }, + |m: &mut NEMTransfer| { &mut m.payload }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "public_key", + |m: &NEMTransfer| { &m.public_key }, + |m: &mut NEMTransfer| { &mut m.public_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "mosaics", + |m: &NEMTransfer| { &m.mosaics }, + |m: &mut NEMTransfer| { &mut m.mosaics }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NEMSignTx.NEMTransfer", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for NEMTransfer { + const NAME: &'static str = "NEMTransfer"; + + fn is_initialized(&self) -> bool { + if self.recipient.is_none() { + return false; + } + if self.amount.is_none() { + return false; + } + for v in &self.mosaics { + if !v.is_initialized() { + 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.recipient = ::std::option::Option::Some(is.read_string()?); + }, + 16 => { + self.amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 26 => { + self.payload = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.public_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 42 => { + self.mosaics.push(is.read_message()?); + }, + 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.recipient.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.amount { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.payload.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + for value in &self.mosaics { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + 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.recipient.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.amount { + os.write_uint64(2, v)?; + } + if let Some(v) = self.payload.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.public_key.as_ref() { + os.write_bytes(4, v)?; + } + for v in &self.mosaics { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + }; + 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() -> NEMTransfer { + NEMTransfer::new() + } + + fn clear(&mut self) { + self.recipient = ::std::option::Option::None; + self.amount = ::std::option::Option::None; + self.payload = ::std::option::Option::None; + self.public_key = ::std::option::Option::None; + self.mosaics.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static NEMTransfer { + static instance: NEMTransfer = NEMTransfer { + recipient: ::std::option::Option::None, + amount: ::std::option::Option::None, + payload: ::std::option::Option::None, + public_key: ::std::option::Option::None, + mosaics: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for NEMTransfer { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("NEMSignTx.NEMTransfer").unwrap()).clone() + } + } + + impl ::std::fmt::Display for NEMTransfer { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for NEMTransfer { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + /// Nested message and enums of message `NEMTransfer` + pub mod nemtransfer { + // @@protoc_insertion_point(message:hw.trezor.messages.nem.NEMSignTx.NEMTransfer.NEMMosaic) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct NEMMosaic { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMTransfer.NEMMosaic.namespace) + pub namespace: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMTransfer.NEMMosaic.mosaic) + pub mosaic: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMTransfer.NEMMosaic.quantity) + pub quantity: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.nem.NEMSignTx.NEMTransfer.NEMMosaic.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a NEMMosaic { + fn default() -> &'a NEMMosaic { + ::default_instance() + } + } + + impl NEMMosaic { + pub fn new() -> NEMMosaic { + ::std::default::Default::default() + } + + // required string namespace = 1; + + pub fn namespace(&self) -> &str { + match self.namespace.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_namespace(&mut self) { + self.namespace = ::std::option::Option::None; + } + + pub fn has_namespace(&self) -> bool { + self.namespace.is_some() + } + + // Param is passed by value, moved + pub fn set_namespace(&mut self, v: ::std::string::String) { + self.namespace = ::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_namespace(&mut self) -> &mut ::std::string::String { + if self.namespace.is_none() { + self.namespace = ::std::option::Option::Some(::std::string::String::new()); + } + self.namespace.as_mut().unwrap() + } + + // Take field + pub fn take_namespace(&mut self) -> ::std::string::String { + self.namespace.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required string mosaic = 2; + + pub fn mosaic(&self) -> &str { + match self.mosaic.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_mosaic(&mut self) { + self.mosaic = ::std::option::Option::None; + } + + pub fn has_mosaic(&self) -> bool { + self.mosaic.is_some() + } + + // Param is passed by value, moved + pub fn set_mosaic(&mut self, v: ::std::string::String) { + self.mosaic = ::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_mosaic(&mut self) -> &mut ::std::string::String { + if self.mosaic.is_none() { + self.mosaic = ::std::option::Option::Some(::std::string::String::new()); + } + self.mosaic.as_mut().unwrap() + } + + // Take field + pub fn take_mosaic(&mut self) -> ::std::string::String { + self.mosaic.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required uint64 quantity = 3; + + pub fn quantity(&self) -> u64 { + self.quantity.unwrap_or(0) + } + + pub fn clear_quantity(&mut self) { + self.quantity = ::std::option::Option::None; + } + + pub fn has_quantity(&self) -> bool { + self.quantity.is_some() + } + + // Param is passed by value, moved + pub fn set_quantity(&mut self, v: u64) { + self.quantity = ::std::option::Option::Some(v); + } + + pub(in super::super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "namespace", + |m: &NEMMosaic| { &m.namespace }, + |m: &mut NEMMosaic| { &mut m.namespace }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "mosaic", + |m: &NEMMosaic| { &m.mosaic }, + |m: &mut NEMMosaic| { &mut m.mosaic }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "quantity", + |m: &NEMMosaic| { &m.quantity }, + |m: &mut NEMMosaic| { &mut m.quantity }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NEMSignTx.NEMTransfer.NEMMosaic", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for NEMMosaic { + const NAME: &'static str = "NEMMosaic"; + + fn is_initialized(&self) -> bool { + if self.namespace.is_none() { + return false; + } + if self.mosaic.is_none() { + return false; + } + if self.quantity.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.namespace = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.mosaic = ::std::option::Option::Some(is.read_string()?); + }, + 24 => { + self.quantity = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.namespace.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.mosaic.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.quantity { + my_size += ::protobuf::rt::uint64_size(3, 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.namespace.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.mosaic.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.quantity { + os.write_uint64(3, 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() -> NEMMosaic { + NEMMosaic::new() + } + + fn clear(&mut self) { + self.namespace = ::std::option::Option::None; + self.mosaic = ::std::option::Option::None; + self.quantity = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static NEMMosaic { + static instance: NEMMosaic = NEMMosaic { + namespace: ::std::option::Option::None, + mosaic: ::std::option::Option::None, + quantity: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for NEMMosaic { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::super::file_descriptor().message_by_package_relative_name("NEMSignTx.NEMTransfer.NEMMosaic").unwrap()).clone() + } + } + + impl ::std::fmt::Display for NEMMosaic { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for NEMMosaic { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + } + + // @@protoc_insertion_point(message:hw.trezor.messages.nem.NEMSignTx.NEMProvisionNamespace) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct NEMProvisionNamespace { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMProvisionNamespace.namespace) + pub namespace: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMProvisionNamespace.parent) + pub parent: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMProvisionNamespace.sink) + pub sink: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMProvisionNamespace.fee) + pub fee: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.nem.NEMSignTx.NEMProvisionNamespace.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a NEMProvisionNamespace { + fn default() -> &'a NEMProvisionNamespace { + ::default_instance() + } + } + + impl NEMProvisionNamespace { + pub fn new() -> NEMProvisionNamespace { + ::std::default::Default::default() + } + + // required string namespace = 1; + + pub fn namespace(&self) -> &str { + match self.namespace.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_namespace(&mut self) { + self.namespace = ::std::option::Option::None; + } + + pub fn has_namespace(&self) -> bool { + self.namespace.is_some() + } + + // Param is passed by value, moved + pub fn set_namespace(&mut self, v: ::std::string::String) { + self.namespace = ::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_namespace(&mut self) -> &mut ::std::string::String { + if self.namespace.is_none() { + self.namespace = ::std::option::Option::Some(::std::string::String::new()); + } + self.namespace.as_mut().unwrap() + } + + // Take field + pub fn take_namespace(&mut self) -> ::std::string::String { + self.namespace.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string parent = 2; + + pub fn parent(&self) -> &str { + match self.parent.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_parent(&mut self) { + self.parent = ::std::option::Option::None; + } + + pub fn has_parent(&self) -> bool { + self.parent.is_some() + } + + // Param is passed by value, moved + pub fn set_parent(&mut self, v: ::std::string::String) { + self.parent = ::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_parent(&mut self) -> &mut ::std::string::String { + if self.parent.is_none() { + self.parent = ::std::option::Option::Some(::std::string::String::new()); + } + self.parent.as_mut().unwrap() + } + + // Take field + pub fn take_parent(&mut self) -> ::std::string::String { + self.parent.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required string sink = 3; + + pub fn sink(&self) -> &str { + match self.sink.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_sink(&mut self) { + self.sink = ::std::option::Option::None; + } + + pub fn has_sink(&self) -> bool { + self.sink.is_some() + } + + // Param is passed by value, moved + pub fn set_sink(&mut self, v: ::std::string::String) { + self.sink = ::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_sink(&mut self) -> &mut ::std::string::String { + if self.sink.is_none() { + self.sink = ::std::option::Option::Some(::std::string::String::new()); + } + self.sink.as_mut().unwrap() + } + + // Take field + pub fn take_sink(&mut self) -> ::std::string::String { + self.sink.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required uint64 fee = 4; + + pub fn fee(&self) -> u64 { + self.fee.unwrap_or(0) + } + + pub fn clear_fee(&mut self) { + self.fee = ::std::option::Option::None; + } + + pub fn has_fee(&self) -> bool { + self.fee.is_some() + } + + // Param is passed by value, moved + pub fn set_fee(&mut self, v: u64) { + self.fee = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "namespace", + |m: &NEMProvisionNamespace| { &m.namespace }, + |m: &mut NEMProvisionNamespace| { &mut m.namespace }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "parent", + |m: &NEMProvisionNamespace| { &m.parent }, + |m: &mut NEMProvisionNamespace| { &mut m.parent }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sink", + |m: &NEMProvisionNamespace| { &m.sink }, + |m: &mut NEMProvisionNamespace| { &mut m.sink }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fee", + |m: &NEMProvisionNamespace| { &m.fee }, + |m: &mut NEMProvisionNamespace| { &mut m.fee }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NEMSignTx.NEMProvisionNamespace", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for NEMProvisionNamespace { + const NAME: &'static str = "NEMProvisionNamespace"; + + fn is_initialized(&self) -> bool { + if self.namespace.is_none() { + return false; + } + if self.sink.is_none() { + return false; + } + if self.fee.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.namespace = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.parent = ::std::option::Option::Some(is.read_string()?); + }, + 26 => { + self.sink = ::std::option::Option::Some(is.read_string()?); + }, + 32 => { + self.fee = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.namespace.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.parent.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.sink.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.fee { + my_size += ::protobuf::rt::uint64_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.namespace.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.parent.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.sink.as_ref() { + os.write_string(3, v)?; + } + if let Some(v) = self.fee { + os.write_uint64(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() -> NEMProvisionNamespace { + NEMProvisionNamespace::new() + } + + fn clear(&mut self) { + self.namespace = ::std::option::Option::None; + self.parent = ::std::option::Option::None; + self.sink = ::std::option::Option::None; + self.fee = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static NEMProvisionNamespace { + static instance: NEMProvisionNamespace = NEMProvisionNamespace { + namespace: ::std::option::Option::None, + parent: ::std::option::Option::None, + sink: ::std::option::Option::None, + fee: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for NEMProvisionNamespace { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("NEMSignTx.NEMProvisionNamespace").unwrap()).clone() + } + } + + impl ::std::fmt::Display for NEMProvisionNamespace { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for NEMProvisionNamespace { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct NEMMosaicCreation { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.definition) + pub definition: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.sink) + pub sink: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.fee) + pub fee: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a NEMMosaicCreation { + fn default() -> &'a NEMMosaicCreation { + ::default_instance() + } + } + + impl NEMMosaicCreation { + pub fn new() -> NEMMosaicCreation { + ::std::default::Default::default() + } + + // required string sink = 2; + + pub fn sink(&self) -> &str { + match self.sink.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_sink(&mut self) { + self.sink = ::std::option::Option::None; + } + + pub fn has_sink(&self) -> bool { + self.sink.is_some() + } + + // Param is passed by value, moved + pub fn set_sink(&mut self, v: ::std::string::String) { + self.sink = ::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_sink(&mut self) -> &mut ::std::string::String { + if self.sink.is_none() { + self.sink = ::std::option::Option::Some(::std::string::String::new()); + } + self.sink.as_mut().unwrap() + } + + // Take field + pub fn take_sink(&mut self) -> ::std::string::String { + self.sink.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required uint64 fee = 3; + + pub fn fee(&self) -> u64 { + self.fee.unwrap_or(0) + } + + pub fn clear_fee(&mut self) { + self.fee = ::std::option::Option::None; + } + + pub fn has_fee(&self) -> bool { + self.fee.is_some() + } + + // Param is passed by value, moved + pub fn set_fee(&mut self, v: u64) { + self.fee = ::std::option::Option::Some(v); + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, nemmosaic_creation::NEMMosaicDefinition>( + "definition", + |m: &NEMMosaicCreation| { &m.definition }, + |m: &mut NEMMosaicCreation| { &mut m.definition }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sink", + |m: &NEMMosaicCreation| { &m.sink }, + |m: &mut NEMMosaicCreation| { &mut m.sink }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fee", + |m: &NEMMosaicCreation| { &m.fee }, + |m: &mut NEMMosaicCreation| { &mut m.fee }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NEMSignTx.NEMMosaicCreation", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for NEMMosaicCreation { + const NAME: &'static str = "NEMMosaicCreation"; + + fn is_initialized(&self) -> bool { + if self.definition.is_none() { + return false; + } + if self.sink.is_none() { + return false; + } + if self.fee.is_none() { + return false; + } + for v in &self.definition { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.definition)?; + }, + 18 => { + self.sink = ::std::option::Option::Some(is.read_string()?); + }, + 24 => { + self.fee = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.definition.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.sink.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.fee { + my_size += ::protobuf::rt::uint64_size(3, 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.definition.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.sink.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.fee { + os.write_uint64(3, 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() -> NEMMosaicCreation { + NEMMosaicCreation::new() + } + + fn clear(&mut self) { + self.definition.clear(); + self.sink = ::std::option::Option::None; + self.fee = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static NEMMosaicCreation { + static instance: NEMMosaicCreation = NEMMosaicCreation { + definition: ::protobuf::MessageField::none(), + sink: ::std::option::Option::None, + fee: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for NEMMosaicCreation { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("NEMSignTx.NEMMosaicCreation").unwrap()).clone() + } + } + + impl ::std::fmt::Display for NEMMosaicCreation { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for NEMMosaicCreation { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + /// Nested message and enums of message `NEMMosaicCreation` + pub mod nemmosaic_creation { + // @@protoc_insertion_point(message:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct NEMMosaicDefinition { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.name) + pub name: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.ticker) + pub ticker: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.namespace) + pub namespace: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.mosaic) + pub mosaic: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.divisibility) + pub divisibility: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.levy) + pub levy: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.fee) + pub fee: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.levy_address) + pub levy_address: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.levy_namespace) + pub levy_namespace: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.levy_mosaic) + pub levy_mosaic: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.supply) + pub supply: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.mutable_supply) + pub mutable_supply: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.transferable) + pub transferable: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.description) + pub description: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.networks) + pub networks: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a NEMMosaicDefinition { + fn default() -> &'a NEMMosaicDefinition { + ::default_instance() + } + } + + impl NEMMosaicDefinition { + pub fn new() -> NEMMosaicDefinition { + ::std::default::Default::default() + } + + // optional string name = 1; + + 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()) + } + + // optional string ticker = 2; + + pub fn ticker(&self) -> &str { + match self.ticker.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_ticker(&mut self) { + self.ticker = ::std::option::Option::None; + } + + pub fn has_ticker(&self) -> bool { + self.ticker.is_some() + } + + // Param is passed by value, moved + pub fn set_ticker(&mut self, v: ::std::string::String) { + self.ticker = ::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_ticker(&mut self) -> &mut ::std::string::String { + if self.ticker.is_none() { + self.ticker = ::std::option::Option::Some(::std::string::String::new()); + } + self.ticker.as_mut().unwrap() + } + + // Take field + pub fn take_ticker(&mut self) -> ::std::string::String { + self.ticker.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required string namespace = 3; + + pub fn namespace(&self) -> &str { + match self.namespace.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_namespace(&mut self) { + self.namespace = ::std::option::Option::None; + } + + pub fn has_namespace(&self) -> bool { + self.namespace.is_some() + } + + // Param is passed by value, moved + pub fn set_namespace(&mut self, v: ::std::string::String) { + self.namespace = ::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_namespace(&mut self) -> &mut ::std::string::String { + if self.namespace.is_none() { + self.namespace = ::std::option::Option::Some(::std::string::String::new()); + } + self.namespace.as_mut().unwrap() + } + + // Take field + pub fn take_namespace(&mut self) -> ::std::string::String { + self.namespace.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required string mosaic = 4; + + pub fn mosaic(&self) -> &str { + match self.mosaic.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_mosaic(&mut self) { + self.mosaic = ::std::option::Option::None; + } + + pub fn has_mosaic(&self) -> bool { + self.mosaic.is_some() + } + + // Param is passed by value, moved + pub fn set_mosaic(&mut self, v: ::std::string::String) { + self.mosaic = ::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_mosaic(&mut self) -> &mut ::std::string::String { + if self.mosaic.is_none() { + self.mosaic = ::std::option::Option::Some(::std::string::String::new()); + } + self.mosaic.as_mut().unwrap() + } + + // Take field + pub fn take_mosaic(&mut self) -> ::std::string::String { + self.mosaic.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint32 divisibility = 5; + + pub fn divisibility(&self) -> u32 { + self.divisibility.unwrap_or(0) + } + + pub fn clear_divisibility(&mut self) { + self.divisibility = ::std::option::Option::None; + } + + pub fn has_divisibility(&self) -> bool { + self.divisibility.is_some() + } + + // Param is passed by value, moved + pub fn set_divisibility(&mut self, v: u32) { + self.divisibility = ::std::option::Option::Some(v); + } + + // optional .hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.NEMMosaicLevy levy = 6; + + pub fn levy(&self) -> nemmosaic_definition::NEMMosaicLevy { + match self.levy { + Some(e) => e.enum_value_or(nemmosaic_definition::NEMMosaicLevy::MosaicLevy_Absolute), + None => nemmosaic_definition::NEMMosaicLevy::MosaicLevy_Absolute, + } + } + + pub fn clear_levy(&mut self) { + self.levy = ::std::option::Option::None; + } + + pub fn has_levy(&self) -> bool { + self.levy.is_some() + } + + // Param is passed by value, moved + pub fn set_levy(&mut self, v: nemmosaic_definition::NEMMosaicLevy) { + self.levy = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional uint64 fee = 7; + + pub fn fee(&self) -> u64 { + self.fee.unwrap_or(0) + } + + pub fn clear_fee(&mut self) { + self.fee = ::std::option::Option::None; + } + + pub fn has_fee(&self) -> bool { + self.fee.is_some() + } + + // Param is passed by value, moved + pub fn set_fee(&mut self, v: u64) { + self.fee = ::std::option::Option::Some(v); + } + + // optional string levy_address = 8; + + pub fn levy_address(&self) -> &str { + match self.levy_address.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_levy_address(&mut self) { + self.levy_address = ::std::option::Option::None; + } + + pub fn has_levy_address(&self) -> bool { + self.levy_address.is_some() + } + + // Param is passed by value, moved + pub fn set_levy_address(&mut self, v: ::std::string::String) { + self.levy_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_levy_address(&mut self) -> &mut ::std::string::String { + if self.levy_address.is_none() { + self.levy_address = ::std::option::Option::Some(::std::string::String::new()); + } + self.levy_address.as_mut().unwrap() + } + + // Take field + pub fn take_levy_address(&mut self) -> ::std::string::String { + self.levy_address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string levy_namespace = 9; + + pub fn levy_namespace(&self) -> &str { + match self.levy_namespace.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_levy_namespace(&mut self) { + self.levy_namespace = ::std::option::Option::None; + } + + pub fn has_levy_namespace(&self) -> bool { + self.levy_namespace.is_some() + } + + // Param is passed by value, moved + pub fn set_levy_namespace(&mut self, v: ::std::string::String) { + self.levy_namespace = ::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_levy_namespace(&mut self) -> &mut ::std::string::String { + if self.levy_namespace.is_none() { + self.levy_namespace = ::std::option::Option::Some(::std::string::String::new()); + } + self.levy_namespace.as_mut().unwrap() + } + + // Take field + pub fn take_levy_namespace(&mut self) -> ::std::string::String { + self.levy_namespace.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string levy_mosaic = 10; + + pub fn levy_mosaic(&self) -> &str { + match self.levy_mosaic.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_levy_mosaic(&mut self) { + self.levy_mosaic = ::std::option::Option::None; + } + + pub fn has_levy_mosaic(&self) -> bool { + self.levy_mosaic.is_some() + } + + // Param is passed by value, moved + pub fn set_levy_mosaic(&mut self, v: ::std::string::String) { + self.levy_mosaic = ::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_levy_mosaic(&mut self) -> &mut ::std::string::String { + if self.levy_mosaic.is_none() { + self.levy_mosaic = ::std::option::Option::Some(::std::string::String::new()); + } + self.levy_mosaic.as_mut().unwrap() + } + + // Take field + pub fn take_levy_mosaic(&mut self) -> ::std::string::String { + self.levy_mosaic.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint64 supply = 11; + + pub fn supply(&self) -> u64 { + self.supply.unwrap_or(0) + } + + pub fn clear_supply(&mut self) { + self.supply = ::std::option::Option::None; + } + + pub fn has_supply(&self) -> bool { + self.supply.is_some() + } + + // Param is passed by value, moved + pub fn set_supply(&mut self, v: u64) { + self.supply = ::std::option::Option::Some(v); + } + + // optional bool mutable_supply = 12; + + pub fn mutable_supply(&self) -> bool { + self.mutable_supply.unwrap_or(false) + } + + pub fn clear_mutable_supply(&mut self) { + self.mutable_supply = ::std::option::Option::None; + } + + pub fn has_mutable_supply(&self) -> bool { + self.mutable_supply.is_some() + } + + // Param is passed by value, moved + pub fn set_mutable_supply(&mut self, v: bool) { + self.mutable_supply = ::std::option::Option::Some(v); + } + + // optional bool transferable = 13; + + pub fn transferable(&self) -> bool { + self.transferable.unwrap_or(false) + } + + pub fn clear_transferable(&mut self) { + self.transferable = ::std::option::Option::None; + } + + pub fn has_transferable(&self) -> bool { + self.transferable.is_some() + } + + // Param is passed by value, moved + pub fn set_transferable(&mut self, v: bool) { + self.transferable = ::std::option::Option::Some(v); + } + + // required string description = 14; + + pub fn description(&self) -> &str { + match self.description.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_description(&mut self) { + self.description = ::std::option::Option::None; + } + + pub fn has_description(&self) -> bool { + self.description.is_some() + } + + // Param is passed by value, moved + pub fn set_description(&mut self, v: ::std::string::String) { + self.description = ::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_description(&mut self) -> &mut ::std::string::String { + if self.description.is_none() { + self.description = ::std::option::Option::Some(::std::string::String::new()); + } + self.description.as_mut().unwrap() + } + + // Take field + pub fn take_description(&mut self) -> ::std::string::String { + self.description.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub(in super::super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(15); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "name", + |m: &NEMMosaicDefinition| { &m.name }, + |m: &mut NEMMosaicDefinition| { &mut m.name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ticker", + |m: &NEMMosaicDefinition| { &m.ticker }, + |m: &mut NEMMosaicDefinition| { &mut m.ticker }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "namespace", + |m: &NEMMosaicDefinition| { &m.namespace }, + |m: &mut NEMMosaicDefinition| { &mut m.namespace }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "mosaic", + |m: &NEMMosaicDefinition| { &m.mosaic }, + |m: &mut NEMMosaicDefinition| { &mut m.mosaic }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "divisibility", + |m: &NEMMosaicDefinition| { &m.divisibility }, + |m: &mut NEMMosaicDefinition| { &mut m.divisibility }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "levy", + |m: &NEMMosaicDefinition| { &m.levy }, + |m: &mut NEMMosaicDefinition| { &mut m.levy }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fee", + |m: &NEMMosaicDefinition| { &m.fee }, + |m: &mut NEMMosaicDefinition| { &mut m.fee }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "levy_address", + |m: &NEMMosaicDefinition| { &m.levy_address }, + |m: &mut NEMMosaicDefinition| { &mut m.levy_address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "levy_namespace", + |m: &NEMMosaicDefinition| { &m.levy_namespace }, + |m: &mut NEMMosaicDefinition| { &mut m.levy_namespace }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "levy_mosaic", + |m: &NEMMosaicDefinition| { &m.levy_mosaic }, + |m: &mut NEMMosaicDefinition| { &mut m.levy_mosaic }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "supply", + |m: &NEMMosaicDefinition| { &m.supply }, + |m: &mut NEMMosaicDefinition| { &mut m.supply }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "mutable_supply", + |m: &NEMMosaicDefinition| { &m.mutable_supply }, + |m: &mut NEMMosaicDefinition| { &mut m.mutable_supply }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "transferable", + |m: &NEMMosaicDefinition| { &m.transferable }, + |m: &mut NEMMosaicDefinition| { &mut m.transferable }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "description", + |m: &NEMMosaicDefinition| { &m.description }, + |m: &mut NEMMosaicDefinition| { &mut m.description }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "networks", + |m: &NEMMosaicDefinition| { &m.networks }, + |m: &mut NEMMosaicDefinition| { &mut m.networks }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for NEMMosaicDefinition { + const NAME: &'static str = "NEMMosaicDefinition"; + + fn is_initialized(&self) -> bool { + if self.namespace.is_none() { + return false; + } + if self.mosaic.is_none() { + return false; + } + if self.description.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.name = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.ticker = ::std::option::Option::Some(is.read_string()?); + }, + 26 => { + self.namespace = ::std::option::Option::Some(is.read_string()?); + }, + 34 => { + self.mosaic = ::std::option::Option::Some(is.read_string()?); + }, + 40 => { + self.divisibility = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.levy = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 56 => { + self.fee = ::std::option::Option::Some(is.read_uint64()?); + }, + 66 => { + self.levy_address = ::std::option::Option::Some(is.read_string()?); + }, + 74 => { + self.levy_namespace = ::std::option::Option::Some(is.read_string()?); + }, + 82 => { + self.levy_mosaic = ::std::option::Option::Some(is.read_string()?); + }, + 88 => { + self.supply = ::std::option::Option::Some(is.read_uint64()?); + }, + 96 => { + self.mutable_supply = ::std::option::Option::Some(is.read_bool()?); + }, + 104 => { + self.transferable = ::std::option::Option::Some(is.read_bool()?); + }, + 114 => { + self.description = ::std::option::Option::Some(is.read_string()?); + }, + 122 => { + is.read_repeated_packed_uint32_into(&mut self.networks)?; + }, + 120 => { + self.networks.push(is.read_uint32()?); + }, + 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.name.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.ticker.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.namespace.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.mosaic.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(v) = self.divisibility { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.levy { + my_size += ::protobuf::rt::int32_size(6, v.value()); + } + if let Some(v) = self.fee { + my_size += ::protobuf::rt::uint64_size(7, v); + } + if let Some(v) = self.levy_address.as_ref() { + my_size += ::protobuf::rt::string_size(8, &v); + } + if let Some(v) = self.levy_namespace.as_ref() { + my_size += ::protobuf::rt::string_size(9, &v); + } + if let Some(v) = self.levy_mosaic.as_ref() { + my_size += ::protobuf::rt::string_size(10, &v); + } + if let Some(v) = self.supply { + my_size += ::protobuf::rt::uint64_size(11, v); + } + if let Some(v) = self.mutable_supply { + my_size += 1 + 1; + } + if let Some(v) = self.transferable { + my_size += 1 + 1; + } + if let Some(v) = self.description.as_ref() { + my_size += ::protobuf::rt::string_size(14, &v); + } + for value in &self.networks { + my_size += ::protobuf::rt::uint32_size(15, *value); + }; + 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.name.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.ticker.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.namespace.as_ref() { + os.write_string(3, v)?; + } + if let Some(v) = self.mosaic.as_ref() { + os.write_string(4, v)?; + } + if let Some(v) = self.divisibility { + os.write_uint32(5, v)?; + } + if let Some(v) = self.levy { + os.write_enum(6, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.fee { + os.write_uint64(7, v)?; + } + if let Some(v) = self.levy_address.as_ref() { + os.write_string(8, v)?; + } + if let Some(v) = self.levy_namespace.as_ref() { + os.write_string(9, v)?; + } + if let Some(v) = self.levy_mosaic.as_ref() { + os.write_string(10, v)?; + } + if let Some(v) = self.supply { + os.write_uint64(11, v)?; + } + if let Some(v) = self.mutable_supply { + os.write_bool(12, v)?; + } + if let Some(v) = self.transferable { + os.write_bool(13, v)?; + } + if let Some(v) = self.description.as_ref() { + os.write_string(14, v)?; + } + for v in &self.networks { + os.write_uint32(15, *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() -> NEMMosaicDefinition { + NEMMosaicDefinition::new() + } + + fn clear(&mut self) { + self.name = ::std::option::Option::None; + self.ticker = ::std::option::Option::None; + self.namespace = ::std::option::Option::None; + self.mosaic = ::std::option::Option::None; + self.divisibility = ::std::option::Option::None; + self.levy = ::std::option::Option::None; + self.fee = ::std::option::Option::None; + self.levy_address = ::std::option::Option::None; + self.levy_namespace = ::std::option::Option::None; + self.levy_mosaic = ::std::option::Option::None; + self.supply = ::std::option::Option::None; + self.mutable_supply = ::std::option::Option::None; + self.transferable = ::std::option::Option::None; + self.description = ::std::option::Option::None; + self.networks.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static NEMMosaicDefinition { + static instance: NEMMosaicDefinition = NEMMosaicDefinition { + name: ::std::option::Option::None, + ticker: ::std::option::Option::None, + namespace: ::std::option::Option::None, + mosaic: ::std::option::Option::None, + divisibility: ::std::option::Option::None, + levy: ::std::option::Option::None, + fee: ::std::option::Option::None, + levy_address: ::std::option::Option::None, + levy_namespace: ::std::option::Option::None, + levy_mosaic: ::std::option::Option::None, + supply: ::std::option::Option::None, + mutable_supply: ::std::option::Option::None, + transferable: ::std::option::Option::None, + description: ::std::option::Option::None, + networks: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for NEMMosaicDefinition { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::super::file_descriptor().message_by_package_relative_name("NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition").unwrap()).clone() + } + } + + impl ::std::fmt::Display for NEMMosaicDefinition { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for NEMMosaicDefinition { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + /// Nested message and enums of message `NEMMosaicDefinition` + pub mod nemmosaic_definition { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.NEMMosaicLevy) + pub enum NEMMosaicLevy { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.NEMMosaicLevy.MosaicLevy_Absolute) + MosaicLevy_Absolute = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.NEMMosaicLevy.MosaicLevy_Percentile) + MosaicLevy_Percentile = 2, + } + + impl ::protobuf::Enum for NEMMosaicLevy { + const NAME: &'static str = "NEMMosaicLevy"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 1 => ::std::option::Option::Some(NEMMosaicLevy::MosaicLevy_Absolute), + 2 => ::std::option::Option::Some(NEMMosaicLevy::MosaicLevy_Percentile), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "MosaicLevy_Absolute" => ::std::option::Option::Some(NEMMosaicLevy::MosaicLevy_Absolute), + "MosaicLevy_Percentile" => ::std::option::Option::Some(NEMMosaicLevy::MosaicLevy_Percentile), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [NEMMosaicLevy] = &[ + NEMMosaicLevy::MosaicLevy_Absolute, + NEMMosaicLevy::MosaicLevy_Percentile, + ]; + } + + impl ::protobuf::EnumFull for NEMMosaicLevy { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::super::super::file_descriptor().enum_by_package_relative_name("NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.NEMMosaicLevy").unwrap()).clone() + } + + fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { + let index = match self { + NEMMosaicLevy::MosaicLevy_Absolute => 0, + NEMMosaicLevy::MosaicLevy_Percentile => 1, + }; + Self::enum_descriptor().value_by_index(index) + } + } + + // Note, `Default` is implemented although default value is not 0 + impl ::std::default::Default for NEMMosaicLevy { + fn default() -> Self { + NEMMosaicLevy::MosaicLevy_Absolute + } + } + + impl NEMMosaicLevy { + pub(in super::super::super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("NEMSignTx.NEMMosaicCreation.NEMMosaicDefinition.NEMMosaicLevy") + } + } + } + } + + // @@protoc_insertion_point(message:hw.trezor.messages.nem.NEMSignTx.NEMMosaicSupplyChange) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct NEMMosaicSupplyChange { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicSupplyChange.namespace) + pub namespace: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicSupplyChange.mosaic) + pub mosaic: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicSupplyChange.type) + pub type_: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicSupplyChange.delta) + pub delta: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.nem.NEMSignTx.NEMMosaicSupplyChange.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a NEMMosaicSupplyChange { + fn default() -> &'a NEMMosaicSupplyChange { + ::default_instance() + } + } + + impl NEMMosaicSupplyChange { + pub fn new() -> NEMMosaicSupplyChange { + ::std::default::Default::default() + } + + // required string namespace = 1; + + pub fn namespace(&self) -> &str { + match self.namespace.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_namespace(&mut self) { + self.namespace = ::std::option::Option::None; + } + + pub fn has_namespace(&self) -> bool { + self.namespace.is_some() + } + + // Param is passed by value, moved + pub fn set_namespace(&mut self, v: ::std::string::String) { + self.namespace = ::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_namespace(&mut self) -> &mut ::std::string::String { + if self.namespace.is_none() { + self.namespace = ::std::option::Option::Some(::std::string::String::new()); + } + self.namespace.as_mut().unwrap() + } + + // Take field + pub fn take_namespace(&mut self) -> ::std::string::String { + self.namespace.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required string mosaic = 2; + + pub fn mosaic(&self) -> &str { + match self.mosaic.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_mosaic(&mut self) { + self.mosaic = ::std::option::Option::None; + } + + pub fn has_mosaic(&self) -> bool { + self.mosaic.is_some() + } + + // Param is passed by value, moved + pub fn set_mosaic(&mut self, v: ::std::string::String) { + self.mosaic = ::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_mosaic(&mut self) -> &mut ::std::string::String { + if self.mosaic.is_none() { + self.mosaic = ::std::option::Option::Some(::std::string::String::new()); + } + self.mosaic.as_mut().unwrap() + } + + // Take field + pub fn take_mosaic(&mut self) -> ::std::string::String { + self.mosaic.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required .hw.trezor.messages.nem.NEMSignTx.NEMMosaicSupplyChange.NEMSupplyChangeType type = 3; + + pub fn type_(&self) -> nemmosaic_supply_change::NEMSupplyChangeType { + match self.type_ { + Some(e) => e.enum_value_or(nemmosaic_supply_change::NEMSupplyChangeType::SupplyChange_Increase), + None => nemmosaic_supply_change::NEMSupplyChangeType::SupplyChange_Increase, + } + } + + pub fn clear_type_(&mut self) { + self.type_ = ::std::option::Option::None; + } + + pub fn has_type(&self) -> bool { + self.type_.is_some() + } + + // Param is passed by value, moved + pub fn set_type(&mut self, v: nemmosaic_supply_change::NEMSupplyChangeType) { + self.type_ = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // required uint64 delta = 4; + + pub fn delta(&self) -> u64 { + self.delta.unwrap_or(0) + } + + pub fn clear_delta(&mut self) { + self.delta = ::std::option::Option::None; + } + + pub fn has_delta(&self) -> bool { + self.delta.is_some() + } + + // Param is passed by value, moved + pub fn set_delta(&mut self, v: u64) { + self.delta = ::std::option::Option::Some(v); + } + + pub(in super) 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::<_, _>( + "namespace", + |m: &NEMMosaicSupplyChange| { &m.namespace }, + |m: &mut NEMMosaicSupplyChange| { &mut m.namespace }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "mosaic", + |m: &NEMMosaicSupplyChange| { &m.mosaic }, + |m: &mut NEMMosaicSupplyChange| { &mut m.mosaic }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "type", + |m: &NEMMosaicSupplyChange| { &m.type_ }, + |m: &mut NEMMosaicSupplyChange| { &mut m.type_ }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "delta", + |m: &NEMMosaicSupplyChange| { &m.delta }, + |m: &mut NEMMosaicSupplyChange| { &mut m.delta }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NEMSignTx.NEMMosaicSupplyChange", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for NEMMosaicSupplyChange { + const NAME: &'static str = "NEMMosaicSupplyChange"; + + fn is_initialized(&self) -> bool { + if self.namespace.is_none() { + return false; + } + if self.mosaic.is_none() { + return false; + } + if self.type_.is_none() { + return false; + } + if self.delta.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.namespace = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.mosaic = ::std::option::Option::Some(is.read_string()?); + }, + 24 => { + self.type_ = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 32 => { + self.delta = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.namespace.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.mosaic.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.type_ { + my_size += ::protobuf::rt::int32_size(3, v.value()); + } + if let Some(v) = self.delta { + my_size += ::protobuf::rt::uint64_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.namespace.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.mosaic.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.type_ { + os.write_enum(3, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.delta { + os.write_uint64(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() -> NEMMosaicSupplyChange { + NEMMosaicSupplyChange::new() + } + + fn clear(&mut self) { + self.namespace = ::std::option::Option::None; + self.mosaic = ::std::option::Option::None; + self.type_ = ::std::option::Option::None; + self.delta = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static NEMMosaicSupplyChange { + static instance: NEMMosaicSupplyChange = NEMMosaicSupplyChange { + namespace: ::std::option::Option::None, + mosaic: ::std::option::Option::None, + type_: ::std::option::Option::None, + delta: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for NEMMosaicSupplyChange { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("NEMSignTx.NEMMosaicSupplyChange").unwrap()).clone() + } + } + + impl ::std::fmt::Display for NEMMosaicSupplyChange { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for NEMMosaicSupplyChange { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + /// Nested message and enums of message `NEMMosaicSupplyChange` + pub mod nemmosaic_supply_change { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.nem.NEMSignTx.NEMMosaicSupplyChange.NEMSupplyChangeType) + pub enum NEMSupplyChangeType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.nem.NEMSignTx.NEMMosaicSupplyChange.NEMSupplyChangeType.SupplyChange_Increase) + SupplyChange_Increase = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.nem.NEMSignTx.NEMMosaicSupplyChange.NEMSupplyChangeType.SupplyChange_Decrease) + SupplyChange_Decrease = 2, + } + + impl ::protobuf::Enum for NEMSupplyChangeType { + const NAME: &'static str = "NEMSupplyChangeType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 1 => ::std::option::Option::Some(NEMSupplyChangeType::SupplyChange_Increase), + 2 => ::std::option::Option::Some(NEMSupplyChangeType::SupplyChange_Decrease), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "SupplyChange_Increase" => ::std::option::Option::Some(NEMSupplyChangeType::SupplyChange_Increase), + "SupplyChange_Decrease" => ::std::option::Option::Some(NEMSupplyChangeType::SupplyChange_Decrease), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [NEMSupplyChangeType] = &[ + NEMSupplyChangeType::SupplyChange_Increase, + NEMSupplyChangeType::SupplyChange_Decrease, + ]; + } + + impl ::protobuf::EnumFull for NEMSupplyChangeType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::super::file_descriptor().enum_by_package_relative_name("NEMSignTx.NEMMosaicSupplyChange.NEMSupplyChangeType").unwrap()).clone() + } + + fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { + let index = match self { + NEMSupplyChangeType::SupplyChange_Increase => 0, + NEMSupplyChangeType::SupplyChange_Decrease => 1, + }; + Self::enum_descriptor().value_by_index(index) + } + } + + // Note, `Default` is implemented although default value is not 0 + impl ::std::default::Default for NEMSupplyChangeType { + fn default() -> Self { + NEMSupplyChangeType::SupplyChange_Increase + } + } + + impl NEMSupplyChangeType { + pub(in super::super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("NEMSignTx.NEMMosaicSupplyChange.NEMSupplyChangeType") + } + } + } + + // @@protoc_insertion_point(message:hw.trezor.messages.nem.NEMSignTx.NEMAggregateModification) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct NEMAggregateModification { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMAggregateModification.modifications) + pub modifications: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMAggregateModification.relative_change) + pub relative_change: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.nem.NEMSignTx.NEMAggregateModification.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a NEMAggregateModification { + fn default() -> &'a NEMAggregateModification { + ::default_instance() + } + } + + impl NEMAggregateModification { + pub fn new() -> NEMAggregateModification { + ::std::default::Default::default() + } + + // optional sint32 relative_change = 2; + + pub fn relative_change(&self) -> i32 { + self.relative_change.unwrap_or(0) + } + + pub fn clear_relative_change(&mut self) { + self.relative_change = ::std::option::Option::None; + } + + pub fn has_relative_change(&self) -> bool { + self.relative_change.is_some() + } + + // Param is passed by value, moved + pub fn set_relative_change(&mut self, v: i32) { + self.relative_change = ::std::option::Option::Some(v); + } + + pub(in super) 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_vec_simpler_accessor::<_, _>( + "modifications", + |m: &NEMAggregateModification| { &m.modifications }, + |m: &mut NEMAggregateModification| { &mut m.modifications }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "relative_change", + |m: &NEMAggregateModification| { &m.relative_change }, + |m: &mut NEMAggregateModification| { &mut m.relative_change }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NEMSignTx.NEMAggregateModification", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for NEMAggregateModification { + const NAME: &'static str = "NEMAggregateModification"; + + fn is_initialized(&self) -> bool { + for v in &self.modifications { + if !v.is_initialized() { + 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.modifications.push(is.read_message()?); + }, + 16 => { + self.relative_change = ::std::option::Option::Some(is.read_sint32()?); + }, + 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; + for value in &self.modifications { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + if let Some(v) = self.relative_change { + my_size += ::protobuf::rt::sint32_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<()> { + for v in &self.modifications { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + }; + if let Some(v) = self.relative_change { + os.write_sint32(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() -> NEMAggregateModification { + NEMAggregateModification::new() + } + + fn clear(&mut self) { + self.modifications.clear(); + self.relative_change = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static NEMAggregateModification { + static instance: NEMAggregateModification = NEMAggregateModification { + modifications: ::std::vec::Vec::new(), + relative_change: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for NEMAggregateModification { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("NEMSignTx.NEMAggregateModification").unwrap()).clone() + } + } + + impl ::std::fmt::Display for NEMAggregateModification { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for NEMAggregateModification { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + /// Nested message and enums of message `NEMAggregateModification` + pub mod nemaggregate_modification { + // @@protoc_insertion_point(message:hw.trezor.messages.nem.NEMSignTx.NEMAggregateModification.NEMCosignatoryModification) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct NEMCosignatoryModification { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMAggregateModification.NEMCosignatoryModification.type) + pub type_: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMAggregateModification.NEMCosignatoryModification.public_key) + pub public_key: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.nem.NEMSignTx.NEMAggregateModification.NEMCosignatoryModification.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a NEMCosignatoryModification { + fn default() -> &'a NEMCosignatoryModification { + ::default_instance() + } + } + + impl NEMCosignatoryModification { + pub fn new() -> NEMCosignatoryModification { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.nem.NEMSignTx.NEMAggregateModification.NEMCosignatoryModification.NEMModificationType type = 1; + + pub fn type_(&self) -> nemcosignatory_modification::NEMModificationType { + match self.type_ { + Some(e) => e.enum_value_or(nemcosignatory_modification::NEMModificationType::CosignatoryModification_Add), + None => nemcosignatory_modification::NEMModificationType::CosignatoryModification_Add, + } + } + + pub fn clear_type_(&mut self) { + self.type_ = ::std::option::Option::None; + } + + pub fn has_type(&self) -> bool { + self.type_.is_some() + } + + // Param is passed by value, moved + pub fn set_type(&mut self, v: nemcosignatory_modification::NEMModificationType) { + self.type_ = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // required bytes public_key = 2; + + pub fn public_key(&self) -> &[u8] { + match self.public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_public_key(&mut self) { + self.public_key = ::std::option::Option::None; + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: ::std::vec::Vec) { + self.public_key = ::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_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.public_key.is_none() { + self.public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> ::std::vec::Vec { + self.public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super::super) 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::<_, _>( + "type", + |m: &NEMCosignatoryModification| { &m.type_ }, + |m: &mut NEMCosignatoryModification| { &mut m.type_ }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "public_key", + |m: &NEMCosignatoryModification| { &m.public_key }, + |m: &mut NEMCosignatoryModification| { &mut m.public_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NEMSignTx.NEMAggregateModification.NEMCosignatoryModification", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for NEMCosignatoryModification { + const NAME: &'static str = "NEMCosignatoryModification"; + + fn is_initialized(&self) -> bool { + if self.type_.is_none() { + return false; + } + if self.public_key.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.type_ = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 18 => { + self.public_key = ::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.type_ { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + if let Some(v) = self.public_key.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.type_ { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.public_key.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() -> NEMCosignatoryModification { + NEMCosignatoryModification::new() + } + + fn clear(&mut self) { + self.type_ = ::std::option::Option::None; + self.public_key = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static NEMCosignatoryModification { + static instance: NEMCosignatoryModification = NEMCosignatoryModification { + type_: ::std::option::Option::None, + public_key: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for NEMCosignatoryModification { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::super::file_descriptor().message_by_package_relative_name("NEMSignTx.NEMAggregateModification.NEMCosignatoryModification").unwrap()).clone() + } + } + + impl ::std::fmt::Display for NEMCosignatoryModification { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for NEMCosignatoryModification { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + /// Nested message and enums of message `NEMCosignatoryModification` + pub mod nemcosignatory_modification { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.nem.NEMSignTx.NEMAggregateModification.NEMCosignatoryModification.NEMModificationType) + pub enum NEMModificationType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.nem.NEMSignTx.NEMAggregateModification.NEMCosignatoryModification.NEMModificationType.CosignatoryModification_Add) + CosignatoryModification_Add = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.nem.NEMSignTx.NEMAggregateModification.NEMCosignatoryModification.NEMModificationType.CosignatoryModification_Delete) + CosignatoryModification_Delete = 2, + } + + impl ::protobuf::Enum for NEMModificationType { + const NAME: &'static str = "NEMModificationType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 1 => ::std::option::Option::Some(NEMModificationType::CosignatoryModification_Add), + 2 => ::std::option::Option::Some(NEMModificationType::CosignatoryModification_Delete), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "CosignatoryModification_Add" => ::std::option::Option::Some(NEMModificationType::CosignatoryModification_Add), + "CosignatoryModification_Delete" => ::std::option::Option::Some(NEMModificationType::CosignatoryModification_Delete), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [NEMModificationType] = &[ + NEMModificationType::CosignatoryModification_Add, + NEMModificationType::CosignatoryModification_Delete, + ]; + } + + impl ::protobuf::EnumFull for NEMModificationType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::super::super::file_descriptor().enum_by_package_relative_name("NEMSignTx.NEMAggregateModification.NEMCosignatoryModification.NEMModificationType").unwrap()).clone() + } + + fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { + let index = match self { + NEMModificationType::CosignatoryModification_Add => 0, + NEMModificationType::CosignatoryModification_Delete => 1, + }; + Self::enum_descriptor().value_by_index(index) + } + } + + // Note, `Default` is implemented although default value is not 0 + impl ::std::default::Default for NEMModificationType { + fn default() -> Self { + NEMModificationType::CosignatoryModification_Add + } + } + + impl NEMModificationType { + pub(in super::super::super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("NEMSignTx.NEMAggregateModification.NEMCosignatoryModification.NEMModificationType") + } + } + } + } + + // @@protoc_insertion_point(message:hw.trezor.messages.nem.NEMSignTx.NEMImportanceTransfer) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct NEMImportanceTransfer { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMImportanceTransfer.mode) + pub mode: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignTx.NEMImportanceTransfer.public_key) + pub public_key: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.nem.NEMSignTx.NEMImportanceTransfer.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a NEMImportanceTransfer { + fn default() -> &'a NEMImportanceTransfer { + ::default_instance() + } + } + + impl NEMImportanceTransfer { + pub fn new() -> NEMImportanceTransfer { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.nem.NEMSignTx.NEMImportanceTransfer.NEMImportanceTransferMode mode = 1; + + pub fn mode(&self) -> nemimportance_transfer::NEMImportanceTransferMode { + match self.mode { + Some(e) => e.enum_value_or(nemimportance_transfer::NEMImportanceTransferMode::ImportanceTransfer_Activate), + None => nemimportance_transfer::NEMImportanceTransferMode::ImportanceTransfer_Activate, + } + } + + pub fn clear_mode(&mut self) { + self.mode = ::std::option::Option::None; + } + + pub fn has_mode(&self) -> bool { + self.mode.is_some() + } + + // Param is passed by value, moved + pub fn set_mode(&mut self, v: nemimportance_transfer::NEMImportanceTransferMode) { + self.mode = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // required bytes public_key = 2; + + pub fn public_key(&self) -> &[u8] { + match self.public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_public_key(&mut self) { + self.public_key = ::std::option::Option::None; + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: ::std::vec::Vec) { + self.public_key = ::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_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.public_key.is_none() { + self.public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> ::std::vec::Vec { + self.public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) 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::<_, _>( + "mode", + |m: &NEMImportanceTransfer| { &m.mode }, + |m: &mut NEMImportanceTransfer| { &mut m.mode }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "public_key", + |m: &NEMImportanceTransfer| { &m.public_key }, + |m: &mut NEMImportanceTransfer| { &mut m.public_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NEMSignTx.NEMImportanceTransfer", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for NEMImportanceTransfer { + const NAME: &'static str = "NEMImportanceTransfer"; + + fn is_initialized(&self) -> bool { + if self.mode.is_none() { + return false; + } + if self.public_key.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.mode = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 18 => { + self.public_key = ::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.mode { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + if let Some(v) = self.public_key.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.mode { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.public_key.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() -> NEMImportanceTransfer { + NEMImportanceTransfer::new() + } + + fn clear(&mut self) { + self.mode = ::std::option::Option::None; + self.public_key = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static NEMImportanceTransfer { + static instance: NEMImportanceTransfer = NEMImportanceTransfer { + mode: ::std::option::Option::None, + public_key: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for NEMImportanceTransfer { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("NEMSignTx.NEMImportanceTransfer").unwrap()).clone() + } + } + + impl ::std::fmt::Display for NEMImportanceTransfer { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for NEMImportanceTransfer { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + /// Nested message and enums of message `NEMImportanceTransfer` + pub mod nemimportance_transfer { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.nem.NEMSignTx.NEMImportanceTransfer.NEMImportanceTransferMode) + pub enum NEMImportanceTransferMode { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.nem.NEMSignTx.NEMImportanceTransfer.NEMImportanceTransferMode.ImportanceTransfer_Activate) + ImportanceTransfer_Activate = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.nem.NEMSignTx.NEMImportanceTransfer.NEMImportanceTransferMode.ImportanceTransfer_Deactivate) + ImportanceTransfer_Deactivate = 2, + } + + impl ::protobuf::Enum for NEMImportanceTransferMode { + const NAME: &'static str = "NEMImportanceTransferMode"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 1 => ::std::option::Option::Some(NEMImportanceTransferMode::ImportanceTransfer_Activate), + 2 => ::std::option::Option::Some(NEMImportanceTransferMode::ImportanceTransfer_Deactivate), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "ImportanceTransfer_Activate" => ::std::option::Option::Some(NEMImportanceTransferMode::ImportanceTransfer_Activate), + "ImportanceTransfer_Deactivate" => ::std::option::Option::Some(NEMImportanceTransferMode::ImportanceTransfer_Deactivate), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [NEMImportanceTransferMode] = &[ + NEMImportanceTransferMode::ImportanceTransfer_Activate, + NEMImportanceTransferMode::ImportanceTransfer_Deactivate, + ]; + } + + impl ::protobuf::EnumFull for NEMImportanceTransferMode { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::super::file_descriptor().enum_by_package_relative_name("NEMSignTx.NEMImportanceTransfer.NEMImportanceTransferMode").unwrap()).clone() + } + + fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { + let index = match self { + NEMImportanceTransferMode::ImportanceTransfer_Activate => 0, + NEMImportanceTransferMode::ImportanceTransfer_Deactivate => 1, + }; + Self::enum_descriptor().value_by_index(index) + } + } + + // Note, `Default` is implemented although default value is not 0 + impl ::std::default::Default for NEMImportanceTransferMode { + fn default() -> Self { + NEMImportanceTransferMode::ImportanceTransfer_Activate + } + } + + impl NEMImportanceTransferMode { + pub(in super::super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("NEMSignTx.NEMImportanceTransfer.NEMImportanceTransferMode") + } + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.nem.NEMSignedTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct NEMSignedTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignedTx.data) + pub data: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMSignedTx.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.nem.NEMSignedTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a NEMSignedTx { + fn default() -> &'a NEMSignedTx { + ::default_instance() + } +} + +impl NEMSignedTx { + pub fn new() -> NEMSignedTx { + ::std::default::Default::default() + } + + // required bytes data = 1; + + pub fn data(&self) -> &[u8] { + match self.data.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_data(&mut self) { + self.data = ::std::option::Option::None; + } + + pub fn has_data(&self) -> bool { + self.data.is_some() + } + + // Param is passed by value, moved + pub fn set_data(&mut self, v: ::std::vec::Vec) { + self.data = ::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_data(&mut self) -> &mut ::std::vec::Vec { + if self.data.is_none() { + self.data = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.data.as_mut().unwrap() + } + + // Take field + pub fn take_data(&mut self) -> ::std::vec::Vec { + self.data.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes signature = 2; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.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::<_, _>( + "data", + |m: &NEMSignedTx| { &m.data }, + |m: &mut NEMSignedTx| { &mut m.data }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &NEMSignedTx| { &m.signature }, + |m: &mut NEMSignedTx| { &mut m.signature }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NEMSignedTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for NEMSignedTx { + const NAME: &'static str = "NEMSignedTx"; + + fn is_initialized(&self) -> bool { + if self.data.is_none() { + return false; + } + if self.signature.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.data = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.signature = ::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.data.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.signature.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.data.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.signature.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() -> NEMSignedTx { + NEMSignedTx::new() + } + + fn clear(&mut self) { + self.data = ::std::option::Option::None; + self.signature = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static NEMSignedTx { + static instance: NEMSignedTx = NEMSignedTx { + data: ::std::option::Option::None, + signature: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for NEMSignedTx { + 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("NEMSignedTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for NEMSignedTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for NEMSignedTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.nem.NEMDecryptMessage) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct NEMDecryptMessage { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMDecryptMessage.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMDecryptMessage.network) + pub network: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMDecryptMessage.public_key) + pub public_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMDecryptMessage.payload) + pub payload: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.nem.NEMDecryptMessage.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a NEMDecryptMessage { + fn default() -> &'a NEMDecryptMessage { + ::default_instance() + } +} + +impl NEMDecryptMessage { + pub fn new() -> NEMDecryptMessage { + ::std::default::Default::default() + } + + // optional uint32 network = 2; + + pub fn network(&self) -> u32 { + self.network.unwrap_or(0) + } + + pub fn clear_network(&mut self) { + self.network = ::std::option::Option::None; + } + + pub fn has_network(&self) -> bool { + self.network.is_some() + } + + // Param is passed by value, moved + pub fn set_network(&mut self, v: u32) { + self.network = ::std::option::Option::Some(v); + } + + // optional bytes public_key = 3; + + pub fn public_key(&self) -> &[u8] { + match self.public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_public_key(&mut self) { + self.public_key = ::std::option::Option::None; + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: ::std::vec::Vec) { + self.public_key = ::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_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.public_key.is_none() { + self.public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> ::std::vec::Vec { + self.public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes payload = 4; + + pub fn payload(&self) -> &[u8] { + match self.payload.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_payload(&mut self) { + self.payload = ::std::option::Option::None; + } + + pub fn has_payload(&self) -> bool { + self.payload.is_some() + } + + // Param is passed by value, moved + pub fn set_payload(&mut self, v: ::std::vec::Vec) { + self.payload = ::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_payload(&mut self) -> &mut ::std::vec::Vec { + if self.payload.is_none() { + self.payload = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.payload.as_mut().unwrap() + } + + // Take field + pub fn take_payload(&mut self) -> ::std::vec::Vec { + self.payload.take().unwrap_or_else(|| ::std::vec::Vec::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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &NEMDecryptMessage| { &m.address_n }, + |m: &mut NEMDecryptMessage| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "network", + |m: &NEMDecryptMessage| { &m.network }, + |m: &mut NEMDecryptMessage| { &mut m.network }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "public_key", + |m: &NEMDecryptMessage| { &m.public_key }, + |m: &mut NEMDecryptMessage| { &mut m.public_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "payload", + |m: &NEMDecryptMessage| { &m.payload }, + |m: &mut NEMDecryptMessage| { &mut m.payload }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NEMDecryptMessage", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for NEMDecryptMessage { + const NAME: &'static str = "NEMDecryptMessage"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.network = ::std::option::Option::Some(is.read_uint32()?); + }, + 26 => { + self.public_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 34 => { + self.payload = ::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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.network { + my_size += ::protobuf::rt::uint32_size(2, v); + } + if let Some(v) = self.public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.payload.as_ref() { + my_size += ::protobuf::rt::bytes_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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.network { + os.write_uint32(2, v)?; + } + if let Some(v) = self.public_key.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.payload.as_ref() { + os.write_bytes(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() -> NEMDecryptMessage { + NEMDecryptMessage::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.network = ::std::option::Option::None; + self.public_key = ::std::option::Option::None; + self.payload = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static NEMDecryptMessage { + static instance: NEMDecryptMessage = NEMDecryptMessage { + address_n: ::std::vec::Vec::new(), + network: ::std::option::Option::None, + public_key: ::std::option::Option::None, + payload: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for NEMDecryptMessage { + 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("NEMDecryptMessage").unwrap()).clone() + } +} + +impl ::std::fmt::Display for NEMDecryptMessage { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for NEMDecryptMessage { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.nem.NEMDecryptedMessage) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct NEMDecryptedMessage { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.nem.NEMDecryptedMessage.payload) + pub payload: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.nem.NEMDecryptedMessage.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a NEMDecryptedMessage { + fn default() -> &'a NEMDecryptedMessage { + ::default_instance() + } +} + +impl NEMDecryptedMessage { + pub fn new() -> NEMDecryptedMessage { + ::std::default::Default::default() + } + + // required bytes payload = 1; + + pub fn payload(&self) -> &[u8] { + match self.payload.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_payload(&mut self) { + self.payload = ::std::option::Option::None; + } + + pub fn has_payload(&self) -> bool { + self.payload.is_some() + } + + // Param is passed by value, moved + pub fn set_payload(&mut self, v: ::std::vec::Vec) { + self.payload = ::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_payload(&mut self) -> &mut ::std::vec::Vec { + if self.payload.is_none() { + self.payload = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.payload.as_mut().unwrap() + } + + // Take field + pub fn take_payload(&mut self) -> ::std::vec::Vec { + self.payload.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "payload", + |m: &NEMDecryptedMessage| { &m.payload }, + |m: &mut NEMDecryptedMessage| { &mut m.payload }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "NEMDecryptedMessage", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for NEMDecryptedMessage { + const NAME: &'static str = "NEMDecryptedMessage"; + + fn is_initialized(&self) -> bool { + if self.payload.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.payload = ::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.payload.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.payload.as_ref() { + os.write_bytes(1, 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() -> NEMDecryptedMessage { + NEMDecryptedMessage::new() + } + + fn clear(&mut self) { + self.payload = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static NEMDecryptedMessage { + static instance: NEMDecryptedMessage = NEMDecryptedMessage { + payload: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for NEMDecryptedMessage { + 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("NEMDecryptedMessage").unwrap()).clone() + } +} + +impl ::std::fmt::Display for NEMDecryptedMessage { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for NEMDecryptedMessage { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x12messages-nem.proto\x12\x16hw.trezor.messages.nem\"\x8a\x01\n\rNEMG\ + etAddress\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\x1d\n\ + \x07network\x18\x02\x20\x01(\r:\x03104R\x07network\x12!\n\x0cshow_displa\ + y\x18\x03\x20\x01(\x08R\x0bshowDisplay\x12\x1a\n\x08chunkify\x18\x04\x20\ + \x01(\x08R\x08chunkify\"&\n\nNEMAddress\x12\x18\n\x07address\x18\x01\x20\ + \x02(\tR\x07address\"\xa2\x19\n\tNEMSignTx\x12X\n\x0btransaction\x18\x01\ + \x20\x02(\x0b26.hw.trezor.messages.nem.NEMSignTx.NEMTransactionCommonR\ + \x0btransaction\x12R\n\x08multisig\x18\x02\x20\x01(\x0b26.hw.trezor.mess\ + ages.nem.NEMSignTx.NEMTransactionCommonR\x08multisig\x12I\n\x08transfer\ + \x18\x03\x20\x01(\x0b2-.hw.trezor.messages.nem.NEMSignTx.NEMTransferR\ + \x08transfer\x12\x1c\n\tcosigning\x18\x04\x20\x01(\x08R\tcosigning\x12h\ + \n\x13provision_namespace\x18\x05\x20\x01(\x0b27.hw.trezor.messages.nem.\ + NEMSignTx.NEMProvisionNamespaceR\x12provisionNamespace\x12\\\n\x0fmosaic\ + _creation\x18\x06\x20\x01(\x0b23.hw.trezor.messages.nem.NEMSignTx.NEMMos\ + aicCreationR\x0emosaicCreation\x12\\\n\rsupply_change\x18\x07\x20\x01(\ + \x0b27.hw.trezor.messages.nem.NEMSignTx.NEMMosaicSupplyChangeR\x0csupply\ + Change\x12q\n\x16aggregate_modification\x18\x08\x20\x01(\x0b2:.hw.trezor\ + .messages.nem.NEMSignTx.NEMAggregateModificationR\x15aggregateModificati\ + on\x12h\n\x13importance_transfer\x18\t\x20\x01(\x0b27.hw.trezor.messages\ + .nem.NEMSignTx.NEMImportanceTransferR\x12importanceTransfer\x12\x1a\n\ + \x08chunkify\x18\n\x20\x01(\x08R\x08chunkify\x1a\xb6\x01\n\x14NEMTransac\ + tionCommon\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\x1d\ + \n\x07network\x18\x02\x20\x01(\r:\x03104R\x07network\x12\x1c\n\ttimestam\ + p\x18\x03\x20\x02(\rR\ttimestamp\x12\x10\n\x03fee\x18\x04\x20\x02(\x04R\ + \x03fee\x12\x1a\n\x08deadline\x18\x05\x20\x02(\rR\x08deadline\x12\x16\n\ + \x06signer\x18\x06\x20\x01(\x0cR\x06signer\x1a\xae\x02\n\x0bNEMTransfer\ + \x12\x1c\n\trecipient\x18\x01\x20\x02(\tR\trecipient\x12\x16\n\x06amount\ + \x18\x02\x20\x02(\x04R\x06amount\x12\x18\n\x07payload\x18\x03\x20\x01(\ + \x0cR\x07payload\x12\x1d\n\npublic_key\x18\x04\x20\x01(\x0cR\tpublicKey\ + \x12Q\n\x07mosaics\x18\x05\x20\x03(\x0b27.hw.trezor.messages.nem.NEMSign\ + Tx.NEMTransfer.NEMMosaicR\x07mosaics\x1a]\n\tNEMMosaic\x12\x1c\n\tnamesp\ + ace\x18\x01\x20\x02(\tR\tnamespace\x12\x16\n\x06mosaic\x18\x02\x20\x02(\ + \tR\x06mosaic\x12\x1a\n\x08quantity\x18\x03\x20\x02(\x04R\x08quantity\ + \x1as\n\x15NEMProvisionNamespace\x12\x1c\n\tnamespace\x18\x01\x20\x02(\t\ + R\tnamespace\x12\x16\n\x06parent\x18\x02\x20\x01(\tR\x06parent\x12\x12\n\ + \x04sink\x18\x03\x20\x02(\tR\x04sink\x12\x10\n\x03fee\x18\x04\x20\x02(\ + \x04R\x03fee\x1a\x8e\x06\n\x11NEMMosaicCreation\x12g\n\ndefinition\x18\ + \x01\x20\x02(\x0b2G.hw.trezor.messages.nem.NEMSignTx.NEMMosaicCreation.N\ + EMMosaicDefinitionR\ndefinition\x12\x12\n\x04sink\x18\x02\x20\x02(\tR\ + \x04sink\x12\x10\n\x03fee\x18\x03\x20\x02(\x04R\x03fee\x1a\xe9\x04\n\x13\ + NEMMosaicDefinition\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x12\ + \x16\n\x06ticker\x18\x02\x20\x01(\tR\x06ticker\x12\x1c\n\tnamespace\x18\ + \x03\x20\x02(\tR\tnamespace\x12\x16\n\x06mosaic\x18\x04\x20\x02(\tR\x06m\ + osaic\x12\"\n\x0cdivisibility\x18\x05\x20\x01(\rR\x0cdivisibility\x12i\n\ + \x04levy\x18\x06\x20\x01(\x0e2U.hw.trezor.messages.nem.NEMSignTx.NEMMosa\ + icCreation.NEMMosaicDefinition.NEMMosaicLevyR\x04levy\x12\x10\n\x03fee\ + \x18\x07\x20\x01(\x04R\x03fee\x12!\n\x0clevy_address\x18\x08\x20\x01(\tR\ + \x0blevyAddress\x12%\n\x0elevy_namespace\x18\t\x20\x01(\tR\rlevyNamespac\ + e\x12\x1f\n\x0blevy_mosaic\x18\n\x20\x01(\tR\nlevyMosaic\x12\x16\n\x06su\ + pply\x18\x0b\x20\x01(\x04R\x06supply\x12%\n\x0emutable_supply\x18\x0c\ + \x20\x01(\x08R\rmutableSupply\x12\"\n\x0ctransferable\x18\r\x20\x01(\x08\ + R\x0ctransferable\x12\x20\n\x0bdescription\x18\x0e\x20\x02(\tR\x0bdescri\ + ption\x12\x1a\n\x08networks\x18\x0f\x20\x03(\rR\x08networks\"C\n\rNEMMos\ + aicLevy\x12\x17\n\x13MosaicLevy_Absolute\x10\x01\x12\x19\n\x15MosaicLevy\ + _Percentile\x10\x02\x1a\x91\x02\n\x15NEMMosaicSupplyChange\x12\x1c\n\tna\ + mespace\x18\x01\x20\x02(\tR\tnamespace\x12\x16\n\x06mosaic\x18\x02\x20\ + \x02(\tR\x06mosaic\x12_\n\x04type\x18\x03\x20\x02(\x0e2K.hw.trezor.messa\ + ges.nem.NEMSignTx.NEMMosaicSupplyChange.NEMSupplyChangeTypeR\x04type\x12\ + \x14\n\x05delta\x18\x04\x20\x02(\x04R\x05delta\"K\n\x13NEMSupplyChangeTy\ + pe\x12\x19\n\x15SupplyChange_Increase\x10\x01\x12\x19\n\x15SupplyChange_\ + Decrease\x10\x02\x1a\xd9\x03\n\x18NEMAggregateModification\x12{\n\rmodif\ + ications\x18\x01\x20\x03(\x0b2U.hw.trezor.messages.nem.NEMSignTx.NEMAggr\ + egateModification.NEMCosignatoryModificationR\rmodifications\x12'\n\x0fr\ + elative_change\x18\x02\x20\x01(\x11R\x0erelativeChange\x1a\x96\x02\n\x1a\ + NEMCosignatoryModification\x12}\n\x04type\x18\x01\x20\x02(\x0e2i.hw.trez\ + or.messages.nem.NEMSignTx.NEMAggregateModification.NEMCosignatoryModific\ + ation.NEMModificationTypeR\x04type\x12\x1d\n\npublic_key\x18\x02\x20\x02\ + (\x0cR\tpublicKey\"Z\n\x13NEMModificationType\x12\x1f\n\x1bCosignatoryMo\ + dification_Add\x10\x01\x12\"\n\x1eCosignatoryModification_Delete\x10\x02\ + \x1a\xfe\x01\n\x15NEMImportanceTransfer\x12e\n\x04mode\x18\x01\x20\x02(\ + \x0e2Q.hw.trezor.messages.nem.NEMSignTx.NEMImportanceTransfer.NEMImporta\ + nceTransferModeR\x04mode\x12\x1d\n\npublic_key\x18\x02\x20\x02(\x0cR\tpu\ + blicKey\"_\n\x19NEMImportanceTransferMode\x12\x1f\n\x1bImportanceTransfe\ + r_Activate\x10\x01\x12!\n\x1dImportanceTransfer_Deactivate\x10\x02\"?\n\ + \x0bNEMSignedTx\x12\x12\n\x04data\x18\x01\x20\x02(\x0cR\x04data\x12\x1c\ + \n\tsignature\x18\x02\x20\x02(\x0cR\tsignature\"\x83\x01\n\x11NEMDecrypt\ + Message\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\x18\n\ + \x07network\x18\x02\x20\x01(\rR\x07network\x12\x1d\n\npublic_key\x18\x03\ + \x20\x01(\x0cR\tpublicKey\x12\x18\n\x07payload\x18\x04\x20\x01(\x0cR\x07\ + payload\"/\n\x13NEMDecryptedMessage\x12\x18\n\x07payload\x18\x01\x20\x02\ + (\x0cR\x07payloadB7\n#com.satoshilabs.trezor.lib.protobufB\x10TrezorMess\ + ageNem\ +"; + +/// `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(16); + messages.push(NEMGetAddress::generated_message_descriptor_data()); + messages.push(NEMAddress::generated_message_descriptor_data()); + messages.push(NEMSignTx::generated_message_descriptor_data()); + messages.push(NEMSignedTx::generated_message_descriptor_data()); + messages.push(NEMDecryptMessage::generated_message_descriptor_data()); + messages.push(NEMDecryptedMessage::generated_message_descriptor_data()); + messages.push(nemsign_tx::NEMTransactionCommon::generated_message_descriptor_data()); + messages.push(nemsign_tx::NEMTransfer::generated_message_descriptor_data()); + messages.push(nemsign_tx::NEMProvisionNamespace::generated_message_descriptor_data()); + messages.push(nemsign_tx::NEMMosaicCreation::generated_message_descriptor_data()); + messages.push(nemsign_tx::NEMMosaicSupplyChange::generated_message_descriptor_data()); + messages.push(nemsign_tx::NEMAggregateModification::generated_message_descriptor_data()); + messages.push(nemsign_tx::NEMImportanceTransfer::generated_message_descriptor_data()); + messages.push(nemsign_tx::nemtransfer::NEMMosaic::generated_message_descriptor_data()); + messages.push(nemsign_tx::nemmosaic_creation::NEMMosaicDefinition::generated_message_descriptor_data()); + messages.push(nemsign_tx::nemaggregate_modification::NEMCosignatoryModification::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(4); + enums.push(nemsign_tx::nemmosaic_creation::nemmosaic_definition::NEMMosaicLevy::generated_enum_descriptor_data()); + enums.push(nemsign_tx::nemmosaic_supply_change::NEMSupplyChangeType::generated_enum_descriptor_data()); + enums.push(nemsign_tx::nemaggregate_modification::nemcosignatory_modification::NEMModificationType::generated_enum_descriptor_data()); + enums.push(nemsign_tx::nemimportance_transfer::NEMImportanceTransferMode::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_ripple.rs b/wallet/trezor-client/src/protos/generated/messages_ripple.rs new file mode 100644 index 0000000000..ab9a5487fe --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_ripple.rs @@ -0,0 +1,1241 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-ripple.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.ripple.RippleGetAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct RippleGetAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleGetAddress.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleGetAddress.show_display) + pub show_display: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleGetAddress.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ripple.RippleGetAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a RippleGetAddress { + fn default() -> &'a RippleGetAddress { + ::default_instance() + } +} + +impl RippleGetAddress { + pub fn new() -> RippleGetAddress { + ::std::default::Default::default() + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 3; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &RippleGetAddress| { &m.address_n }, + |m: &mut RippleGetAddress| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &RippleGetAddress| { &m.show_display }, + |m: &mut RippleGetAddress| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &RippleGetAddress| { &m.chunkify }, + |m: &mut RippleGetAddress| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "RippleGetAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for RippleGetAddress { + const NAME: &'static str = "RippleGetAddress"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 24 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.show_display { + os.write_bool(2, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(3, 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() -> RippleGetAddress { + RippleGetAddress::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.show_display = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static RippleGetAddress { + static instance: RippleGetAddress = RippleGetAddress { + address_n: ::std::vec::Vec::new(), + show_display: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for RippleGetAddress { + 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("RippleGetAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for RippleGetAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RippleGetAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ripple.RippleAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct RippleAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleAddress.address) + pub address: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ripple.RippleAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a RippleAddress { + fn default() -> &'a RippleAddress { + ::default_instance() + } +} + +impl RippleAddress { + pub fn new() -> RippleAddress { + ::std::default::Default::default() + } + + // required string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &RippleAddress| { &m.address }, + |m: &mut RippleAddress| { &mut m.address }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "RippleAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for RippleAddress { + const NAME: &'static str = "RippleAddress"; + + fn is_initialized(&self) -> bool { + if self.address.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_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::string_size(1, &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_string(1, 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() -> RippleAddress { + RippleAddress::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static RippleAddress { + static instance: RippleAddress = RippleAddress { + address: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for RippleAddress { + 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("RippleAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for RippleAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RippleAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ripple.RippleSignTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct RippleSignTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.fee) + pub fee: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.flags) + pub flags: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.sequence) + pub sequence: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.last_ledger_sequence) + pub last_ledger_sequence: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.payment) + pub payment: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ripple.RippleSignTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a RippleSignTx { + fn default() -> &'a RippleSignTx { + ::default_instance() + } +} + +impl RippleSignTx { + pub fn new() -> RippleSignTx { + ::std::default::Default::default() + } + + // required uint64 fee = 2; + + pub fn fee(&self) -> u64 { + self.fee.unwrap_or(0) + } + + pub fn clear_fee(&mut self) { + self.fee = ::std::option::Option::None; + } + + pub fn has_fee(&self) -> bool { + self.fee.is_some() + } + + // Param is passed by value, moved + pub fn set_fee(&mut self, v: u64) { + self.fee = ::std::option::Option::Some(v); + } + + // optional uint32 flags = 3; + + pub fn flags(&self) -> u32 { + self.flags.unwrap_or(0u32) + } + + pub fn clear_flags(&mut self) { + self.flags = ::std::option::Option::None; + } + + pub fn has_flags(&self) -> bool { + self.flags.is_some() + } + + // Param is passed by value, moved + pub fn set_flags(&mut self, v: u32) { + self.flags = ::std::option::Option::Some(v); + } + + // required uint32 sequence = 4; + + pub fn sequence(&self) -> u32 { + self.sequence.unwrap_or(0) + } + + pub fn clear_sequence(&mut self) { + self.sequence = ::std::option::Option::None; + } + + pub fn has_sequence(&self) -> bool { + self.sequence.is_some() + } + + // Param is passed by value, moved + pub fn set_sequence(&mut self, v: u32) { + self.sequence = ::std::option::Option::Some(v); + } + + // optional uint32 last_ledger_sequence = 5; + + pub fn last_ledger_sequence(&self) -> u32 { + self.last_ledger_sequence.unwrap_or(0) + } + + pub fn clear_last_ledger_sequence(&mut self) { + self.last_ledger_sequence = ::std::option::Option::None; + } + + pub fn has_last_ledger_sequence(&self) -> bool { + self.last_ledger_sequence.is_some() + } + + // Param is passed by value, moved + pub fn set_last_ledger_sequence(&mut self, v: u32) { + self.last_ledger_sequence = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 7; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(7); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &RippleSignTx| { &m.address_n }, + |m: &mut RippleSignTx| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fee", + |m: &RippleSignTx| { &m.fee }, + |m: &mut RippleSignTx| { &mut m.fee }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "flags", + |m: &RippleSignTx| { &m.flags }, + |m: &mut RippleSignTx| { &mut m.flags }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sequence", + |m: &RippleSignTx| { &m.sequence }, + |m: &mut RippleSignTx| { &mut m.sequence }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "last_ledger_sequence", + |m: &RippleSignTx| { &m.last_ledger_sequence }, + |m: &mut RippleSignTx| { &mut m.last_ledger_sequence }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, ripple_sign_tx::RipplePayment>( + "payment", + |m: &RippleSignTx| { &m.payment }, + |m: &mut RippleSignTx| { &mut m.payment }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &RippleSignTx| { &m.chunkify }, + |m: &mut RippleSignTx| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "RippleSignTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for RippleSignTx { + const NAME: &'static str = "RippleSignTx"; + + fn is_initialized(&self) -> bool { + if self.fee.is_none() { + return false; + } + if self.sequence.is_none() { + return false; + } + if self.payment.is_none() { + return false; + } + for v in &self.payment { + if !v.is_initialized() { + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.fee = ::std::option::Option::Some(is.read_uint64()?); + }, + 24 => { + self.flags = ::std::option::Option::Some(is.read_uint32()?); + }, + 32 => { + self.sequence = ::std::option::Option::Some(is.read_uint32()?); + }, + 40 => { + self.last_ledger_sequence = ::std::option::Option::Some(is.read_uint32()?); + }, + 50 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.payment)?; + }, + 56 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.fee { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.flags { + my_size += ::protobuf::rt::uint32_size(3, v); + } + if let Some(v) = self.sequence { + my_size += ::protobuf::rt::uint32_size(4, v); + } + if let Some(v) = self.last_ledger_sequence { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.payment.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.fee { + os.write_uint64(2, v)?; + } + if let Some(v) = self.flags { + os.write_uint32(3, v)?; + } + if let Some(v) = self.sequence { + os.write_uint32(4, v)?; + } + if let Some(v) = self.last_ledger_sequence { + os.write_uint32(5, v)?; + } + if let Some(v) = self.payment.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(6, v, os)?; + } + if let Some(v) = self.chunkify { + os.write_bool(7, 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() -> RippleSignTx { + RippleSignTx::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.fee = ::std::option::Option::None; + self.flags = ::std::option::Option::None; + self.sequence = ::std::option::Option::None; + self.last_ledger_sequence = ::std::option::Option::None; + self.payment.clear(); + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static RippleSignTx { + static instance: RippleSignTx = RippleSignTx { + address_n: ::std::vec::Vec::new(), + fee: ::std::option::Option::None, + flags: ::std::option::Option::None, + sequence: ::std::option::Option::None, + last_ledger_sequence: ::std::option::Option::None, + payment: ::protobuf::MessageField::none(), + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for RippleSignTx { + 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("RippleSignTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for RippleSignTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RippleSignTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `RippleSignTx` +pub mod ripple_sign_tx { + // @@protoc_insertion_point(message:hw.trezor.messages.ripple.RippleSignTx.RipplePayment) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct RipplePayment { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.RipplePayment.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.RipplePayment.destination) + pub destination: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.RipplePayment.destination_tag) + pub destination_tag: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ripple.RippleSignTx.RipplePayment.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a RipplePayment { + fn default() -> &'a RipplePayment { + ::default_instance() + } + } + + impl RipplePayment { + pub fn new() -> RipplePayment { + ::std::default::Default::default() + } + + // required uint64 amount = 1; + + pub fn amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + // required string destination = 2; + + pub fn destination(&self) -> &str { + match self.destination.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_destination(&mut self) { + self.destination = ::std::option::Option::None; + } + + pub fn has_destination(&self) -> bool { + self.destination.is_some() + } + + // Param is passed by value, moved + pub fn set_destination(&mut self, v: ::std::string::String) { + self.destination = ::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_destination(&mut self) -> &mut ::std::string::String { + if self.destination.is_none() { + self.destination = ::std::option::Option::Some(::std::string::String::new()); + } + self.destination.as_mut().unwrap() + } + + // Take field + pub fn take_destination(&mut self) -> ::std::string::String { + self.destination.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint32 destination_tag = 3; + + pub fn destination_tag(&self) -> u32 { + self.destination_tag.unwrap_or(0) + } + + pub fn clear_destination_tag(&mut self) { + self.destination_tag = ::std::option::Option::None; + } + + pub fn has_destination_tag(&self) -> bool { + self.destination_tag.is_some() + } + + // Param is passed by value, moved + pub fn set_destination_tag(&mut self, v: u32) { + self.destination_tag = ::std::option::Option::Some(v); + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &RipplePayment| { &m.amount }, + |m: &mut RipplePayment| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "destination", + |m: &RipplePayment| { &m.destination }, + |m: &mut RipplePayment| { &mut m.destination }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "destination_tag", + |m: &RipplePayment| { &m.destination_tag }, + |m: &mut RipplePayment| { &mut m.destination_tag }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "RippleSignTx.RipplePayment", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for RipplePayment { + const NAME: &'static str = "RipplePayment"; + + fn is_initialized(&self) -> bool { + if self.amount.is_none() { + return false; + } + if self.destination.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.amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 18 => { + self.destination = ::std::option::Option::Some(is.read_string()?); + }, + 24 => { + self.destination_tag = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.amount { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.destination.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.destination_tag { + my_size += ::protobuf::rt::uint32_size(3, 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.amount { + os.write_uint64(1, v)?; + } + if let Some(v) = self.destination.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.destination_tag { + os.write_uint32(3, 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() -> RipplePayment { + RipplePayment::new() + } + + fn clear(&mut self) { + self.amount = ::std::option::Option::None; + self.destination = ::std::option::Option::None; + self.destination_tag = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static RipplePayment { + static instance: RipplePayment = RipplePayment { + amount: ::std::option::Option::None, + destination: ::std::option::Option::None, + destination_tag: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for RipplePayment { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("RippleSignTx.RipplePayment").unwrap()).clone() + } + } + + impl ::std::fmt::Display for RipplePayment { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for RipplePayment { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.ripple.RippleSignedTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct RippleSignedTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignedTx.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignedTx.serialized_tx) + pub serialized_tx: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.ripple.RippleSignedTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a RippleSignedTx { + fn default() -> &'a RippleSignedTx { + ::default_instance() + } +} + +impl RippleSignedTx { + pub fn new() -> RippleSignedTx { + ::std::default::Default::default() + } + + // required bytes signature = 1; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes serialized_tx = 2; + + pub fn serialized_tx(&self) -> &[u8] { + match self.serialized_tx.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_serialized_tx(&mut self) { + self.serialized_tx = ::std::option::Option::None; + } + + pub fn has_serialized_tx(&self) -> bool { + self.serialized_tx.is_some() + } + + // Param is passed by value, moved + pub fn set_serialized_tx(&mut self, v: ::std::vec::Vec) { + self.serialized_tx = ::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_serialized_tx(&mut self) -> &mut ::std::vec::Vec { + if self.serialized_tx.is_none() { + self.serialized_tx = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.serialized_tx.as_mut().unwrap() + } + + // Take field + pub fn take_serialized_tx(&mut self) -> ::std::vec::Vec { + self.serialized_tx.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::<_, _>( + "signature", + |m: &RippleSignedTx| { &m.signature }, + |m: &mut RippleSignedTx| { &mut m.signature }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "serialized_tx", + |m: &RippleSignedTx| { &m.serialized_tx }, + |m: &mut RippleSignedTx| { &mut m.serialized_tx }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "RippleSignedTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for RippleSignedTx { + const NAME: &'static str = "RippleSignedTx"; + + fn is_initialized(&self) -> bool { + if self.signature.is_none() { + return false; + } + if self.serialized_tx.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.signature = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.serialized_tx = ::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.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.serialized_tx.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.signature.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.serialized_tx.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() -> RippleSignedTx { + RippleSignedTx::new() + } + + fn clear(&mut self) { + self.signature = ::std::option::Option::None; + self.serialized_tx = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static RippleSignedTx { + static instance: RippleSignedTx = RippleSignedTx { + signature: ::std::option::Option::None, + serialized_tx: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for RippleSignedTx { + 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("RippleSignedTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for RippleSignedTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RippleSignedTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x15messages-ripple.proto\x12\x19hw.trezor.messages.ripple\"n\n\x10Rip\ + pleGetAddress\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12!\ + \n\x0cshow_display\x18\x02\x20\x01(\x08R\x0bshowDisplay\x12\x1a\n\x08chu\ + nkify\x18\x03\x20\x01(\x08R\x08chunkify\")\n\rRippleAddress\x12\x18\n\ + \x07address\x18\x01\x20\x02(\tR\x07address\"\x85\x03\n\x0cRippleSignTx\ + \x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\x10\n\x03fee\ + \x18\x02\x20\x02(\x04R\x03fee\x12\x17\n\x05flags\x18\x03\x20\x01(\r:\x01\ + 0R\x05flags\x12\x1a\n\x08sequence\x18\x04\x20\x02(\rR\x08sequence\x120\n\ + \x14last_ledger_sequence\x18\x05\x20\x01(\rR\x12lastLedgerSequence\x12O\ + \n\x07payment\x18\x06\x20\x02(\x0b25.hw.trezor.messages.ripple.RippleSig\ + nTx.RipplePaymentR\x07payment\x12\x1a\n\x08chunkify\x18\x07\x20\x01(\x08\ + R\x08chunkify\x1ar\n\rRipplePayment\x12\x16\n\x06amount\x18\x01\x20\x02(\ + \x04R\x06amount\x12\x20\n\x0bdestination\x18\x02\x20\x02(\tR\x0bdestinat\ + ion\x12'\n\x0fdestination_tag\x18\x03\x20\x01(\rR\x0edestinationTag\"S\n\ + \x0eRippleSignedTx\x12\x1c\n\tsignature\x18\x01\x20\x02(\x0cR\tsignature\ + \x12#\n\rserialized_tx\x18\x02\x20\x02(\x0cR\x0cserializedTxB:\n#com.sat\ + oshilabs.trezor.lib.protobufB\x13TrezorMessageRipple\ +"; + +/// `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(5); + messages.push(RippleGetAddress::generated_message_descriptor_data()); + messages.push(RippleAddress::generated_message_descriptor_data()); + messages.push(RippleSignTx::generated_message_descriptor_data()); + messages.push(RippleSignedTx::generated_message_descriptor_data()); + messages.push(ripple_sign_tx::RipplePayment::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_solana.rs b/wallet/trezor-client/src/protos/generated/messages_solana.rs new file mode 100644 index 0000000000..38d4ba81aa --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_solana.rs @@ -0,0 +1,1594 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-solana.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.solana.SolanaGetPublicKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SolanaGetPublicKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.solana.SolanaGetPublicKey.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.solana.SolanaGetPublicKey.show_display) + pub show_display: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.solana.SolanaGetPublicKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SolanaGetPublicKey { + fn default() -> &'a SolanaGetPublicKey { + ::default_instance() + } +} + +impl SolanaGetPublicKey { + pub fn new() -> SolanaGetPublicKey { + ::std::default::Default::default() + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + 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_vec_simpler_accessor::<_, _>( + "address_n", + |m: &SolanaGetPublicKey| { &m.address_n }, + |m: &mut SolanaGetPublicKey| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &SolanaGetPublicKey| { &m.show_display }, + |m: &mut SolanaGetPublicKey| { &mut m.show_display }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SolanaGetPublicKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SolanaGetPublicKey { + const NAME: &'static str = "SolanaGetPublicKey"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.show_display { + os.write_bool(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() -> SolanaGetPublicKey { + SolanaGetPublicKey::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.show_display = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static SolanaGetPublicKey { + static instance: SolanaGetPublicKey = SolanaGetPublicKey { + address_n: ::std::vec::Vec::new(), + show_display: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SolanaGetPublicKey { + 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("SolanaGetPublicKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SolanaGetPublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SolanaGetPublicKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.solana.SolanaPublicKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SolanaPublicKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.solana.SolanaPublicKey.public_key) + pub public_key: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.solana.SolanaPublicKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SolanaPublicKey { + fn default() -> &'a SolanaPublicKey { + ::default_instance() + } +} + +impl SolanaPublicKey { + pub fn new() -> SolanaPublicKey { + ::std::default::Default::default() + } + + // required bytes public_key = 1; + + pub fn public_key(&self) -> &[u8] { + match self.public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_public_key(&mut self) { + self.public_key = ::std::option::Option::None; + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: ::std::vec::Vec) { + self.public_key = ::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_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.public_key.is_none() { + self.public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> ::std::vec::Vec { + self.public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "public_key", + |m: &SolanaPublicKey| { &m.public_key }, + |m: &mut SolanaPublicKey| { &mut m.public_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SolanaPublicKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SolanaPublicKey { + const NAME: &'static str = "SolanaPublicKey"; + + fn is_initialized(&self) -> bool { + if self.public_key.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.public_key = ::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.public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.public_key.as_ref() { + os.write_bytes(1, 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() -> SolanaPublicKey { + SolanaPublicKey::new() + } + + fn clear(&mut self) { + self.public_key = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static SolanaPublicKey { + static instance: SolanaPublicKey = SolanaPublicKey { + public_key: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SolanaPublicKey { + 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("SolanaPublicKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SolanaPublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SolanaPublicKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.solana.SolanaGetAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SolanaGetAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.solana.SolanaGetAddress.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.solana.SolanaGetAddress.show_display) + pub show_display: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.solana.SolanaGetAddress.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.solana.SolanaGetAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SolanaGetAddress { + fn default() -> &'a SolanaGetAddress { + ::default_instance() + } +} + +impl SolanaGetAddress { + pub fn new() -> SolanaGetAddress { + ::std::default::Default::default() + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 3; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &SolanaGetAddress| { &m.address_n }, + |m: &mut SolanaGetAddress| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &SolanaGetAddress| { &m.show_display }, + |m: &mut SolanaGetAddress| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &SolanaGetAddress| { &m.chunkify }, + |m: &mut SolanaGetAddress| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SolanaGetAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SolanaGetAddress { + const NAME: &'static str = "SolanaGetAddress"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 24 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.show_display { + os.write_bool(2, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(3, 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() -> SolanaGetAddress { + SolanaGetAddress::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.show_display = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static SolanaGetAddress { + static instance: SolanaGetAddress = SolanaGetAddress { + address_n: ::std::vec::Vec::new(), + show_display: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SolanaGetAddress { + 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("SolanaGetAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SolanaGetAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SolanaGetAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.solana.SolanaAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SolanaAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.solana.SolanaAddress.address) + pub address: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.solana.SolanaAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SolanaAddress { + fn default() -> &'a SolanaAddress { + ::default_instance() + } +} + +impl SolanaAddress { + pub fn new() -> SolanaAddress { + ::std::default::Default::default() + } + + // required string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &SolanaAddress| { &m.address }, + |m: &mut SolanaAddress| { &mut m.address }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SolanaAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SolanaAddress { + const NAME: &'static str = "SolanaAddress"; + + fn is_initialized(&self) -> bool { + if self.address.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_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::string_size(1, &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_string(1, 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() -> SolanaAddress { + SolanaAddress::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static SolanaAddress { + static instance: SolanaAddress = SolanaAddress { + address: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SolanaAddress { + 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("SolanaAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SolanaAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SolanaAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.solana.SolanaTxTokenAccountInfo) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SolanaTxTokenAccountInfo { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.solana.SolanaTxTokenAccountInfo.base_address) + pub base_address: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.solana.SolanaTxTokenAccountInfo.token_program) + pub token_program: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.solana.SolanaTxTokenAccountInfo.token_mint) + pub token_mint: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.solana.SolanaTxTokenAccountInfo.token_account) + pub token_account: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.solana.SolanaTxTokenAccountInfo.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SolanaTxTokenAccountInfo { + fn default() -> &'a SolanaTxTokenAccountInfo { + ::default_instance() + } +} + +impl SolanaTxTokenAccountInfo { + pub fn new() -> SolanaTxTokenAccountInfo { + ::std::default::Default::default() + } + + // required string base_address = 1; + + pub fn base_address(&self) -> &str { + match self.base_address.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_base_address(&mut self) { + self.base_address = ::std::option::Option::None; + } + + pub fn has_base_address(&self) -> bool { + self.base_address.is_some() + } + + // Param is passed by value, moved + pub fn set_base_address(&mut self, v: ::std::string::String) { + self.base_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_base_address(&mut self) -> &mut ::std::string::String { + if self.base_address.is_none() { + self.base_address = ::std::option::Option::Some(::std::string::String::new()); + } + self.base_address.as_mut().unwrap() + } + + // Take field + pub fn take_base_address(&mut self) -> ::std::string::String { + self.base_address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required string token_program = 2; + + pub fn token_program(&self) -> &str { + match self.token_program.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_token_program(&mut self) { + self.token_program = ::std::option::Option::None; + } + + pub fn has_token_program(&self) -> bool { + self.token_program.is_some() + } + + // Param is passed by value, moved + pub fn set_token_program(&mut self, v: ::std::string::String) { + self.token_program = ::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_token_program(&mut self) -> &mut ::std::string::String { + if self.token_program.is_none() { + self.token_program = ::std::option::Option::Some(::std::string::String::new()); + } + self.token_program.as_mut().unwrap() + } + + // Take field + pub fn take_token_program(&mut self) -> ::std::string::String { + self.token_program.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required string token_mint = 3; + + pub fn token_mint(&self) -> &str { + match self.token_mint.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_token_mint(&mut self) { + self.token_mint = ::std::option::Option::None; + } + + pub fn has_token_mint(&self) -> bool { + self.token_mint.is_some() + } + + // Param is passed by value, moved + pub fn set_token_mint(&mut self, v: ::std::string::String) { + self.token_mint = ::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_token_mint(&mut self) -> &mut ::std::string::String { + if self.token_mint.is_none() { + self.token_mint = ::std::option::Option::Some(::std::string::String::new()); + } + self.token_mint.as_mut().unwrap() + } + + // Take field + pub fn take_token_mint(&mut self) -> ::std::string::String { + self.token_mint.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required string token_account = 4; + + pub fn token_account(&self) -> &str { + match self.token_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_token_account(&mut self) { + self.token_account = ::std::option::Option::None; + } + + pub fn has_token_account(&self) -> bool { + self.token_account.is_some() + } + + // Param is passed by value, moved + pub fn set_token_account(&mut self, v: ::std::string::String) { + self.token_account = ::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_token_account(&mut self) -> &mut ::std::string::String { + if self.token_account.is_none() { + self.token_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.token_account.as_mut().unwrap() + } + + // Take field + pub fn take_token_account(&mut self) -> ::std::string::String { + self.token_account.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::<_, _>( + "base_address", + |m: &SolanaTxTokenAccountInfo| { &m.base_address }, + |m: &mut SolanaTxTokenAccountInfo| { &mut m.base_address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "token_program", + |m: &SolanaTxTokenAccountInfo| { &m.token_program }, + |m: &mut SolanaTxTokenAccountInfo| { &mut m.token_program }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "token_mint", + |m: &SolanaTxTokenAccountInfo| { &m.token_mint }, + |m: &mut SolanaTxTokenAccountInfo| { &mut m.token_mint }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "token_account", + |m: &SolanaTxTokenAccountInfo| { &m.token_account }, + |m: &mut SolanaTxTokenAccountInfo| { &mut m.token_account }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SolanaTxTokenAccountInfo", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SolanaTxTokenAccountInfo { + const NAME: &'static str = "SolanaTxTokenAccountInfo"; + + fn is_initialized(&self) -> bool { + if self.base_address.is_none() { + return false; + } + if self.token_program.is_none() { + return false; + } + if self.token_mint.is_none() { + return false; + } + if self.token_account.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.base_address = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.token_program = ::std::option::Option::Some(is.read_string()?); + }, + 26 => { + self.token_mint = ::std::option::Option::Some(is.read_string()?); + }, + 34 => { + self.token_account = ::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.base_address.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.token_program.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.token_mint.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.token_account.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.base_address.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.token_program.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.token_mint.as_ref() { + os.write_string(3, v)?; + } + if let Some(v) = self.token_account.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() -> SolanaTxTokenAccountInfo { + SolanaTxTokenAccountInfo::new() + } + + fn clear(&mut self) { + self.base_address = ::std::option::Option::None; + self.token_program = ::std::option::Option::None; + self.token_mint = ::std::option::Option::None; + self.token_account = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static SolanaTxTokenAccountInfo { + static instance: SolanaTxTokenAccountInfo = SolanaTxTokenAccountInfo { + base_address: ::std::option::Option::None, + token_program: ::std::option::Option::None, + token_mint: ::std::option::Option::None, + token_account: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SolanaTxTokenAccountInfo { + 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("SolanaTxTokenAccountInfo").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SolanaTxTokenAccountInfo { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SolanaTxTokenAccountInfo { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.solana.SolanaTxAdditionalInfo) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SolanaTxAdditionalInfo { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.solana.SolanaTxAdditionalInfo.token_accounts_infos) + pub token_accounts_infos: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.solana.SolanaTxAdditionalInfo.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SolanaTxAdditionalInfo { + fn default() -> &'a SolanaTxAdditionalInfo { + ::default_instance() + } +} + +impl SolanaTxAdditionalInfo { + pub fn new() -> SolanaTxAdditionalInfo { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "token_accounts_infos", + |m: &SolanaTxAdditionalInfo| { &m.token_accounts_infos }, + |m: &mut SolanaTxAdditionalInfo| { &mut m.token_accounts_infos }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SolanaTxAdditionalInfo", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SolanaTxAdditionalInfo { + const NAME: &'static str = "SolanaTxAdditionalInfo"; + + fn is_initialized(&self) -> bool { + for v in &self.token_accounts_infos { + if !v.is_initialized() { + 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.token_accounts_infos.push(is.read_message()?); + }, + 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; + for value in &self.token_accounts_infos { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + 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<()> { + for v in &self.token_accounts_infos { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + }; + 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() -> SolanaTxAdditionalInfo { + SolanaTxAdditionalInfo::new() + } + + fn clear(&mut self) { + self.token_accounts_infos.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static SolanaTxAdditionalInfo { + static instance: SolanaTxAdditionalInfo = SolanaTxAdditionalInfo { + token_accounts_infos: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SolanaTxAdditionalInfo { + 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("SolanaTxAdditionalInfo").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SolanaTxAdditionalInfo { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SolanaTxAdditionalInfo { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.solana.SolanaSignTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SolanaSignTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.solana.SolanaSignTx.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.solana.SolanaSignTx.serialized_tx) + pub serialized_tx: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.solana.SolanaSignTx.additional_info) + pub additional_info: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.solana.SolanaSignTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SolanaSignTx { + fn default() -> &'a SolanaSignTx { + ::default_instance() + } +} + +impl SolanaSignTx { + pub fn new() -> SolanaSignTx { + ::std::default::Default::default() + } + + // required bytes serialized_tx = 2; + + pub fn serialized_tx(&self) -> &[u8] { + match self.serialized_tx.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_serialized_tx(&mut self) { + self.serialized_tx = ::std::option::Option::None; + } + + pub fn has_serialized_tx(&self) -> bool { + self.serialized_tx.is_some() + } + + // Param is passed by value, moved + pub fn set_serialized_tx(&mut self, v: ::std::vec::Vec) { + self.serialized_tx = ::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_serialized_tx(&mut self) -> &mut ::std::vec::Vec { + if self.serialized_tx.is_none() { + self.serialized_tx = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.serialized_tx.as_mut().unwrap() + } + + // Take field + pub fn take_serialized_tx(&mut self) -> ::std::vec::Vec { + self.serialized_tx.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &SolanaSignTx| { &m.address_n }, + |m: &mut SolanaSignTx| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "serialized_tx", + |m: &SolanaSignTx| { &m.serialized_tx }, + |m: &mut SolanaSignTx| { &mut m.serialized_tx }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, SolanaTxAdditionalInfo>( + "additional_info", + |m: &SolanaSignTx| { &m.additional_info }, + |m: &mut SolanaSignTx| { &mut m.additional_info }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SolanaSignTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SolanaSignTx { + const NAME: &'static str = "SolanaSignTx"; + + fn is_initialized(&self) -> bool { + if self.serialized_tx.is_none() { + return false; + } + for v in &self.additional_info { + if !v.is_initialized() { + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.serialized_tx = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.additional_info)?; + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.serialized_tx.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.additional_info.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.serialized_tx.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.additional_info.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + 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() -> SolanaSignTx { + SolanaSignTx::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.serialized_tx = ::std::option::Option::None; + self.additional_info.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static SolanaSignTx { + static instance: SolanaSignTx = SolanaSignTx { + address_n: ::std::vec::Vec::new(), + serialized_tx: ::std::option::Option::None, + additional_info: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SolanaSignTx { + 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("SolanaSignTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SolanaSignTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SolanaSignTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.solana.SolanaTxSignature) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SolanaTxSignature { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.solana.SolanaTxSignature.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.solana.SolanaTxSignature.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SolanaTxSignature { + fn default() -> &'a SolanaTxSignature { + ::default_instance() + } +} + +impl SolanaTxSignature { + pub fn new() -> SolanaTxSignature { + ::std::default::Default::default() + } + + // required bytes signature = 1; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &SolanaTxSignature| { &m.signature }, + |m: &mut SolanaTxSignature| { &mut m.signature }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SolanaTxSignature", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SolanaTxSignature { + const NAME: &'static str = "SolanaTxSignature"; + + fn is_initialized(&self) -> bool { + if self.signature.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.signature = ::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.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.signature.as_ref() { + os.write_bytes(1, 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() -> SolanaTxSignature { + SolanaTxSignature::new() + } + + fn clear(&mut self) { + self.signature = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static SolanaTxSignature { + static instance: SolanaTxSignature = SolanaTxSignature { + signature: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SolanaTxSignature { + 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("SolanaTxSignature").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SolanaTxSignature { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SolanaTxSignature { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x15messages-solana.proto\x12\x19hw.trezor.messages.solana\"T\n\x12Sol\ + anaGetPublicKey\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\ + !\n\x0cshow_display\x18\x02\x20\x01(\x08R\x0bshowDisplay\"0\n\x0fSolanaP\ + ublicKey\x12\x1d\n\npublic_key\x18\x01\x20\x02(\x0cR\tpublicKey\"n\n\x10\ + SolanaGetAddress\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\ + \x12!\n\x0cshow_display\x18\x02\x20\x01(\x08R\x0bshowDisplay\x12\x1a\n\ + \x08chunkify\x18\x03\x20\x01(\x08R\x08chunkify\")\n\rSolanaAddress\x12\ + \x18\n\x07address\x18\x01\x20\x02(\tR\x07address\"\xa6\x01\n\x18SolanaTx\ + TokenAccountInfo\x12!\n\x0cbase_address\x18\x01\x20\x02(\tR\x0bbaseAddre\ + ss\x12#\n\rtoken_program\x18\x02\x20\x02(\tR\x0ctokenProgram\x12\x1d\n\n\ + token_mint\x18\x03\x20\x02(\tR\ttokenMint\x12#\n\rtoken_account\x18\x04\ + \x20\x02(\tR\x0ctokenAccount\"\x7f\n\x16SolanaTxAdditionalInfo\x12e\n\ + \x14token_accounts_infos\x18\x01\x20\x03(\x0b23.hw.trezor.messages.solan\ + a.SolanaTxTokenAccountInfoR\x12tokenAccountsInfos\"\xac\x01\n\x0cSolanaS\ + ignTx\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12#\n\rseria\ + lized_tx\x18\x02\x20\x02(\x0cR\x0cserializedTx\x12Z\n\x0fadditional_info\ + \x18\x03\x20\x01(\x0b21.hw.trezor.messages.solana.SolanaTxAdditionalInfo\ + R\x0eadditionalInfo\"1\n\x11SolanaTxSignature\x12\x1c\n\tsignature\x18\ + \x01\x20\x02(\x0cR\tsignature\ +"; + +/// `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(8); + messages.push(SolanaGetPublicKey::generated_message_descriptor_data()); + messages.push(SolanaPublicKey::generated_message_descriptor_data()); + messages.push(SolanaGetAddress::generated_message_descriptor_data()); + messages.push(SolanaAddress::generated_message_descriptor_data()); + messages.push(SolanaTxTokenAccountInfo::generated_message_descriptor_data()); + messages.push(SolanaTxAdditionalInfo::generated_message_descriptor_data()); + messages.push(SolanaSignTx::generated_message_descriptor_data()); + messages.push(SolanaTxSignature::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_stellar.rs b/wallet/trezor-client/src/protos/generated/messages_stellar.rs new file mode 100644 index 0000000000..e9fa8fa9e9 --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_stellar.rs @@ -0,0 +1,6413 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-stellar.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarAsset) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarAsset { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarAsset.type) + pub type_: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarAsset.code) + pub code: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarAsset.issuer) + pub issuer: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarAsset.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarAsset { + fn default() -> &'a StellarAsset { + ::default_instance() + } +} + +impl StellarAsset { + pub fn new() -> StellarAsset { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.stellar.StellarAssetType type = 1; + + pub fn type_(&self) -> StellarAssetType { + match self.type_ { + Some(e) => e.enum_value_or(StellarAssetType::NATIVE), + None => StellarAssetType::NATIVE, + } + } + + pub fn clear_type_(&mut self) { + self.type_ = ::std::option::Option::None; + } + + pub fn has_type(&self) -> bool { + self.type_.is_some() + } + + // Param is passed by value, moved + pub fn set_type(&mut self, v: StellarAssetType) { + self.type_ = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional string code = 2; + + pub fn code(&self) -> &str { + match self.code.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_code(&mut self) { + self.code = ::std::option::Option::None; + } + + pub fn has_code(&self) -> bool { + self.code.is_some() + } + + // Param is passed by value, moved + pub fn set_code(&mut self, v: ::std::string::String) { + self.code = ::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_code(&mut self) -> &mut ::std::string::String { + if self.code.is_none() { + self.code = ::std::option::Option::Some(::std::string::String::new()); + } + self.code.as_mut().unwrap() + } + + // Take field + pub fn take_code(&mut self) -> ::std::string::String { + self.code.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string issuer = 3; + + pub fn issuer(&self) -> &str { + match self.issuer.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_issuer(&mut self) { + self.issuer = ::std::option::Option::None; + } + + pub fn has_issuer(&self) -> bool { + self.issuer.is_some() + } + + // Param is passed by value, moved + pub fn set_issuer(&mut self, v: ::std::string::String) { + self.issuer = ::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_issuer(&mut self) -> &mut ::std::string::String { + if self.issuer.is_none() { + self.issuer = ::std::option::Option::Some(::std::string::String::new()); + } + self.issuer.as_mut().unwrap() + } + + // Take field + pub fn take_issuer(&mut self) -> ::std::string::String { + self.issuer.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "type", + |m: &StellarAsset| { &m.type_ }, + |m: &mut StellarAsset| { &mut m.type_ }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "code", + |m: &StellarAsset| { &m.code }, + |m: &mut StellarAsset| { &mut m.code }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "issuer", + |m: &StellarAsset| { &m.issuer }, + |m: &mut StellarAsset| { &mut m.issuer }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarAsset", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarAsset { + const NAME: &'static str = "StellarAsset"; + + fn is_initialized(&self) -> bool { + if self.type_.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.type_ = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 18 => { + self.code = ::std::option::Option::Some(is.read_string()?); + }, + 26 => { + self.issuer = ::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.type_ { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + if let Some(v) = self.code.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.issuer.as_ref() { + my_size += ::protobuf::rt::string_size(3, &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.type_ { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.code.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.issuer.as_ref() { + os.write_string(3, 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() -> StellarAsset { + StellarAsset::new() + } + + fn clear(&mut self) { + self.type_ = ::std::option::Option::None; + self.code = ::std::option::Option::None; + self.issuer = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarAsset { + static instance: StellarAsset = StellarAsset { + type_: ::std::option::Option::None, + code: ::std::option::Option::None, + issuer: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarAsset { + 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("StellarAsset").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarAsset { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarAsset { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarGetAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarGetAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarGetAddress.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarGetAddress.show_display) + pub show_display: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarGetAddress.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarGetAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarGetAddress { + fn default() -> &'a StellarGetAddress { + ::default_instance() + } +} + +impl StellarGetAddress { + pub fn new() -> StellarGetAddress { + ::std::default::Default::default() + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 3; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &StellarGetAddress| { &m.address_n }, + |m: &mut StellarGetAddress| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &StellarGetAddress| { &m.show_display }, + |m: &mut StellarGetAddress| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &StellarGetAddress| { &m.chunkify }, + |m: &mut StellarGetAddress| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarGetAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarGetAddress { + const NAME: &'static str = "StellarGetAddress"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 24 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.show_display { + os.write_bool(2, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(3, 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() -> StellarGetAddress { + StellarGetAddress::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.show_display = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarGetAddress { + static instance: StellarGetAddress = StellarGetAddress { + address_n: ::std::vec::Vec::new(), + show_display: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarGetAddress { + 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("StellarGetAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarGetAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarGetAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarAddress.address) + pub address: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarAddress { + fn default() -> &'a StellarAddress { + ::default_instance() + } +} + +impl StellarAddress { + pub fn new() -> StellarAddress { + ::std::default::Default::default() + } + + // required string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &StellarAddress| { &m.address }, + |m: &mut StellarAddress| { &mut m.address }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarAddress { + const NAME: &'static str = "StellarAddress"; + + fn is_initialized(&self) -> bool { + if self.address.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_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::string_size(1, &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_string(1, 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() -> StellarAddress { + StellarAddress::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarAddress { + static instance: StellarAddress = StellarAddress { + address: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarAddress { + 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("StellarAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarSignTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarSignTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSignTx.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSignTx.network_passphrase) + pub network_passphrase: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSignTx.source_account) + pub source_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSignTx.fee) + pub fee: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSignTx.sequence_number) + pub sequence_number: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSignTx.timebounds_start) + pub timebounds_start: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSignTx.timebounds_end) + pub timebounds_end: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSignTx.memo_type) + pub memo_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSignTx.memo_text) + pub memo_text: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSignTx.memo_id) + pub memo_id: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSignTx.memo_hash) + pub memo_hash: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSignTx.num_operations) + pub num_operations: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarSignTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarSignTx { + fn default() -> &'a StellarSignTx { + ::default_instance() + } +} + +impl StellarSignTx { + pub fn new() -> StellarSignTx { + ::std::default::Default::default() + } + + // required string network_passphrase = 3; + + pub fn network_passphrase(&self) -> &str { + match self.network_passphrase.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_network_passphrase(&mut self) { + self.network_passphrase = ::std::option::Option::None; + } + + pub fn has_network_passphrase(&self) -> bool { + self.network_passphrase.is_some() + } + + // Param is passed by value, moved + pub fn set_network_passphrase(&mut self, v: ::std::string::String) { + self.network_passphrase = ::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_network_passphrase(&mut self) -> &mut ::std::string::String { + if self.network_passphrase.is_none() { + self.network_passphrase = ::std::option::Option::Some(::std::string::String::new()); + } + self.network_passphrase.as_mut().unwrap() + } + + // Take field + pub fn take_network_passphrase(&mut self) -> ::std::string::String { + self.network_passphrase.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required string source_account = 4; + + pub fn source_account(&self) -> &str { + match self.source_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_source_account(&mut self) { + self.source_account = ::std::option::Option::None; + } + + pub fn has_source_account(&self) -> bool { + self.source_account.is_some() + } + + // Param is passed by value, moved + pub fn set_source_account(&mut self, v: ::std::string::String) { + self.source_account = ::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_source_account(&mut self) -> &mut ::std::string::String { + if self.source_account.is_none() { + self.source_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.source_account.as_mut().unwrap() + } + + // Take field + pub fn take_source_account(&mut self) -> ::std::string::String { + self.source_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required uint32 fee = 5; + + pub fn fee(&self) -> u32 { + self.fee.unwrap_or(0) + } + + pub fn clear_fee(&mut self) { + self.fee = ::std::option::Option::None; + } + + pub fn has_fee(&self) -> bool { + self.fee.is_some() + } + + // Param is passed by value, moved + pub fn set_fee(&mut self, v: u32) { + self.fee = ::std::option::Option::Some(v); + } + + // required uint64 sequence_number = 6; + + pub fn sequence_number(&self) -> u64 { + self.sequence_number.unwrap_or(0) + } + + pub fn clear_sequence_number(&mut self) { + self.sequence_number = ::std::option::Option::None; + } + + pub fn has_sequence_number(&self) -> bool { + self.sequence_number.is_some() + } + + // Param is passed by value, moved + pub fn set_sequence_number(&mut self, v: u64) { + self.sequence_number = ::std::option::Option::Some(v); + } + + // required uint32 timebounds_start = 8; + + pub fn timebounds_start(&self) -> u32 { + self.timebounds_start.unwrap_or(0) + } + + pub fn clear_timebounds_start(&mut self) { + self.timebounds_start = ::std::option::Option::None; + } + + pub fn has_timebounds_start(&self) -> bool { + self.timebounds_start.is_some() + } + + // Param is passed by value, moved + pub fn set_timebounds_start(&mut self, v: u32) { + self.timebounds_start = ::std::option::Option::Some(v); + } + + // required uint32 timebounds_end = 9; + + pub fn timebounds_end(&self) -> u32 { + self.timebounds_end.unwrap_or(0) + } + + pub fn clear_timebounds_end(&mut self) { + self.timebounds_end = ::std::option::Option::None; + } + + pub fn has_timebounds_end(&self) -> bool { + self.timebounds_end.is_some() + } + + // Param is passed by value, moved + pub fn set_timebounds_end(&mut self, v: u32) { + self.timebounds_end = ::std::option::Option::Some(v); + } + + // required .hw.trezor.messages.stellar.StellarSignTx.StellarMemoType memo_type = 10; + + pub fn memo_type(&self) -> stellar_sign_tx::StellarMemoType { + match self.memo_type { + Some(e) => e.enum_value_or(stellar_sign_tx::StellarMemoType::NONE), + None => stellar_sign_tx::StellarMemoType::NONE, + } + } + + pub fn clear_memo_type(&mut self) { + self.memo_type = ::std::option::Option::None; + } + + pub fn has_memo_type(&self) -> bool { + self.memo_type.is_some() + } + + // Param is passed by value, moved + pub fn set_memo_type(&mut self, v: stellar_sign_tx::StellarMemoType) { + self.memo_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional string memo_text = 11; + + pub fn memo_text(&self) -> &str { + match self.memo_text.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_memo_text(&mut self) { + self.memo_text = ::std::option::Option::None; + } + + pub fn has_memo_text(&self) -> bool { + self.memo_text.is_some() + } + + // Param is passed by value, moved + pub fn set_memo_text(&mut self, v: ::std::string::String) { + self.memo_text = ::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_memo_text(&mut self) -> &mut ::std::string::String { + if self.memo_text.is_none() { + self.memo_text = ::std::option::Option::Some(::std::string::String::new()); + } + self.memo_text.as_mut().unwrap() + } + + // Take field + pub fn take_memo_text(&mut self) -> ::std::string::String { + self.memo_text.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint64 memo_id = 12; + + pub fn memo_id(&self) -> u64 { + self.memo_id.unwrap_or(0) + } + + pub fn clear_memo_id(&mut self) { + self.memo_id = ::std::option::Option::None; + } + + pub fn has_memo_id(&self) -> bool { + self.memo_id.is_some() + } + + // Param is passed by value, moved + pub fn set_memo_id(&mut self, v: u64) { + self.memo_id = ::std::option::Option::Some(v); + } + + // optional bytes memo_hash = 13; + + pub fn memo_hash(&self) -> &[u8] { + match self.memo_hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_memo_hash(&mut self) { + self.memo_hash = ::std::option::Option::None; + } + + pub fn has_memo_hash(&self) -> bool { + self.memo_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_memo_hash(&mut self, v: ::std::vec::Vec) { + self.memo_hash = ::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_memo_hash(&mut self) -> &mut ::std::vec::Vec { + if self.memo_hash.is_none() { + self.memo_hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.memo_hash.as_mut().unwrap() + } + + // Take field + pub fn take_memo_hash(&mut self) -> ::std::vec::Vec { + self.memo_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint32 num_operations = 14; + + pub fn num_operations(&self) -> u32 { + self.num_operations.unwrap_or(0) + } + + pub fn clear_num_operations(&mut self) { + self.num_operations = ::std::option::Option::None; + } + + pub fn has_num_operations(&self) -> bool { + self.num_operations.is_some() + } + + // Param is passed by value, moved + pub fn set_num_operations(&mut self, v: u32) { + self.num_operations = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(12); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &StellarSignTx| { &m.address_n }, + |m: &mut StellarSignTx| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "network_passphrase", + |m: &StellarSignTx| { &m.network_passphrase }, + |m: &mut StellarSignTx| { &mut m.network_passphrase }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "source_account", + |m: &StellarSignTx| { &m.source_account }, + |m: &mut StellarSignTx| { &mut m.source_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fee", + |m: &StellarSignTx| { &m.fee }, + |m: &mut StellarSignTx| { &mut m.fee }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sequence_number", + |m: &StellarSignTx| { &m.sequence_number }, + |m: &mut StellarSignTx| { &mut m.sequence_number }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "timebounds_start", + |m: &StellarSignTx| { &m.timebounds_start }, + |m: &mut StellarSignTx| { &mut m.timebounds_start }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "timebounds_end", + |m: &StellarSignTx| { &m.timebounds_end }, + |m: &mut StellarSignTx| { &mut m.timebounds_end }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "memo_type", + |m: &StellarSignTx| { &m.memo_type }, + |m: &mut StellarSignTx| { &mut m.memo_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "memo_text", + |m: &StellarSignTx| { &m.memo_text }, + |m: &mut StellarSignTx| { &mut m.memo_text }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "memo_id", + |m: &StellarSignTx| { &m.memo_id }, + |m: &mut StellarSignTx| { &mut m.memo_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "memo_hash", + |m: &StellarSignTx| { &m.memo_hash }, + |m: &mut StellarSignTx| { &mut m.memo_hash }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "num_operations", + |m: &StellarSignTx| { &m.num_operations }, + |m: &mut StellarSignTx| { &mut m.num_operations }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarSignTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarSignTx { + const NAME: &'static str = "StellarSignTx"; + + fn is_initialized(&self) -> bool { + if self.network_passphrase.is_none() { + return false; + } + if self.source_account.is_none() { + return false; + } + if self.fee.is_none() { + return false; + } + if self.sequence_number.is_none() { + return false; + } + if self.timebounds_start.is_none() { + return false; + } + if self.timebounds_end.is_none() { + return false; + } + if self.memo_type.is_none() { + return false; + } + if self.num_operations.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 { + 18 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 16 => { + self.address_n.push(is.read_uint32()?); + }, + 26 => { + self.network_passphrase = ::std::option::Option::Some(is.read_string()?); + }, + 34 => { + self.source_account = ::std::option::Option::Some(is.read_string()?); + }, + 40 => { + self.fee = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.sequence_number = ::std::option::Option::Some(is.read_uint64()?); + }, + 64 => { + self.timebounds_start = ::std::option::Option::Some(is.read_uint32()?); + }, + 72 => { + self.timebounds_end = ::std::option::Option::Some(is.read_uint32()?); + }, + 80 => { + self.memo_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 90 => { + self.memo_text = ::std::option::Option::Some(is.read_string()?); + }, + 96 => { + self.memo_id = ::std::option::Option::Some(is.read_uint64()?); + }, + 106 => { + self.memo_hash = ::std::option::Option::Some(is.read_bytes()?); + }, + 112 => { + self.num_operations = ::std::option::Option::Some(is.read_uint32()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(2, *value); + }; + if let Some(v) = self.network_passphrase.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.source_account.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(v) = self.fee { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.sequence_number { + my_size += ::protobuf::rt::uint64_size(6, v); + } + if let Some(v) = self.timebounds_start { + my_size += ::protobuf::rt::uint32_size(8, v); + } + if let Some(v) = self.timebounds_end { + my_size += ::protobuf::rt::uint32_size(9, v); + } + if let Some(v) = self.memo_type { + my_size += ::protobuf::rt::int32_size(10, v.value()); + } + if let Some(v) = self.memo_text.as_ref() { + my_size += ::protobuf::rt::string_size(11, &v); + } + if let Some(v) = self.memo_id { + my_size += ::protobuf::rt::uint64_size(12, v); + } + if let Some(v) = self.memo_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(13, &v); + } + if let Some(v) = self.num_operations { + my_size += ::protobuf::rt::uint32_size(14, 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<()> { + for v in &self.address_n { + os.write_uint32(2, *v)?; + }; + if let Some(v) = self.network_passphrase.as_ref() { + os.write_string(3, v)?; + } + if let Some(v) = self.source_account.as_ref() { + os.write_string(4, v)?; + } + if let Some(v) = self.fee { + os.write_uint32(5, v)?; + } + if let Some(v) = self.sequence_number { + os.write_uint64(6, v)?; + } + if let Some(v) = self.timebounds_start { + os.write_uint32(8, v)?; + } + if let Some(v) = self.timebounds_end { + os.write_uint32(9, v)?; + } + if let Some(v) = self.memo_type { + os.write_enum(10, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.memo_text.as_ref() { + os.write_string(11, v)?; + } + if let Some(v) = self.memo_id { + os.write_uint64(12, v)?; + } + if let Some(v) = self.memo_hash.as_ref() { + os.write_bytes(13, v)?; + } + if let Some(v) = self.num_operations { + os.write_uint32(14, 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() -> StellarSignTx { + StellarSignTx::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.network_passphrase = ::std::option::Option::None; + self.source_account = ::std::option::Option::None; + self.fee = ::std::option::Option::None; + self.sequence_number = ::std::option::Option::None; + self.timebounds_start = ::std::option::Option::None; + self.timebounds_end = ::std::option::Option::None; + self.memo_type = ::std::option::Option::None; + self.memo_text = ::std::option::Option::None; + self.memo_id = ::std::option::Option::None; + self.memo_hash = ::std::option::Option::None; + self.num_operations = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarSignTx { + static instance: StellarSignTx = StellarSignTx { + address_n: ::std::vec::Vec::new(), + network_passphrase: ::std::option::Option::None, + source_account: ::std::option::Option::None, + fee: ::std::option::Option::None, + sequence_number: ::std::option::Option::None, + timebounds_start: ::std::option::Option::None, + timebounds_end: ::std::option::Option::None, + memo_type: ::std::option::Option::None, + memo_text: ::std::option::Option::None, + memo_id: ::std::option::Option::None, + memo_hash: ::std::option::Option::None, + num_operations: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarSignTx { + 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("StellarSignTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarSignTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarSignTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `StellarSignTx` +pub mod stellar_sign_tx { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.stellar.StellarSignTx.StellarMemoType) + pub enum StellarMemoType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarSignTx.StellarMemoType.NONE) + NONE = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarSignTx.StellarMemoType.TEXT) + TEXT = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarSignTx.StellarMemoType.ID) + ID = 2, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarSignTx.StellarMemoType.HASH) + HASH = 3, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarSignTx.StellarMemoType.RETURN) + RETURN = 4, + } + + impl ::protobuf::Enum for StellarMemoType { + const NAME: &'static str = "StellarMemoType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(StellarMemoType::NONE), + 1 => ::std::option::Option::Some(StellarMemoType::TEXT), + 2 => ::std::option::Option::Some(StellarMemoType::ID), + 3 => ::std::option::Option::Some(StellarMemoType::HASH), + 4 => ::std::option::Option::Some(StellarMemoType::RETURN), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "NONE" => ::std::option::Option::Some(StellarMemoType::NONE), + "TEXT" => ::std::option::Option::Some(StellarMemoType::TEXT), + "ID" => ::std::option::Option::Some(StellarMemoType::ID), + "HASH" => ::std::option::Option::Some(StellarMemoType::HASH), + "RETURN" => ::std::option::Option::Some(StellarMemoType::RETURN), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [StellarMemoType] = &[ + StellarMemoType::NONE, + StellarMemoType::TEXT, + StellarMemoType::ID, + StellarMemoType::HASH, + StellarMemoType::RETURN, + ]; + } + + impl ::protobuf::EnumFull for StellarMemoType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("StellarSignTx.StellarMemoType").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 StellarMemoType { + fn default() -> Self { + StellarMemoType::NONE + } + } + + impl StellarMemoType { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("StellarSignTx.StellarMemoType") + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarTxOpRequest) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarTxOpRequest { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarTxOpRequest.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarTxOpRequest { + fn default() -> &'a StellarTxOpRequest { + ::default_instance() + } +} + +impl StellarTxOpRequest { + pub fn new() -> StellarTxOpRequest { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarTxOpRequest", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarTxOpRequest { + const NAME: &'static str = "StellarTxOpRequest"; + + 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 { + 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; + 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<()> { + 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() -> StellarTxOpRequest { + StellarTxOpRequest::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarTxOpRequest { + static instance: StellarTxOpRequest = StellarTxOpRequest { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarTxOpRequest { + 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("StellarTxOpRequest").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarTxOpRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarTxOpRequest { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarPaymentOp) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarPaymentOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPaymentOp.source_account) + pub source_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPaymentOp.destination_account) + pub destination_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPaymentOp.asset) + pub asset: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPaymentOp.amount) + pub amount: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarPaymentOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarPaymentOp { + fn default() -> &'a StellarPaymentOp { + ::default_instance() + } +} + +impl StellarPaymentOp { + pub fn new() -> StellarPaymentOp { + ::std::default::Default::default() + } + + // optional string source_account = 1; + + pub fn source_account(&self) -> &str { + match self.source_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_source_account(&mut self) { + self.source_account = ::std::option::Option::None; + } + + pub fn has_source_account(&self) -> bool { + self.source_account.is_some() + } + + // Param is passed by value, moved + pub fn set_source_account(&mut self, v: ::std::string::String) { + self.source_account = ::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_source_account(&mut self) -> &mut ::std::string::String { + if self.source_account.is_none() { + self.source_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.source_account.as_mut().unwrap() + } + + // Take field + pub fn take_source_account(&mut self) -> ::std::string::String { + self.source_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required string destination_account = 2; + + pub fn destination_account(&self) -> &str { + match self.destination_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_destination_account(&mut self) { + self.destination_account = ::std::option::Option::None; + } + + pub fn has_destination_account(&self) -> bool { + self.destination_account.is_some() + } + + // Param is passed by value, moved + pub fn set_destination_account(&mut self, v: ::std::string::String) { + self.destination_account = ::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_destination_account(&mut self) -> &mut ::std::string::String { + if self.destination_account.is_none() { + self.destination_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.destination_account.as_mut().unwrap() + } + + // Take field + pub fn take_destination_account(&mut self) -> ::std::string::String { + self.destination_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required sint64 amount = 4; + + pub fn amount(&self) -> i64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: i64) { + self.amount = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "source_account", + |m: &StellarPaymentOp| { &m.source_account }, + |m: &mut StellarPaymentOp| { &mut m.source_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "destination_account", + |m: &StellarPaymentOp| { &m.destination_account }, + |m: &mut StellarPaymentOp| { &mut m.destination_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StellarAsset>( + "asset", + |m: &StellarPaymentOp| { &m.asset }, + |m: &mut StellarPaymentOp| { &mut m.asset }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &StellarPaymentOp| { &m.amount }, + |m: &mut StellarPaymentOp| { &mut m.amount }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarPaymentOp", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarPaymentOp { + const NAME: &'static str = "StellarPaymentOp"; + + fn is_initialized(&self) -> bool { + if self.destination_account.is_none() { + return false; + } + if self.asset.is_none() { + return false; + } + if self.amount.is_none() { + return false; + } + for v in &self.asset { + if !v.is_initialized() { + 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.source_account = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.destination_account = ::std::option::Option::Some(is.read_string()?); + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.asset)?; + }, + 32 => { + self.amount = ::std::option::Option::Some(is.read_sint64()?); + }, + 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.source_account.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.destination_account.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.asset.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.amount { + my_size += ::protobuf::rt::sint64_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.source_account.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.destination_account.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.asset.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.amount { + os.write_sint64(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() -> StellarPaymentOp { + StellarPaymentOp::new() + } + + fn clear(&mut self) { + self.source_account = ::std::option::Option::None; + self.destination_account = ::std::option::Option::None; + self.asset.clear(); + self.amount = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarPaymentOp { + static instance: StellarPaymentOp = StellarPaymentOp { + source_account: ::std::option::Option::None, + destination_account: ::std::option::Option::None, + asset: ::protobuf::MessageField::none(), + amount: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarPaymentOp { + 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("StellarPaymentOp").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarPaymentOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarPaymentOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarCreateAccountOp) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarCreateAccountOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarCreateAccountOp.source_account) + pub source_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarCreateAccountOp.new_account) + pub new_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarCreateAccountOp.starting_balance) + pub starting_balance: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarCreateAccountOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarCreateAccountOp { + fn default() -> &'a StellarCreateAccountOp { + ::default_instance() + } +} + +impl StellarCreateAccountOp { + pub fn new() -> StellarCreateAccountOp { + ::std::default::Default::default() + } + + // optional string source_account = 1; + + pub fn source_account(&self) -> &str { + match self.source_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_source_account(&mut self) { + self.source_account = ::std::option::Option::None; + } + + pub fn has_source_account(&self) -> bool { + self.source_account.is_some() + } + + // Param is passed by value, moved + pub fn set_source_account(&mut self, v: ::std::string::String) { + self.source_account = ::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_source_account(&mut self) -> &mut ::std::string::String { + if self.source_account.is_none() { + self.source_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.source_account.as_mut().unwrap() + } + + // Take field + pub fn take_source_account(&mut self) -> ::std::string::String { + self.source_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required string new_account = 2; + + pub fn new_account(&self) -> &str { + match self.new_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_new_account(&mut self) { + self.new_account = ::std::option::Option::None; + } + + pub fn has_new_account(&self) -> bool { + self.new_account.is_some() + } + + // Param is passed by value, moved + pub fn set_new_account(&mut self, v: ::std::string::String) { + self.new_account = ::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_new_account(&mut self) -> &mut ::std::string::String { + if self.new_account.is_none() { + self.new_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.new_account.as_mut().unwrap() + } + + // Take field + pub fn take_new_account(&mut self) -> ::std::string::String { + self.new_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required sint64 starting_balance = 3; + + pub fn starting_balance(&self) -> i64 { + self.starting_balance.unwrap_or(0) + } + + pub fn clear_starting_balance(&mut self) { + self.starting_balance = ::std::option::Option::None; + } + + pub fn has_starting_balance(&self) -> bool { + self.starting_balance.is_some() + } + + // Param is passed by value, moved + pub fn set_starting_balance(&mut self, v: i64) { + self.starting_balance = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "source_account", + |m: &StellarCreateAccountOp| { &m.source_account }, + |m: &mut StellarCreateAccountOp| { &mut m.source_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "new_account", + |m: &StellarCreateAccountOp| { &m.new_account }, + |m: &mut StellarCreateAccountOp| { &mut m.new_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "starting_balance", + |m: &StellarCreateAccountOp| { &m.starting_balance }, + |m: &mut StellarCreateAccountOp| { &mut m.starting_balance }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarCreateAccountOp", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarCreateAccountOp { + const NAME: &'static str = "StellarCreateAccountOp"; + + fn is_initialized(&self) -> bool { + if self.new_account.is_none() { + return false; + } + if self.starting_balance.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.source_account = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.new_account = ::std::option::Option::Some(is.read_string()?); + }, + 24 => { + self.starting_balance = ::std::option::Option::Some(is.read_sint64()?); + }, + 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.source_account.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.new_account.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.starting_balance { + my_size += ::protobuf::rt::sint64_size(3, 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.source_account.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.new_account.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.starting_balance { + os.write_sint64(3, 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() -> StellarCreateAccountOp { + StellarCreateAccountOp::new() + } + + fn clear(&mut self) { + self.source_account = ::std::option::Option::None; + self.new_account = ::std::option::Option::None; + self.starting_balance = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarCreateAccountOp { + static instance: StellarCreateAccountOp = StellarCreateAccountOp { + source_account: ::std::option::Option::None, + new_account: ::std::option::Option::None, + starting_balance: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarCreateAccountOp { + 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("StellarCreateAccountOp").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarCreateAccountOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarCreateAccountOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarPathPaymentStrictReceiveOp) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarPathPaymentStrictReceiveOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPathPaymentStrictReceiveOp.source_account) + pub source_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPathPaymentStrictReceiveOp.send_asset) + pub send_asset: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPathPaymentStrictReceiveOp.send_max) + pub send_max: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPathPaymentStrictReceiveOp.destination_account) + pub destination_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPathPaymentStrictReceiveOp.destination_asset) + pub destination_asset: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPathPaymentStrictReceiveOp.destination_amount) + pub destination_amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPathPaymentStrictReceiveOp.paths) + pub paths: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarPathPaymentStrictReceiveOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarPathPaymentStrictReceiveOp { + fn default() -> &'a StellarPathPaymentStrictReceiveOp { + ::default_instance() + } +} + +impl StellarPathPaymentStrictReceiveOp { + pub fn new() -> StellarPathPaymentStrictReceiveOp { + ::std::default::Default::default() + } + + // optional string source_account = 1; + + pub fn source_account(&self) -> &str { + match self.source_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_source_account(&mut self) { + self.source_account = ::std::option::Option::None; + } + + pub fn has_source_account(&self) -> bool { + self.source_account.is_some() + } + + // Param is passed by value, moved + pub fn set_source_account(&mut self, v: ::std::string::String) { + self.source_account = ::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_source_account(&mut self) -> &mut ::std::string::String { + if self.source_account.is_none() { + self.source_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.source_account.as_mut().unwrap() + } + + // Take field + pub fn take_source_account(&mut self) -> ::std::string::String { + self.source_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required sint64 send_max = 3; + + pub fn send_max(&self) -> i64 { + self.send_max.unwrap_or(0) + } + + pub fn clear_send_max(&mut self) { + self.send_max = ::std::option::Option::None; + } + + pub fn has_send_max(&self) -> bool { + self.send_max.is_some() + } + + // Param is passed by value, moved + pub fn set_send_max(&mut self, v: i64) { + self.send_max = ::std::option::Option::Some(v); + } + + // required string destination_account = 4; + + pub fn destination_account(&self) -> &str { + match self.destination_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_destination_account(&mut self) { + self.destination_account = ::std::option::Option::None; + } + + pub fn has_destination_account(&self) -> bool { + self.destination_account.is_some() + } + + // Param is passed by value, moved + pub fn set_destination_account(&mut self, v: ::std::string::String) { + self.destination_account = ::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_destination_account(&mut self) -> &mut ::std::string::String { + if self.destination_account.is_none() { + self.destination_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.destination_account.as_mut().unwrap() + } + + // Take field + pub fn take_destination_account(&mut self) -> ::std::string::String { + self.destination_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required sint64 destination_amount = 6; + + pub fn destination_amount(&self) -> i64 { + self.destination_amount.unwrap_or(0) + } + + pub fn clear_destination_amount(&mut self) { + self.destination_amount = ::std::option::Option::None; + } + + pub fn has_destination_amount(&self) -> bool { + self.destination_amount.is_some() + } + + // Param is passed by value, moved + pub fn set_destination_amount(&mut self, v: i64) { + self.destination_amount = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(7); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "source_account", + |m: &StellarPathPaymentStrictReceiveOp| { &m.source_account }, + |m: &mut StellarPathPaymentStrictReceiveOp| { &mut m.source_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StellarAsset>( + "send_asset", + |m: &StellarPathPaymentStrictReceiveOp| { &m.send_asset }, + |m: &mut StellarPathPaymentStrictReceiveOp| { &mut m.send_asset }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "send_max", + |m: &StellarPathPaymentStrictReceiveOp| { &m.send_max }, + |m: &mut StellarPathPaymentStrictReceiveOp| { &mut m.send_max }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "destination_account", + |m: &StellarPathPaymentStrictReceiveOp| { &m.destination_account }, + |m: &mut StellarPathPaymentStrictReceiveOp| { &mut m.destination_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StellarAsset>( + "destination_asset", + |m: &StellarPathPaymentStrictReceiveOp| { &m.destination_asset }, + |m: &mut StellarPathPaymentStrictReceiveOp| { &mut m.destination_asset }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "destination_amount", + |m: &StellarPathPaymentStrictReceiveOp| { &m.destination_amount }, + |m: &mut StellarPathPaymentStrictReceiveOp| { &mut m.destination_amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "paths", + |m: &StellarPathPaymentStrictReceiveOp| { &m.paths }, + |m: &mut StellarPathPaymentStrictReceiveOp| { &mut m.paths }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarPathPaymentStrictReceiveOp", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarPathPaymentStrictReceiveOp { + const NAME: &'static str = "StellarPathPaymentStrictReceiveOp"; + + fn is_initialized(&self) -> bool { + if self.send_asset.is_none() { + return false; + } + if self.send_max.is_none() { + return false; + } + if self.destination_account.is_none() { + return false; + } + if self.destination_asset.is_none() { + return false; + } + if self.destination_amount.is_none() { + return false; + } + for v in &self.send_asset { + if !v.is_initialized() { + return false; + } + }; + for v in &self.destination_asset { + if !v.is_initialized() { + return false; + } + }; + for v in &self.paths { + if !v.is_initialized() { + 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.source_account = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.send_asset)?; + }, + 24 => { + self.send_max = ::std::option::Option::Some(is.read_sint64()?); + }, + 34 => { + self.destination_account = ::std::option::Option::Some(is.read_string()?); + }, + 42 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.destination_asset)?; + }, + 48 => { + self.destination_amount = ::std::option::Option::Some(is.read_sint64()?); + }, + 58 => { + self.paths.push(is.read_message()?); + }, + 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.source_account.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.send_asset.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.send_max { + my_size += ::protobuf::rt::sint64_size(3, v); + } + if let Some(v) = self.destination_account.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(v) = self.destination_asset.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.destination_amount { + my_size += ::protobuf::rt::sint64_size(6, v); + } + for value in &self.paths { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + 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.source_account.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.send_asset.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + if let Some(v) = self.send_max { + os.write_sint64(3, v)?; + } + if let Some(v) = self.destination_account.as_ref() { + os.write_string(4, v)?; + } + if let Some(v) = self.destination_asset.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + } + if let Some(v) = self.destination_amount { + os.write_sint64(6, v)?; + } + for v in &self.paths { + ::protobuf::rt::write_message_field_with_cached_size(7, v, os)?; + }; + 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() -> StellarPathPaymentStrictReceiveOp { + StellarPathPaymentStrictReceiveOp::new() + } + + fn clear(&mut self) { + self.source_account = ::std::option::Option::None; + self.send_asset.clear(); + self.send_max = ::std::option::Option::None; + self.destination_account = ::std::option::Option::None; + self.destination_asset.clear(); + self.destination_amount = ::std::option::Option::None; + self.paths.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarPathPaymentStrictReceiveOp { + static instance: StellarPathPaymentStrictReceiveOp = StellarPathPaymentStrictReceiveOp { + source_account: ::std::option::Option::None, + send_asset: ::protobuf::MessageField::none(), + send_max: ::std::option::Option::None, + destination_account: ::std::option::Option::None, + destination_asset: ::protobuf::MessageField::none(), + destination_amount: ::std::option::Option::None, + paths: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarPathPaymentStrictReceiveOp { + 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("StellarPathPaymentStrictReceiveOp").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarPathPaymentStrictReceiveOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarPathPaymentStrictReceiveOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarPathPaymentStrictSendOp) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarPathPaymentStrictSendOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPathPaymentStrictSendOp.source_account) + pub source_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPathPaymentStrictSendOp.send_asset) + pub send_asset: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPathPaymentStrictSendOp.send_amount) + pub send_amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPathPaymentStrictSendOp.destination_account) + pub destination_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPathPaymentStrictSendOp.destination_asset) + pub destination_asset: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPathPaymentStrictSendOp.destination_min) + pub destination_min: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarPathPaymentStrictSendOp.paths) + pub paths: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarPathPaymentStrictSendOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarPathPaymentStrictSendOp { + fn default() -> &'a StellarPathPaymentStrictSendOp { + ::default_instance() + } +} + +impl StellarPathPaymentStrictSendOp { + pub fn new() -> StellarPathPaymentStrictSendOp { + ::std::default::Default::default() + } + + // optional string source_account = 1; + + pub fn source_account(&self) -> &str { + match self.source_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_source_account(&mut self) { + self.source_account = ::std::option::Option::None; + } + + pub fn has_source_account(&self) -> bool { + self.source_account.is_some() + } + + // Param is passed by value, moved + pub fn set_source_account(&mut self, v: ::std::string::String) { + self.source_account = ::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_source_account(&mut self) -> &mut ::std::string::String { + if self.source_account.is_none() { + self.source_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.source_account.as_mut().unwrap() + } + + // Take field + pub fn take_source_account(&mut self) -> ::std::string::String { + self.source_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required sint64 send_amount = 3; + + pub fn send_amount(&self) -> i64 { + self.send_amount.unwrap_or(0) + } + + pub fn clear_send_amount(&mut self) { + self.send_amount = ::std::option::Option::None; + } + + pub fn has_send_amount(&self) -> bool { + self.send_amount.is_some() + } + + // Param is passed by value, moved + pub fn set_send_amount(&mut self, v: i64) { + self.send_amount = ::std::option::Option::Some(v); + } + + // required string destination_account = 4; + + pub fn destination_account(&self) -> &str { + match self.destination_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_destination_account(&mut self) { + self.destination_account = ::std::option::Option::None; + } + + pub fn has_destination_account(&self) -> bool { + self.destination_account.is_some() + } + + // Param is passed by value, moved + pub fn set_destination_account(&mut self, v: ::std::string::String) { + self.destination_account = ::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_destination_account(&mut self) -> &mut ::std::string::String { + if self.destination_account.is_none() { + self.destination_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.destination_account.as_mut().unwrap() + } + + // Take field + pub fn take_destination_account(&mut self) -> ::std::string::String { + self.destination_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required sint64 destination_min = 6; + + pub fn destination_min(&self) -> i64 { + self.destination_min.unwrap_or(0) + } + + pub fn clear_destination_min(&mut self) { + self.destination_min = ::std::option::Option::None; + } + + pub fn has_destination_min(&self) -> bool { + self.destination_min.is_some() + } + + // Param is passed by value, moved + pub fn set_destination_min(&mut self, v: i64) { + self.destination_min = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(7); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "source_account", + |m: &StellarPathPaymentStrictSendOp| { &m.source_account }, + |m: &mut StellarPathPaymentStrictSendOp| { &mut m.source_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StellarAsset>( + "send_asset", + |m: &StellarPathPaymentStrictSendOp| { &m.send_asset }, + |m: &mut StellarPathPaymentStrictSendOp| { &mut m.send_asset }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "send_amount", + |m: &StellarPathPaymentStrictSendOp| { &m.send_amount }, + |m: &mut StellarPathPaymentStrictSendOp| { &mut m.send_amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "destination_account", + |m: &StellarPathPaymentStrictSendOp| { &m.destination_account }, + |m: &mut StellarPathPaymentStrictSendOp| { &mut m.destination_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StellarAsset>( + "destination_asset", + |m: &StellarPathPaymentStrictSendOp| { &m.destination_asset }, + |m: &mut StellarPathPaymentStrictSendOp| { &mut m.destination_asset }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "destination_min", + |m: &StellarPathPaymentStrictSendOp| { &m.destination_min }, + |m: &mut StellarPathPaymentStrictSendOp| { &mut m.destination_min }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "paths", + |m: &StellarPathPaymentStrictSendOp| { &m.paths }, + |m: &mut StellarPathPaymentStrictSendOp| { &mut m.paths }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarPathPaymentStrictSendOp", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarPathPaymentStrictSendOp { + const NAME: &'static str = "StellarPathPaymentStrictSendOp"; + + fn is_initialized(&self) -> bool { + if self.send_asset.is_none() { + return false; + } + if self.send_amount.is_none() { + return false; + } + if self.destination_account.is_none() { + return false; + } + if self.destination_asset.is_none() { + return false; + } + if self.destination_min.is_none() { + return false; + } + for v in &self.send_asset { + if !v.is_initialized() { + return false; + } + }; + for v in &self.destination_asset { + if !v.is_initialized() { + return false; + } + }; + for v in &self.paths { + if !v.is_initialized() { + 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.source_account = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.send_asset)?; + }, + 24 => { + self.send_amount = ::std::option::Option::Some(is.read_sint64()?); + }, + 34 => { + self.destination_account = ::std::option::Option::Some(is.read_string()?); + }, + 42 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.destination_asset)?; + }, + 48 => { + self.destination_min = ::std::option::Option::Some(is.read_sint64()?); + }, + 58 => { + self.paths.push(is.read_message()?); + }, + 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.source_account.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.send_asset.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.send_amount { + my_size += ::protobuf::rt::sint64_size(3, v); + } + if let Some(v) = self.destination_account.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(v) = self.destination_asset.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.destination_min { + my_size += ::protobuf::rt::sint64_size(6, v); + } + for value in &self.paths { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + 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.source_account.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.send_asset.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + if let Some(v) = self.send_amount { + os.write_sint64(3, v)?; + } + if let Some(v) = self.destination_account.as_ref() { + os.write_string(4, v)?; + } + if let Some(v) = self.destination_asset.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + } + if let Some(v) = self.destination_min { + os.write_sint64(6, v)?; + } + for v in &self.paths { + ::protobuf::rt::write_message_field_with_cached_size(7, v, os)?; + }; + 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() -> StellarPathPaymentStrictSendOp { + StellarPathPaymentStrictSendOp::new() + } + + fn clear(&mut self) { + self.source_account = ::std::option::Option::None; + self.send_asset.clear(); + self.send_amount = ::std::option::Option::None; + self.destination_account = ::std::option::Option::None; + self.destination_asset.clear(); + self.destination_min = ::std::option::Option::None; + self.paths.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarPathPaymentStrictSendOp { + static instance: StellarPathPaymentStrictSendOp = StellarPathPaymentStrictSendOp { + source_account: ::std::option::Option::None, + send_asset: ::protobuf::MessageField::none(), + send_amount: ::std::option::Option::None, + destination_account: ::std::option::Option::None, + destination_asset: ::protobuf::MessageField::none(), + destination_min: ::std::option::Option::None, + paths: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarPathPaymentStrictSendOp { + 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("StellarPathPaymentStrictSendOp").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarPathPaymentStrictSendOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarPathPaymentStrictSendOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarManageSellOfferOp) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarManageSellOfferOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageSellOfferOp.source_account) + pub source_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageSellOfferOp.selling_asset) + pub selling_asset: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageSellOfferOp.buying_asset) + pub buying_asset: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageSellOfferOp.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageSellOfferOp.price_n) + pub price_n: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageSellOfferOp.price_d) + pub price_d: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageSellOfferOp.offer_id) + pub offer_id: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarManageSellOfferOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarManageSellOfferOp { + fn default() -> &'a StellarManageSellOfferOp { + ::default_instance() + } +} + +impl StellarManageSellOfferOp { + pub fn new() -> StellarManageSellOfferOp { + ::std::default::Default::default() + } + + // optional string source_account = 1; + + pub fn source_account(&self) -> &str { + match self.source_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_source_account(&mut self) { + self.source_account = ::std::option::Option::None; + } + + pub fn has_source_account(&self) -> bool { + self.source_account.is_some() + } + + // Param is passed by value, moved + pub fn set_source_account(&mut self, v: ::std::string::String) { + self.source_account = ::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_source_account(&mut self) -> &mut ::std::string::String { + if self.source_account.is_none() { + self.source_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.source_account.as_mut().unwrap() + } + + // Take field + pub fn take_source_account(&mut self) -> ::std::string::String { + self.source_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required sint64 amount = 4; + + pub fn amount(&self) -> i64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: i64) { + self.amount = ::std::option::Option::Some(v); + } + + // required uint32 price_n = 5; + + pub fn price_n(&self) -> u32 { + self.price_n.unwrap_or(0) + } + + pub fn clear_price_n(&mut self) { + self.price_n = ::std::option::Option::None; + } + + pub fn has_price_n(&self) -> bool { + self.price_n.is_some() + } + + // Param is passed by value, moved + pub fn set_price_n(&mut self, v: u32) { + self.price_n = ::std::option::Option::Some(v); + } + + // required uint32 price_d = 6; + + pub fn price_d(&self) -> u32 { + self.price_d.unwrap_or(0) + } + + pub fn clear_price_d(&mut self) { + self.price_d = ::std::option::Option::None; + } + + pub fn has_price_d(&self) -> bool { + self.price_d.is_some() + } + + // Param is passed by value, moved + pub fn set_price_d(&mut self, v: u32) { + self.price_d = ::std::option::Option::Some(v); + } + + // required uint64 offer_id = 7; + + pub fn offer_id(&self) -> u64 { + self.offer_id.unwrap_or(0) + } + + pub fn clear_offer_id(&mut self) { + self.offer_id = ::std::option::Option::None; + } + + pub fn has_offer_id(&self) -> bool { + self.offer_id.is_some() + } + + // Param is passed by value, moved + pub fn set_offer_id(&mut self, v: u64) { + self.offer_id = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(7); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "source_account", + |m: &StellarManageSellOfferOp| { &m.source_account }, + |m: &mut StellarManageSellOfferOp| { &mut m.source_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StellarAsset>( + "selling_asset", + |m: &StellarManageSellOfferOp| { &m.selling_asset }, + |m: &mut StellarManageSellOfferOp| { &mut m.selling_asset }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StellarAsset>( + "buying_asset", + |m: &StellarManageSellOfferOp| { &m.buying_asset }, + |m: &mut StellarManageSellOfferOp| { &mut m.buying_asset }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &StellarManageSellOfferOp| { &m.amount }, + |m: &mut StellarManageSellOfferOp| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "price_n", + |m: &StellarManageSellOfferOp| { &m.price_n }, + |m: &mut StellarManageSellOfferOp| { &mut m.price_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "price_d", + |m: &StellarManageSellOfferOp| { &m.price_d }, + |m: &mut StellarManageSellOfferOp| { &mut m.price_d }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "offer_id", + |m: &StellarManageSellOfferOp| { &m.offer_id }, + |m: &mut StellarManageSellOfferOp| { &mut m.offer_id }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarManageSellOfferOp", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarManageSellOfferOp { + const NAME: &'static str = "StellarManageSellOfferOp"; + + fn is_initialized(&self) -> bool { + if self.selling_asset.is_none() { + return false; + } + if self.buying_asset.is_none() { + return false; + } + if self.amount.is_none() { + return false; + } + if self.price_n.is_none() { + return false; + } + if self.price_d.is_none() { + return false; + } + if self.offer_id.is_none() { + return false; + } + for v in &self.selling_asset { + if !v.is_initialized() { + return false; + } + }; + for v in &self.buying_asset { + if !v.is_initialized() { + 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.source_account = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.selling_asset)?; + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.buying_asset)?; + }, + 32 => { + self.amount = ::std::option::Option::Some(is.read_sint64()?); + }, + 40 => { + self.price_n = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.price_d = ::std::option::Option::Some(is.read_uint32()?); + }, + 56 => { + self.offer_id = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.source_account.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.selling_asset.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.buying_asset.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.amount { + my_size += ::protobuf::rt::sint64_size(4, v); + } + if let Some(v) = self.price_n { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.price_d { + my_size += ::protobuf::rt::uint32_size(6, v); + } + if let Some(v) = self.offer_id { + my_size += ::protobuf::rt::uint64_size(7, 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.source_account.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.selling_asset.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + if let Some(v) = self.buying_asset.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.amount { + os.write_sint64(4, v)?; + } + if let Some(v) = self.price_n { + os.write_uint32(5, v)?; + } + if let Some(v) = self.price_d { + os.write_uint32(6, v)?; + } + if let Some(v) = self.offer_id { + os.write_uint64(7, 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() -> StellarManageSellOfferOp { + StellarManageSellOfferOp::new() + } + + fn clear(&mut self) { + self.source_account = ::std::option::Option::None; + self.selling_asset.clear(); + self.buying_asset.clear(); + self.amount = ::std::option::Option::None; + self.price_n = ::std::option::Option::None; + self.price_d = ::std::option::Option::None; + self.offer_id = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarManageSellOfferOp { + static instance: StellarManageSellOfferOp = StellarManageSellOfferOp { + source_account: ::std::option::Option::None, + selling_asset: ::protobuf::MessageField::none(), + buying_asset: ::protobuf::MessageField::none(), + amount: ::std::option::Option::None, + price_n: ::std::option::Option::None, + price_d: ::std::option::Option::None, + offer_id: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarManageSellOfferOp { + 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("StellarManageSellOfferOp").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarManageSellOfferOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarManageSellOfferOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarManageBuyOfferOp) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarManageBuyOfferOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageBuyOfferOp.source_account) + pub source_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageBuyOfferOp.selling_asset) + pub selling_asset: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageBuyOfferOp.buying_asset) + pub buying_asset: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageBuyOfferOp.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageBuyOfferOp.price_n) + pub price_n: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageBuyOfferOp.price_d) + pub price_d: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageBuyOfferOp.offer_id) + pub offer_id: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarManageBuyOfferOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarManageBuyOfferOp { + fn default() -> &'a StellarManageBuyOfferOp { + ::default_instance() + } +} + +impl StellarManageBuyOfferOp { + pub fn new() -> StellarManageBuyOfferOp { + ::std::default::Default::default() + } + + // optional string source_account = 1; + + pub fn source_account(&self) -> &str { + match self.source_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_source_account(&mut self) { + self.source_account = ::std::option::Option::None; + } + + pub fn has_source_account(&self) -> bool { + self.source_account.is_some() + } + + // Param is passed by value, moved + pub fn set_source_account(&mut self, v: ::std::string::String) { + self.source_account = ::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_source_account(&mut self) -> &mut ::std::string::String { + if self.source_account.is_none() { + self.source_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.source_account.as_mut().unwrap() + } + + // Take field + pub fn take_source_account(&mut self) -> ::std::string::String { + self.source_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required sint64 amount = 4; + + pub fn amount(&self) -> i64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: i64) { + self.amount = ::std::option::Option::Some(v); + } + + // required uint32 price_n = 5; + + pub fn price_n(&self) -> u32 { + self.price_n.unwrap_or(0) + } + + pub fn clear_price_n(&mut self) { + self.price_n = ::std::option::Option::None; + } + + pub fn has_price_n(&self) -> bool { + self.price_n.is_some() + } + + // Param is passed by value, moved + pub fn set_price_n(&mut self, v: u32) { + self.price_n = ::std::option::Option::Some(v); + } + + // required uint32 price_d = 6; + + pub fn price_d(&self) -> u32 { + self.price_d.unwrap_or(0) + } + + pub fn clear_price_d(&mut self) { + self.price_d = ::std::option::Option::None; + } + + pub fn has_price_d(&self) -> bool { + self.price_d.is_some() + } + + // Param is passed by value, moved + pub fn set_price_d(&mut self, v: u32) { + self.price_d = ::std::option::Option::Some(v); + } + + // required uint64 offer_id = 7; + + pub fn offer_id(&self) -> u64 { + self.offer_id.unwrap_or(0) + } + + pub fn clear_offer_id(&mut self) { + self.offer_id = ::std::option::Option::None; + } + + pub fn has_offer_id(&self) -> bool { + self.offer_id.is_some() + } + + // Param is passed by value, moved + pub fn set_offer_id(&mut self, v: u64) { + self.offer_id = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(7); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "source_account", + |m: &StellarManageBuyOfferOp| { &m.source_account }, + |m: &mut StellarManageBuyOfferOp| { &mut m.source_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StellarAsset>( + "selling_asset", + |m: &StellarManageBuyOfferOp| { &m.selling_asset }, + |m: &mut StellarManageBuyOfferOp| { &mut m.selling_asset }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StellarAsset>( + "buying_asset", + |m: &StellarManageBuyOfferOp| { &m.buying_asset }, + |m: &mut StellarManageBuyOfferOp| { &mut m.buying_asset }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &StellarManageBuyOfferOp| { &m.amount }, + |m: &mut StellarManageBuyOfferOp| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "price_n", + |m: &StellarManageBuyOfferOp| { &m.price_n }, + |m: &mut StellarManageBuyOfferOp| { &mut m.price_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "price_d", + |m: &StellarManageBuyOfferOp| { &m.price_d }, + |m: &mut StellarManageBuyOfferOp| { &mut m.price_d }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "offer_id", + |m: &StellarManageBuyOfferOp| { &m.offer_id }, + |m: &mut StellarManageBuyOfferOp| { &mut m.offer_id }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarManageBuyOfferOp", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarManageBuyOfferOp { + const NAME: &'static str = "StellarManageBuyOfferOp"; + + fn is_initialized(&self) -> bool { + if self.selling_asset.is_none() { + return false; + } + if self.buying_asset.is_none() { + return false; + } + if self.amount.is_none() { + return false; + } + if self.price_n.is_none() { + return false; + } + if self.price_d.is_none() { + return false; + } + if self.offer_id.is_none() { + return false; + } + for v in &self.selling_asset { + if !v.is_initialized() { + return false; + } + }; + for v in &self.buying_asset { + if !v.is_initialized() { + 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.source_account = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.selling_asset)?; + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.buying_asset)?; + }, + 32 => { + self.amount = ::std::option::Option::Some(is.read_sint64()?); + }, + 40 => { + self.price_n = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.price_d = ::std::option::Option::Some(is.read_uint32()?); + }, + 56 => { + self.offer_id = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.source_account.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.selling_asset.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.buying_asset.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.amount { + my_size += ::protobuf::rt::sint64_size(4, v); + } + if let Some(v) = self.price_n { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.price_d { + my_size += ::protobuf::rt::uint32_size(6, v); + } + if let Some(v) = self.offer_id { + my_size += ::protobuf::rt::uint64_size(7, 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.source_account.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.selling_asset.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + if let Some(v) = self.buying_asset.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.amount { + os.write_sint64(4, v)?; + } + if let Some(v) = self.price_n { + os.write_uint32(5, v)?; + } + if let Some(v) = self.price_d { + os.write_uint32(6, v)?; + } + if let Some(v) = self.offer_id { + os.write_uint64(7, 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() -> StellarManageBuyOfferOp { + StellarManageBuyOfferOp::new() + } + + fn clear(&mut self) { + self.source_account = ::std::option::Option::None; + self.selling_asset.clear(); + self.buying_asset.clear(); + self.amount = ::std::option::Option::None; + self.price_n = ::std::option::Option::None; + self.price_d = ::std::option::Option::None; + self.offer_id = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarManageBuyOfferOp { + static instance: StellarManageBuyOfferOp = StellarManageBuyOfferOp { + source_account: ::std::option::Option::None, + selling_asset: ::protobuf::MessageField::none(), + buying_asset: ::protobuf::MessageField::none(), + amount: ::std::option::Option::None, + price_n: ::std::option::Option::None, + price_d: ::std::option::Option::None, + offer_id: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarManageBuyOfferOp { + 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("StellarManageBuyOfferOp").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarManageBuyOfferOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarManageBuyOfferOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarCreatePassiveSellOfferOp) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarCreatePassiveSellOfferOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarCreatePassiveSellOfferOp.source_account) + pub source_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarCreatePassiveSellOfferOp.selling_asset) + pub selling_asset: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarCreatePassiveSellOfferOp.buying_asset) + pub buying_asset: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarCreatePassiveSellOfferOp.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarCreatePassiveSellOfferOp.price_n) + pub price_n: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarCreatePassiveSellOfferOp.price_d) + pub price_d: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarCreatePassiveSellOfferOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarCreatePassiveSellOfferOp { + fn default() -> &'a StellarCreatePassiveSellOfferOp { + ::default_instance() + } +} + +impl StellarCreatePassiveSellOfferOp { + pub fn new() -> StellarCreatePassiveSellOfferOp { + ::std::default::Default::default() + } + + // optional string source_account = 1; + + pub fn source_account(&self) -> &str { + match self.source_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_source_account(&mut self) { + self.source_account = ::std::option::Option::None; + } + + pub fn has_source_account(&self) -> bool { + self.source_account.is_some() + } + + // Param is passed by value, moved + pub fn set_source_account(&mut self, v: ::std::string::String) { + self.source_account = ::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_source_account(&mut self) -> &mut ::std::string::String { + if self.source_account.is_none() { + self.source_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.source_account.as_mut().unwrap() + } + + // Take field + pub fn take_source_account(&mut self) -> ::std::string::String { + self.source_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required sint64 amount = 4; + + pub fn amount(&self) -> i64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: i64) { + self.amount = ::std::option::Option::Some(v); + } + + // required uint32 price_n = 5; + + pub fn price_n(&self) -> u32 { + self.price_n.unwrap_or(0) + } + + pub fn clear_price_n(&mut self) { + self.price_n = ::std::option::Option::None; + } + + pub fn has_price_n(&self) -> bool { + self.price_n.is_some() + } + + // Param is passed by value, moved + pub fn set_price_n(&mut self, v: u32) { + self.price_n = ::std::option::Option::Some(v); + } + + // required uint32 price_d = 6; + + pub fn price_d(&self) -> u32 { + self.price_d.unwrap_or(0) + } + + pub fn clear_price_d(&mut self) { + self.price_d = ::std::option::Option::None; + } + + pub fn has_price_d(&self) -> bool { + self.price_d.is_some() + } + + // Param is passed by value, moved + pub fn set_price_d(&mut self, v: u32) { + self.price_d = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "source_account", + |m: &StellarCreatePassiveSellOfferOp| { &m.source_account }, + |m: &mut StellarCreatePassiveSellOfferOp| { &mut m.source_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StellarAsset>( + "selling_asset", + |m: &StellarCreatePassiveSellOfferOp| { &m.selling_asset }, + |m: &mut StellarCreatePassiveSellOfferOp| { &mut m.selling_asset }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StellarAsset>( + "buying_asset", + |m: &StellarCreatePassiveSellOfferOp| { &m.buying_asset }, + |m: &mut StellarCreatePassiveSellOfferOp| { &mut m.buying_asset }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &StellarCreatePassiveSellOfferOp| { &m.amount }, + |m: &mut StellarCreatePassiveSellOfferOp| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "price_n", + |m: &StellarCreatePassiveSellOfferOp| { &m.price_n }, + |m: &mut StellarCreatePassiveSellOfferOp| { &mut m.price_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "price_d", + |m: &StellarCreatePassiveSellOfferOp| { &m.price_d }, + |m: &mut StellarCreatePassiveSellOfferOp| { &mut m.price_d }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarCreatePassiveSellOfferOp", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarCreatePassiveSellOfferOp { + const NAME: &'static str = "StellarCreatePassiveSellOfferOp"; + + fn is_initialized(&self) -> bool { + if self.selling_asset.is_none() { + return false; + } + if self.buying_asset.is_none() { + return false; + } + if self.amount.is_none() { + return false; + } + if self.price_n.is_none() { + return false; + } + if self.price_d.is_none() { + return false; + } + for v in &self.selling_asset { + if !v.is_initialized() { + return false; + } + }; + for v in &self.buying_asset { + if !v.is_initialized() { + 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.source_account = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.selling_asset)?; + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.buying_asset)?; + }, + 32 => { + self.amount = ::std::option::Option::Some(is.read_sint64()?); + }, + 40 => { + self.price_n = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.price_d = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.source_account.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.selling_asset.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.buying_asset.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.amount { + my_size += ::protobuf::rt::sint64_size(4, v); + } + if let Some(v) = self.price_n { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.price_d { + my_size += ::protobuf::rt::uint32_size(6, 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.source_account.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.selling_asset.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + if let Some(v) = self.buying_asset.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.amount { + os.write_sint64(4, v)?; + } + if let Some(v) = self.price_n { + os.write_uint32(5, v)?; + } + if let Some(v) = self.price_d { + os.write_uint32(6, 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() -> StellarCreatePassiveSellOfferOp { + StellarCreatePassiveSellOfferOp::new() + } + + fn clear(&mut self) { + self.source_account = ::std::option::Option::None; + self.selling_asset.clear(); + self.buying_asset.clear(); + self.amount = ::std::option::Option::None; + self.price_n = ::std::option::Option::None; + self.price_d = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarCreatePassiveSellOfferOp { + static instance: StellarCreatePassiveSellOfferOp = StellarCreatePassiveSellOfferOp { + source_account: ::std::option::Option::None, + selling_asset: ::protobuf::MessageField::none(), + buying_asset: ::protobuf::MessageField::none(), + amount: ::std::option::Option::None, + price_n: ::std::option::Option::None, + price_d: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarCreatePassiveSellOfferOp { + 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("StellarCreatePassiveSellOfferOp").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarCreatePassiveSellOfferOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarCreatePassiveSellOfferOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarSetOptionsOp) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarSetOptionsOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSetOptionsOp.source_account) + pub source_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSetOptionsOp.inflation_destination_account) + pub inflation_destination_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSetOptionsOp.clear_flags) + pub clear_flags: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSetOptionsOp.set_flags) + pub set_flags: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSetOptionsOp.master_weight) + pub master_weight: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSetOptionsOp.low_threshold) + pub low_threshold: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSetOptionsOp.medium_threshold) + pub medium_threshold: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSetOptionsOp.high_threshold) + pub high_threshold: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSetOptionsOp.home_domain) + pub home_domain: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSetOptionsOp.signer_type) + pub signer_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSetOptionsOp.signer_key) + pub signer_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSetOptionsOp.signer_weight) + pub signer_weight: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarSetOptionsOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarSetOptionsOp { + fn default() -> &'a StellarSetOptionsOp { + ::default_instance() + } +} + +impl StellarSetOptionsOp { + pub fn new() -> StellarSetOptionsOp { + ::std::default::Default::default() + } + + // optional string source_account = 1; + + pub fn source_account(&self) -> &str { + match self.source_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_source_account(&mut self) { + self.source_account = ::std::option::Option::None; + } + + pub fn has_source_account(&self) -> bool { + self.source_account.is_some() + } + + // Param is passed by value, moved + pub fn set_source_account(&mut self, v: ::std::string::String) { + self.source_account = ::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_source_account(&mut self) -> &mut ::std::string::String { + if self.source_account.is_none() { + self.source_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.source_account.as_mut().unwrap() + } + + // Take field + pub fn take_source_account(&mut self) -> ::std::string::String { + self.source_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string inflation_destination_account = 2; + + pub fn inflation_destination_account(&self) -> &str { + match self.inflation_destination_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_inflation_destination_account(&mut self) { + self.inflation_destination_account = ::std::option::Option::None; + } + + pub fn has_inflation_destination_account(&self) -> bool { + self.inflation_destination_account.is_some() + } + + // Param is passed by value, moved + pub fn set_inflation_destination_account(&mut self, v: ::std::string::String) { + self.inflation_destination_account = ::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_inflation_destination_account(&mut self) -> &mut ::std::string::String { + if self.inflation_destination_account.is_none() { + self.inflation_destination_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.inflation_destination_account.as_mut().unwrap() + } + + // Take field + pub fn take_inflation_destination_account(&mut self) -> ::std::string::String { + self.inflation_destination_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint32 clear_flags = 3; + + pub fn clear_flags(&self) -> u32 { + self.clear_flags.unwrap_or(0) + } + + pub fn clear_clear_flags(&mut self) { + self.clear_flags = ::std::option::Option::None; + } + + pub fn has_clear_flags(&self) -> bool { + self.clear_flags.is_some() + } + + // Param is passed by value, moved + pub fn set_clear_flags(&mut self, v: u32) { + self.clear_flags = ::std::option::Option::Some(v); + } + + // optional uint32 set_flags = 4; + + pub fn set_flags(&self) -> u32 { + self.set_flags.unwrap_or(0) + } + + pub fn clear_set_flags(&mut self) { + self.set_flags = ::std::option::Option::None; + } + + pub fn has_set_flags(&self) -> bool { + self.set_flags.is_some() + } + + // Param is passed by value, moved + pub fn set_set_flags(&mut self, v: u32) { + self.set_flags = ::std::option::Option::Some(v); + } + + // optional uint32 master_weight = 5; + + pub fn master_weight(&self) -> u32 { + self.master_weight.unwrap_or(0) + } + + pub fn clear_master_weight(&mut self) { + self.master_weight = ::std::option::Option::None; + } + + pub fn has_master_weight(&self) -> bool { + self.master_weight.is_some() + } + + // Param is passed by value, moved + pub fn set_master_weight(&mut self, v: u32) { + self.master_weight = ::std::option::Option::Some(v); + } + + // optional uint32 low_threshold = 6; + + pub fn low_threshold(&self) -> u32 { + self.low_threshold.unwrap_or(0) + } + + pub fn clear_low_threshold(&mut self) { + self.low_threshold = ::std::option::Option::None; + } + + pub fn has_low_threshold(&self) -> bool { + self.low_threshold.is_some() + } + + // Param is passed by value, moved + pub fn set_low_threshold(&mut self, v: u32) { + self.low_threshold = ::std::option::Option::Some(v); + } + + // optional uint32 medium_threshold = 7; + + pub fn medium_threshold(&self) -> u32 { + self.medium_threshold.unwrap_or(0) + } + + pub fn clear_medium_threshold(&mut self) { + self.medium_threshold = ::std::option::Option::None; + } + + pub fn has_medium_threshold(&self) -> bool { + self.medium_threshold.is_some() + } + + // Param is passed by value, moved + pub fn set_medium_threshold(&mut self, v: u32) { + self.medium_threshold = ::std::option::Option::Some(v); + } + + // optional uint32 high_threshold = 8; + + pub fn high_threshold(&self) -> u32 { + self.high_threshold.unwrap_or(0) + } + + pub fn clear_high_threshold(&mut self) { + self.high_threshold = ::std::option::Option::None; + } + + pub fn has_high_threshold(&self) -> bool { + self.high_threshold.is_some() + } + + // Param is passed by value, moved + pub fn set_high_threshold(&mut self, v: u32) { + self.high_threshold = ::std::option::Option::Some(v); + } + + // optional string home_domain = 9; + + pub fn home_domain(&self) -> &str { + match self.home_domain.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_home_domain(&mut self) { + self.home_domain = ::std::option::Option::None; + } + + pub fn has_home_domain(&self) -> bool { + self.home_domain.is_some() + } + + // Param is passed by value, moved + pub fn set_home_domain(&mut self, v: ::std::string::String) { + self.home_domain = ::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_home_domain(&mut self) -> &mut ::std::string::String { + if self.home_domain.is_none() { + self.home_domain = ::std::option::Option::Some(::std::string::String::new()); + } + self.home_domain.as_mut().unwrap() + } + + // Take field + pub fn take_home_domain(&mut self) -> ::std::string::String { + self.home_domain.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional .hw.trezor.messages.stellar.StellarSetOptionsOp.StellarSignerType signer_type = 10; + + pub fn signer_type(&self) -> stellar_set_options_op::StellarSignerType { + match self.signer_type { + Some(e) => e.enum_value_or(stellar_set_options_op::StellarSignerType::ACCOUNT), + None => stellar_set_options_op::StellarSignerType::ACCOUNT, + } + } + + pub fn clear_signer_type(&mut self) { + self.signer_type = ::std::option::Option::None; + } + + pub fn has_signer_type(&self) -> bool { + self.signer_type.is_some() + } + + // Param is passed by value, moved + pub fn set_signer_type(&mut self, v: stellar_set_options_op::StellarSignerType) { + self.signer_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional bytes signer_key = 11; + + pub fn signer_key(&self) -> &[u8] { + match self.signer_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signer_key(&mut self) { + self.signer_key = ::std::option::Option::None; + } + + pub fn has_signer_key(&self) -> bool { + self.signer_key.is_some() + } + + // Param is passed by value, moved + pub fn set_signer_key(&mut self, v: ::std::vec::Vec) { + self.signer_key = ::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_signer_key(&mut self) -> &mut ::std::vec::Vec { + if self.signer_key.is_none() { + self.signer_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signer_key.as_mut().unwrap() + } + + // Take field + pub fn take_signer_key(&mut self) -> ::std::vec::Vec { + self.signer_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 signer_weight = 12; + + pub fn signer_weight(&self) -> u32 { + self.signer_weight.unwrap_or(0) + } + + pub fn clear_signer_weight(&mut self) { + self.signer_weight = ::std::option::Option::None; + } + + pub fn has_signer_weight(&self) -> bool { + self.signer_weight.is_some() + } + + // Param is passed by value, moved + pub fn set_signer_weight(&mut self, v: u32) { + self.signer_weight = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(12); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "source_account", + |m: &StellarSetOptionsOp| { &m.source_account }, + |m: &mut StellarSetOptionsOp| { &mut m.source_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "inflation_destination_account", + |m: &StellarSetOptionsOp| { &m.inflation_destination_account }, + |m: &mut StellarSetOptionsOp| { &mut m.inflation_destination_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "clear_flags", + |m: &StellarSetOptionsOp| { &m.clear_flags }, + |m: &mut StellarSetOptionsOp| { &mut m.clear_flags }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "set_flags", + |m: &StellarSetOptionsOp| { &m.set_flags }, + |m: &mut StellarSetOptionsOp| { &mut m.set_flags }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "master_weight", + |m: &StellarSetOptionsOp| { &m.master_weight }, + |m: &mut StellarSetOptionsOp| { &mut m.master_weight }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "low_threshold", + |m: &StellarSetOptionsOp| { &m.low_threshold }, + |m: &mut StellarSetOptionsOp| { &mut m.low_threshold }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "medium_threshold", + |m: &StellarSetOptionsOp| { &m.medium_threshold }, + |m: &mut StellarSetOptionsOp| { &mut m.medium_threshold }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "high_threshold", + |m: &StellarSetOptionsOp| { &m.high_threshold }, + |m: &mut StellarSetOptionsOp| { &mut m.high_threshold }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "home_domain", + |m: &StellarSetOptionsOp| { &m.home_domain }, + |m: &mut StellarSetOptionsOp| { &mut m.home_domain }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signer_type", + |m: &StellarSetOptionsOp| { &m.signer_type }, + |m: &mut StellarSetOptionsOp| { &mut m.signer_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signer_key", + |m: &StellarSetOptionsOp| { &m.signer_key }, + |m: &mut StellarSetOptionsOp| { &mut m.signer_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signer_weight", + |m: &StellarSetOptionsOp| { &m.signer_weight }, + |m: &mut StellarSetOptionsOp| { &mut m.signer_weight }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarSetOptionsOp", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarSetOptionsOp { + const NAME: &'static str = "StellarSetOptionsOp"; + + 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.source_account = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.inflation_destination_account = ::std::option::Option::Some(is.read_string()?); + }, + 24 => { + self.clear_flags = ::std::option::Option::Some(is.read_uint32()?); + }, + 32 => { + self.set_flags = ::std::option::Option::Some(is.read_uint32()?); + }, + 40 => { + self.master_weight = ::std::option::Option::Some(is.read_uint32()?); + }, + 48 => { + self.low_threshold = ::std::option::Option::Some(is.read_uint32()?); + }, + 56 => { + self.medium_threshold = ::std::option::Option::Some(is.read_uint32()?); + }, + 64 => { + self.high_threshold = ::std::option::Option::Some(is.read_uint32()?); + }, + 74 => { + self.home_domain = ::std::option::Option::Some(is.read_string()?); + }, + 80 => { + self.signer_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 90 => { + self.signer_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 96 => { + self.signer_weight = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.source_account.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.inflation_destination_account.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.clear_flags { + my_size += ::protobuf::rt::uint32_size(3, v); + } + if let Some(v) = self.set_flags { + my_size += ::protobuf::rt::uint32_size(4, v); + } + if let Some(v) = self.master_weight { + my_size += ::protobuf::rt::uint32_size(5, v); + } + if let Some(v) = self.low_threshold { + my_size += ::protobuf::rt::uint32_size(6, v); + } + if let Some(v) = self.medium_threshold { + my_size += ::protobuf::rt::uint32_size(7, v); + } + if let Some(v) = self.high_threshold { + my_size += ::protobuf::rt::uint32_size(8, v); + } + if let Some(v) = self.home_domain.as_ref() { + my_size += ::protobuf::rt::string_size(9, &v); + } + if let Some(v) = self.signer_type { + my_size += ::protobuf::rt::int32_size(10, v.value()); + } + if let Some(v) = self.signer_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(11, &v); + } + if let Some(v) = self.signer_weight { + my_size += ::protobuf::rt::uint32_size(12, 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.source_account.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.inflation_destination_account.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.clear_flags { + os.write_uint32(3, v)?; + } + if let Some(v) = self.set_flags { + os.write_uint32(4, v)?; + } + if let Some(v) = self.master_weight { + os.write_uint32(5, v)?; + } + if let Some(v) = self.low_threshold { + os.write_uint32(6, v)?; + } + if let Some(v) = self.medium_threshold { + os.write_uint32(7, v)?; + } + if let Some(v) = self.high_threshold { + os.write_uint32(8, v)?; + } + if let Some(v) = self.home_domain.as_ref() { + os.write_string(9, v)?; + } + if let Some(v) = self.signer_type { + os.write_enum(10, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.signer_key.as_ref() { + os.write_bytes(11, v)?; + } + if let Some(v) = self.signer_weight { + os.write_uint32(12, 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() -> StellarSetOptionsOp { + StellarSetOptionsOp::new() + } + + fn clear(&mut self) { + self.source_account = ::std::option::Option::None; + self.inflation_destination_account = ::std::option::Option::None; + self.clear_flags = ::std::option::Option::None; + self.set_flags = ::std::option::Option::None; + self.master_weight = ::std::option::Option::None; + self.low_threshold = ::std::option::Option::None; + self.medium_threshold = ::std::option::Option::None; + self.high_threshold = ::std::option::Option::None; + self.home_domain = ::std::option::Option::None; + self.signer_type = ::std::option::Option::None; + self.signer_key = ::std::option::Option::None; + self.signer_weight = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarSetOptionsOp { + static instance: StellarSetOptionsOp = StellarSetOptionsOp { + source_account: ::std::option::Option::None, + inflation_destination_account: ::std::option::Option::None, + clear_flags: ::std::option::Option::None, + set_flags: ::std::option::Option::None, + master_weight: ::std::option::Option::None, + low_threshold: ::std::option::Option::None, + medium_threshold: ::std::option::Option::None, + high_threshold: ::std::option::Option::None, + home_domain: ::std::option::Option::None, + signer_type: ::std::option::Option::None, + signer_key: ::std::option::Option::None, + signer_weight: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarSetOptionsOp { + 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("StellarSetOptionsOp").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarSetOptionsOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarSetOptionsOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `StellarSetOptionsOp` +pub mod stellar_set_options_op { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.stellar.StellarSetOptionsOp.StellarSignerType) + pub enum StellarSignerType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarSetOptionsOp.StellarSignerType.ACCOUNT) + ACCOUNT = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarSetOptionsOp.StellarSignerType.PRE_AUTH) + PRE_AUTH = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarSetOptionsOp.StellarSignerType.HASH) + HASH = 2, + } + + impl ::protobuf::Enum for StellarSignerType { + const NAME: &'static str = "StellarSignerType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(StellarSignerType::ACCOUNT), + 1 => ::std::option::Option::Some(StellarSignerType::PRE_AUTH), + 2 => ::std::option::Option::Some(StellarSignerType::HASH), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "ACCOUNT" => ::std::option::Option::Some(StellarSignerType::ACCOUNT), + "PRE_AUTH" => ::std::option::Option::Some(StellarSignerType::PRE_AUTH), + "HASH" => ::std::option::Option::Some(StellarSignerType::HASH), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [StellarSignerType] = &[ + StellarSignerType::ACCOUNT, + StellarSignerType::PRE_AUTH, + StellarSignerType::HASH, + ]; + } + + impl ::protobuf::EnumFull for StellarSignerType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("StellarSetOptionsOp.StellarSignerType").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 StellarSignerType { + fn default() -> Self { + StellarSignerType::ACCOUNT + } + } + + impl StellarSignerType { + pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("StellarSetOptionsOp.StellarSignerType") + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarChangeTrustOp) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarChangeTrustOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarChangeTrustOp.source_account) + pub source_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarChangeTrustOp.asset) + pub asset: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarChangeTrustOp.limit) + pub limit: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarChangeTrustOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarChangeTrustOp { + fn default() -> &'a StellarChangeTrustOp { + ::default_instance() + } +} + +impl StellarChangeTrustOp { + pub fn new() -> StellarChangeTrustOp { + ::std::default::Default::default() + } + + // optional string source_account = 1; + + pub fn source_account(&self) -> &str { + match self.source_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_source_account(&mut self) { + self.source_account = ::std::option::Option::None; + } + + pub fn has_source_account(&self) -> bool { + self.source_account.is_some() + } + + // Param is passed by value, moved + pub fn set_source_account(&mut self, v: ::std::string::String) { + self.source_account = ::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_source_account(&mut self) -> &mut ::std::string::String { + if self.source_account.is_none() { + self.source_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.source_account.as_mut().unwrap() + } + + // Take field + pub fn take_source_account(&mut self) -> ::std::string::String { + self.source_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required uint64 limit = 3; + + pub fn limit(&self) -> u64 { + self.limit.unwrap_or(0) + } + + pub fn clear_limit(&mut self) { + self.limit = ::std::option::Option::None; + } + + pub fn has_limit(&self) -> bool { + self.limit.is_some() + } + + // Param is passed by value, moved + pub fn set_limit(&mut self, v: u64) { + self.limit = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "source_account", + |m: &StellarChangeTrustOp| { &m.source_account }, + |m: &mut StellarChangeTrustOp| { &mut m.source_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StellarAsset>( + "asset", + |m: &StellarChangeTrustOp| { &m.asset }, + |m: &mut StellarChangeTrustOp| { &mut m.asset }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "limit", + |m: &StellarChangeTrustOp| { &m.limit }, + |m: &mut StellarChangeTrustOp| { &mut m.limit }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarChangeTrustOp", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarChangeTrustOp { + const NAME: &'static str = "StellarChangeTrustOp"; + + fn is_initialized(&self) -> bool { + if self.asset.is_none() { + return false; + } + if self.limit.is_none() { + return false; + } + for v in &self.asset { + if !v.is_initialized() { + 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.source_account = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.asset)?; + }, + 24 => { + self.limit = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.source_account.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.asset.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.limit { + my_size += ::protobuf::rt::uint64_size(3, 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.source_account.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.asset.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + if let Some(v) = self.limit { + os.write_uint64(3, 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() -> StellarChangeTrustOp { + StellarChangeTrustOp::new() + } + + fn clear(&mut self) { + self.source_account = ::std::option::Option::None; + self.asset.clear(); + self.limit = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarChangeTrustOp { + static instance: StellarChangeTrustOp = StellarChangeTrustOp { + source_account: ::std::option::Option::None, + asset: ::protobuf::MessageField::none(), + limit: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarChangeTrustOp { + 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("StellarChangeTrustOp").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarChangeTrustOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarChangeTrustOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarAllowTrustOp) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarAllowTrustOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarAllowTrustOp.source_account) + pub source_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarAllowTrustOp.trusted_account) + pub trusted_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarAllowTrustOp.asset_type) + pub asset_type: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarAllowTrustOp.asset_code) + pub asset_code: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarAllowTrustOp.is_authorized) + pub is_authorized: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarAllowTrustOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarAllowTrustOp { + fn default() -> &'a StellarAllowTrustOp { + ::default_instance() + } +} + +impl StellarAllowTrustOp { + pub fn new() -> StellarAllowTrustOp { + ::std::default::Default::default() + } + + // optional string source_account = 1; + + pub fn source_account(&self) -> &str { + match self.source_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_source_account(&mut self) { + self.source_account = ::std::option::Option::None; + } + + pub fn has_source_account(&self) -> bool { + self.source_account.is_some() + } + + // Param is passed by value, moved + pub fn set_source_account(&mut self, v: ::std::string::String) { + self.source_account = ::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_source_account(&mut self) -> &mut ::std::string::String { + if self.source_account.is_none() { + self.source_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.source_account.as_mut().unwrap() + } + + // Take field + pub fn take_source_account(&mut self) -> ::std::string::String { + self.source_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required string trusted_account = 2; + + pub fn trusted_account(&self) -> &str { + match self.trusted_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_trusted_account(&mut self) { + self.trusted_account = ::std::option::Option::None; + } + + pub fn has_trusted_account(&self) -> bool { + self.trusted_account.is_some() + } + + // Param is passed by value, moved + pub fn set_trusted_account(&mut self, v: ::std::string::String) { + self.trusted_account = ::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_trusted_account(&mut self) -> &mut ::std::string::String { + if self.trusted_account.is_none() { + self.trusted_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.trusted_account.as_mut().unwrap() + } + + // Take field + pub fn take_trusted_account(&mut self) -> ::std::string::String { + self.trusted_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required .hw.trezor.messages.stellar.StellarAssetType asset_type = 3; + + pub fn asset_type(&self) -> StellarAssetType { + match self.asset_type { + Some(e) => e.enum_value_or(StellarAssetType::NATIVE), + None => StellarAssetType::NATIVE, + } + } + + pub fn clear_asset_type(&mut self) { + self.asset_type = ::std::option::Option::None; + } + + pub fn has_asset_type(&self) -> bool { + self.asset_type.is_some() + } + + // Param is passed by value, moved + pub fn set_asset_type(&mut self, v: StellarAssetType) { + self.asset_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // optional string asset_code = 4; + + pub fn asset_code(&self) -> &str { + match self.asset_code.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_asset_code(&mut self) { + self.asset_code = ::std::option::Option::None; + } + + pub fn has_asset_code(&self) -> bool { + self.asset_code.is_some() + } + + // Param is passed by value, moved + pub fn set_asset_code(&mut self, v: ::std::string::String) { + self.asset_code = ::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_asset_code(&mut self) -> &mut ::std::string::String { + if self.asset_code.is_none() { + self.asset_code = ::std::option::Option::Some(::std::string::String::new()); + } + self.asset_code.as_mut().unwrap() + } + + // Take field + pub fn take_asset_code(&mut self) -> ::std::string::String { + self.asset_code.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required bool is_authorized = 5; + + pub fn is_authorized(&self) -> bool { + self.is_authorized.unwrap_or(false) + } + + pub fn clear_is_authorized(&mut self) { + self.is_authorized = ::std::option::Option::None; + } + + pub fn has_is_authorized(&self) -> bool { + self.is_authorized.is_some() + } + + // Param is passed by value, moved + pub fn set_is_authorized(&mut self, v: bool) { + self.is_authorized = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "source_account", + |m: &StellarAllowTrustOp| { &m.source_account }, + |m: &mut StellarAllowTrustOp| { &mut m.source_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "trusted_account", + |m: &StellarAllowTrustOp| { &m.trusted_account }, + |m: &mut StellarAllowTrustOp| { &mut m.trusted_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "asset_type", + |m: &StellarAllowTrustOp| { &m.asset_type }, + |m: &mut StellarAllowTrustOp| { &mut m.asset_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "asset_code", + |m: &StellarAllowTrustOp| { &m.asset_code }, + |m: &mut StellarAllowTrustOp| { &mut m.asset_code }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "is_authorized", + |m: &StellarAllowTrustOp| { &m.is_authorized }, + |m: &mut StellarAllowTrustOp| { &mut m.is_authorized }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarAllowTrustOp", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarAllowTrustOp { + const NAME: &'static str = "StellarAllowTrustOp"; + + fn is_initialized(&self) -> bool { + if self.trusted_account.is_none() { + return false; + } + if self.asset_type.is_none() { + return false; + } + if self.is_authorized.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.source_account = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.trusted_account = ::std::option::Option::Some(is.read_string()?); + }, + 24 => { + self.asset_type = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 34 => { + self.asset_code = ::std::option::Option::Some(is.read_string()?); + }, + 40 => { + self.is_authorized = ::std::option::Option::Some(is.read_bool()?); + }, + 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.source_account.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.trusted_account.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.asset_type { + my_size += ::protobuf::rt::int32_size(3, v.value()); + } + if let Some(v) = self.asset_code.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(v) = self.is_authorized { + my_size += 1 + 1; + } + 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.source_account.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.trusted_account.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.asset_type { + os.write_enum(3, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.asset_code.as_ref() { + os.write_string(4, v)?; + } + if let Some(v) = self.is_authorized { + os.write_bool(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() -> StellarAllowTrustOp { + StellarAllowTrustOp::new() + } + + fn clear(&mut self) { + self.source_account = ::std::option::Option::None; + self.trusted_account = ::std::option::Option::None; + self.asset_type = ::std::option::Option::None; + self.asset_code = ::std::option::Option::None; + self.is_authorized = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarAllowTrustOp { + static instance: StellarAllowTrustOp = StellarAllowTrustOp { + source_account: ::std::option::Option::None, + trusted_account: ::std::option::Option::None, + asset_type: ::std::option::Option::None, + asset_code: ::std::option::Option::None, + is_authorized: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarAllowTrustOp { + 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("StellarAllowTrustOp").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarAllowTrustOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarAllowTrustOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarAccountMergeOp) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarAccountMergeOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarAccountMergeOp.source_account) + pub source_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarAccountMergeOp.destination_account) + pub destination_account: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarAccountMergeOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarAccountMergeOp { + fn default() -> &'a StellarAccountMergeOp { + ::default_instance() + } +} + +impl StellarAccountMergeOp { + pub fn new() -> StellarAccountMergeOp { + ::std::default::Default::default() + } + + // optional string source_account = 1; + + pub fn source_account(&self) -> &str { + match self.source_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_source_account(&mut self) { + self.source_account = ::std::option::Option::None; + } + + pub fn has_source_account(&self) -> bool { + self.source_account.is_some() + } + + // Param is passed by value, moved + pub fn set_source_account(&mut self, v: ::std::string::String) { + self.source_account = ::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_source_account(&mut self) -> &mut ::std::string::String { + if self.source_account.is_none() { + self.source_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.source_account.as_mut().unwrap() + } + + // Take field + pub fn take_source_account(&mut self) -> ::std::string::String { + self.source_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required string destination_account = 2; + + pub fn destination_account(&self) -> &str { + match self.destination_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_destination_account(&mut self) { + self.destination_account = ::std::option::Option::None; + } + + pub fn has_destination_account(&self) -> bool { + self.destination_account.is_some() + } + + // Param is passed by value, moved + pub fn set_destination_account(&mut self, v: ::std::string::String) { + self.destination_account = ::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_destination_account(&mut self) -> &mut ::std::string::String { + if self.destination_account.is_none() { + self.destination_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.destination_account.as_mut().unwrap() + } + + // Take field + pub fn take_destination_account(&mut self) -> ::std::string::String { + self.destination_account.take().unwrap_or_else(|| ::std::string::String::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::<_, _>( + "source_account", + |m: &StellarAccountMergeOp| { &m.source_account }, + |m: &mut StellarAccountMergeOp| { &mut m.source_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "destination_account", + |m: &StellarAccountMergeOp| { &m.destination_account }, + |m: &mut StellarAccountMergeOp| { &mut m.destination_account }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarAccountMergeOp", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarAccountMergeOp { + const NAME: &'static str = "StellarAccountMergeOp"; + + fn is_initialized(&self) -> bool { + if self.destination_account.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.source_account = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.destination_account = ::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.source_account.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.destination_account.as_ref() { + my_size += ::protobuf::rt::string_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.source_account.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.destination_account.as_ref() { + os.write_string(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() -> StellarAccountMergeOp { + StellarAccountMergeOp::new() + } + + fn clear(&mut self) { + self.source_account = ::std::option::Option::None; + self.destination_account = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarAccountMergeOp { + static instance: StellarAccountMergeOp = StellarAccountMergeOp { + source_account: ::std::option::Option::None, + destination_account: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarAccountMergeOp { + 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("StellarAccountMergeOp").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarAccountMergeOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarAccountMergeOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarManageDataOp) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarManageDataOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageDataOp.source_account) + pub source_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageDataOp.key) + pub key: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarManageDataOp.value) + pub value: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarManageDataOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarManageDataOp { + fn default() -> &'a StellarManageDataOp { + ::default_instance() + } +} + +impl StellarManageDataOp { + pub fn new() -> StellarManageDataOp { + ::std::default::Default::default() + } + + // optional string source_account = 1; + + pub fn source_account(&self) -> &str { + match self.source_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_source_account(&mut self) { + self.source_account = ::std::option::Option::None; + } + + pub fn has_source_account(&self) -> bool { + self.source_account.is_some() + } + + // Param is passed by value, moved + pub fn set_source_account(&mut self, v: ::std::string::String) { + self.source_account = ::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_source_account(&mut self) -> &mut ::std::string::String { + if self.source_account.is_none() { + self.source_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.source_account.as_mut().unwrap() + } + + // Take field + pub fn take_source_account(&mut self) -> ::std::string::String { + self.source_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required string key = 2; + + pub fn key(&self) -> &str { + match self.key.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_key(&mut self) { + self.key = ::std::option::Option::None; + } + + pub fn has_key(&self) -> bool { + self.key.is_some() + } + + // Param is passed by value, moved + pub fn set_key(&mut self, v: ::std::string::String) { + self.key = ::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_key(&mut self) -> &mut ::std::string::String { + if self.key.is_none() { + self.key = ::std::option::Option::Some(::std::string::String::new()); + } + self.key.as_mut().unwrap() + } + + // Take field + pub fn take_key(&mut self) -> ::std::string::String { + self.key.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bytes value = 3; + + pub fn value(&self) -> &[u8] { + match self.value.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_value(&mut self) { + self.value = ::std::option::Option::None; + } + + pub fn has_value(&self) -> bool { + self.value.is_some() + } + + // Param is passed by value, moved + pub fn set_value(&mut self, v: ::std::vec::Vec) { + self.value = ::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_value(&mut self) -> &mut ::std::vec::Vec { + if self.value.is_none() { + self.value = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.value.as_mut().unwrap() + } + + // Take field + pub fn take_value(&mut self) -> ::std::vec::Vec { + self.value.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "source_account", + |m: &StellarManageDataOp| { &m.source_account }, + |m: &mut StellarManageDataOp| { &mut m.source_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "key", + |m: &StellarManageDataOp| { &m.key }, + |m: &mut StellarManageDataOp| { &mut m.key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "value", + |m: &StellarManageDataOp| { &m.value }, + |m: &mut StellarManageDataOp| { &mut m.value }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarManageDataOp", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarManageDataOp { + const NAME: &'static str = "StellarManageDataOp"; + + fn is_initialized(&self) -> bool { + if self.key.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.source_account = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.key = ::std::option::Option::Some(is.read_string()?); + }, + 26 => { + self.value = ::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.source_account.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.key.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.value.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &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.source_account.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.key.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.value.as_ref() { + os.write_bytes(3, 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() -> StellarManageDataOp { + StellarManageDataOp::new() + } + + fn clear(&mut self) { + self.source_account = ::std::option::Option::None; + self.key = ::std::option::Option::None; + self.value = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarManageDataOp { + static instance: StellarManageDataOp = StellarManageDataOp { + source_account: ::std::option::Option::None, + key: ::std::option::Option::None, + value: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarManageDataOp { + 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("StellarManageDataOp").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarManageDataOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarManageDataOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarBumpSequenceOp) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarBumpSequenceOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarBumpSequenceOp.source_account) + pub source_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarBumpSequenceOp.bump_to) + pub bump_to: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarBumpSequenceOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarBumpSequenceOp { + fn default() -> &'a StellarBumpSequenceOp { + ::default_instance() + } +} + +impl StellarBumpSequenceOp { + pub fn new() -> StellarBumpSequenceOp { + ::std::default::Default::default() + } + + // optional string source_account = 1; + + pub fn source_account(&self) -> &str { + match self.source_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_source_account(&mut self) { + self.source_account = ::std::option::Option::None; + } + + pub fn has_source_account(&self) -> bool { + self.source_account.is_some() + } + + // Param is passed by value, moved + pub fn set_source_account(&mut self, v: ::std::string::String) { + self.source_account = ::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_source_account(&mut self) -> &mut ::std::string::String { + if self.source_account.is_none() { + self.source_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.source_account.as_mut().unwrap() + } + + // Take field + pub fn take_source_account(&mut self) -> ::std::string::String { + self.source_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required uint64 bump_to = 2; + + pub fn bump_to(&self) -> u64 { + self.bump_to.unwrap_or(0) + } + + pub fn clear_bump_to(&mut self) { + self.bump_to = ::std::option::Option::None; + } + + pub fn has_bump_to(&self) -> bool { + self.bump_to.is_some() + } + + // Param is passed by value, moved + pub fn set_bump_to(&mut self, v: u64) { + self.bump_to = ::std::option::Option::Some(v); + } + + 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::<_, _>( + "source_account", + |m: &StellarBumpSequenceOp| { &m.source_account }, + |m: &mut StellarBumpSequenceOp| { &mut m.source_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "bump_to", + |m: &StellarBumpSequenceOp| { &m.bump_to }, + |m: &mut StellarBumpSequenceOp| { &mut m.bump_to }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarBumpSequenceOp", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarBumpSequenceOp { + const NAME: &'static str = "StellarBumpSequenceOp"; + + fn is_initialized(&self) -> bool { + if self.bump_to.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.source_account = ::std::option::Option::Some(is.read_string()?); + }, + 16 => { + self.bump_to = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.source_account.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.bump_to { + my_size += ::protobuf::rt::uint64_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.source_account.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.bump_to { + os.write_uint64(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() -> StellarBumpSequenceOp { + StellarBumpSequenceOp::new() + } + + fn clear(&mut self) { + self.source_account = ::std::option::Option::None; + self.bump_to = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarBumpSequenceOp { + static instance: StellarBumpSequenceOp = StellarBumpSequenceOp { + source_account: ::std::option::Option::None, + bump_to: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarBumpSequenceOp { + 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("StellarBumpSequenceOp").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarBumpSequenceOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarBumpSequenceOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarClaimClaimableBalanceOp) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarClaimClaimableBalanceOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarClaimClaimableBalanceOp.source_account) + pub source_account: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarClaimClaimableBalanceOp.balance_id) + pub balance_id: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarClaimClaimableBalanceOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarClaimClaimableBalanceOp { + fn default() -> &'a StellarClaimClaimableBalanceOp { + ::default_instance() + } +} + +impl StellarClaimClaimableBalanceOp { + pub fn new() -> StellarClaimClaimableBalanceOp { + ::std::default::Default::default() + } + + // optional string source_account = 1; + + pub fn source_account(&self) -> &str { + match self.source_account.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_source_account(&mut self) { + self.source_account = ::std::option::Option::None; + } + + pub fn has_source_account(&self) -> bool { + self.source_account.is_some() + } + + // Param is passed by value, moved + pub fn set_source_account(&mut self, v: ::std::string::String) { + self.source_account = ::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_source_account(&mut self) -> &mut ::std::string::String { + if self.source_account.is_none() { + self.source_account = ::std::option::Option::Some(::std::string::String::new()); + } + self.source_account.as_mut().unwrap() + } + + // Take field + pub fn take_source_account(&mut self) -> ::std::string::String { + self.source_account.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required bytes balance_id = 2; + + pub fn balance_id(&self) -> &[u8] { + match self.balance_id.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_balance_id(&mut self) { + self.balance_id = ::std::option::Option::None; + } + + pub fn has_balance_id(&self) -> bool { + self.balance_id.is_some() + } + + // Param is passed by value, moved + pub fn set_balance_id(&mut self, v: ::std::vec::Vec) { + self.balance_id = ::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_balance_id(&mut self) -> &mut ::std::vec::Vec { + if self.balance_id.is_none() { + self.balance_id = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.balance_id.as_mut().unwrap() + } + + // Take field + pub fn take_balance_id(&mut self) -> ::std::vec::Vec { + self.balance_id.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::<_, _>( + "source_account", + |m: &StellarClaimClaimableBalanceOp| { &m.source_account }, + |m: &mut StellarClaimClaimableBalanceOp| { &mut m.source_account }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "balance_id", + |m: &StellarClaimClaimableBalanceOp| { &m.balance_id }, + |m: &mut StellarClaimClaimableBalanceOp| { &mut m.balance_id }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarClaimClaimableBalanceOp", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarClaimClaimableBalanceOp { + const NAME: &'static str = "StellarClaimClaimableBalanceOp"; + + fn is_initialized(&self) -> bool { + if self.balance_id.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.source_account = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.balance_id = ::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.source_account.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.balance_id.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.source_account.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.balance_id.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() -> StellarClaimClaimableBalanceOp { + StellarClaimClaimableBalanceOp::new() + } + + fn clear(&mut self) { + self.source_account = ::std::option::Option::None; + self.balance_id = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarClaimClaimableBalanceOp { + static instance: StellarClaimClaimableBalanceOp = StellarClaimClaimableBalanceOp { + source_account: ::std::option::Option::None, + balance_id: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarClaimClaimableBalanceOp { + 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("StellarClaimClaimableBalanceOp").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarClaimClaimableBalanceOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarClaimClaimableBalanceOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarSignedTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StellarSignedTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSignedTx.public_key) + pub public_key: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSignedTx.signature) + pub signature: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarSignedTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StellarSignedTx { + fn default() -> &'a StellarSignedTx { + ::default_instance() + } +} + +impl StellarSignedTx { + pub fn new() -> StellarSignedTx { + ::std::default::Default::default() + } + + // required bytes public_key = 1; + + pub fn public_key(&self) -> &[u8] { + match self.public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_public_key(&mut self) { + self.public_key = ::std::option::Option::None; + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: ::std::vec::Vec) { + self.public_key = ::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_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.public_key.is_none() { + self.public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> ::std::vec::Vec { + self.public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes signature = 2; + + pub fn signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::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_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.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::<_, _>( + "public_key", + |m: &StellarSignedTx| { &m.public_key }, + |m: &mut StellarSignedTx| { &mut m.public_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &StellarSignedTx| { &m.signature }, + |m: &mut StellarSignedTx| { &mut m.signature }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StellarSignedTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StellarSignedTx { + const NAME: &'static str = "StellarSignedTx"; + + fn is_initialized(&self) -> bool { + if self.public_key.is_none() { + return false; + } + if self.signature.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.public_key = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.signature = ::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.public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.signature.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.public_key.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.signature.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() -> StellarSignedTx { + StellarSignedTx::new() + } + + fn clear(&mut self) { + self.public_key = ::std::option::Option::None; + self.signature = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StellarSignedTx { + static instance: StellarSignedTx = StellarSignedTx { + public_key: ::std::option::Option::None, + signature: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StellarSignedTx { + 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("StellarSignedTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StellarSignedTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StellarSignedTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:hw.trezor.messages.stellar.StellarAssetType) +pub enum StellarAssetType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarAssetType.NATIVE) + NATIVE = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarAssetType.ALPHANUM4) + ALPHANUM4 = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarAssetType.ALPHANUM12) + ALPHANUM12 = 2, +} + +impl ::protobuf::Enum for StellarAssetType { + const NAME: &'static str = "StellarAssetType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(StellarAssetType::NATIVE), + 1 => ::std::option::Option::Some(StellarAssetType::ALPHANUM4), + 2 => ::std::option::Option::Some(StellarAssetType::ALPHANUM12), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "NATIVE" => ::std::option::Option::Some(StellarAssetType::NATIVE), + "ALPHANUM4" => ::std::option::Option::Some(StellarAssetType::ALPHANUM4), + "ALPHANUM12" => ::std::option::Option::Some(StellarAssetType::ALPHANUM12), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [StellarAssetType] = &[ + StellarAssetType::NATIVE, + StellarAssetType::ALPHANUM4, + StellarAssetType::ALPHANUM12, + ]; +} + +impl ::protobuf::EnumFull for StellarAssetType { + 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("StellarAssetType").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 StellarAssetType { + fn default() -> Self { + StellarAssetType::NATIVE + } +} + +impl StellarAssetType { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("StellarAssetType") + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x16messages-stellar.proto\x12\x1ahw.trezor.messages.stellar\"|\n\x0cS\ + tellarAsset\x12@\n\x04type\x18\x01\x20\x02(\x0e2,.hw.trezor.messages.ste\ + llar.StellarAssetTypeR\x04type\x12\x12\n\x04code\x18\x02\x20\x01(\tR\x04\ + code\x12\x16\n\x06issuer\x18\x03\x20\x01(\tR\x06issuer\"o\n\x11StellarGe\ + tAddress\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12!\n\x0c\ + show_display\x18\x02\x20\x01(\x08R\x0bshowDisplay\x12\x1a\n\x08chunkify\ + \x18\x03\x20\x01(\x08R\x08chunkify\"*\n\x0eStellarAddress\x12\x18\n\x07a\ + ddress\x18\x01\x20\x02(\tR\x07address\"\xa6\x04\n\rStellarSignTx\x12\x1b\ + \n\taddress_n\x18\x02\x20\x03(\rR\x08addressN\x12-\n\x12network_passphra\ + se\x18\x03\x20\x02(\tR\x11networkPassphrase\x12%\n\x0esource_account\x18\ + \x04\x20\x02(\tR\rsourceAccount\x12\x10\n\x03fee\x18\x05\x20\x02(\rR\x03\ + fee\x12'\n\x0fsequence_number\x18\x06\x20\x02(\x04R\x0esequenceNumber\ + \x12)\n\x10timebounds_start\x18\x08\x20\x02(\rR\x0ftimeboundsStart\x12%\ + \n\x0etimebounds_end\x18\t\x20\x02(\rR\rtimeboundsEnd\x12V\n\tmemo_type\ + \x18\n\x20\x02(\x0e29.hw.trezor.messages.stellar.StellarSignTx.StellarMe\ + moTypeR\x08memoType\x12\x1b\n\tmemo_text\x18\x0b\x20\x01(\tR\x08memoText\ + \x12\x17\n\x07memo_id\x18\x0c\x20\x01(\x04R\x06memoId\x12\x1b\n\tmemo_ha\ + sh\x18\r\x20\x01(\x0cR\x08memoHash\x12%\n\x0enum_operations\x18\x0e\x20\ + \x02(\rR\rnumOperations\"C\n\x0fStellarMemoType\x12\x08\n\x04NONE\x10\0\ + \x12\x08\n\x04TEXT\x10\x01\x12\x06\n\x02ID\x10\x02\x12\x08\n\x04HASH\x10\ + \x03\x12\n\n\x06RETURN\x10\x04\"\x14\n\x12StellarTxOpRequest\"\xc2\x01\n\ + \x10StellarPaymentOp\x12%\n\x0esource_account\x18\x01\x20\x01(\tR\rsourc\ + eAccount\x12/\n\x13destination_account\x18\x02\x20\x02(\tR\x12destinatio\ + nAccount\x12>\n\x05asset\x18\x03\x20\x02(\x0b2(.hw.trezor.messages.stell\ + ar.StellarAssetR\x05asset\x12\x16\n\x06amount\x18\x04\x20\x02(\x12R\x06a\ + mount\"\x8b\x01\n\x16StellarCreateAccountOp\x12%\n\x0esource_account\x18\ + \x01\x20\x01(\tR\rsourceAccount\x12\x1f\n\x0bnew_account\x18\x02\x20\x02\ + (\tR\nnewAccount\x12)\n\x10starting_balance\x18\x03\x20\x02(\x12R\x0fsta\ + rtingBalance\"\xa5\x03\n!StellarPathPaymentStrictReceiveOp\x12%\n\x0esou\ + rce_account\x18\x01\x20\x01(\tR\rsourceAccount\x12G\n\nsend_asset\x18\ + \x02\x20\x02(\x0b2(.hw.trezor.messages.stellar.StellarAssetR\tsendAsset\ + \x12\x19\n\x08send_max\x18\x03\x20\x02(\x12R\x07sendMax\x12/\n\x13destin\ + ation_account\x18\x04\x20\x02(\tR\x12destinationAccount\x12U\n\x11destin\ + ation_asset\x18\x05\x20\x02(\x0b2(.hw.trezor.messages.stellar.StellarAss\ + etR\x10destinationAsset\x12-\n\x12destination_amount\x18\x06\x20\x02(\ + \x12R\x11destinationAmount\x12>\n\x05paths\x18\x07\x20\x03(\x0b2(.hw.tre\ + zor.messages.stellar.StellarAssetR\x05paths\"\xa2\x03\n\x1eStellarPathPa\ + ymentStrictSendOp\x12%\n\x0esource_account\x18\x01\x20\x01(\tR\rsourceAc\ + count\x12G\n\nsend_asset\x18\x02\x20\x02(\x0b2(.hw.trezor.messages.stell\ + ar.StellarAssetR\tsendAsset\x12\x1f\n\x0bsend_amount\x18\x03\x20\x02(\ + \x12R\nsendAmount\x12/\n\x13destination_account\x18\x04\x20\x02(\tR\x12d\ + estinationAccount\x12U\n\x11destination_asset\x18\x05\x20\x02(\x0b2(.hw.\ + trezor.messages.stellar.StellarAssetR\x10destinationAsset\x12'\n\x0fdest\ + ination_min\x18\x06\x20\x02(\x12R\x0edestinationMin\x12>\n\x05paths\x18\ + \x07\x20\x03(\x0b2(.hw.trezor.messages.stellar.StellarAssetR\x05paths\"\ + \xc2\x02\n\x18StellarManageSellOfferOp\x12%\n\x0esource_account\x18\x01\ + \x20\x01(\tR\rsourceAccount\x12M\n\rselling_asset\x18\x02\x20\x02(\x0b2(\ + .hw.trezor.messages.stellar.StellarAssetR\x0csellingAsset\x12K\n\x0cbuyi\ + ng_asset\x18\x03\x20\x02(\x0b2(.hw.trezor.messages.stellar.StellarAssetR\ + \x0bbuyingAsset\x12\x16\n\x06amount\x18\x04\x20\x02(\x12R\x06amount\x12\ + \x17\n\x07price_n\x18\x05\x20\x02(\rR\x06priceN\x12\x17\n\x07price_d\x18\ + \x06\x20\x02(\rR\x06priceD\x12\x19\n\x08offer_id\x18\x07\x20\x02(\x04R\ + \x07offerId\"\xc1\x02\n\x17StellarManageBuyOfferOp\x12%\n\x0esource_acco\ + unt\x18\x01\x20\x01(\tR\rsourceAccount\x12M\n\rselling_asset\x18\x02\x20\ + \x02(\x0b2(.hw.trezor.messages.stellar.StellarAssetR\x0csellingAsset\x12\ + K\n\x0cbuying_asset\x18\x03\x20\x02(\x0b2(.hw.trezor.messages.stellar.St\ + ellarAssetR\x0bbuyingAsset\x12\x16\n\x06amount\x18\x04\x20\x02(\x12R\x06\ + amount\x12\x17\n\x07price_n\x18\x05\x20\x02(\rR\x06priceN\x12\x17\n\x07p\ + rice_d\x18\x06\x20\x02(\rR\x06priceD\x12\x19\n\x08offer_id\x18\x07\x20\ + \x02(\x04R\x07offerId\"\xae\x02\n\x1fStellarCreatePassiveSellOfferOp\x12\ + %\n\x0esource_account\x18\x01\x20\x01(\tR\rsourceAccount\x12M\n\rselling\ + _asset\x18\x02\x20\x02(\x0b2(.hw.trezor.messages.stellar.StellarAssetR\ + \x0csellingAsset\x12K\n\x0cbuying_asset\x18\x03\x20\x02(\x0b2(.hw.trezor\ + .messages.stellar.StellarAssetR\x0bbuyingAsset\x12\x16\n\x06amount\x18\ + \x04\x20\x02(\x12R\x06amount\x12\x17\n\x07price_n\x18\x05\x20\x02(\rR\ + \x06priceN\x12\x17\n\x07price_d\x18\x06\x20\x02(\rR\x06priceD\"\xdd\x04\ + \n\x13StellarSetOptionsOp\x12%\n\x0esource_account\x18\x01\x20\x01(\tR\r\ + sourceAccount\x12B\n\x1dinflation_destination_account\x18\x02\x20\x01(\t\ + R\x1binflationDestinationAccount\x12\x1f\n\x0bclear_flags\x18\x03\x20\ + \x01(\rR\nclearFlags\x12\x1b\n\tset_flags\x18\x04\x20\x01(\rR\x08setFlag\ + s\x12#\n\rmaster_weight\x18\x05\x20\x01(\rR\x0cmasterWeight\x12#\n\rlow_\ + threshold\x18\x06\x20\x01(\rR\x0clowThreshold\x12)\n\x10medium_threshold\ + \x18\x07\x20\x01(\rR\x0fmediumThreshold\x12%\n\x0ehigh_threshold\x18\x08\ + \x20\x01(\rR\rhighThreshold\x12\x1f\n\x0bhome_domain\x18\t\x20\x01(\tR\n\ + homeDomain\x12b\n\x0bsigner_type\x18\n\x20\x01(\x0e2A.hw.trezor.messages\ + .stellar.StellarSetOptionsOp.StellarSignerTypeR\nsignerType\x12\x1d\n\ns\ + igner_key\x18\x0b\x20\x01(\x0cR\tsignerKey\x12#\n\rsigner_weight\x18\x0c\ + \x20\x01(\rR\x0csignerWeight\"8\n\x11StellarSignerType\x12\x0b\n\x07ACCO\ + UNT\x10\0\x12\x0c\n\x08PRE_AUTH\x10\x01\x12\x08\n\x04HASH\x10\x02\"\x93\ + \x01\n\x14StellarChangeTrustOp\x12%\n\x0esource_account\x18\x01\x20\x01(\ + \tR\rsourceAccount\x12>\n\x05asset\x18\x02\x20\x02(\x0b2(.hw.trezor.mess\ + ages.stellar.StellarAssetR\x05asset\x12\x14\n\x05limit\x18\x03\x20\x02(\ + \x04R\x05limit\"\xf6\x01\n\x13StellarAllowTrustOp\x12%\n\x0esource_accou\ + nt\x18\x01\x20\x01(\tR\rsourceAccount\x12'\n\x0ftrusted_account\x18\x02\ + \x20\x02(\tR\x0etrustedAccount\x12K\n\nasset_type\x18\x03\x20\x02(\x0e2,\ + .hw.trezor.messages.stellar.StellarAssetTypeR\tassetType\x12\x1d\n\nasse\ + t_code\x18\x04\x20\x01(\tR\tassetCode\x12#\n\ris_authorized\x18\x05\x20\ + \x02(\x08R\x0cisAuthorized\"o\n\x15StellarAccountMergeOp\x12%\n\x0esourc\ + e_account\x18\x01\x20\x01(\tR\rsourceAccount\x12/\n\x13destination_accou\ + nt\x18\x02\x20\x02(\tR\x12destinationAccount\"d\n\x13StellarManageDataOp\ + \x12%\n\x0esource_account\x18\x01\x20\x01(\tR\rsourceAccount\x12\x10\n\ + \x03key\x18\x02\x20\x02(\tR\x03key\x12\x14\n\x05value\x18\x03\x20\x01(\ + \x0cR\x05value\"W\n\x15StellarBumpSequenceOp\x12%\n\x0esource_account\ + \x18\x01\x20\x01(\tR\rsourceAccount\x12\x17\n\x07bump_to\x18\x02\x20\x02\ + (\x04R\x06bumpTo\"f\n\x1eStellarClaimClaimableBalanceOp\x12%\n\x0esource\ + _account\x18\x01\x20\x01(\tR\rsourceAccount\x12\x1d\n\nbalance_id\x18\ + \x02\x20\x02(\x0cR\tbalanceId\"N\n\x0fStellarSignedTx\x12\x1d\n\npublic_\ + key\x18\x01\x20\x02(\x0cR\tpublicKey\x12\x1c\n\tsignature\x18\x02\x20\ + \x02(\x0cR\tsignature*=\n\x10StellarAssetType\x12\n\n\x06NATIVE\x10\0\ + \x12\r\n\tALPHANUM4\x10\x01\x12\x0e\n\nALPHANUM12\x10\x02B;\n#com.satosh\ + ilabs.trezor.lib.protobufB\x14TrezorMessageStellar\ +"; + +/// `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(20); + messages.push(StellarAsset::generated_message_descriptor_data()); + messages.push(StellarGetAddress::generated_message_descriptor_data()); + messages.push(StellarAddress::generated_message_descriptor_data()); + messages.push(StellarSignTx::generated_message_descriptor_data()); + messages.push(StellarTxOpRequest::generated_message_descriptor_data()); + messages.push(StellarPaymentOp::generated_message_descriptor_data()); + messages.push(StellarCreateAccountOp::generated_message_descriptor_data()); + messages.push(StellarPathPaymentStrictReceiveOp::generated_message_descriptor_data()); + messages.push(StellarPathPaymentStrictSendOp::generated_message_descriptor_data()); + messages.push(StellarManageSellOfferOp::generated_message_descriptor_data()); + messages.push(StellarManageBuyOfferOp::generated_message_descriptor_data()); + messages.push(StellarCreatePassiveSellOfferOp::generated_message_descriptor_data()); + messages.push(StellarSetOptionsOp::generated_message_descriptor_data()); + messages.push(StellarChangeTrustOp::generated_message_descriptor_data()); + messages.push(StellarAllowTrustOp::generated_message_descriptor_data()); + messages.push(StellarAccountMergeOp::generated_message_descriptor_data()); + messages.push(StellarManageDataOp::generated_message_descriptor_data()); + messages.push(StellarBumpSequenceOp::generated_message_descriptor_data()); + messages.push(StellarClaimClaimableBalanceOp::generated_message_descriptor_data()); + messages.push(StellarSignedTx::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(3); + enums.push(StellarAssetType::generated_enum_descriptor_data()); + enums.push(stellar_sign_tx::StellarMemoType::generated_enum_descriptor_data()); + enums.push(stellar_set_options_op::StellarSignerType::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_tezos.rs b/wallet/trezor-client/src/protos/generated/messages_tezos.rs new file mode 100644 index 0000000000..772554fe5a --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_tezos.rs @@ -0,0 +1,4584 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-tezos.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.tezos.TezosGetAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TezosGetAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosGetAddress.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosGetAddress.show_display) + pub show_display: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosGetAddress.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.tezos.TezosGetAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TezosGetAddress { + fn default() -> &'a TezosGetAddress { + ::default_instance() + } +} + +impl TezosGetAddress { + pub fn new() -> TezosGetAddress { + ::std::default::Default::default() + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 3; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &TezosGetAddress| { &m.address_n }, + |m: &mut TezosGetAddress| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &TezosGetAddress| { &m.show_display }, + |m: &mut TezosGetAddress| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &TezosGetAddress| { &m.chunkify }, + |m: &mut TezosGetAddress| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TezosGetAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TezosGetAddress { + const NAME: &'static str = "TezosGetAddress"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 24 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.show_display { + os.write_bool(2, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(3, 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() -> TezosGetAddress { + TezosGetAddress::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.show_display = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TezosGetAddress { + static instance: TezosGetAddress = TezosGetAddress { + address_n: ::std::vec::Vec::new(), + show_display: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TezosGetAddress { + 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("TezosGetAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TezosGetAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TezosGetAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.tezos.TezosAddress) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TezosAddress { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosAddress.address) + pub address: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.tezos.TezosAddress.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TezosAddress { + fn default() -> &'a TezosAddress { + ::default_instance() + } +} + +impl TezosAddress { + pub fn new() -> TezosAddress { + ::std::default::Default::default() + } + + // required string address = 1; + + pub fn address(&self) -> &str { + 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::string::String) { + 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::string::String { + if self.address.is_none() { + self.address = ::std::option::Option::Some(::std::string::String::new()); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "address", + |m: &TezosAddress| { &m.address }, + |m: &mut TezosAddress| { &mut m.address }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TezosAddress", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TezosAddress { + const NAME: &'static str = "TezosAddress"; + + fn is_initialized(&self) -> bool { + if self.address.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_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::string_size(1, &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_string(1, 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() -> TezosAddress { + TezosAddress::new() + } + + fn clear(&mut self) { + self.address = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TezosAddress { + static instance: TezosAddress = TezosAddress { + address: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TezosAddress { + 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("TezosAddress").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TezosAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TezosAddress { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.tezos.TezosGetPublicKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TezosGetPublicKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosGetPublicKey.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosGetPublicKey.show_display) + pub show_display: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosGetPublicKey.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.tezos.TezosGetPublicKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TezosGetPublicKey { + fn default() -> &'a TezosGetPublicKey { + ::default_instance() + } +} + +impl TezosGetPublicKey { + pub fn new() -> TezosGetPublicKey { + ::std::default::Default::default() + } + + // optional bool show_display = 2; + + pub fn show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + // optional bool chunkify = 3; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &TezosGetPublicKey| { &m.address_n }, + |m: &mut TezosGetPublicKey| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "show_display", + |m: &TezosGetPublicKey| { &m.show_display }, + |m: &mut TezosGetPublicKey| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &TezosGetPublicKey| { &m.chunkify }, + |m: &mut TezosGetPublicKey| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TezosGetPublicKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TezosGetPublicKey { + const NAME: &'static str = "TezosGetPublicKey"; + + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 16 => { + self.show_display = ::std::option::Option::Some(is.read_bool()?); + }, + 24 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.show_display { + my_size += 1 + 1; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.show_display { + os.write_bool(2, v)?; + } + if let Some(v) = self.chunkify { + os.write_bool(3, 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() -> TezosGetPublicKey { + TezosGetPublicKey::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.show_display = ::std::option::Option::None; + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TezosGetPublicKey { + static instance: TezosGetPublicKey = TezosGetPublicKey { + address_n: ::std::vec::Vec::new(), + show_display: ::std::option::Option::None, + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TezosGetPublicKey { + 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("TezosGetPublicKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TezosGetPublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TezosGetPublicKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.tezos.TezosPublicKey) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TezosPublicKey { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosPublicKey.public_key) + pub public_key: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.tezos.TezosPublicKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TezosPublicKey { + fn default() -> &'a TezosPublicKey { + ::default_instance() + } +} + +impl TezosPublicKey { + pub fn new() -> TezosPublicKey { + ::std::default::Default::default() + } + + // required string public_key = 1; + + pub fn public_key(&self) -> &str { + match self.public_key.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_public_key(&mut self) { + self.public_key = ::std::option::Option::None; + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: ::std::string::String) { + self.public_key = ::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_public_key(&mut self) -> &mut ::std::string::String { + if self.public_key.is_none() { + self.public_key = ::std::option::Option::Some(::std::string::String::new()); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> ::std::string::String { + self.public_key.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "public_key", + |m: &TezosPublicKey| { &m.public_key }, + |m: &mut TezosPublicKey| { &mut m.public_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TezosPublicKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TezosPublicKey { + const NAME: &'static str = "TezosPublicKey"; + + fn is_initialized(&self) -> bool { + if self.public_key.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.public_key = ::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.public_key.as_ref() { + my_size += ::protobuf::rt::string_size(1, &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.public_key.as_ref() { + os.write_string(1, 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() -> TezosPublicKey { + TezosPublicKey::new() + } + + fn clear(&mut self) { + self.public_key = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TezosPublicKey { + static instance: TezosPublicKey = TezosPublicKey { + public_key: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TezosPublicKey { + 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("TezosPublicKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TezosPublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TezosPublicKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.tezos.TezosSignTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TezosSignTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.address_n) + pub address_n: ::std::vec::Vec, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.branch) + pub branch: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.reveal) + pub reveal: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.transaction) + pub transaction: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.origination) + pub origination: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.delegation) + pub delegation: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.proposal) + pub proposal: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.ballot) + pub ballot: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.chunkify) + pub chunkify: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.tezos.TezosSignTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TezosSignTx { + fn default() -> &'a TezosSignTx { + ::default_instance() + } +} + +impl TezosSignTx { + pub fn new() -> TezosSignTx { + ::std::default::Default::default() + } + + // required bytes branch = 2; + + pub fn branch(&self) -> &[u8] { + match self.branch.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_branch(&mut self) { + self.branch = ::std::option::Option::None; + } + + pub fn has_branch(&self) -> bool { + self.branch.is_some() + } + + // Param is passed by value, moved + pub fn set_branch(&mut self, v: ::std::vec::Vec) { + self.branch = ::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_branch(&mut self) -> &mut ::std::vec::Vec { + if self.branch.is_none() { + self.branch = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.branch.as_mut().unwrap() + } + + // Take field + pub fn take_branch(&mut self) -> ::std::vec::Vec { + self.branch.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool chunkify = 9; + + pub fn chunkify(&self) -> bool { + self.chunkify.unwrap_or(false) + } + + pub fn clear_chunkify(&mut self) { + self.chunkify = ::std::option::Option::None; + } + + pub fn has_chunkify(&self) -> bool { + self.chunkify.is_some() + } + + // Param is passed by value, moved + pub fn set_chunkify(&mut self, v: bool) { + self.chunkify = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(9); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "address_n", + |m: &TezosSignTx| { &m.address_n }, + |m: &mut TezosSignTx| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "branch", + |m: &TezosSignTx| { &m.branch }, + |m: &mut TezosSignTx| { &mut m.branch }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, tezos_sign_tx::TezosRevealOp>( + "reveal", + |m: &TezosSignTx| { &m.reveal }, + |m: &mut TezosSignTx| { &mut m.reveal }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, tezos_sign_tx::TezosTransactionOp>( + "transaction", + |m: &TezosSignTx| { &m.transaction }, + |m: &mut TezosSignTx| { &mut m.transaction }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, tezos_sign_tx::TezosOriginationOp>( + "origination", + |m: &TezosSignTx| { &m.origination }, + |m: &mut TezosSignTx| { &mut m.origination }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, tezos_sign_tx::TezosDelegationOp>( + "delegation", + |m: &TezosSignTx| { &m.delegation }, + |m: &mut TezosSignTx| { &mut m.delegation }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, tezos_sign_tx::TezosProposalOp>( + "proposal", + |m: &TezosSignTx| { &m.proposal }, + |m: &mut TezosSignTx| { &mut m.proposal }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, tezos_sign_tx::TezosBallotOp>( + "ballot", + |m: &TezosSignTx| { &m.ballot }, + |m: &mut TezosSignTx| { &mut m.ballot }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "chunkify", + |m: &TezosSignTx| { &m.chunkify }, + |m: &mut TezosSignTx| { &mut m.chunkify }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TezosSignTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TezosSignTx { + const NAME: &'static str = "TezosSignTx"; + + fn is_initialized(&self) -> bool { + if self.branch.is_none() { + return false; + } + for v in &self.reveal { + if !v.is_initialized() { + return false; + } + }; + for v in &self.transaction { + if !v.is_initialized() { + return false; + } + }; + for v in &self.origination { + if !v.is_initialized() { + return false; + } + }; + for v in &self.delegation { + if !v.is_initialized() { + return false; + } + }; + for v in &self.proposal { + if !v.is_initialized() { + return false; + } + }; + for v in &self.ballot { + if !v.is_initialized() { + 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 => { + is.read_repeated_packed_uint32_into(&mut self.address_n)?; + }, + 8 => { + self.address_n.push(is.read_uint32()?); + }, + 18 => { + self.branch = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.reveal)?; + }, + 34 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.transaction)?; + }, + 42 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.origination)?; + }, + 50 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.delegation)?; + }, + 58 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.proposal)?; + }, + 66 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.ballot)?; + }, + 72 => { + self.chunkify = ::std::option::Option::Some(is.read_bool()?); + }, + 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; + for value in &self.address_n { + my_size += ::protobuf::rt::uint32_size(1, *value); + }; + if let Some(v) = self.branch.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.reveal.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.transaction.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.origination.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.delegation.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.proposal.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.ballot.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.chunkify { + my_size += 1 + 1; + } + 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<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(v) = self.branch.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.reveal.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.transaction.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + } + if let Some(v) = self.origination.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + } + if let Some(v) = self.delegation.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(6, v, os)?; + } + if let Some(v) = self.proposal.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(7, v, os)?; + } + if let Some(v) = self.ballot.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(8, v, os)?; + } + if let Some(v) = self.chunkify { + os.write_bool(9, 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() -> TezosSignTx { + TezosSignTx::new() + } + + fn clear(&mut self) { + self.address_n.clear(); + self.branch = ::std::option::Option::None; + self.reveal.clear(); + self.transaction.clear(); + self.origination.clear(); + self.delegation.clear(); + self.proposal.clear(); + self.ballot.clear(); + self.chunkify = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TezosSignTx { + static instance: TezosSignTx = TezosSignTx { + address_n: ::std::vec::Vec::new(), + branch: ::std::option::Option::None, + reveal: ::protobuf::MessageField::none(), + transaction: ::protobuf::MessageField::none(), + origination: ::protobuf::MessageField::none(), + delegation: ::protobuf::MessageField::none(), + proposal: ::protobuf::MessageField::none(), + ballot: ::protobuf::MessageField::none(), + chunkify: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TezosSignTx { + 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("TezosSignTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TezosSignTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TezosSignTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `TezosSignTx` +pub mod tezos_sign_tx { + // @@protoc_insertion_point(message:hw.trezor.messages.tezos.TezosSignTx.TezosContractID) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TezosContractID { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosContractID.tag) + pub tag: ::std::option::Option<::protobuf::EnumOrUnknown>, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosContractID.hash) + pub hash: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.tezos.TezosSignTx.TezosContractID.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TezosContractID { + fn default() -> &'a TezosContractID { + ::default_instance() + } + } + + impl TezosContractID { + pub fn new() -> TezosContractID { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.tezos.TezosSignTx.TezosContractID.TezosContractType tag = 1; + + pub fn tag(&self) -> tezos_contract_id::TezosContractType { + match self.tag { + Some(e) => e.enum_value_or(tezos_contract_id::TezosContractType::Implicit), + None => tezos_contract_id::TezosContractType::Implicit, + } + } + + pub fn clear_tag(&mut self) { + self.tag = ::std::option::Option::None; + } + + pub fn has_tag(&self) -> bool { + self.tag.is_some() + } + + // Param is passed by value, moved + pub fn set_tag(&mut self, v: tezos_contract_id::TezosContractType) { + self.tag = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + // required bytes hash = 2; + + pub fn hash(&self) -> &[u8] { + match self.hash.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_hash(&mut self) { + self.hash = ::std::option::Option::None; + } + + pub fn has_hash(&self) -> bool { + self.hash.is_some() + } + + // Param is passed by value, moved + pub fn set_hash(&mut self, v: ::std::vec::Vec) { + self.hash = ::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_hash(&mut self) -> &mut ::std::vec::Vec { + if self.hash.is_none() { + self.hash = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.hash.as_mut().unwrap() + } + + // Take field + pub fn take_hash(&mut self) -> ::std::vec::Vec { + self.hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) 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::<_, _>( + "tag", + |m: &TezosContractID| { &m.tag }, + |m: &mut TezosContractID| { &mut m.tag }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "hash", + |m: &TezosContractID| { &m.hash }, + |m: &mut TezosContractID| { &mut m.hash }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TezosSignTx.TezosContractID", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TezosContractID { + const NAME: &'static str = "TezosContractID"; + + fn is_initialized(&self) -> bool { + if self.tag.is_none() { + return false; + } + if self.hash.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.tag = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 18 => { + self.hash = ::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.tag { + my_size += ::protobuf::rt::int32_size(1, v.value()); + } + if let Some(v) = self.hash.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.tag { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?; + } + if let Some(v) = self.hash.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() -> TezosContractID { + TezosContractID::new() + } + + fn clear(&mut self) { + self.tag = ::std::option::Option::None; + self.hash = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TezosContractID { + static instance: TezosContractID = TezosContractID { + tag: ::std::option::Option::None, + hash: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TezosContractID { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TezosSignTx.TezosContractID").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TezosContractID { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TezosContractID { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + /// Nested message and enums of message `TezosContractID` + pub mod tezos_contract_id { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.tezos.TezosSignTx.TezosContractID.TezosContractType) + pub enum TezosContractType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.tezos.TezosSignTx.TezosContractID.TezosContractType.Implicit) + Implicit = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.tezos.TezosSignTx.TezosContractID.TezosContractType.Originated) + Originated = 1, + } + + impl ::protobuf::Enum for TezosContractType { + const NAME: &'static str = "TezosContractType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(TezosContractType::Implicit), + 1 => ::std::option::Option::Some(TezosContractType::Originated), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "Implicit" => ::std::option::Option::Some(TezosContractType::Implicit), + "Originated" => ::std::option::Option::Some(TezosContractType::Originated), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [TezosContractType] = &[ + TezosContractType::Implicit, + TezosContractType::Originated, + ]; + } + + impl ::protobuf::EnumFull for TezosContractType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::super::file_descriptor().enum_by_package_relative_name("TezosSignTx.TezosContractID.TezosContractType").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 TezosContractType { + fn default() -> Self { + TezosContractType::Implicit + } + } + + impl TezosContractType { + pub(in super::super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("TezosSignTx.TezosContractID.TezosContractType") + } + } + } + + // @@protoc_insertion_point(message:hw.trezor.messages.tezos.TezosSignTx.TezosRevealOp) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TezosRevealOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosRevealOp.source) + pub source: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosRevealOp.fee) + pub fee: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosRevealOp.counter) + pub counter: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosRevealOp.gas_limit) + pub gas_limit: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosRevealOp.storage_limit) + pub storage_limit: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosRevealOp.public_key) + pub public_key: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.tezos.TezosSignTx.TezosRevealOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TezosRevealOp { + fn default() -> &'a TezosRevealOp { + ::default_instance() + } + } + + impl TezosRevealOp { + pub fn new() -> TezosRevealOp { + ::std::default::Default::default() + } + + // required bytes source = 7; + + pub fn source(&self) -> &[u8] { + match self.source.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_source(&mut self) { + self.source = ::std::option::Option::None; + } + + pub fn has_source(&self) -> bool { + self.source.is_some() + } + + // Param is passed by value, moved + pub fn set_source(&mut self, v: ::std::vec::Vec) { + self.source = ::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_source(&mut self) -> &mut ::std::vec::Vec { + if self.source.is_none() { + self.source = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.source.as_mut().unwrap() + } + + // Take field + pub fn take_source(&mut self) -> ::std::vec::Vec { + self.source.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint64 fee = 2; + + pub fn fee(&self) -> u64 { + self.fee.unwrap_or(0) + } + + pub fn clear_fee(&mut self) { + self.fee = ::std::option::Option::None; + } + + pub fn has_fee(&self) -> bool { + self.fee.is_some() + } + + // Param is passed by value, moved + pub fn set_fee(&mut self, v: u64) { + self.fee = ::std::option::Option::Some(v); + } + + // required uint64 counter = 3; + + pub fn counter(&self) -> u64 { + self.counter.unwrap_or(0) + } + + pub fn clear_counter(&mut self) { + self.counter = ::std::option::Option::None; + } + + pub fn has_counter(&self) -> bool { + self.counter.is_some() + } + + // Param is passed by value, moved + pub fn set_counter(&mut self, v: u64) { + self.counter = ::std::option::Option::Some(v); + } + + // required uint64 gas_limit = 4; + + pub fn gas_limit(&self) -> u64 { + self.gas_limit.unwrap_or(0) + } + + pub fn clear_gas_limit(&mut self) { + self.gas_limit = ::std::option::Option::None; + } + + pub fn has_gas_limit(&self) -> bool { + self.gas_limit.is_some() + } + + // Param is passed by value, moved + pub fn set_gas_limit(&mut self, v: u64) { + self.gas_limit = ::std::option::Option::Some(v); + } + + // required uint64 storage_limit = 5; + + pub fn storage_limit(&self) -> u64 { + self.storage_limit.unwrap_or(0) + } + + pub fn clear_storage_limit(&mut self) { + self.storage_limit = ::std::option::Option::None; + } + + pub fn has_storage_limit(&self) -> bool { + self.storage_limit.is_some() + } + + // Param is passed by value, moved + pub fn set_storage_limit(&mut self, v: u64) { + self.storage_limit = ::std::option::Option::Some(v); + } + + // required bytes public_key = 6; + + pub fn public_key(&self) -> &[u8] { + match self.public_key.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_public_key(&mut self) { + self.public_key = ::std::option::Option::None; + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: ::std::vec::Vec) { + self.public_key = ::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_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.public_key.is_none() { + self.public_key = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> ::std::vec::Vec { + self.public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "source", + |m: &TezosRevealOp| { &m.source }, + |m: &mut TezosRevealOp| { &mut m.source }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fee", + |m: &TezosRevealOp| { &m.fee }, + |m: &mut TezosRevealOp| { &mut m.fee }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "counter", + |m: &TezosRevealOp| { &m.counter }, + |m: &mut TezosRevealOp| { &mut m.counter }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "gas_limit", + |m: &TezosRevealOp| { &m.gas_limit }, + |m: &mut TezosRevealOp| { &mut m.gas_limit }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "storage_limit", + |m: &TezosRevealOp| { &m.storage_limit }, + |m: &mut TezosRevealOp| { &mut m.storage_limit }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "public_key", + |m: &TezosRevealOp| { &m.public_key }, + |m: &mut TezosRevealOp| { &mut m.public_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TezosSignTx.TezosRevealOp", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TezosRevealOp { + const NAME: &'static str = "TezosRevealOp"; + + fn is_initialized(&self) -> bool { + if self.source.is_none() { + return false; + } + if self.fee.is_none() { + return false; + } + if self.counter.is_none() { + return false; + } + if self.gas_limit.is_none() { + return false; + } + if self.storage_limit.is_none() { + return false; + } + if self.public_key.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 { + 58 => { + self.source = ::std::option::Option::Some(is.read_bytes()?); + }, + 16 => { + self.fee = ::std::option::Option::Some(is.read_uint64()?); + }, + 24 => { + self.counter = ::std::option::Option::Some(is.read_uint64()?); + }, + 32 => { + self.gas_limit = ::std::option::Option::Some(is.read_uint64()?); + }, + 40 => { + self.storage_limit = ::std::option::Option::Some(is.read_uint64()?); + }, + 50 => { + self.public_key = ::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.source.as_ref() { + my_size += ::protobuf::rt::bytes_size(7, &v); + } + if let Some(v) = self.fee { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.counter { + my_size += ::protobuf::rt::uint64_size(3, v); + } + if let Some(v) = self.gas_limit { + my_size += ::protobuf::rt::uint64_size(4, v); + } + if let Some(v) = self.storage_limit { + my_size += ::protobuf::rt::uint64_size(5, v); + } + if let Some(v) = self.public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &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.source.as_ref() { + os.write_bytes(7, v)?; + } + if let Some(v) = self.fee { + os.write_uint64(2, v)?; + } + if let Some(v) = self.counter { + os.write_uint64(3, v)?; + } + if let Some(v) = self.gas_limit { + os.write_uint64(4, v)?; + } + if let Some(v) = self.storage_limit { + os.write_uint64(5, v)?; + } + if let Some(v) = self.public_key.as_ref() { + os.write_bytes(6, 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() -> TezosRevealOp { + TezosRevealOp::new() + } + + fn clear(&mut self) { + self.source = ::std::option::Option::None; + self.fee = ::std::option::Option::None; + self.counter = ::std::option::Option::None; + self.gas_limit = ::std::option::Option::None; + self.storage_limit = ::std::option::Option::None; + self.public_key = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TezosRevealOp { + static instance: TezosRevealOp = TezosRevealOp { + source: ::std::option::Option::None, + fee: ::std::option::Option::None, + counter: ::std::option::Option::None, + gas_limit: ::std::option::Option::None, + storage_limit: ::std::option::Option::None, + public_key: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TezosRevealOp { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TezosSignTx.TezosRevealOp").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TezosRevealOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TezosRevealOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TezosTransactionOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.source) + pub source: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.fee) + pub fee: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.counter) + pub counter: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.gas_limit) + pub gas_limit: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.storage_limit) + pub storage_limit: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.amount) + pub amount: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.destination) + pub destination: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.parameters) + pub parameters: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.parameters_manager) + pub parameters_manager: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TezosTransactionOp { + fn default() -> &'a TezosTransactionOp { + ::default_instance() + } + } + + impl TezosTransactionOp { + pub fn new() -> TezosTransactionOp { + ::std::default::Default::default() + } + + // required bytes source = 9; + + pub fn source(&self) -> &[u8] { + match self.source.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_source(&mut self) { + self.source = ::std::option::Option::None; + } + + pub fn has_source(&self) -> bool { + self.source.is_some() + } + + // Param is passed by value, moved + pub fn set_source(&mut self, v: ::std::vec::Vec) { + self.source = ::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_source(&mut self) -> &mut ::std::vec::Vec { + if self.source.is_none() { + self.source = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.source.as_mut().unwrap() + } + + // Take field + pub fn take_source(&mut self) -> ::std::vec::Vec { + self.source.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint64 fee = 2; + + pub fn fee(&self) -> u64 { + self.fee.unwrap_or(0) + } + + pub fn clear_fee(&mut self) { + self.fee = ::std::option::Option::None; + } + + pub fn has_fee(&self) -> bool { + self.fee.is_some() + } + + // Param is passed by value, moved + pub fn set_fee(&mut self, v: u64) { + self.fee = ::std::option::Option::Some(v); + } + + // required uint64 counter = 3; + + pub fn counter(&self) -> u64 { + self.counter.unwrap_or(0) + } + + pub fn clear_counter(&mut self) { + self.counter = ::std::option::Option::None; + } + + pub fn has_counter(&self) -> bool { + self.counter.is_some() + } + + // Param is passed by value, moved + pub fn set_counter(&mut self, v: u64) { + self.counter = ::std::option::Option::Some(v); + } + + // required uint64 gas_limit = 4; + + pub fn gas_limit(&self) -> u64 { + self.gas_limit.unwrap_or(0) + } + + pub fn clear_gas_limit(&mut self) { + self.gas_limit = ::std::option::Option::None; + } + + pub fn has_gas_limit(&self) -> bool { + self.gas_limit.is_some() + } + + // Param is passed by value, moved + pub fn set_gas_limit(&mut self, v: u64) { + self.gas_limit = ::std::option::Option::Some(v); + } + + // required uint64 storage_limit = 5; + + pub fn storage_limit(&self) -> u64 { + self.storage_limit.unwrap_or(0) + } + + pub fn clear_storage_limit(&mut self) { + self.storage_limit = ::std::option::Option::None; + } + + pub fn has_storage_limit(&self) -> bool { + self.storage_limit.is_some() + } + + // Param is passed by value, moved + pub fn set_storage_limit(&mut self, v: u64) { + self.storage_limit = ::std::option::Option::Some(v); + } + + // required uint64 amount = 6; + + pub fn amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + // optional bytes parameters = 8; + + pub fn parameters(&self) -> &[u8] { + match self.parameters.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_parameters(&mut self) { + self.parameters = ::std::option::Option::None; + } + + pub fn has_parameters(&self) -> bool { + self.parameters.is_some() + } + + // Param is passed by value, moved + pub fn set_parameters(&mut self, v: ::std::vec::Vec) { + self.parameters = ::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_parameters(&mut self) -> &mut ::std::vec::Vec { + if self.parameters.is_none() { + self.parameters = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.parameters.as_mut().unwrap() + } + + // Take field + pub fn take_parameters(&mut self) -> ::std::vec::Vec { + self.parameters.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(9); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "source", + |m: &TezosTransactionOp| { &m.source }, + |m: &mut TezosTransactionOp| { &mut m.source }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fee", + |m: &TezosTransactionOp| { &m.fee }, + |m: &mut TezosTransactionOp| { &mut m.fee }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "counter", + |m: &TezosTransactionOp| { &m.counter }, + |m: &mut TezosTransactionOp| { &mut m.counter }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "gas_limit", + |m: &TezosTransactionOp| { &m.gas_limit }, + |m: &mut TezosTransactionOp| { &mut m.gas_limit }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "storage_limit", + |m: &TezosTransactionOp| { &m.storage_limit }, + |m: &mut TezosTransactionOp| { &mut m.storage_limit }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &TezosTransactionOp| { &m.amount }, + |m: &mut TezosTransactionOp| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, TezosContractID>( + "destination", + |m: &TezosTransactionOp| { &m.destination }, + |m: &mut TezosTransactionOp| { &mut m.destination }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "parameters", + |m: &TezosTransactionOp| { &m.parameters }, + |m: &mut TezosTransactionOp| { &mut m.parameters }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, tezos_transaction_op::TezosParametersManager>( + "parameters_manager", + |m: &TezosTransactionOp| { &m.parameters_manager }, + |m: &mut TezosTransactionOp| { &mut m.parameters_manager }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TezosSignTx.TezosTransactionOp", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TezosTransactionOp { + const NAME: &'static str = "TezosTransactionOp"; + + fn is_initialized(&self) -> bool { + if self.source.is_none() { + return false; + } + if self.fee.is_none() { + return false; + } + if self.counter.is_none() { + return false; + } + if self.gas_limit.is_none() { + return false; + } + if self.storage_limit.is_none() { + return false; + } + if self.amount.is_none() { + return false; + } + if self.destination.is_none() { + return false; + } + for v in &self.destination { + if !v.is_initialized() { + return false; + } + }; + for v in &self.parameters_manager { + if !v.is_initialized() { + 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 { + 74 => { + self.source = ::std::option::Option::Some(is.read_bytes()?); + }, + 16 => { + self.fee = ::std::option::Option::Some(is.read_uint64()?); + }, + 24 => { + self.counter = ::std::option::Option::Some(is.read_uint64()?); + }, + 32 => { + self.gas_limit = ::std::option::Option::Some(is.read_uint64()?); + }, + 40 => { + self.storage_limit = ::std::option::Option::Some(is.read_uint64()?); + }, + 48 => { + self.amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 58 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.destination)?; + }, + 66 => { + self.parameters = ::std::option::Option::Some(is.read_bytes()?); + }, + 82 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.parameters_manager)?; + }, + 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.source.as_ref() { + my_size += ::protobuf::rt::bytes_size(9, &v); + } + if let Some(v) = self.fee { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.counter { + my_size += ::protobuf::rt::uint64_size(3, v); + } + if let Some(v) = self.gas_limit { + my_size += ::protobuf::rt::uint64_size(4, v); + } + if let Some(v) = self.storage_limit { + my_size += ::protobuf::rt::uint64_size(5, v); + } + if let Some(v) = self.amount { + my_size += ::protobuf::rt::uint64_size(6, v); + } + if let Some(v) = self.destination.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.parameters.as_ref() { + my_size += ::protobuf::rt::bytes_size(8, &v); + } + if let Some(v) = self.parameters_manager.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.source.as_ref() { + os.write_bytes(9, v)?; + } + if let Some(v) = self.fee { + os.write_uint64(2, v)?; + } + if let Some(v) = self.counter { + os.write_uint64(3, v)?; + } + if let Some(v) = self.gas_limit { + os.write_uint64(4, v)?; + } + if let Some(v) = self.storage_limit { + os.write_uint64(5, v)?; + } + if let Some(v) = self.amount { + os.write_uint64(6, v)?; + } + if let Some(v) = self.destination.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(7, v, os)?; + } + if let Some(v) = self.parameters.as_ref() { + os.write_bytes(8, v)?; + } + if let Some(v) = self.parameters_manager.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(10, v, os)?; + } + 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() -> TezosTransactionOp { + TezosTransactionOp::new() + } + + fn clear(&mut self) { + self.source = ::std::option::Option::None; + self.fee = ::std::option::Option::None; + self.counter = ::std::option::Option::None; + self.gas_limit = ::std::option::Option::None; + self.storage_limit = ::std::option::Option::None; + self.amount = ::std::option::Option::None; + self.destination.clear(); + self.parameters = ::std::option::Option::None; + self.parameters_manager.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static TezosTransactionOp { + static instance: TezosTransactionOp = TezosTransactionOp { + source: ::std::option::Option::None, + fee: ::std::option::Option::None, + counter: ::std::option::Option::None, + gas_limit: ::std::option::Option::None, + storage_limit: ::std::option::Option::None, + amount: ::std::option::Option::None, + destination: ::protobuf::MessageField::none(), + parameters: ::std::option::Option::None, + parameters_manager: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TezosTransactionOp { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TezosSignTx.TezosTransactionOp").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TezosTransactionOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TezosTransactionOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + /// Nested message and enums of message `TezosTransactionOp` + pub mod tezos_transaction_op { + // @@protoc_insertion_point(message:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.TezosParametersManager) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TezosParametersManager { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.TezosParametersManager.set_delegate) + pub set_delegate: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.TezosParametersManager.cancel_delegate) + pub cancel_delegate: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.TezosParametersManager.transfer) + pub transfer: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.TezosParametersManager.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TezosParametersManager { + fn default() -> &'a TezosParametersManager { + ::default_instance() + } + } + + impl TezosParametersManager { + pub fn new() -> TezosParametersManager { + ::std::default::Default::default() + } + + // optional bytes set_delegate = 1; + + pub fn set_delegate(&self) -> &[u8] { + match self.set_delegate.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_set_delegate(&mut self) { + self.set_delegate = ::std::option::Option::None; + } + + pub fn has_set_delegate(&self) -> bool { + self.set_delegate.is_some() + } + + // Param is passed by value, moved + pub fn set_set_delegate(&mut self, v: ::std::vec::Vec) { + self.set_delegate = ::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_set_delegate(&mut self) -> &mut ::std::vec::Vec { + if self.set_delegate.is_none() { + self.set_delegate = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.set_delegate.as_mut().unwrap() + } + + // Take field + pub fn take_set_delegate(&mut self) -> ::std::vec::Vec { + self.set_delegate.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool cancel_delegate = 2; + + pub fn cancel_delegate(&self) -> bool { + self.cancel_delegate.unwrap_or(false) + } + + pub fn clear_cancel_delegate(&mut self) { + self.cancel_delegate = ::std::option::Option::None; + } + + pub fn has_cancel_delegate(&self) -> bool { + self.cancel_delegate.is_some() + } + + // Param is passed by value, moved + pub fn set_cancel_delegate(&mut self, v: bool) { + self.cancel_delegate = ::std::option::Option::Some(v); + } + + pub(in super::super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "set_delegate", + |m: &TezosParametersManager| { &m.set_delegate }, + |m: &mut TezosParametersManager| { &mut m.set_delegate }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "cancel_delegate", + |m: &TezosParametersManager| { &m.cancel_delegate }, + |m: &mut TezosParametersManager| { &mut m.cancel_delegate }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, tezos_parameters_manager::TezosManagerTransfer>( + "transfer", + |m: &TezosParametersManager| { &m.transfer }, + |m: &mut TezosParametersManager| { &mut m.transfer }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TezosSignTx.TezosTransactionOp.TezosParametersManager", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TezosParametersManager { + const NAME: &'static str = "TezosParametersManager"; + + fn is_initialized(&self) -> bool { + for v in &self.transfer { + if !v.is_initialized() { + 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.set_delegate = ::std::option::Option::Some(is.read_bytes()?); + }, + 16 => { + self.cancel_delegate = ::std::option::Option::Some(is.read_bool()?); + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.transfer)?; + }, + 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.set_delegate.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.cancel_delegate { + my_size += 1 + 1; + } + if let Some(v) = self.transfer.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + 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.set_delegate.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.cancel_delegate { + os.write_bool(2, v)?; + } + if let Some(v) = self.transfer.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + 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() -> TezosParametersManager { + TezosParametersManager::new() + } + + fn clear(&mut self) { + self.set_delegate = ::std::option::Option::None; + self.cancel_delegate = ::std::option::Option::None; + self.transfer.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static TezosParametersManager { + static instance: TezosParametersManager = TezosParametersManager { + set_delegate: ::std::option::Option::None, + cancel_delegate: ::std::option::Option::None, + transfer: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TezosParametersManager { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::super::file_descriptor().message_by_package_relative_name("TezosSignTx.TezosTransactionOp.TezosParametersManager").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TezosParametersManager { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TezosParametersManager { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + /// Nested message and enums of message `TezosParametersManager` + pub mod tezos_parameters_manager { + // @@protoc_insertion_point(message:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.TezosParametersManager.TezosManagerTransfer) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TezosManagerTransfer { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.TezosParametersManager.TezosManagerTransfer.destination) + pub destination: ::protobuf::MessageField, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.TezosParametersManager.TezosManagerTransfer.amount) + pub amount: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.TezosParametersManager.TezosManagerTransfer.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TezosManagerTransfer { + fn default() -> &'a TezosManagerTransfer { + ::default_instance() + } + } + + impl TezosManagerTransfer { + pub fn new() -> TezosManagerTransfer { + ::std::default::Default::default() + } + + // required uint64 amount = 2; + + pub fn amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + pub(in super::super::super) 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_message_field_accessor::<_, super::super::TezosContractID>( + "destination", + |m: &TezosManagerTransfer| { &m.destination }, + |m: &mut TezosManagerTransfer| { &mut m.destination }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "amount", + |m: &TezosManagerTransfer| { &m.amount }, + |m: &mut TezosManagerTransfer| { &mut m.amount }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TezosSignTx.TezosTransactionOp.TezosParametersManager.TezosManagerTransfer", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TezosManagerTransfer { + const NAME: &'static str = "TezosManagerTransfer"; + + fn is_initialized(&self) -> bool { + if self.destination.is_none() { + return false; + } + if self.amount.is_none() { + return false; + } + for v in &self.destination { + if !v.is_initialized() { + 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 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.destination)?; + }, + 16 => { + self.amount = ::std::option::Option::Some(is.read_uint64()?); + }, + 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.destination.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.amount { + my_size += ::protobuf::rt::uint64_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.destination.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.amount { + os.write_uint64(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() -> TezosManagerTransfer { + TezosManagerTransfer::new() + } + + fn clear(&mut self) { + self.destination.clear(); + self.amount = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TezosManagerTransfer { + static instance: TezosManagerTransfer = TezosManagerTransfer { + destination: ::protobuf::MessageField::none(), + amount: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TezosManagerTransfer { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::super::super::file_descriptor().message_by_package_relative_name("TezosSignTx.TezosTransactionOp.TezosParametersManager.TezosManagerTransfer").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TezosManagerTransfer { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TezosManagerTransfer { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + } + } + + // @@protoc_insertion_point(message:hw.trezor.messages.tezos.TezosSignTx.TezosOriginationOp) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TezosOriginationOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosOriginationOp.source) + pub source: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosOriginationOp.fee) + pub fee: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosOriginationOp.counter) + pub counter: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosOriginationOp.gas_limit) + pub gas_limit: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosOriginationOp.storage_limit) + pub storage_limit: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosOriginationOp.manager_pubkey) + pub manager_pubkey: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosOriginationOp.balance) + pub balance: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosOriginationOp.spendable) + pub spendable: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosOriginationOp.delegatable) + pub delegatable: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosOriginationOp.delegate) + pub delegate: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosOriginationOp.script) + pub script: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.tezos.TezosSignTx.TezosOriginationOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TezosOriginationOp { + fn default() -> &'a TezosOriginationOp { + ::default_instance() + } + } + + impl TezosOriginationOp { + pub fn new() -> TezosOriginationOp { + ::std::default::Default::default() + } + + // required bytes source = 12; + + pub fn source(&self) -> &[u8] { + match self.source.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_source(&mut self) { + self.source = ::std::option::Option::None; + } + + pub fn has_source(&self) -> bool { + self.source.is_some() + } + + // Param is passed by value, moved + pub fn set_source(&mut self, v: ::std::vec::Vec) { + self.source = ::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_source(&mut self) -> &mut ::std::vec::Vec { + if self.source.is_none() { + self.source = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.source.as_mut().unwrap() + } + + // Take field + pub fn take_source(&mut self) -> ::std::vec::Vec { + self.source.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint64 fee = 2; + + pub fn fee(&self) -> u64 { + self.fee.unwrap_or(0) + } + + pub fn clear_fee(&mut self) { + self.fee = ::std::option::Option::None; + } + + pub fn has_fee(&self) -> bool { + self.fee.is_some() + } + + // Param is passed by value, moved + pub fn set_fee(&mut self, v: u64) { + self.fee = ::std::option::Option::Some(v); + } + + // required uint64 counter = 3; + + pub fn counter(&self) -> u64 { + self.counter.unwrap_or(0) + } + + pub fn clear_counter(&mut self) { + self.counter = ::std::option::Option::None; + } + + pub fn has_counter(&self) -> bool { + self.counter.is_some() + } + + // Param is passed by value, moved + pub fn set_counter(&mut self, v: u64) { + self.counter = ::std::option::Option::Some(v); + } + + // required uint64 gas_limit = 4; + + pub fn gas_limit(&self) -> u64 { + self.gas_limit.unwrap_or(0) + } + + pub fn clear_gas_limit(&mut self) { + self.gas_limit = ::std::option::Option::None; + } + + pub fn has_gas_limit(&self) -> bool { + self.gas_limit.is_some() + } + + // Param is passed by value, moved + pub fn set_gas_limit(&mut self, v: u64) { + self.gas_limit = ::std::option::Option::Some(v); + } + + // required uint64 storage_limit = 5; + + pub fn storage_limit(&self) -> u64 { + self.storage_limit.unwrap_or(0) + } + + pub fn clear_storage_limit(&mut self) { + self.storage_limit = ::std::option::Option::None; + } + + pub fn has_storage_limit(&self) -> bool { + self.storage_limit.is_some() + } + + // Param is passed by value, moved + pub fn set_storage_limit(&mut self, v: u64) { + self.storage_limit = ::std::option::Option::Some(v); + } + + // optional bytes manager_pubkey = 6; + + pub fn manager_pubkey(&self) -> &[u8] { + match self.manager_pubkey.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_manager_pubkey(&mut self) { + self.manager_pubkey = ::std::option::Option::None; + } + + pub fn has_manager_pubkey(&self) -> bool { + self.manager_pubkey.is_some() + } + + // Param is passed by value, moved + pub fn set_manager_pubkey(&mut self, v: ::std::vec::Vec) { + self.manager_pubkey = ::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_manager_pubkey(&mut self) -> &mut ::std::vec::Vec { + if self.manager_pubkey.is_none() { + self.manager_pubkey = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.manager_pubkey.as_mut().unwrap() + } + + // Take field + pub fn take_manager_pubkey(&mut self) -> ::std::vec::Vec { + self.manager_pubkey.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint64 balance = 7; + + pub fn balance(&self) -> u64 { + self.balance.unwrap_or(0) + } + + pub fn clear_balance(&mut self) { + self.balance = ::std::option::Option::None; + } + + pub fn has_balance(&self) -> bool { + self.balance.is_some() + } + + // Param is passed by value, moved + pub fn set_balance(&mut self, v: u64) { + self.balance = ::std::option::Option::Some(v); + } + + // optional bool spendable = 8; + + pub fn spendable(&self) -> bool { + self.spendable.unwrap_or(false) + } + + pub fn clear_spendable(&mut self) { + self.spendable = ::std::option::Option::None; + } + + pub fn has_spendable(&self) -> bool { + self.spendable.is_some() + } + + // Param is passed by value, moved + pub fn set_spendable(&mut self, v: bool) { + self.spendable = ::std::option::Option::Some(v); + } + + // optional bool delegatable = 9; + + pub fn delegatable(&self) -> bool { + self.delegatable.unwrap_or(false) + } + + pub fn clear_delegatable(&mut self) { + self.delegatable = ::std::option::Option::None; + } + + pub fn has_delegatable(&self) -> bool { + self.delegatable.is_some() + } + + // Param is passed by value, moved + pub fn set_delegatable(&mut self, v: bool) { + self.delegatable = ::std::option::Option::Some(v); + } + + // optional bytes delegate = 10; + + pub fn delegate(&self) -> &[u8] { + match self.delegate.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_delegate(&mut self) { + self.delegate = ::std::option::Option::None; + } + + pub fn has_delegate(&self) -> bool { + self.delegate.is_some() + } + + // Param is passed by value, moved + pub fn set_delegate(&mut self, v: ::std::vec::Vec) { + self.delegate = ::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_delegate(&mut self) -> &mut ::std::vec::Vec { + if self.delegate.is_none() { + self.delegate = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.delegate.as_mut().unwrap() + } + + // Take field + pub fn take_delegate(&mut self) -> ::std::vec::Vec { + self.delegate.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required bytes script = 11; + + pub fn script(&self) -> &[u8] { + match self.script.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_script(&mut self) { + self.script = ::std::option::Option::None; + } + + pub fn has_script(&self) -> bool { + self.script.is_some() + } + + // Param is passed by value, moved + pub fn set_script(&mut self, v: ::std::vec::Vec) { + self.script = ::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_script(&mut self) -> &mut ::std::vec::Vec { + if self.script.is_none() { + self.script = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.script.as_mut().unwrap() + } + + // Take field + pub fn take_script(&mut self) -> ::std::vec::Vec { + self.script.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(11); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "source", + |m: &TezosOriginationOp| { &m.source }, + |m: &mut TezosOriginationOp| { &mut m.source }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fee", + |m: &TezosOriginationOp| { &m.fee }, + |m: &mut TezosOriginationOp| { &mut m.fee }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "counter", + |m: &TezosOriginationOp| { &m.counter }, + |m: &mut TezosOriginationOp| { &mut m.counter }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "gas_limit", + |m: &TezosOriginationOp| { &m.gas_limit }, + |m: &mut TezosOriginationOp| { &mut m.gas_limit }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "storage_limit", + |m: &TezosOriginationOp| { &m.storage_limit }, + |m: &mut TezosOriginationOp| { &mut m.storage_limit }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "manager_pubkey", + |m: &TezosOriginationOp| { &m.manager_pubkey }, + |m: &mut TezosOriginationOp| { &mut m.manager_pubkey }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "balance", + |m: &TezosOriginationOp| { &m.balance }, + |m: &mut TezosOriginationOp| { &mut m.balance }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "spendable", + |m: &TezosOriginationOp| { &m.spendable }, + |m: &mut TezosOriginationOp| { &mut m.spendable }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "delegatable", + |m: &TezosOriginationOp| { &m.delegatable }, + |m: &mut TezosOriginationOp| { &mut m.delegatable }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "delegate", + |m: &TezosOriginationOp| { &m.delegate }, + |m: &mut TezosOriginationOp| { &mut m.delegate }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "script", + |m: &TezosOriginationOp| { &m.script }, + |m: &mut TezosOriginationOp| { &mut m.script }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TezosSignTx.TezosOriginationOp", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TezosOriginationOp { + const NAME: &'static str = "TezosOriginationOp"; + + fn is_initialized(&self) -> bool { + if self.source.is_none() { + return false; + } + if self.fee.is_none() { + return false; + } + if self.counter.is_none() { + return false; + } + if self.gas_limit.is_none() { + return false; + } + if self.storage_limit.is_none() { + return false; + } + if self.balance.is_none() { + return false; + } + if self.script.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 { + 98 => { + self.source = ::std::option::Option::Some(is.read_bytes()?); + }, + 16 => { + self.fee = ::std::option::Option::Some(is.read_uint64()?); + }, + 24 => { + self.counter = ::std::option::Option::Some(is.read_uint64()?); + }, + 32 => { + self.gas_limit = ::std::option::Option::Some(is.read_uint64()?); + }, + 40 => { + self.storage_limit = ::std::option::Option::Some(is.read_uint64()?); + }, + 50 => { + self.manager_pubkey = ::std::option::Option::Some(is.read_bytes()?); + }, + 56 => { + self.balance = ::std::option::Option::Some(is.read_uint64()?); + }, + 64 => { + self.spendable = ::std::option::Option::Some(is.read_bool()?); + }, + 72 => { + self.delegatable = ::std::option::Option::Some(is.read_bool()?); + }, + 82 => { + self.delegate = ::std::option::Option::Some(is.read_bytes()?); + }, + 90 => { + self.script = ::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.source.as_ref() { + my_size += ::protobuf::rt::bytes_size(12, &v); + } + if let Some(v) = self.fee { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.counter { + my_size += ::protobuf::rt::uint64_size(3, v); + } + if let Some(v) = self.gas_limit { + my_size += ::protobuf::rt::uint64_size(4, v); + } + if let Some(v) = self.storage_limit { + my_size += ::protobuf::rt::uint64_size(5, v); + } + if let Some(v) = self.manager_pubkey.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &v); + } + if let Some(v) = self.balance { + my_size += ::protobuf::rt::uint64_size(7, v); + } + if let Some(v) = self.spendable { + my_size += 1 + 1; + } + if let Some(v) = self.delegatable { + my_size += 1 + 1; + } + if let Some(v) = self.delegate.as_ref() { + my_size += ::protobuf::rt::bytes_size(10, &v); + } + if let Some(v) = self.script.as_ref() { + my_size += ::protobuf::rt::bytes_size(11, &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.source.as_ref() { + os.write_bytes(12, v)?; + } + if let Some(v) = self.fee { + os.write_uint64(2, v)?; + } + if let Some(v) = self.counter { + os.write_uint64(3, v)?; + } + if let Some(v) = self.gas_limit { + os.write_uint64(4, v)?; + } + if let Some(v) = self.storage_limit { + os.write_uint64(5, v)?; + } + if let Some(v) = self.manager_pubkey.as_ref() { + os.write_bytes(6, v)?; + } + if let Some(v) = self.balance { + os.write_uint64(7, v)?; + } + if let Some(v) = self.spendable { + os.write_bool(8, v)?; + } + if let Some(v) = self.delegatable { + os.write_bool(9, v)?; + } + if let Some(v) = self.delegate.as_ref() { + os.write_bytes(10, v)?; + } + if let Some(v) = self.script.as_ref() { + os.write_bytes(11, 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() -> TezosOriginationOp { + TezosOriginationOp::new() + } + + fn clear(&mut self) { + self.source = ::std::option::Option::None; + self.fee = ::std::option::Option::None; + self.counter = ::std::option::Option::None; + self.gas_limit = ::std::option::Option::None; + self.storage_limit = ::std::option::Option::None; + self.manager_pubkey = ::std::option::Option::None; + self.balance = ::std::option::Option::None; + self.spendable = ::std::option::Option::None; + self.delegatable = ::std::option::Option::None; + self.delegate = ::std::option::Option::None; + self.script = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TezosOriginationOp { + static instance: TezosOriginationOp = TezosOriginationOp { + source: ::std::option::Option::None, + fee: ::std::option::Option::None, + counter: ::std::option::Option::None, + gas_limit: ::std::option::Option::None, + storage_limit: ::std::option::Option::None, + manager_pubkey: ::std::option::Option::None, + balance: ::std::option::Option::None, + spendable: ::std::option::Option::None, + delegatable: ::std::option::Option::None, + delegate: ::std::option::Option::None, + script: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TezosOriginationOp { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TezosSignTx.TezosOriginationOp").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TezosOriginationOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TezosOriginationOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.tezos.TezosSignTx.TezosDelegationOp) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TezosDelegationOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosDelegationOp.source) + pub source: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosDelegationOp.fee) + pub fee: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosDelegationOp.counter) + pub counter: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosDelegationOp.gas_limit) + pub gas_limit: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosDelegationOp.storage_limit) + pub storage_limit: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosDelegationOp.delegate) + pub delegate: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.tezos.TezosSignTx.TezosDelegationOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TezosDelegationOp { + fn default() -> &'a TezosDelegationOp { + ::default_instance() + } + } + + impl TezosDelegationOp { + pub fn new() -> TezosDelegationOp { + ::std::default::Default::default() + } + + // required bytes source = 7; + + pub fn source(&self) -> &[u8] { + match self.source.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_source(&mut self) { + self.source = ::std::option::Option::None; + } + + pub fn has_source(&self) -> bool { + self.source.is_some() + } + + // Param is passed by value, moved + pub fn set_source(&mut self, v: ::std::vec::Vec) { + self.source = ::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_source(&mut self) -> &mut ::std::vec::Vec { + if self.source.is_none() { + self.source = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.source.as_mut().unwrap() + } + + // Take field + pub fn take_source(&mut self) -> ::std::vec::Vec { + self.source.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint64 fee = 2; + + pub fn fee(&self) -> u64 { + self.fee.unwrap_or(0) + } + + pub fn clear_fee(&mut self) { + self.fee = ::std::option::Option::None; + } + + pub fn has_fee(&self) -> bool { + self.fee.is_some() + } + + // Param is passed by value, moved + pub fn set_fee(&mut self, v: u64) { + self.fee = ::std::option::Option::Some(v); + } + + // required uint64 counter = 3; + + pub fn counter(&self) -> u64 { + self.counter.unwrap_or(0) + } + + pub fn clear_counter(&mut self) { + self.counter = ::std::option::Option::None; + } + + pub fn has_counter(&self) -> bool { + self.counter.is_some() + } + + // Param is passed by value, moved + pub fn set_counter(&mut self, v: u64) { + self.counter = ::std::option::Option::Some(v); + } + + // required uint64 gas_limit = 4; + + pub fn gas_limit(&self) -> u64 { + self.gas_limit.unwrap_or(0) + } + + pub fn clear_gas_limit(&mut self) { + self.gas_limit = ::std::option::Option::None; + } + + pub fn has_gas_limit(&self) -> bool { + self.gas_limit.is_some() + } + + // Param is passed by value, moved + pub fn set_gas_limit(&mut self, v: u64) { + self.gas_limit = ::std::option::Option::Some(v); + } + + // required uint64 storage_limit = 5; + + pub fn storage_limit(&self) -> u64 { + self.storage_limit.unwrap_or(0) + } + + pub fn clear_storage_limit(&mut self) { + self.storage_limit = ::std::option::Option::None; + } + + pub fn has_storage_limit(&self) -> bool { + self.storage_limit.is_some() + } + + // Param is passed by value, moved + pub fn set_storage_limit(&mut self, v: u64) { + self.storage_limit = ::std::option::Option::Some(v); + } + + // required bytes delegate = 6; + + pub fn delegate(&self) -> &[u8] { + match self.delegate.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_delegate(&mut self) { + self.delegate = ::std::option::Option::None; + } + + pub fn has_delegate(&self) -> bool { + self.delegate.is_some() + } + + // Param is passed by value, moved + pub fn set_delegate(&mut self, v: ::std::vec::Vec) { + self.delegate = ::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_delegate(&mut self) -> &mut ::std::vec::Vec { + if self.delegate.is_none() { + self.delegate = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.delegate.as_mut().unwrap() + } + + // Take field + pub fn take_delegate(&mut self) -> ::std::vec::Vec { + self.delegate.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "source", + |m: &TezosDelegationOp| { &m.source }, + |m: &mut TezosDelegationOp| { &mut m.source }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "fee", + |m: &TezosDelegationOp| { &m.fee }, + |m: &mut TezosDelegationOp| { &mut m.fee }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "counter", + |m: &TezosDelegationOp| { &m.counter }, + |m: &mut TezosDelegationOp| { &mut m.counter }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "gas_limit", + |m: &TezosDelegationOp| { &m.gas_limit }, + |m: &mut TezosDelegationOp| { &mut m.gas_limit }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "storage_limit", + |m: &TezosDelegationOp| { &m.storage_limit }, + |m: &mut TezosDelegationOp| { &mut m.storage_limit }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "delegate", + |m: &TezosDelegationOp| { &m.delegate }, + |m: &mut TezosDelegationOp| { &mut m.delegate }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TezosSignTx.TezosDelegationOp", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TezosDelegationOp { + const NAME: &'static str = "TezosDelegationOp"; + + fn is_initialized(&self) -> bool { + if self.source.is_none() { + return false; + } + if self.fee.is_none() { + return false; + } + if self.counter.is_none() { + return false; + } + if self.gas_limit.is_none() { + return false; + } + if self.storage_limit.is_none() { + return false; + } + if self.delegate.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 { + 58 => { + self.source = ::std::option::Option::Some(is.read_bytes()?); + }, + 16 => { + self.fee = ::std::option::Option::Some(is.read_uint64()?); + }, + 24 => { + self.counter = ::std::option::Option::Some(is.read_uint64()?); + }, + 32 => { + self.gas_limit = ::std::option::Option::Some(is.read_uint64()?); + }, + 40 => { + self.storage_limit = ::std::option::Option::Some(is.read_uint64()?); + }, + 50 => { + self.delegate = ::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.source.as_ref() { + my_size += ::protobuf::rt::bytes_size(7, &v); + } + if let Some(v) = self.fee { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.counter { + my_size += ::protobuf::rt::uint64_size(3, v); + } + if let Some(v) = self.gas_limit { + my_size += ::protobuf::rt::uint64_size(4, v); + } + if let Some(v) = self.storage_limit { + my_size += ::protobuf::rt::uint64_size(5, v); + } + if let Some(v) = self.delegate.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &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.source.as_ref() { + os.write_bytes(7, v)?; + } + if let Some(v) = self.fee { + os.write_uint64(2, v)?; + } + if let Some(v) = self.counter { + os.write_uint64(3, v)?; + } + if let Some(v) = self.gas_limit { + os.write_uint64(4, v)?; + } + if let Some(v) = self.storage_limit { + os.write_uint64(5, v)?; + } + if let Some(v) = self.delegate.as_ref() { + os.write_bytes(6, 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() -> TezosDelegationOp { + TezosDelegationOp::new() + } + + fn clear(&mut self) { + self.source = ::std::option::Option::None; + self.fee = ::std::option::Option::None; + self.counter = ::std::option::Option::None; + self.gas_limit = ::std::option::Option::None; + self.storage_limit = ::std::option::Option::None; + self.delegate = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TezosDelegationOp { + static instance: TezosDelegationOp = TezosDelegationOp { + source: ::std::option::Option::None, + fee: ::std::option::Option::None, + counter: ::std::option::Option::None, + gas_limit: ::std::option::Option::None, + storage_limit: ::std::option::Option::None, + delegate: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TezosDelegationOp { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TezosSignTx.TezosDelegationOp").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TezosDelegationOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TezosDelegationOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.tezos.TezosSignTx.TezosProposalOp) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TezosProposalOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosProposalOp.source) + pub source: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosProposalOp.period) + pub period: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosProposalOp.proposals) + pub proposals: ::std::vec::Vec<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.tezos.TezosSignTx.TezosProposalOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TezosProposalOp { + fn default() -> &'a TezosProposalOp { + ::default_instance() + } + } + + impl TezosProposalOp { + pub fn new() -> TezosProposalOp { + ::std::default::Default::default() + } + + // required bytes source = 1; + + pub fn source(&self) -> &[u8] { + match self.source.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_source(&mut self) { + self.source = ::std::option::Option::None; + } + + pub fn has_source(&self) -> bool { + self.source.is_some() + } + + // Param is passed by value, moved + pub fn set_source(&mut self, v: ::std::vec::Vec) { + self.source = ::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_source(&mut self) -> &mut ::std::vec::Vec { + if self.source.is_none() { + self.source = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.source.as_mut().unwrap() + } + + // Take field + pub fn take_source(&mut self) -> ::std::vec::Vec { + self.source.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint64 period = 2; + + pub fn period(&self) -> u64 { + self.period.unwrap_or(0) + } + + pub fn clear_period(&mut self) { + self.period = ::std::option::Option::None; + } + + pub fn has_period(&self) -> bool { + self.period.is_some() + } + + // Param is passed by value, moved + pub fn set_period(&mut self, v: u64) { + self.period = ::std::option::Option::Some(v); + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "source", + |m: &TezosProposalOp| { &m.source }, + |m: &mut TezosProposalOp| { &mut m.source }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "period", + |m: &TezosProposalOp| { &m.period }, + |m: &mut TezosProposalOp| { &mut m.period }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "proposals", + |m: &TezosProposalOp| { &m.proposals }, + |m: &mut TezosProposalOp| { &mut m.proposals }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TezosSignTx.TezosProposalOp", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TezosProposalOp { + const NAME: &'static str = "TezosProposalOp"; + + fn is_initialized(&self) -> bool { + if self.source.is_none() { + return false; + } + if self.period.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.source = ::std::option::Option::Some(is.read_bytes()?); + }, + 16 => { + self.period = ::std::option::Option::Some(is.read_uint64()?); + }, + 34 => { + self.proposals.push(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.source.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.period { + my_size += ::protobuf::rt::uint64_size(2, v); + } + for value in &self.proposals { + my_size += ::protobuf::rt::bytes_size(4, &value); + }; + 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.source.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.period { + os.write_uint64(2, v)?; + } + for v in &self.proposals { + os.write_bytes(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() -> TezosProposalOp { + TezosProposalOp::new() + } + + fn clear(&mut self) { + self.source = ::std::option::Option::None; + self.period = ::std::option::Option::None; + self.proposals.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static TezosProposalOp { + static instance: TezosProposalOp = TezosProposalOp { + source: ::std::option::Option::None, + period: ::std::option::Option::None, + proposals: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TezosProposalOp { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TezosSignTx.TezosProposalOp").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TezosProposalOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TezosProposalOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + // @@protoc_insertion_point(message:hw.trezor.messages.tezos.TezosSignTx.TezosBallotOp) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct TezosBallotOp { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosBallotOp.source) + pub source: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosBallotOp.period) + pub period: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosBallotOp.proposal) + pub proposal: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignTx.TezosBallotOp.ballot) + pub ballot: ::std::option::Option<::protobuf::EnumOrUnknown>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.tezos.TezosSignTx.TezosBallotOp.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a TezosBallotOp { + fn default() -> &'a TezosBallotOp { + ::default_instance() + } + } + + impl TezosBallotOp { + pub fn new() -> TezosBallotOp { + ::std::default::Default::default() + } + + // required bytes source = 1; + + pub fn source(&self) -> &[u8] { + match self.source.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_source(&mut self) { + self.source = ::std::option::Option::None; + } + + pub fn has_source(&self) -> bool { + self.source.is_some() + } + + // Param is passed by value, moved + pub fn set_source(&mut self, v: ::std::vec::Vec) { + self.source = ::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_source(&mut self) -> &mut ::std::vec::Vec { + if self.source.is_none() { + self.source = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.source.as_mut().unwrap() + } + + // Take field + pub fn take_source(&mut self) -> ::std::vec::Vec { + self.source.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required uint64 period = 2; + + pub fn period(&self) -> u64 { + self.period.unwrap_or(0) + } + + pub fn clear_period(&mut self) { + self.period = ::std::option::Option::None; + } + + pub fn has_period(&self) -> bool { + self.period.is_some() + } + + // Param is passed by value, moved + pub fn set_period(&mut self, v: u64) { + self.period = ::std::option::Option::Some(v); + } + + // required bytes proposal = 3; + + pub fn proposal(&self) -> &[u8] { + match self.proposal.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_proposal(&mut self) { + self.proposal = ::std::option::Option::None; + } + + pub fn has_proposal(&self) -> bool { + self.proposal.is_some() + } + + // Param is passed by value, moved + pub fn set_proposal(&mut self, v: ::std::vec::Vec) { + self.proposal = ::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_proposal(&mut self) -> &mut ::std::vec::Vec { + if self.proposal.is_none() { + self.proposal = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.proposal.as_mut().unwrap() + } + + // Take field + pub fn take_proposal(&mut self) -> ::std::vec::Vec { + self.proposal.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required .hw.trezor.messages.tezos.TezosSignTx.TezosBallotOp.TezosBallotType ballot = 4; + + pub fn ballot(&self) -> tezos_ballot_op::TezosBallotType { + match self.ballot { + Some(e) => e.enum_value_or(tezos_ballot_op::TezosBallotType::Yay), + None => tezos_ballot_op::TezosBallotType::Yay, + } + } + + pub fn clear_ballot(&mut self) { + self.ballot = ::std::option::Option::None; + } + + pub fn has_ballot(&self) -> bool { + self.ballot.is_some() + } + + // Param is passed by value, moved + pub fn set_ballot(&mut self, v: tezos_ballot_op::TezosBallotType) { + self.ballot = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v)); + } + + pub(in super) 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::<_, _>( + "source", + |m: &TezosBallotOp| { &m.source }, + |m: &mut TezosBallotOp| { &mut m.source }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "period", + |m: &TezosBallotOp| { &m.period }, + |m: &mut TezosBallotOp| { &mut m.period }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "proposal", + |m: &TezosBallotOp| { &m.proposal }, + |m: &mut TezosBallotOp| { &mut m.proposal }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "ballot", + |m: &TezosBallotOp| { &m.ballot }, + |m: &mut TezosBallotOp| { &mut m.ballot }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TezosSignTx.TezosBallotOp", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for TezosBallotOp { + const NAME: &'static str = "TezosBallotOp"; + + fn is_initialized(&self) -> bool { + if self.source.is_none() { + return false; + } + if self.period.is_none() { + return false; + } + if self.proposal.is_none() { + return false; + } + if self.ballot.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.source = ::std::option::Option::Some(is.read_bytes()?); + }, + 16 => { + self.period = ::std::option::Option::Some(is.read_uint64()?); + }, + 26 => { + self.proposal = ::std::option::Option::Some(is.read_bytes()?); + }, + 32 => { + self.ballot = ::std::option::Option::Some(is.read_enum_or_unknown()?); + }, + 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.source.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.period { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.proposal.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.ballot { + my_size += ::protobuf::rt::int32_size(4, v.value()); + } + 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.source.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.period { + os.write_uint64(2, v)?; + } + if let Some(v) = self.proposal.as_ref() { + os.write_bytes(3, v)?; + } + if let Some(v) = self.ballot { + os.write_enum(4, ::protobuf::EnumOrUnknown::value(&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() -> TezosBallotOp { + TezosBallotOp::new() + } + + fn clear(&mut self) { + self.source = ::std::option::Option::None; + self.period = ::std::option::Option::None; + self.proposal = ::std::option::Option::None; + self.ballot = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TezosBallotOp { + static instance: TezosBallotOp = TezosBallotOp { + source: ::std::option::Option::None, + period: ::std::option::Option::None, + proposal: ::std::option::Option::None, + ballot: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for TezosBallotOp { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("TezosSignTx.TezosBallotOp").unwrap()).clone() + } + } + + impl ::std::fmt::Display for TezosBallotOp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for TezosBallotOp { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + + /// Nested message and enums of message `TezosBallotOp` + pub mod tezos_ballot_op { + #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] + // @@protoc_insertion_point(enum:hw.trezor.messages.tezos.TezosSignTx.TezosBallotOp.TezosBallotType) + pub enum TezosBallotType { + // @@protoc_insertion_point(enum_value:hw.trezor.messages.tezos.TezosSignTx.TezosBallotOp.TezosBallotType.Yay) + Yay = 0, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.tezos.TezosSignTx.TezosBallotOp.TezosBallotType.Nay) + Nay = 1, + // @@protoc_insertion_point(enum_value:hw.trezor.messages.tezos.TezosSignTx.TezosBallotOp.TezosBallotType.Pass) + Pass = 2, + } + + impl ::protobuf::Enum for TezosBallotType { + const NAME: &'static str = "TezosBallotType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(TezosBallotType::Yay), + 1 => ::std::option::Option::Some(TezosBallotType::Nay), + 2 => ::std::option::Option::Some(TezosBallotType::Pass), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "Yay" => ::std::option::Option::Some(TezosBallotType::Yay), + "Nay" => ::std::option::Option::Some(TezosBallotType::Nay), + "Pass" => ::std::option::Option::Some(TezosBallotType::Pass), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [TezosBallotType] = &[ + TezosBallotType::Yay, + TezosBallotType::Nay, + TezosBallotType::Pass, + ]; + } + + impl ::protobuf::EnumFull for TezosBallotType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::super::file_descriptor().enum_by_package_relative_name("TezosSignTx.TezosBallotOp.TezosBallotType").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 TezosBallotType { + fn default() -> Self { + TezosBallotType::Yay + } + } + + impl TezosBallotType { + pub(in super::super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("TezosSignTx.TezosBallotOp.TezosBallotType") + } + } + } +} + +// @@protoc_insertion_point(message:hw.trezor.messages.tezos.TezosSignedTx) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct TezosSignedTx { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignedTx.signature) + pub signature: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignedTx.sig_op_contents) + pub sig_op_contents: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.tezos.TezosSignedTx.operation_hash) + pub operation_hash: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.tezos.TezosSignedTx.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TezosSignedTx { + fn default() -> &'a TezosSignedTx { + ::default_instance() + } +} + +impl TezosSignedTx { + pub fn new() -> TezosSignedTx { + ::std::default::Default::default() + } + + // required string signature = 1; + + pub fn signature(&self) -> &str { + match self.signature.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_signature(&mut self) { + self.signature = ::std::option::Option::None; + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::string::String) { + self.signature = ::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_signature(&mut self) -> &mut ::std::string::String { + if self.signature.is_none() { + self.signature = ::std::option::Option::Some(::std::string::String::new()); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::string::String { + self.signature.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // required bytes sig_op_contents = 2; + + pub fn sig_op_contents(&self) -> &[u8] { + match self.sig_op_contents.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_sig_op_contents(&mut self) { + self.sig_op_contents = ::std::option::Option::None; + } + + pub fn has_sig_op_contents(&self) -> bool { + self.sig_op_contents.is_some() + } + + // Param is passed by value, moved + pub fn set_sig_op_contents(&mut self, v: ::std::vec::Vec) { + self.sig_op_contents = ::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_sig_op_contents(&mut self) -> &mut ::std::vec::Vec { + if self.sig_op_contents.is_none() { + self.sig_op_contents = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.sig_op_contents.as_mut().unwrap() + } + + // Take field + pub fn take_sig_op_contents(&mut self) -> ::std::vec::Vec { + self.sig_op_contents.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // required string operation_hash = 3; + + pub fn operation_hash(&self) -> &str { + match self.operation_hash.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_operation_hash(&mut self) { + self.operation_hash = ::std::option::Option::None; + } + + pub fn has_operation_hash(&self) -> bool { + self.operation_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_operation_hash(&mut self, v: ::std::string::String) { + self.operation_hash = ::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_operation_hash(&mut self) -> &mut ::std::string::String { + if self.operation_hash.is_none() { + self.operation_hash = ::std::option::Option::Some(::std::string::String::new()); + } + self.operation_hash.as_mut().unwrap() + } + + // Take field + pub fn take_operation_hash(&mut self) -> ::std::string::String { + self.operation_hash.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "signature", + |m: &TezosSignedTx| { &m.signature }, + |m: &mut TezosSignedTx| { &mut m.signature }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "sig_op_contents", + |m: &TezosSignedTx| { &m.sig_op_contents }, + |m: &mut TezosSignedTx| { &mut m.sig_op_contents }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "operation_hash", + |m: &TezosSignedTx| { &m.operation_hash }, + |m: &mut TezosSignedTx| { &mut m.operation_hash }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TezosSignedTx", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TezosSignedTx { + const NAME: &'static str = "TezosSignedTx"; + + fn is_initialized(&self) -> bool { + if self.signature.is_none() { + return false; + } + if self.sig_op_contents.is_none() { + return false; + } + if self.operation_hash.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.signature = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.sig_op_contents = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.operation_hash = ::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.signature.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.sig_op_contents.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.operation_hash.as_ref() { + my_size += ::protobuf::rt::string_size(3, &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.signature.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.sig_op_contents.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.operation_hash.as_ref() { + os.write_string(3, 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() -> TezosSignedTx { + TezosSignedTx::new() + } + + fn clear(&mut self) { + self.signature = ::std::option::Option::None; + self.sig_op_contents = ::std::option::Option::None; + self.operation_hash = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TezosSignedTx { + static instance: TezosSignedTx = TezosSignedTx { + signature: ::std::option::Option::None, + sig_op_contents: ::std::option::Option::None, + operation_hash: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TezosSignedTx { + 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("TezosSignedTx").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TezosSignedTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TezosSignedTx { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x14messages-tezos.proto\x12\x18hw.trezor.messages.tezos\"m\n\x0fTezos\ + GetAddress\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12!\n\ + \x0cshow_display\x18\x02\x20\x01(\x08R\x0bshowDisplay\x12\x1a\n\x08chunk\ + ify\x18\x03\x20\x01(\x08R\x08chunkify\"(\n\x0cTezosAddress\x12\x18\n\x07\ + address\x18\x01\x20\x02(\tR\x07address\"o\n\x11TezosGetPublicKey\x12\x1b\ + \n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12!\n\x0cshow_display\x18\ + \x02\x20\x01(\x08R\x0bshowDisplay\x12\x1a\n\x08chunkify\x18\x03\x20\x01(\ + \x08R\x08chunkify\"/\n\x0eTezosPublicKey\x12\x1d\n\npublic_key\x18\x01\ + \x20\x02(\tR\tpublicKey\"\xc0\x14\n\x0bTezosSignTx\x12\x1b\n\taddress_n\ + \x18\x01\x20\x03(\rR\x08addressN\x12\x16\n\x06branch\x18\x02\x20\x02(\ + \x0cR\x06branch\x12K\n\x06reveal\x18\x03\x20\x01(\x0b23.hw.trezor.messag\ + es.tezos.TezosSignTx.TezosRevealOpR\x06reveal\x12Z\n\x0btransaction\x18\ + \x04\x20\x01(\x0b28.hw.trezor.messages.tezos.TezosSignTx.TezosTransactio\ + nOpR\x0btransaction\x12Z\n\x0borigination\x18\x05\x20\x01(\x0b28.hw.trez\ + or.messages.tezos.TezosSignTx.TezosOriginationOpR\x0borigination\x12W\n\ + \ndelegation\x18\x06\x20\x01(\x0b27.hw.trezor.messages.tezos.TezosSignTx\ + .TezosDelegationOpR\ndelegation\x12Q\n\x08proposal\x18\x07\x20\x01(\x0b2\ + 5.hw.trezor.messages.tezos.TezosSignTx.TezosProposalOpR\x08proposal\x12K\ + \n\x06ballot\x18\x08\x20\x01(\x0b23.hw.trezor.messages.tezos.TezosSignTx\ + .TezosBallotOpR\x06ballot\x12\x1a\n\x08chunkify\x18\t\x20\x01(\x08R\x08c\ + hunkify\x1a\xb3\x01\n\x0fTezosContractID\x12Y\n\x03tag\x18\x01\x20\x02(\ + \x0e2G.hw.trezor.messages.tezos.TezosSignTx.TezosContractID.TezosContrac\ + tTypeR\x03tag\x12\x12\n\x04hash\x18\x02\x20\x02(\x0cR\x04hash\"1\n\x11Te\ + zosContractType\x12\x0c\n\x08Implicit\x10\0\x12\x0e\n\nOriginated\x10\ + \x01\x1a\xb4\x01\n\rTezosRevealOp\x12\x16\n\x06source\x18\x07\x20\x02(\ + \x0cR\x06source\x12\x10\n\x03fee\x18\x02\x20\x02(\x04R\x03fee\x12\x18\n\ + \x07counter\x18\x03\x20\x02(\x04R\x07counter\x12\x1b\n\tgas_limit\x18\ + \x04\x20\x02(\x04R\x08gasLimit\x12#\n\rstorage_limit\x18\x05\x20\x02(\ + \x04R\x0cstorageLimit\x12\x1d\n\npublic_key\x18\x06\x20\x02(\x0cR\tpubli\ + cKey\x1a\x9f\x06\n\x12TezosTransactionOp\x12\x16\n\x06source\x18\t\x20\ + \x02(\x0cR\x06source\x12\x10\n\x03fee\x18\x02\x20\x02(\x04R\x03fee\x12\ + \x18\n\x07counter\x18\x03\x20\x02(\x04R\x07counter\x12\x1b\n\tgas_limit\ + \x18\x04\x20\x02(\x04R\x08gasLimit\x12#\n\rstorage_limit\x18\x05\x20\x02\ + (\x04R\x0cstorageLimit\x12\x16\n\x06amount\x18\x06\x20\x02(\x04R\x06amou\ + nt\x12W\n\x0bdestination\x18\x07\x20\x02(\x0b25.hw.trezor.messages.tezos\ + .TezosSignTx.TezosContractIDR\x0bdestination\x12\x1e\n\nparameters\x18\ + \x08\x20\x01(\x0cR\nparameters\x12~\n\x12parameters_manager\x18\n\x20\ + \x01(\x0b2O.hw.trezor.messages.tezos.TezosSignTx.TezosTransactionOp.Tezo\ + sParametersManagerR\x11parametersManager\x1a\xf1\x02\n\x16TezosParameter\ + sManager\x12!\n\x0cset_delegate\x18\x01\x20\x01(\x0cR\x0bsetDelegate\x12\ + '\n\x0fcancel_delegate\x18\x02\x20\x01(\x08R\x0ecancelDelegate\x12\x80\ + \x01\n\x08transfer\x18\x03\x20\x01(\x0b2d.hw.trezor.messages.tezos.Tezos\ + SignTx.TezosTransactionOp.TezosParametersManager.TezosManagerTransferR\ + \x08transfer\x1a\x87\x01\n\x14TezosManagerTransfer\x12W\n\x0bdestination\ + \x18\x01\x20\x02(\x0b25.hw.trezor.messages.tezos.TezosSignTx.TezosContra\ + ctIDR\x0bdestination\x12\x16\n\x06amount\x18\x02\x20\x02(\x04R\x06amount\ + \x1a\xcf\x02\n\x12TezosOriginationOp\x12\x16\n\x06source\x18\x0c\x20\x02\ + (\x0cR\x06source\x12\x10\n\x03fee\x18\x02\x20\x02(\x04R\x03fee\x12\x18\n\ + \x07counter\x18\x03\x20\x02(\x04R\x07counter\x12\x1b\n\tgas_limit\x18\ + \x04\x20\x02(\x04R\x08gasLimit\x12#\n\rstorage_limit\x18\x05\x20\x02(\ + \x04R\x0cstorageLimit\x12%\n\x0emanager_pubkey\x18\x06\x20\x01(\x0cR\rma\ + nagerPubkey\x12\x18\n\x07balance\x18\x07\x20\x02(\x04R\x07balance\x12\ + \x1c\n\tspendable\x18\x08\x20\x01(\x08R\tspendable\x12\x20\n\x0bdelegata\ + ble\x18\t\x20\x01(\x08R\x0bdelegatable\x12\x1a\n\x08delegate\x18\n\x20\ + \x01(\x0cR\x08delegate\x12\x16\n\x06script\x18\x0b\x20\x02(\x0cR\x06scri\ + pt\x1a\xb5\x01\n\x11TezosDelegationOp\x12\x16\n\x06source\x18\x07\x20\ + \x02(\x0cR\x06source\x12\x10\n\x03fee\x18\x02\x20\x02(\x04R\x03fee\x12\ + \x18\n\x07counter\x18\x03\x20\x02(\x04R\x07counter\x12\x1b\n\tgas_limit\ + \x18\x04\x20\x02(\x04R\x08gasLimit\x12#\n\rstorage_limit\x18\x05\x20\x02\ + (\x04R\x0cstorageLimit\x12\x1a\n\x08delegate\x18\x06\x20\x02(\x0cR\x08de\ + legate\x1a_\n\x0fTezosProposalOp\x12\x16\n\x06source\x18\x01\x20\x02(\ + \x0cR\x06source\x12\x16\n\x06period\x18\x02\x20\x02(\x04R\x06period\x12\ + \x1c\n\tproposals\x18\x04\x20\x03(\x0cR\tproposals\x1a\xe7\x01\n\rTezosB\ + allotOp\x12\x16\n\x06source\x18\x01\x20\x02(\x0cR\x06source\x12\x16\n\ + \x06period\x18\x02\x20\x02(\x04R\x06period\x12\x1a\n\x08proposal\x18\x03\ + \x20\x02(\x0cR\x08proposal\x12[\n\x06ballot\x18\x04\x20\x02(\x0e2C.hw.tr\ + ezor.messages.tezos.TezosSignTx.TezosBallotOp.TezosBallotTypeR\x06ballot\ + \"-\n\x0fTezosBallotType\x12\x07\n\x03Yay\x10\0\x12\x07\n\x03Nay\x10\x01\ + \x12\x08\n\x04Pass\x10\x02\"|\n\rTezosSignedTx\x12\x1c\n\tsignature\x18\ + \x01\x20\x02(\tR\tsignature\x12&\n\x0fsig_op_contents\x18\x02\x20\x02(\ + \x0cR\rsigOpContents\x12%\n\x0eoperation_hash\x18\x03\x20\x02(\tR\ropera\ + tionHashB9\n#com.satoshilabs.trezor.lib.protobufB\x12TrezorMessageTezos\ +"; + +/// `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(15); + messages.push(TezosGetAddress::generated_message_descriptor_data()); + messages.push(TezosAddress::generated_message_descriptor_data()); + messages.push(TezosGetPublicKey::generated_message_descriptor_data()); + messages.push(TezosPublicKey::generated_message_descriptor_data()); + messages.push(TezosSignTx::generated_message_descriptor_data()); + messages.push(TezosSignedTx::generated_message_descriptor_data()); + messages.push(tezos_sign_tx::TezosContractID::generated_message_descriptor_data()); + messages.push(tezos_sign_tx::TezosRevealOp::generated_message_descriptor_data()); + messages.push(tezos_sign_tx::TezosTransactionOp::generated_message_descriptor_data()); + messages.push(tezos_sign_tx::TezosOriginationOp::generated_message_descriptor_data()); + messages.push(tezos_sign_tx::TezosDelegationOp::generated_message_descriptor_data()); + messages.push(tezos_sign_tx::TezosProposalOp::generated_message_descriptor_data()); + messages.push(tezos_sign_tx::TezosBallotOp::generated_message_descriptor_data()); + messages.push(tezos_sign_tx::tezos_transaction_op::TezosParametersManager::generated_message_descriptor_data()); + messages.push(tezos_sign_tx::tezos_transaction_op::tezos_parameters_manager::TezosManagerTransfer::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(2); + enums.push(tezos_sign_tx::tezos_contract_id::TezosContractType::generated_enum_descriptor_data()); + enums.push(tezos_sign_tx::tezos_ballot_op::TezosBallotType::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/generated/messages_webauthn.rs b/wallet/trezor-client/src/protos/generated/messages_webauthn.rs new file mode 100644 index 0000000000..6276d730db --- /dev/null +++ b/wallet/trezor-client/src/protos/generated/messages_webauthn.rs @@ -0,0 +1,1257 @@ +// This file is generated by rust-protobuf 3.3.0. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @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-webauthn.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; + +// @@protoc_insertion_point(message:hw.trezor.messages.webauthn.WebAuthnListResidentCredentials) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct WebAuthnListResidentCredentials { + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.webauthn.WebAuthnListResidentCredentials.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a WebAuthnListResidentCredentials { + fn default() -> &'a WebAuthnListResidentCredentials { + ::default_instance() + } +} + +impl WebAuthnListResidentCredentials { + pub fn new() -> WebAuthnListResidentCredentials { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "WebAuthnListResidentCredentials", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for WebAuthnListResidentCredentials { + const NAME: &'static str = "WebAuthnListResidentCredentials"; + + 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 { + 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; + 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<()> { + 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() -> WebAuthnListResidentCredentials { + WebAuthnListResidentCredentials::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static WebAuthnListResidentCredentials { + static instance: WebAuthnListResidentCredentials = WebAuthnListResidentCredentials { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for WebAuthnListResidentCredentials { + 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("WebAuthnListResidentCredentials").unwrap()).clone() + } +} + +impl ::std::fmt::Display for WebAuthnListResidentCredentials { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for WebAuthnListResidentCredentials { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.webauthn.WebAuthnAddResidentCredential) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct WebAuthnAddResidentCredential { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.webauthn.WebAuthnAddResidentCredential.credential_id) + pub credential_id: ::std::option::Option<::std::vec::Vec>, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.webauthn.WebAuthnAddResidentCredential.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a WebAuthnAddResidentCredential { + fn default() -> &'a WebAuthnAddResidentCredential { + ::default_instance() + } +} + +impl WebAuthnAddResidentCredential { + pub fn new() -> WebAuthnAddResidentCredential { + ::std::default::Default::default() + } + + // optional bytes credential_id = 1; + + pub fn credential_id(&self) -> &[u8] { + match self.credential_id.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_credential_id(&mut self) { + self.credential_id = ::std::option::Option::None; + } + + pub fn has_credential_id(&self) -> bool { + self.credential_id.is_some() + } + + // Param is passed by value, moved + pub fn set_credential_id(&mut self, v: ::std::vec::Vec) { + self.credential_id = ::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_credential_id(&mut self) -> &mut ::std::vec::Vec { + if self.credential_id.is_none() { + self.credential_id = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.credential_id.as_mut().unwrap() + } + + // Take field + pub fn take_credential_id(&mut self) -> ::std::vec::Vec { + self.credential_id.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "credential_id", + |m: &WebAuthnAddResidentCredential| { &m.credential_id }, + |m: &mut WebAuthnAddResidentCredential| { &mut m.credential_id }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "WebAuthnAddResidentCredential", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for WebAuthnAddResidentCredential { + const NAME: &'static str = "WebAuthnAddResidentCredential"; + + 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.credential_id = ::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.credential_id.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &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.credential_id.as_ref() { + os.write_bytes(1, 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() -> WebAuthnAddResidentCredential { + WebAuthnAddResidentCredential::new() + } + + fn clear(&mut self) { + self.credential_id = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static WebAuthnAddResidentCredential { + static instance: WebAuthnAddResidentCredential = WebAuthnAddResidentCredential { + credential_id: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for WebAuthnAddResidentCredential { + 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("WebAuthnAddResidentCredential").unwrap()).clone() + } +} + +impl ::std::fmt::Display for WebAuthnAddResidentCredential { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for WebAuthnAddResidentCredential { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.webauthn.WebAuthnRemoveResidentCredential) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct WebAuthnRemoveResidentCredential { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.webauthn.WebAuthnRemoveResidentCredential.index) + pub index: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.webauthn.WebAuthnRemoveResidentCredential.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a WebAuthnRemoveResidentCredential { + fn default() -> &'a WebAuthnRemoveResidentCredential { + ::default_instance() + } +} + +impl WebAuthnRemoveResidentCredential { + pub fn new() -> WebAuthnRemoveResidentCredential { + ::std::default::Default::default() + } + + // optional uint32 index = 1; + + pub fn index(&self) -> u32 { + self.index.unwrap_or(0) + } + + pub fn clear_index(&mut self) { + self.index = ::std::option::Option::None; + } + + pub fn has_index(&self) -> bool { + self.index.is_some() + } + + // Param is passed by value, moved + pub fn set_index(&mut self, v: u32) { + self.index = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "index", + |m: &WebAuthnRemoveResidentCredential| { &m.index }, + |m: &mut WebAuthnRemoveResidentCredential| { &mut m.index }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "WebAuthnRemoveResidentCredential", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for WebAuthnRemoveResidentCredential { + const NAME: &'static str = "WebAuthnRemoveResidentCredential"; + + 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 { + 8 => { + self.index = ::std::option::Option::Some(is.read_uint32()?); + }, + 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.index { + my_size += ::protobuf::rt::uint32_size(1, 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.index { + os.write_uint32(1, 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() -> WebAuthnRemoveResidentCredential { + WebAuthnRemoveResidentCredential::new() + } + + fn clear(&mut self) { + self.index = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static WebAuthnRemoveResidentCredential { + static instance: WebAuthnRemoveResidentCredential = WebAuthnRemoveResidentCredential { + index: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for WebAuthnRemoveResidentCredential { + 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("WebAuthnRemoveResidentCredential").unwrap()).clone() + } +} + +impl ::std::fmt::Display for WebAuthnRemoveResidentCredential { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for WebAuthnRemoveResidentCredential { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:hw.trezor.messages.webauthn.WebAuthnCredentials) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct WebAuthnCredentials { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.webauthn.WebAuthnCredentials.credentials) + pub credentials: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.webauthn.WebAuthnCredentials.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a WebAuthnCredentials { + fn default() -> &'a WebAuthnCredentials { + ::default_instance() + } +} + +impl WebAuthnCredentials { + pub fn new() -> WebAuthnCredentials { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "credentials", + |m: &WebAuthnCredentials| { &m.credentials }, + |m: &mut WebAuthnCredentials| { &mut m.credentials }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "WebAuthnCredentials", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for WebAuthnCredentials { + const NAME: &'static str = "WebAuthnCredentials"; + + 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.credentials.push(is.read_message()?); + }, + 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; + for value in &self.credentials { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + 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<()> { + for v in &self.credentials { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + }; + 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() -> WebAuthnCredentials { + WebAuthnCredentials::new() + } + + fn clear(&mut self) { + self.credentials.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static WebAuthnCredentials { + static instance: WebAuthnCredentials = WebAuthnCredentials { + credentials: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for WebAuthnCredentials { + 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("WebAuthnCredentials").unwrap()).clone() + } +} + +impl ::std::fmt::Display for WebAuthnCredentials { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for WebAuthnCredentials { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `WebAuthnCredentials` +pub mod web_authn_credentials { + // @@protoc_insertion_point(message:hw.trezor.messages.webauthn.WebAuthnCredentials.WebAuthnCredential) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct WebAuthnCredential { + // message fields + // @@protoc_insertion_point(field:hw.trezor.messages.webauthn.WebAuthnCredentials.WebAuthnCredential.index) + pub index: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.webauthn.WebAuthnCredentials.WebAuthnCredential.id) + pub id: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.webauthn.WebAuthnCredentials.WebAuthnCredential.rp_id) + pub rp_id: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.webauthn.WebAuthnCredentials.WebAuthnCredential.rp_name) + pub rp_name: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.webauthn.WebAuthnCredentials.WebAuthnCredential.user_id) + pub user_id: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:hw.trezor.messages.webauthn.WebAuthnCredentials.WebAuthnCredential.user_name) + pub user_name: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.webauthn.WebAuthnCredentials.WebAuthnCredential.user_display_name) + pub user_display_name: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:hw.trezor.messages.webauthn.WebAuthnCredentials.WebAuthnCredential.creation_time) + pub creation_time: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.webauthn.WebAuthnCredentials.WebAuthnCredential.hmac_secret) + pub hmac_secret: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.webauthn.WebAuthnCredentials.WebAuthnCredential.use_sign_count) + pub use_sign_count: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.webauthn.WebAuthnCredentials.WebAuthnCredential.algorithm) + pub algorithm: ::std::option::Option, + // @@protoc_insertion_point(field:hw.trezor.messages.webauthn.WebAuthnCredentials.WebAuthnCredential.curve) + pub curve: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:hw.trezor.messages.webauthn.WebAuthnCredentials.WebAuthnCredential.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a WebAuthnCredential { + fn default() -> &'a WebAuthnCredential { + ::default_instance() + } + } + + impl WebAuthnCredential { + pub fn new() -> WebAuthnCredential { + ::std::default::Default::default() + } + + // optional uint32 index = 1; + + pub fn index(&self) -> u32 { + self.index.unwrap_or(0) + } + + pub fn clear_index(&mut self) { + self.index = ::std::option::Option::None; + } + + pub fn has_index(&self) -> bool { + self.index.is_some() + } + + // Param is passed by value, moved + pub fn set_index(&mut self, v: u32) { + self.index = ::std::option::Option::Some(v); + } + + // optional bytes id = 2; + + pub fn id(&self) -> &[u8] { + match self.id.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_id(&mut self) { + self.id = ::std::option::Option::None; + } + + pub fn has_id(&self) -> bool { + self.id.is_some() + } + + // Param is passed by value, moved + pub fn set_id(&mut self, v: ::std::vec::Vec) { + self.id = ::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_id(&mut self) -> &mut ::std::vec::Vec { + if self.id.is_none() { + self.id = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.id.as_mut().unwrap() + } + + // Take field + pub fn take_id(&mut self) -> ::std::vec::Vec { + self.id.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional string rp_id = 3; + + pub fn rp_id(&self) -> &str { + match self.rp_id.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_rp_id(&mut self) { + self.rp_id = ::std::option::Option::None; + } + + pub fn has_rp_id(&self) -> bool { + self.rp_id.is_some() + } + + // Param is passed by value, moved + pub fn set_rp_id(&mut self, v: ::std::string::String) { + self.rp_id = ::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_rp_id(&mut self) -> &mut ::std::string::String { + if self.rp_id.is_none() { + self.rp_id = ::std::option::Option::Some(::std::string::String::new()); + } + self.rp_id.as_mut().unwrap() + } + + // Take field + pub fn take_rp_id(&mut self) -> ::std::string::String { + self.rp_id.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string rp_name = 4; + + pub fn rp_name(&self) -> &str { + match self.rp_name.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_rp_name(&mut self) { + self.rp_name = ::std::option::Option::None; + } + + pub fn has_rp_name(&self) -> bool { + self.rp_name.is_some() + } + + // Param is passed by value, moved + pub fn set_rp_name(&mut self, v: ::std::string::String) { + self.rp_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_rp_name(&mut self) -> &mut ::std::string::String { + if self.rp_name.is_none() { + self.rp_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.rp_name.as_mut().unwrap() + } + + // Take field + pub fn take_rp_name(&mut self) -> ::std::string::String { + self.rp_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bytes user_id = 5; + + pub fn user_id(&self) -> &[u8] { + match self.user_id.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_user_id(&mut self) { + self.user_id = ::std::option::Option::None; + } + + pub fn has_user_id(&self) -> bool { + self.user_id.is_some() + } + + // Param is passed by value, moved + pub fn set_user_id(&mut self, v: ::std::vec::Vec) { + self.user_id = ::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_user_id(&mut self) -> &mut ::std::vec::Vec { + if self.user_id.is_none() { + self.user_id = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.user_id.as_mut().unwrap() + } + + // Take field + pub fn take_user_id(&mut self) -> ::std::vec::Vec { + self.user_id.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional string user_name = 6; + + pub fn user_name(&self) -> &str { + match self.user_name.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_user_name(&mut self) { + self.user_name = ::std::option::Option::None; + } + + pub fn has_user_name(&self) -> bool { + self.user_name.is_some() + } + + // Param is passed by value, moved + pub fn set_user_name(&mut self, v: ::std::string::String) { + self.user_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_user_name(&mut self) -> &mut ::std::string::String { + if self.user_name.is_none() { + self.user_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.user_name.as_mut().unwrap() + } + + // Take field + pub fn take_user_name(&mut self) -> ::std::string::String { + self.user_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string user_display_name = 7; + + pub fn user_display_name(&self) -> &str { + match self.user_display_name.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_user_display_name(&mut self) { + self.user_display_name = ::std::option::Option::None; + } + + pub fn has_user_display_name(&self) -> bool { + self.user_display_name.is_some() + } + + // Param is passed by value, moved + pub fn set_user_display_name(&mut self, v: ::std::string::String) { + self.user_display_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_user_display_name(&mut self) -> &mut ::std::string::String { + if self.user_display_name.is_none() { + self.user_display_name = ::std::option::Option::Some(::std::string::String::new()); + } + self.user_display_name.as_mut().unwrap() + } + + // Take field + pub fn take_user_display_name(&mut self) -> ::std::string::String { + self.user_display_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint32 creation_time = 8; + + pub fn creation_time(&self) -> u32 { + self.creation_time.unwrap_or(0) + } + + pub fn clear_creation_time(&mut self) { + self.creation_time = ::std::option::Option::None; + } + + pub fn has_creation_time(&self) -> bool { + self.creation_time.is_some() + } + + // Param is passed by value, moved + pub fn set_creation_time(&mut self, v: u32) { + self.creation_time = ::std::option::Option::Some(v); + } + + // optional bool hmac_secret = 9; + + pub fn hmac_secret(&self) -> bool { + self.hmac_secret.unwrap_or(false) + } + + pub fn clear_hmac_secret(&mut self) { + self.hmac_secret = ::std::option::Option::None; + } + + pub fn has_hmac_secret(&self) -> bool { + self.hmac_secret.is_some() + } + + // Param is passed by value, moved + pub fn set_hmac_secret(&mut self, v: bool) { + self.hmac_secret = ::std::option::Option::Some(v); + } + + // optional bool use_sign_count = 10; + + pub fn use_sign_count(&self) -> bool { + self.use_sign_count.unwrap_or(false) + } + + pub fn clear_use_sign_count(&mut self) { + self.use_sign_count = ::std::option::Option::None; + } + + pub fn has_use_sign_count(&self) -> bool { + self.use_sign_count.is_some() + } + + // Param is passed by value, moved + pub fn set_use_sign_count(&mut self, v: bool) { + self.use_sign_count = ::std::option::Option::Some(v); + } + + // optional sint32 algorithm = 11; + + pub fn algorithm(&self) -> i32 { + self.algorithm.unwrap_or(0) + } + + pub fn clear_algorithm(&mut self) { + self.algorithm = ::std::option::Option::None; + } + + pub fn has_algorithm(&self) -> bool { + self.algorithm.is_some() + } + + // Param is passed by value, moved + pub fn set_algorithm(&mut self, v: i32) { + self.algorithm = ::std::option::Option::Some(v); + } + + // optional sint32 curve = 12; + + pub fn curve(&self) -> i32 { + self.curve.unwrap_or(0) + } + + pub fn clear_curve(&mut self) { + self.curve = ::std::option::Option::None; + } + + pub fn has_curve(&self) -> bool { + self.curve.is_some() + } + + // Param is passed by value, moved + pub fn set_curve(&mut self, v: i32) { + self.curve = ::std::option::Option::Some(v); + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(12); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "index", + |m: &WebAuthnCredential| { &m.index }, + |m: &mut WebAuthnCredential| { &mut m.index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "id", + |m: &WebAuthnCredential| { &m.id }, + |m: &mut WebAuthnCredential| { &mut m.id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "rp_id", + |m: &WebAuthnCredential| { &m.rp_id }, + |m: &mut WebAuthnCredential| { &mut m.rp_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "rp_name", + |m: &WebAuthnCredential| { &m.rp_name }, + |m: &mut WebAuthnCredential| { &mut m.rp_name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "user_id", + |m: &WebAuthnCredential| { &m.user_id }, + |m: &mut WebAuthnCredential| { &mut m.user_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "user_name", + |m: &WebAuthnCredential| { &m.user_name }, + |m: &mut WebAuthnCredential| { &mut m.user_name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "user_display_name", + |m: &WebAuthnCredential| { &m.user_display_name }, + |m: &mut WebAuthnCredential| { &mut m.user_display_name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "creation_time", + |m: &WebAuthnCredential| { &m.creation_time }, + |m: &mut WebAuthnCredential| { &mut m.creation_time }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "hmac_secret", + |m: &WebAuthnCredential| { &m.hmac_secret }, + |m: &mut WebAuthnCredential| { &mut m.hmac_secret }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "use_sign_count", + |m: &WebAuthnCredential| { &m.use_sign_count }, + |m: &mut WebAuthnCredential| { &mut m.use_sign_count }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "algorithm", + |m: &WebAuthnCredential| { &m.algorithm }, + |m: &mut WebAuthnCredential| { &mut m.algorithm }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "curve", + |m: &WebAuthnCredential| { &m.curve }, + |m: &mut WebAuthnCredential| { &mut m.curve }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "WebAuthnCredentials.WebAuthnCredential", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for WebAuthnCredential { + const NAME: &'static str = "WebAuthnCredential"; + + 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 { + 8 => { + self.index = ::std::option::Option::Some(is.read_uint32()?); + }, + 18 => { + self.id = ::std::option::Option::Some(is.read_bytes()?); + }, + 26 => { + self.rp_id = ::std::option::Option::Some(is.read_string()?); + }, + 34 => { + self.rp_name = ::std::option::Option::Some(is.read_string()?); + }, + 42 => { + self.user_id = ::std::option::Option::Some(is.read_bytes()?); + }, + 50 => { + self.user_name = ::std::option::Option::Some(is.read_string()?); + }, + 58 => { + self.user_display_name = ::std::option::Option::Some(is.read_string()?); + }, + 64 => { + self.creation_time = ::std::option::Option::Some(is.read_uint32()?); + }, + 72 => { + self.hmac_secret = ::std::option::Option::Some(is.read_bool()?); + }, + 80 => { + self.use_sign_count = ::std::option::Option::Some(is.read_bool()?); + }, + 88 => { + self.algorithm = ::std::option::Option::Some(is.read_sint32()?); + }, + 96 => { + self.curve = ::std::option::Option::Some(is.read_sint32()?); + }, + 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.index { + my_size += ::protobuf::rt::uint32_size(1, v); + } + if let Some(v) = self.id.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.rp_id.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.rp_name.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(v) = self.user_id.as_ref() { + my_size += ::protobuf::rt::bytes_size(5, &v); + } + if let Some(v) = self.user_name.as_ref() { + my_size += ::protobuf::rt::string_size(6, &v); + } + if let Some(v) = self.user_display_name.as_ref() { + my_size += ::protobuf::rt::string_size(7, &v); + } + if let Some(v) = self.creation_time { + my_size += ::protobuf::rt::uint32_size(8, v); + } + if let Some(v) = self.hmac_secret { + my_size += 1 + 1; + } + if let Some(v) = self.use_sign_count { + my_size += 1 + 1; + } + if let Some(v) = self.algorithm { + my_size += ::protobuf::rt::sint32_size(11, v); + } + if let Some(v) = self.curve { + my_size += ::protobuf::rt::sint32_size(12, 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.index { + os.write_uint32(1, v)?; + } + if let Some(v) = self.id.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.rp_id.as_ref() { + os.write_string(3, v)?; + } + if let Some(v) = self.rp_name.as_ref() { + os.write_string(4, v)?; + } + if let Some(v) = self.user_id.as_ref() { + os.write_bytes(5, v)?; + } + if let Some(v) = self.user_name.as_ref() { + os.write_string(6, v)?; + } + if let Some(v) = self.user_display_name.as_ref() { + os.write_string(7, v)?; + } + if let Some(v) = self.creation_time { + os.write_uint32(8, v)?; + } + if let Some(v) = self.hmac_secret { + os.write_bool(9, v)?; + } + if let Some(v) = self.use_sign_count { + os.write_bool(10, v)?; + } + if let Some(v) = self.algorithm { + os.write_sint32(11, v)?; + } + if let Some(v) = self.curve { + os.write_sint32(12, 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() -> WebAuthnCredential { + WebAuthnCredential::new() + } + + fn clear(&mut self) { + self.index = ::std::option::Option::None; + self.id = ::std::option::Option::None; + self.rp_id = ::std::option::Option::None; + self.rp_name = ::std::option::Option::None; + self.user_id = ::std::option::Option::None; + self.user_name = ::std::option::Option::None; + self.user_display_name = ::std::option::Option::None; + self.creation_time = ::std::option::Option::None; + self.hmac_secret = ::std::option::Option::None; + self.use_sign_count = ::std::option::Option::None; + self.algorithm = ::std::option::Option::None; + self.curve = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static WebAuthnCredential { + static instance: WebAuthnCredential = WebAuthnCredential { + index: ::std::option::Option::None, + id: ::std::option::Option::None, + rp_id: ::std::option::Option::None, + rp_name: ::std::option::Option::None, + user_id: ::std::option::Option::None, + user_name: ::std::option::Option::None, + user_display_name: ::std::option::Option::None, + creation_time: ::std::option::Option::None, + hmac_secret: ::std::option::Option::None, + use_sign_count: ::std::option::Option::None, + algorithm: ::std::option::Option::None, + curve: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for WebAuthnCredential { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("WebAuthnCredentials.WebAuthnCredential").unwrap()).clone() + } + } + + impl ::std::fmt::Display for WebAuthnCredential { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for WebAuthnCredential { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x17messages-webauthn.proto\x12\x1bhw.trezor.messages.webauthn\"!\n\ + \x1fWebAuthnListResidentCredentials\"D\n\x1dWebAuthnAddResidentCredentia\ + l\x12#\n\rcredential_id\x18\x01\x20\x01(\x0cR\x0ccredentialId\"8\n\x20We\ + bAuthnRemoveResidentCredential\x12\x14\n\x05index\x18\x01\x20\x01(\rR\ + \x05index\"\xe9\x03\n\x13WebAuthnCredentials\x12e\n\x0bcredentials\x18\ + \x01\x20\x03(\x0b2C.hw.trezor.messages.webauthn.WebAuthnCredentials.WebA\ + uthnCredentialR\x0bcredentials\x1a\xea\x02\n\x12WebAuthnCredential\x12\ + \x14\n\x05index\x18\x01\x20\x01(\rR\x05index\x12\x0e\n\x02id\x18\x02\x20\ + \x01(\x0cR\x02id\x12\x13\n\x05rp_id\x18\x03\x20\x01(\tR\x04rpId\x12\x17\ + \n\x07rp_name\x18\x04\x20\x01(\tR\x06rpName\x12\x17\n\x07user_id\x18\x05\ + \x20\x01(\x0cR\x06userId\x12\x1b\n\tuser_name\x18\x06\x20\x01(\tR\x08use\ + rName\x12*\n\x11user_display_name\x18\x07\x20\x01(\tR\x0fuserDisplayName\ + \x12#\n\rcreation_time\x18\x08\x20\x01(\rR\x0ccreationTime\x12\x1f\n\x0b\ + hmac_secret\x18\t\x20\x01(\x08R\nhmacSecret\x12$\n\x0euse_sign_count\x18\ + \n\x20\x01(\x08R\x0cuseSignCount\x12\x1c\n\talgorithm\x18\x0b\x20\x01(\ + \x11R\talgorithm\x12\x14\n\x05curve\x18\x0c\x20\x01(\x11R\x05curveB<\n#c\ + om.satoshilabs.trezor.lib.protobufB\x15TrezorMessageWebAuthn\ +"; + +/// `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(5); + messages.push(WebAuthnListResidentCredentials::generated_message_descriptor_data()); + messages.push(WebAuthnAddResidentCredential::generated_message_descriptor_data()); + messages.push(WebAuthnRemoveResidentCredential::generated_message_descriptor_data()); + messages.push(WebAuthnCredentials::generated_message_descriptor_data()); + messages.push(web_authn_credentials::WebAuthnCredential::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/wallet/trezor-client/src/protos/mod.rs b/wallet/trezor-client/src/protos/mod.rs new file mode 100644 index 0000000000..0f0a68126b --- /dev/null +++ b/wallet/trezor-client/src/protos/mod.rs @@ -0,0 +1,44 @@ +//! Bindings for Trezor protobufs. + +// Note: we do not use the generated `mod.rs` because we want to feature-gate some modules manually. +// This significantly improves compile times. +// See https://github.com/joshieDo/rust-trezor-api/pull/9 for more details. +#[allow(ambiguous_glob_reexports, unreachable_pub)] +#[allow(clippy::all)] +mod generated { + macro_rules! modules { + ($($($feature:literal =>)? $module:ident)+) => {$( + $(#[cfg(feature = $feature)])? + mod $module; + $(#[cfg(feature = $feature)])? + pub use self::$module::*; + )+}; + } + + modules! { + messages + messages_bootloader + messages_common + messages_crypto + messages_debug + messages_management + + "bitcoin" => messages_bitcoin + "ethereum" => messages_ethereum + "ethereum" => messages_ethereum_eip712 + "ethereum" => messages_ethereum_definitions + "binance" => messages_binance + "cardano" => messages_cardano + "eos" => messages_eos + "monero" => messages_monero + "nem" => messages_nem + "ripple" => messages_ripple + "solana" => messages_solana + "stellar" => messages_stellar + "tezos" => messages_tezos + "webauthn" => messages_webauthn + "mintlayer" => messages_mintlayer + } +} + +pub use generated::*; diff --git a/wallet/trezor-client/src/transport/error.rs b/wallet/trezor-client/src/transport/error.rs new file mode 100644 index 0000000000..282ae16f65 --- /dev/null +++ b/wallet/trezor-client/src/transport/error.rs @@ -0,0 +1,49 @@ +//! # Error Handling + +/// Trezor error. +#[derive(Debug, thiserror::Error)] +pub enum Error { + /// [rusb] error. + #[error(transparent)] + Usb(#[from] rusb::Error), + + /// [std::io] error. + #[error(transparent)] + IO(#[from] std::io::Error), + + /// The device to connect to was not found. + #[error("the device to connect to was not found")] + DeviceNotFound, + + /// The device is no longer available. + #[error("the device is no longer available")] + DeviceDisconnected, + + /// The device produced a data chunk of unexpected size. + #[error("the device produced a data chunk of unexpected size")] + UnexpectedChunkSizeFromDevice(usize), + + /// Timeout expired while reading from device. + #[error("timeout expired while reading from device")] + DeviceReadTimeout, + + /// The device sent a chunk with a wrong magic value. + #[error("the device sent a chunk with a wrong magic value")] + DeviceBadMagic, + + /// The device sent a message with a wrong session id. + #[error("the device sent a message with a wrong session id")] + DeviceBadSessionId, + + /// The device sent an unexpected sequence number. + #[error("the device sent an unexpected sequence number")] + DeviceUnexpectedSequenceNumber, + + /// Received a non-existing message type from the device. + #[error("received a non-existing message type from the device")] + InvalidMessageType(u32), + + /// Unable to determine device serial number. + #[error("unable to determine device serial number")] + NoDeviceSerial, +} diff --git a/wallet/trezor-client/src/transport/mod.rs b/wallet/trezor-client/src/transport/mod.rs new file mode 100644 index 0000000000..ee08c9e76c --- /dev/null +++ b/wallet/trezor-client/src/transport/mod.rs @@ -0,0 +1,85 @@ +use super::{AvailableDevice, Model}; +use crate::protos::MessageType; +use std::fmt; + +pub mod error; +pub mod protocol; +pub mod udp; +pub mod webusb; + +/// An available transport for a Trezor device, containing any of the different supported +/// transports. +#[derive(Debug)] +pub enum AvailableDeviceTransport { + WebUsb(webusb::AvailableWebUsbTransport), + Udp(udp::AvailableUdpTransport), +} + +impl fmt::Display for AvailableDeviceTransport { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + AvailableDeviceTransport::WebUsb(ref t) => write!(f, "{}", t), + AvailableDeviceTransport::Udp(ref t) => write!(f, "{}", t), + } + } +} + +/// A protobuf message accompanied by the message type. This type is used to pass messages over the +/// transport and used to contain messages received from the transport. +pub struct ProtoMessage(pub MessageType, pub Vec); + +impl ProtoMessage { + pub fn new(mt: MessageType, payload: Vec) -> ProtoMessage { + ProtoMessage(mt, payload) + } + pub fn message_type(&self) -> MessageType { + self.0 + } + pub fn payload(&self) -> &[u8] { + &self.1 + } + pub fn into_payload(self) -> Vec { + self.1 + } + + /// Take the payload from the ProtoMessage and parse it to a protobuf message. + pub fn into_message(self) -> Result { + protobuf::Message::parse_from_bytes(&self.into_payload()) + } +} + +/// The transport interface that is implemented by the different ways to communicate with a Trezor +/// device. +pub trait Transport: Sync + Send { + fn session_begin(&mut self) -> Result<(), error::Error>; + fn session_end(&mut self) -> Result<(), error::Error>; + + fn write_message(&mut self, message: ProtoMessage) -> Result<(), error::Error>; + fn read_message(&mut self) -> Result; +} + +/// A delegation method to connect an available device transport. It delegates to the different +/// transport types. +pub fn connect(available_device: &AvailableDevice) -> Result, error::Error> { + match available_device.transport { + AvailableDeviceTransport::WebUsb(_) => webusb::WebUsbTransport::connect(available_device), + AvailableDeviceTransport::Udp(_) => udp::UdpTransport::connect(available_device), + } +} + +// A collection of transport-global constants. +mod constants { + pub(crate) const DEV_TREZOR_LEGACY: (u16, u16) = (0x534C, 0x0001); + pub(crate) const DEV_TREZOR: (u16, u16) = (0x1209, 0x53C1); + pub(crate) const DEV_TREZOR_BOOTLOADER: (u16, u16) = (0x1209, 0x53C0); +} + +/// Derive the Trezor model from the USB device. +pub(crate) fn derive_model(dev_id: (u16, u16)) -> Option { + match dev_id { + constants::DEV_TREZOR_LEGACY => Some(Model::TrezorLegacy), + constants::DEV_TREZOR => Some(Model::Trezor), + constants::DEV_TREZOR_BOOTLOADER => Some(Model::TrezorBootloader), + _ => None, + } +} diff --git a/wallet/trezor-client/src/transport/protocol.rs b/wallet/trezor-client/src/transport/protocol.rs new file mode 100644 index 0000000000..fd9376f266 --- /dev/null +++ b/wallet/trezor-client/src/transport/protocol.rs @@ -0,0 +1,214 @@ +use crate::{ + protos::MessageType, + transport::{error::Error, ProtoMessage}, +}; +use byteorder::{BigEndian, ByteOrder}; +use protobuf::Enum; +use std::cmp; + +/// A link represents a serial connection to send and receive byte chunks from and to a device. +pub trait Link { + fn write_chunk(&mut self, chunk: Vec) -> Result<(), Error>; + fn read_chunk(&mut self) -> Result, Error>; +} + +/// A protocol is used to encode messages in chunks that can be sent to the device and to parse +/// chunks into messages. +pub trait Protocol { + fn session_begin(&mut self) -> Result<(), Error>; + fn session_end(&mut self) -> Result<(), Error>; + fn write(&mut self, message: ProtoMessage) -> Result<(), Error>; + fn read(&mut self) -> Result; +} + +/// The length of the chunks sent. +const REPLEN: usize = 64; + +/// V2 of the binary protocol. +/// This version is currently not in use by any device and is subject to change. +#[allow(dead_code)] +pub struct ProtocolV2 { + pub link: L, + pub session_id: u32, +} + +impl Protocol for ProtocolV2 { + fn session_begin(&mut self) -> Result<(), Error> { + let mut chunk = vec![0; REPLEN]; + chunk[0] = 0x03; + self.link.write_chunk(chunk)?; + let resp = self.link.read_chunk()?; + if resp[0] != 0x03 { + println!( + "bad magic in v2 session_begin: {:x} instead of 0x03", + resp[0] + ); + return Err(Error::DeviceBadMagic); + } + self.session_id = BigEndian::read_u32(&resp[1..5]); + Ok(()) + } + + fn session_end(&mut self) -> Result<(), Error> { + assert!(self.session_id != 0); + let mut chunk = vec![0; REPLEN]; + chunk[0] = 0x04; + BigEndian::write_u32(&mut chunk[1..5], self.session_id); + self.link.write_chunk(chunk)?; + let resp = self.link.read_chunk()?; + if resp[0] != 0x04 { + println!("bad magic in v2 session_end: {:x} instead of 0x04", resp[0]); + return Err(Error::DeviceBadMagic); + } + self.session_id = 0; + Ok(()) + } + + fn write(&mut self, message: ProtoMessage) -> Result<(), Error> { + assert!(self.session_id != 0); + + // First generate the total payload, then write it to the transport in chunks. + let mut data = vec![0; 8]; + BigEndian::write_u32(&mut data[0..4], message.message_type() as u32); + BigEndian::write_u32(&mut data[4..8], message.payload().len() as u32); + data.extend(message.into_payload()); + + let mut cur: usize = 0; + let mut seq: isize = -1; + while cur < data.len() { + // Build header. + let mut chunk = if seq < 0 { + let mut header = vec![0; 5]; + header[0] = 0x01; + BigEndian::write_u32(&mut header[1..5], self.session_id); + header + } else { + let mut header = vec![0; 9]; + header[0] = 0x01; + BigEndian::write_u32(&mut header[1..5], self.session_id); + BigEndian::write_u32(&mut header[5..9], seq as u32); + header + }; + seq += 1; + + // Fill remainder. + let end = cmp::min(cur + (REPLEN - chunk.len()), data.len()); + chunk.extend(&data[cur..end]); + cur = end; + debug_assert!(chunk.len() <= REPLEN); + chunk.resize(REPLEN, 0); + + self.link.write_chunk(chunk)?; + } + + Ok(()) + } + + fn read(&mut self) -> Result { + debug_assert!(self.session_id != 0); + + let chunk = self.link.read_chunk()?; + if chunk[0] != 0x01 { + println!("bad magic in v2 read: {:x} instead of 0x01", chunk[0]); + return Err(Error::DeviceBadMagic); + } + if BigEndian::read_u32(&chunk[1..5]) != self.session_id { + return Err(Error::DeviceBadSessionId); + } + let message_type_id = BigEndian::read_u32(&chunk[5..9]); + let message_type = MessageType::from_i32(message_type_id as i32) + .ok_or(Error::InvalidMessageType(message_type_id))?; + let data_length = BigEndian::read_u32(&chunk[9..13]) as usize; + + let mut data: Vec = chunk[13..].into(); + let mut seq = 0; + while data.len() < data_length { + let chunk = self.link.read_chunk()?; + if chunk[0] != 0x02 { + println!( + "bad magic in v2 session_begin: {:x} instead of 0x02", + chunk[0] + ); + return Err(Error::DeviceBadMagic); + } + if BigEndian::read_u32(&chunk[1..5]) != self.session_id { + return Err(Error::DeviceBadSessionId); + } + if BigEndian::read_u32(&chunk[5..9]) != seq as u32 { + return Err(Error::DeviceUnexpectedSequenceNumber); + } + seq += 1; + + data.extend(&chunk[9..]); + } + + Ok(ProtoMessage(message_type, data[0..data_length].into())) + } +} + +/// The original binary protocol. +pub struct ProtocolV1 { + pub link: L, +} + +impl Protocol for ProtocolV1 { + fn session_begin(&mut self) -> Result<(), Error> { + Ok(()) // no sessions + } + + fn session_end(&mut self) -> Result<(), Error> { + Ok(()) // no sessions + } + + fn write(&mut self, message: ProtoMessage) -> Result<(), Error> { + // First generate the total payload, then write it to the transport in chunks. + let mut data = vec![0; 8]; + data[0] = 0x23; + data[1] = 0x23; + BigEndian::write_u16(&mut data[2..4], message.message_type() as u16); + BigEndian::write_u32(&mut data[4..8], message.payload().len() as u32); + data.extend(message.into_payload()); + + let mut cur: usize = 0; + while cur < data.len() { + let mut chunk = vec![0x3f]; + let end = cmp::min(cur + (REPLEN - 1), data.len()); + chunk.extend(&data[cur..end]); + cur = end; + debug_assert!(chunk.len() <= REPLEN); + chunk.resize(REPLEN, 0); + + self.link.write_chunk(chunk)?; + } + + Ok(()) + } + + fn read(&mut self) -> Result { + let chunk = self.link.read_chunk()?; + if chunk[0] != 0x3f || chunk[1] != 0x23 || chunk[2] != 0x23 { + println!( + "bad magic in v1 read: {:x}{:x}{:x} instead of 0x3f2323", + chunk[0], chunk[1], chunk[2] + ); + return Err(Error::DeviceBadMagic); + } + let message_type_id = BigEndian::read_u16(&chunk[3..5]) as u32; + let message_type = MessageType::from_i32(message_type_id as i32) + .ok_or(Error::InvalidMessageType(message_type_id))?; + let data_length = BigEndian::read_u32(&chunk[5..9]) as usize; + let mut data: Vec = chunk[9..].into(); + + while data.len() < data_length { + let chunk = self.link.read_chunk()?; + if chunk[0] != 0x3f { + println!("bad magic in v1 read: {:x} instead of 0x3f", chunk[0]); + return Err(Error::DeviceBadMagic); + } + + data.extend(&chunk[1..]); + } + + Ok(ProtoMessage(message_type, data[0..data_length].into())) + } +} diff --git a/wallet/trezor-client/src/transport/udp.rs b/wallet/trezor-client/src/transport/udp.rs new file mode 100644 index 0000000000..b70ef5bf66 --- /dev/null +++ b/wallet/trezor-client/src/transport/udp.rs @@ -0,0 +1,159 @@ +use super::{ + error::Error, + protocol::{Link, Protocol, ProtocolV1}, + AvailableDeviceTransport, ProtoMessage, Transport, +}; +use crate::{AvailableDevice, Model}; +use std::{fmt, net::UdpSocket, result::Result, time::Duration}; + +// A collection of constants related to the Emulator Ports. +mod constants { + pub(crate) const DEFAULT_HOST: &str = "127.0.0.1"; + pub(crate) const DEFAULT_PORT: &str = "21324"; + pub(crate) const DEFAULT_DEBUG_PORT: &str = "21325"; + pub(crate) const LOCAL_LISTENER: &str = "127.0.0.1:0"; +} + +use constants::{DEFAULT_DEBUG_PORT, DEFAULT_HOST, DEFAULT_PORT, LOCAL_LISTENER}; + +/// The chunk size for the serial protocol. +const CHUNK_SIZE: usize = 64; + +const READ_TIMEOUT_MS: u64 = 100000; +const WRITE_TIMEOUT_MS: u64 = 100000; + +/// An available transport for connecting with a device. +#[derive(Debug)] +pub struct AvailableUdpTransport { + pub host: String, + pub port: String, +} + +impl fmt::Display for AvailableUdpTransport { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "udp:{}:{}", self.host, self.port) + } +} + +/// An actual serial HID USB link to a device over which bytes can be sent. +struct UdpLink { + socket: UdpSocket, + device: (String, String), +} +// No need to implement drop as every member is owned + +impl Link for UdpLink { + fn write_chunk(&mut self, chunk: Vec) -> Result<(), Error> { + debug_assert_eq!(CHUNK_SIZE, chunk.len()); + let timeout = Duration::from_millis(WRITE_TIMEOUT_MS); + self.socket.set_write_timeout(Some(timeout))?; + if let Err(e) = self.socket.send(&chunk) { + return Err(e.into()); + } + Ok(()) + } + + fn read_chunk(&mut self) -> Result, Error> { + let mut chunk = vec![0; CHUNK_SIZE]; + let timeout = Duration::from_millis(READ_TIMEOUT_MS); + self.socket.set_read_timeout(Some(timeout))?; + + let n = self.socket.recv(&mut chunk)?; + if n == CHUNK_SIZE { + Ok(chunk) + } else { + Err(Error::DeviceReadTimeout) + } + } +} + +impl UdpLink { + fn open(path: &str) -> Result { + let mut parts = path.split(':'); + let link = Self { + socket: UdpSocket::bind(LOCAL_LISTENER)?, + device: ( + parts.next().expect("Incorrect Path").to_owned(), + parts.next().expect("Incorrect Path").to_owned(), + ), + }; + link.socket.connect(path)?; + Ok(link) + } + + // Ping the port and compare against expected response + fn ping(&self) -> Result { + let mut resp = [0; CHUNK_SIZE]; + self.socket.send("PINGPING".as_bytes())?; + let size = self.socket.recv(&mut resp)?; + Ok(&resp[..size] == "PONGPONG".as_bytes()) + } +} + +/// An implementation of the Transport interface for UDP devices. +pub struct UdpTransport { + protocol: ProtocolV1, +} + +impl UdpTransport { + pub fn find_devices(debug: bool, path: Option<&str>) -> Result, Error> { + let mut devices = Vec::new(); + let mut dest = String::new(); + match path { + Some(p) => p.clone_into(&mut dest), + None => { + dest.push_str(DEFAULT_HOST); + dest.push(':'); + dest.push_str(if debug { + DEFAULT_DEBUG_PORT + } else { + DEFAULT_PORT + }); + } + }; + let link = UdpLink::open(&dest)?; + if link.ping()? { + devices.push(AvailableDevice { + model: Model::TrezorEmulator, + debug, + transport: AvailableDeviceTransport::Udp(AvailableUdpTransport { + host: link.device.0, + port: link.device.1, + }), + }); + } + Ok(devices) + } + + /// Connect to a device over the UDP transport. + pub fn connect(device: &AvailableDevice) -> Result, Error> { + let transport = match device.transport { + AvailableDeviceTransport::Udp(ref t) => t, + _ => panic!("passed wrong AvailableDevice in UdpTransport::connect"), + }; + let mut path = String::new(); + path.push_str(&transport.host); + path.push(':'); + path.push_str(&transport.port); + let link = UdpLink::open(&path)?; + Ok(Box::new(UdpTransport { + protocol: ProtocolV1 { link }, + })) + } +} + +impl super::Transport for UdpTransport { + fn session_begin(&mut self) -> Result<(), Error> { + self.protocol.session_begin() + } + fn session_end(&mut self) -> Result<(), Error> { + self.protocol.session_end() + } + + fn write_message(&mut self, message: ProtoMessage) -> Result<(), Error> { + self.protocol.write(message) + } + fn read_message(&mut self) -> Result { + self.protocol.read() + } +} diff --git a/wallet/trezor-client/src/transport/webusb.rs b/wallet/trezor-client/src/transport/webusb.rs new file mode 100644 index 0000000000..635f048ecb --- /dev/null +++ b/wallet/trezor-client/src/transport/webusb.rs @@ -0,0 +1,173 @@ +use crate::{ + transport::{ + derive_model, + error::Error, + protocol::{Link, Protocol, ProtocolV1}, + AvailableDeviceTransport, ProtoMessage, Transport, + }, + AvailableDevice, +}; +use rusb::*; +use std::{fmt, result::Result, time::Duration}; + +// A collection of constants related to the WebUsb protocol. +mod constants { + pub(crate) const CONFIG_ID: u8 = 0; + pub(crate) const INTERFACE_DESCRIPTOR: u8 = 0; + pub(crate) const LIBUSB_CLASS_VENDOR_SPEC: u8 = 0xff; + + pub(crate) const INTERFACE: u8 = 0; + pub(crate) const INTERFACE_DEBUG: u8 = 1; + pub(crate) const ENDPOINT: u8 = 1; + pub(crate) const ENDPOINT_DEBUG: u8 = 2; + pub(crate) const READ_ENDPOINT_MASK: u8 = 0x80; +} + +/// The chunk size for the serial protocol. +const CHUNK_SIZE: usize = 64; + +const READ_TIMEOUT_MS: u64 = 100000; +const WRITE_TIMEOUT_MS: u64 = 100000; + +/// An available transport for connecting with a device. +#[derive(Debug)] +pub struct AvailableWebUsbTransport { + pub bus: u8, + pub address: u8, +} + +impl fmt::Display for AvailableWebUsbTransport { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "WebUSB ({}:{})", self.bus, self.address) + } +} + +/// An actual serial USB link to a device over which bytes can be sent. +pub struct WebUsbLink { + handle: DeviceHandle, + endpoint: u8, +} + +impl Link for WebUsbLink { + fn write_chunk(&mut self, chunk: Vec) -> Result<(), Error> { + debug_assert_eq!(CHUNK_SIZE, chunk.len()); + let timeout = Duration::from_millis(WRITE_TIMEOUT_MS); + if let Err(e) = self.handle.write_interrupt(self.endpoint, &chunk, timeout) { + return Err(e.into()); + } + Ok(()) + } + + fn read_chunk(&mut self) -> Result, Error> { + let mut chunk = vec![0; CHUNK_SIZE]; + let endpoint = constants::READ_ENDPOINT_MASK | self.endpoint; + let timeout = Duration::from_millis(READ_TIMEOUT_MS); + + let n = self.handle.read_interrupt(endpoint, &mut chunk, timeout)?; + if n == CHUNK_SIZE { + Ok(chunk) + } else { + Err(Error::DeviceReadTimeout) + } + } +} + +/// An implementation of the Transport interface for WebUSB devices. +pub struct WebUsbTransport { + protocol: ProtocolV1, +} + +impl WebUsbTransport { + pub fn find_devices(debug: bool) -> Result, Error> { + let mut devices = Vec::new(); + + for dev in rusb::devices().unwrap().iter() { + let desc = dev.device_descriptor()?; + let dev_id = (desc.vendor_id(), desc.product_id()); + + let model = match derive_model(dev_id) { + Some(m) => m, + None => continue, + }; + + // Check something with interface class code like python-trezor does. + let class_code = dev + .config_descriptor(constants::CONFIG_ID)? + .interfaces() + .find(|i| i.number() == constants::INTERFACE) + .ok_or(rusb::Error::Other)? + .descriptors() + .find(|d| d.setting_number() == constants::INTERFACE_DESCRIPTOR) + .ok_or(rusb::Error::Other)? + .class_code(); + if class_code != constants::LIBUSB_CLASS_VENDOR_SPEC { + continue; + } + + devices.push(AvailableDevice { + model, + debug, + transport: AvailableDeviceTransport::WebUsb(AvailableWebUsbTransport { + bus: dev.bus_number(), + address: dev.address(), + }), + }); + } + Ok(devices) + } + + /// Connect to a device over the WebUSB transport. + pub fn connect(device: &AvailableDevice) -> Result, Error> { + let transport = match &device.transport { + AvailableDeviceTransport::WebUsb(t) => t, + _ => panic!("passed wrong AvailableDevice in WebUsbTransport::connect"), + }; + + let interface = match device.debug { + false => constants::INTERFACE, + true => constants::INTERFACE_DEBUG, + }; + + // Go over the devices again to match the desired device. + let dev = rusb::devices()? + .iter() + .find(|dev| dev.bus_number() == transport.bus && dev.address() == transport.address) + .ok_or(Error::DeviceDisconnected)?; + // Check if there is not another device connected on this bus. + let dev_desc = dev.device_descriptor()?; + let dev_id = (dev_desc.vendor_id(), dev_desc.product_id()); + if derive_model(dev_id).as_ref() != Some(&device.model) { + return Err(Error::DeviceDisconnected); + } + let handle = dev.open()?; + handle.claim_interface(interface)?; + + Ok(Box::new(WebUsbTransport { + protocol: ProtocolV1 { + link: WebUsbLink { + handle, + endpoint: match device.debug { + false => constants::ENDPOINT, + true => constants::ENDPOINT_DEBUG, + }, + }, + }, + })) + } +} + +impl super::Transport for WebUsbTransport { + fn session_begin(&mut self) -> Result<(), Error> { + self.protocol.session_begin() + } + fn session_end(&mut self) -> Result<(), Error> { + self.protocol.session_end() + } + + fn write_message(&mut self, message: ProtoMessage) -> Result<(), Error> { + self.protocol.write(message) + } + fn read_message(&mut self) -> Result { + self.protocol.read() + } +} diff --git a/wallet/trezor-client/src/utils.rs b/wallet/trezor-client/src/utils.rs new file mode 100644 index 0000000000..c248599700 --- /dev/null +++ b/wallet/trezor-client/src/utils.rs @@ -0,0 +1,73 @@ +use crate::error::{Error, Result}; +use bitcoin::{ + address, + address::Payload, + bip32, + blockdata::script::Script, + hashes::{sha256d, Hash}, + psbt, + secp256k1::ecdsa::{RecoverableSignature, RecoveryId}, + Address, Network, +}; + +/// Retrieve an address from the given script. +pub fn address_from_script(script: &Script, network: Network) -> Option { + let payload = Payload::from_script(script).ok()?; + Some(Address::new(network, payload)) +} + +/// Find the (first if multiple) PSBT input that refers to the given txid. +pub fn psbt_find_input(psbt: &psbt::Psbt, txid: sha256d::Hash) -> Result<&psbt::Input> { + let inputs = &psbt.unsigned_tx.input; + let idx = inputs + .iter() + .position(|tx| *tx.previous_output.txid.as_raw_hash() == txid) + .ok_or(Error::TxRequestUnknownTxid(txid))?; + psbt.inputs.get(idx).ok_or(Error::TxRequestInvalidIndex(idx)) +} + +/// Get a hash from a reverse byte representation. +pub fn from_rev_bytes(rev_bytes: &[u8]) -> Option { + let mut bytes = rev_bytes.to_vec(); + bytes.reverse(); + sha256d::Hash::from_slice(&bytes).ok() +} + +/// Get the reverse byte representation of a hash. +pub fn to_rev_bytes(hash: &sha256d::Hash) -> [u8; 32] { + let mut bytes = hash.to_byte_array(); + bytes.reverse(); + bytes +} + +/// Parse a Bitcoin Core-style 65-byte recoverable signature. +pub fn parse_recoverable_signature( + sig: &[u8], +) -> Result { + if sig.len() != 65 { + return Err(bitcoin::secp256k1::Error::InvalidSignature); + } + + // Bitcoin Core sets the first byte to `27 + rec + (fCompressed ? 4 : 0)`. + let rec_id = RecoveryId::from_i32(if sig[0] >= 31 { + (sig[0] - 31) as i32 + } else { + (sig[0] - 27) as i32 + })?; + + RecoverableSignature::from_compact(&sig[1..], rec_id) +} + +/// Convert a bitcoin network constant to the Trezor-compatible coin_name string. +pub fn coin_name(network: Network) -> Result { + match network { + Network::Bitcoin => Ok("Bitcoin".to_owned()), + Network::Testnet => Ok("Testnet".to_owned()), + _ => Err(Error::UnsupportedNetwork), + } +} + +/// Convert a BIP-32 derivation path into a `Vec`. +pub fn convert_path(path: &bip32::DerivationPath) -> Vec { + path.into_iter().map(|i| u32::from(*i)).collect() +}