From 30f2e7a1fc94fa12d12f133fba573f9159096e3a Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Mon, 30 Dec 2024 17:41:40 +0000 Subject: [PATCH 1/2] zcash_client_backend: Migrate to `tonic-build 0.12.3` --- Cargo.lock | 5 +- Cargo.toml | 2 +- supply-chain/audits.toml | 6 ++ zcash_client_backend/build.rs | 2 +- zcash_client_backend/src/proto/service.rs | 71 +++++++++-------------- 5 files changed, 40 insertions(+), 46 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fe3cefaeb8..00b86423f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4656,13 +4656,14 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568392c5a2bd0020723e3f387891176aabafe36fd9fcd074ad309dfa0c8eb964" +checksum = "9557ce109ea773b399c9b9e5dca39294110b74f1f342cb347a80d1fce8c26a11" dependencies = [ "prettyplease", "proc-macro2", "prost-build", + "prost-types", "quote", "syn 2.0.63", ] diff --git a/Cargo.toml b/Cargo.toml index 8e42e975c2..24559a118a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -125,7 +125,7 @@ rayon = "1.5" # Protobuf and gRPC prost = "0.13" tonic = { version = "0.12", default-features = false } -tonic-build = { version = "0.12", default-features = false } +tonic-build = { version = "0.12.3", default-features = false } # Secret management secrecy = "0.8" diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index b4611bbcf0..c1f692aa22 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -570,6 +570,12 @@ who = "Jack Grigg " criteria = "safe-to-deploy" delta = "0.12.0 -> 0.12.1" +[[audits.tonic-build]] +who = "Jack Grigg " +criteria = "safe-to-deploy" +delta = "0.12.1 -> 0.12.3" +notes = "Changes to generated code make sense and don't result in anything unexpected." + [[audits.utf8parse]] who = "Jack Grigg " criteria = "safe-to-run" diff --git a/zcash_client_backend/build.rs b/zcash_client_backend/build.rs index 396738bdb5..e2503554a3 100644 --- a/zcash_client_backend/build.rs +++ b/zcash_client_backend/build.rs @@ -72,7 +72,7 @@ fn build() -> io::Result<()> { ".cash.z.wallet.sdk.rpc.CompactOrchardAction", "crate::proto::compact_formats::CompactOrchardAction", ) - .compile(&[SERVICE_PROTO], &["proto/"])?; + .compile_protos(&[SERVICE_PROTO], &["proto/"])?; // Build the proposal types. tonic_build::compile_protos(PROPOSAL_PROTO)?; diff --git a/zcash_client_backend/src/proto/service.rs b/zcash_client_backend/src/proto/service.rs index 66db72451c..9992428f07 100644 --- a/zcash_client_backend/src/proto/service.rs +++ b/zcash_client_backend/src/proto/service.rs @@ -281,7 +281,13 @@ impl ShieldedProtocol { /// Generated client implementations. #[cfg(feature = "lightwalletd-tonic")] pub mod compact_tx_streamer_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] @@ -292,8 +298,8 @@ pub mod compact_tx_streamer_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -318,7 +324,7 @@ pub mod compact_tx_streamer_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { CompactTxStreamerClient::new(InterceptedService::new(inner, interceptor)) } @@ -362,8 +368,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -393,8 +398,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -424,8 +428,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -457,8 +460,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -490,8 +492,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -518,8 +519,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -546,8 +546,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -577,8 +576,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -604,8 +602,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -631,8 +628,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -672,8 +668,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -704,8 +699,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -735,8 +729,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -762,8 +755,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -794,8 +786,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -824,8 +815,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -854,8 +844,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -882,8 +871,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -910,8 +898,7 @@ pub mod compact_tx_streamer_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; From 919cb286d16904d29e6c17353d66246a31505d2c Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Mon, 30 Dec 2024 18:02:31 +0000 Subject: [PATCH 2/2] Migrate to `prost-build 0.13.4` --- Cargo.lock | 17 +++++------ supply-chain/audits.toml | 29 +++++++++++++++++++ .../src/proto/compact_formats.rs | 6 ---- zcash_client_backend/src/proto/proposal.rs | 27 +++++------------ zcash_client_backend/src/proto/service.rs | 25 ++-------------- 5 files changed, 47 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 00b86423f6..f545a461ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3313,9 +3313,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.13.1" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" +checksum = "2c0fef6c4230e4ccf618a35c59d7ede15dea37de8427500f50aff708806e42ec" dependencies = [ "bytes", "prost-derive", @@ -3323,11 +3323,10 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.13.1" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb182580f71dd070f88d01ce3de9f4da5021db7115d2e1c3605a754153b77c1" +checksum = "d0f3e5beed80eb580c68e2c600937ac2c4eedabdfd5ef1e5b7ea4f3fba84497b" dependencies = [ - "bytes", "heck 0.5.0", "itertools 0.13.0", "log", @@ -3344,9 +3343,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.13.1" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" +checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3" dependencies = [ "anyhow", "itertools 0.13.0", @@ -3357,9 +3356,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.13.1" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" +checksum = "cc2f1e56baa61e93533aebc21af4d2134b70f66275e0fcdf3cbe43d77ff7e8fc" dependencies = [ "prost", ] diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index c1f692aa22..c0066a8dd9 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -346,11 +346,30 @@ who = "Daira-Emma Hopwood " criteria = "safe-to-deploy" delta = "0.12.1 -> 0.12.3" +[[audits.prost]] +who = "Jack Grigg " +criteria = "safe-to-deploy" +delta = "0.13.1 -> 0.13.4" +notes = """ +- The new `unsafe` block in `encoded_len_varint` has correct safety documentation. +- The other changes to `unsafe` code are a move of existing `unsafe` code. +""" + [[audits.prost-build]] who = "Daira-Emma Hopwood " criteria = "safe-to-deploy" delta = "0.12.1 -> 0.12.3" +[[audits.prost-build]] +who = "Jack Grigg " +criteria = "safe-to-deploy" +delta = "0.13.1 -> 0.13.4" +notes = """ +- Changes to generated code make sense. +- Changes to `protoc` path handling don't alter existing usages (just allow the + path to be explicitly set). +""" + [[audits.prost-derive]] who = "Daira-Emma Hopwood " criteria = "safe-to-deploy" @@ -362,11 +381,21 @@ criteria = "safe-to-deploy" delta = "0.12.3 -> 0.12.6" notes = "Changes to proc macro code are to fix lints after bumping MSRV." +[[audits.prost-derive]] +who = "Jack Grigg " +criteria = "safe-to-deploy" +delta = "0.13.1 -> 0.13.4" + [[audits.prost-types]] who = "Daira-Emma Hopwood " criteria = "safe-to-deploy" delta = "0.12.1 -> 0.12.3" +[[audits.prost-types]] +who = "Jack Grigg " +criteria = "safe-to-deploy" +delta = "0.13.1 -> 0.13.4" + [[audits.redox_syscall]] who = "Daira-Emma Hopwood " criteria = "safe-to-run" diff --git a/zcash_client_backend/src/proto/compact_formats.rs b/zcash_client_backend/src/proto/compact_formats.rs index 1e688b6014..e2931b11b6 100644 --- a/zcash_client_backend/src/proto/compact_formats.rs +++ b/zcash_client_backend/src/proto/compact_formats.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. /// Information about the state of the chain as of a given block. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ChainMetadata { /// the size of the Sapling note commitment tree as of the end of this block @@ -16,7 +15,6 @@ pub struct ChainMetadata { /// 1. Detect a payment to your Shielded address /// 2. Detect a spend of your Shielded notes /// 3. Update your witnesses to generate new spend proofs. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CompactBlock { /// the version of this wire format, for storage @@ -49,7 +47,6 @@ pub struct CompactBlock { /// CompactTx contains the minimum information for a wallet to know if this transaction /// is relevant to it (either pays to it or spends from it) via shielded elements /// only. This message will not encode a transparent-to-transparent transaction. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CompactTx { /// Index and hash will allow the receiver to call out to chain @@ -80,7 +77,6 @@ pub struct CompactTx { /// /// CompactSaplingSpend is a Sapling Spend Description as described in 7.3 of the Zcash /// protocol specification. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CompactSaplingSpend { /// Nullifier (see the Zcash protocol specification) @@ -91,7 +87,6 @@ pub struct CompactSaplingSpend { /// /// It encodes the `cmu` field, `ephemeralKey` field, and a 52-byte prefix of the /// `encCiphertext` field of a Sapling Output Description. Total size is 116 bytes. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CompactSaplingOutput { /// Note commitment u-coordinate. @@ -105,7 +100,6 @@ pub struct CompactSaplingOutput { pub ciphertext: ::prost::alloc::vec::Vec, } /// A compact representation of an [Orchard Action](). -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CompactOrchardAction { /// \[32\] The nullifier of the input note diff --git a/zcash_client_backend/src/proto/proposal.rs b/zcash_client_backend/src/proto/proposal.rs index d4fd13c1e4..eed2b14a7d 100644 --- a/zcash_client_backend/src/proto/proposal.rs +++ b/zcash_client_backend/src/proto/proposal.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. /// A data structure that describes a series of transactions to be created. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Proposal { /// The version of this serialization format. @@ -21,7 +20,6 @@ pub struct Proposal { } /// A data structure that describes the inputs to be consumed and outputs to /// be produced in a proposed transaction. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProposalStep { /// ZIP 321 serialized transaction request @@ -51,7 +49,6 @@ pub struct ProposalStep { /// A mapping from ZIP 321 payment index to the output pool that has been chosen /// for that payment, based upon the payment address and the selected inputs to /// the transaction. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct PaymentOutputPool { #[prost(uint32, tag = "1")] @@ -61,7 +58,6 @@ pub struct PaymentOutputPool { } /// The unique identifier and value for each proposed input that does not /// require a back-reference to a prior step of the proposal. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReceivedOutput { #[prost(bytes = "vec", tag = "1")] @@ -75,7 +71,6 @@ pub struct ReceivedOutput { } /// A reference to a payment in a prior step of the proposal. This payment must /// belong to the wallet. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct PriorStepOutput { #[prost(uint32, tag = "1")] @@ -84,7 +79,6 @@ pub struct PriorStepOutput { pub payment_index: u32, } /// A reference to a change or ephemeral output from a prior step of the proposal. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct PriorStepChange { #[prost(uint32, tag = "1")] @@ -93,7 +87,6 @@ pub struct PriorStepChange { pub change_index: u32, } /// The unique identifier and value for an input to be used in the transaction. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProposedInput { #[prost(oneof = "proposed_input::Value", tags = "1, 2, 3")] @@ -101,7 +94,6 @@ pub struct ProposedInput { } /// Nested message and enum types in `ProposedInput`. pub mod proposed_input { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { #[prost(message, tag = "1")] @@ -113,7 +105,6 @@ pub mod proposed_input { } } /// The proposed change outputs and fee value. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TransactionBalance { /// A list of change or ephemeral output values. @@ -130,7 +121,6 @@ pub struct TransactionBalance { /// an ephemeral output, which must be spent by a subsequent step. This is /// only supported for transparent outputs. Each ephemeral output will be /// given a unique t-address. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChangeValue { /// The value of a change or ephemeral output to be created, in zatoshis. @@ -149,7 +139,6 @@ pub struct ChangeValue { } /// An object wrapper for memo bytes, to facilitate representing the /// `change_memo == None` case. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MemoBytes { #[prost(bytes = "vec", tag = "1")] @@ -177,10 +166,10 @@ impl ValuePool { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ValuePool::PoolNotSpecified => "PoolNotSpecified", - ValuePool::Transparent => "Transparent", - ValuePool::Sapling => "Sapling", - ValuePool::Orchard => "Orchard", + Self::PoolNotSpecified => "PoolNotSpecified", + Self::Transparent => "Transparent", + Self::Sapling => "Sapling", + Self::Orchard => "Orchard", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -217,10 +206,10 @@ impl FeeRule { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - FeeRule::NotSpecified => "FeeRuleNotSpecified", - FeeRule::PreZip313 => "PreZip313", - FeeRule::Zip313 => "Zip313", - FeeRule::Zip317 => "Zip317", + Self::NotSpecified => "FeeRuleNotSpecified", + Self::PreZip313 => "PreZip313", + Self::Zip313 => "Zip313", + Self::Zip317 => "Zip317", } } /// Creates an enum from field names used in the ProtoBuf definition. diff --git a/zcash_client_backend/src/proto/service.rs b/zcash_client_backend/src/proto/service.rs index 9992428f07..f471e81567 100644 --- a/zcash_client_backend/src/proto/service.rs +++ b/zcash_client_backend/src/proto/service.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// A BlockID message contains identifiers to select a block: a height or a /// hash. Specification by hash is not implemented, but may be in the future. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockId { #[prost(uint64, tag = "1")] @@ -11,7 +10,6 @@ pub struct BlockId { } /// BlockRange specifies a series of blocks from start to end inclusive. /// Both BlockIDs must be heights; specification by hash is not yet supported. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockRange { #[prost(message, optional, tag = "1")] @@ -22,7 +20,6 @@ pub struct BlockRange { /// A TxFilter contains the information needed to identify a particular /// transaction: either a block and an index, or a direct transaction hash. /// Currently, only specification by hash is supported. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxFilter { /// block identifier, height or hash @@ -41,7 +38,6 @@ pub struct TxFilter { /// /// FIXME: the documentation here about mempool status contradicts the documentation /// for the `height` field. See -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawTransaction { /// exact data returned by Zcash 'getrawtransaction' @@ -54,7 +50,6 @@ pub struct RawTransaction { /// A SendResponse encodes an error code and a string. It is currently used /// only by SendTransaction(). If error code is zero, the operation was /// successful; if non-zero, it and the message specify the failure. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendResponse { #[prost(int32, tag = "1")] @@ -63,16 +58,13 @@ pub struct SendResponse { pub error_message: ::prost::alloc::string::String, } /// Chainspec is a placeholder to allow specification of a particular chain fork. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ChainSpec {} /// Empty is for gRPCs that take no arguments, currently only GetLightdInfo. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Empty {} /// LightdInfo returns various information about this lightwalletd instance /// and the state of the blockchain. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LightdInfo { #[prost(string, tag = "1")] @@ -114,7 +106,6 @@ pub struct LightdInfo { } /// TransparentAddressBlockFilter restricts the results to the given address /// or block range. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TransparentAddressBlockFilter { /// t-address @@ -127,7 +118,6 @@ pub struct TransparentAddressBlockFilter { /// Duration is currently used only for testing, so that the Ping rpc /// can simulate a delay, to create many simultaneous connections. Units /// are microseconds. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Duration { #[prost(int64, tag = "1")] @@ -136,7 +126,6 @@ pub struct Duration { /// PingResponse is used to indicate concurrency, how many Ping rpcs /// are executing upon entry and upon exit (after the delay). /// This rpc is used for testing only. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct PingResponse { #[prost(int64, tag = "1")] @@ -144,32 +133,27 @@ pub struct PingResponse { #[prost(int64, tag = "2")] pub exit: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Address { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddressList { #[prost(string, repeated, tag = "1")] pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Balance { #[prost(int64, tag = "1")] pub value_zat: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Exclude { #[prost(bytes = "vec", repeated, tag = "1")] pub txid: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } /// The TreeState is derived from the Zcash z_gettreestate rpc. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TreeState { /// "main" or "test" @@ -191,7 +175,6 @@ pub struct TreeState { #[prost(string, tag = "6")] pub orchard_tree: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct GetSubtreeRootsArg { /// Index identifying where to start returning subtree roots @@ -204,7 +187,6 @@ pub struct GetSubtreeRootsArg { #[prost(uint32, tag = "3")] pub max_entries: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SubtreeRoot { /// The 32-byte Merkle root of the subtree. @@ -219,7 +201,6 @@ pub struct SubtreeRoot { } /// Results are sorted by height, which makes it easy to issue another /// request that picks up from where the previous left off. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetAddressUtxosArg { #[prost(string, repeated, tag = "1")] @@ -230,7 +211,6 @@ pub struct GetAddressUtxosArg { #[prost(uint32, tag = "3")] pub max_entries: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetAddressUtxosReply { #[prost(string, tag = "6")] @@ -246,7 +226,6 @@ pub struct GetAddressUtxosReply { #[prost(uint64, tag = "5")] pub height: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetAddressUtxosReplyList { #[prost(message, repeated, tag = "1")] @@ -265,8 +244,8 @@ impl ShieldedProtocol { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ShieldedProtocol::Sapling => "sapling", - ShieldedProtocol::Orchard => "orchard", + Self::Sapling => "sapling", + Self::Orchard => "orchard", } } /// Creates an enum from field names used in the ProtoBuf definition.