From d3cc12de46e2d8bad04f0295cdfdc281e24a558d Mon Sep 17 00:00:00 2001 From: "Robert G. Jakabosky" Date: Thu, 21 Nov 2024 20:50:56 +0800 Subject: [PATCH] Remove unused error variant. --- rust/frameworks/tw_substrate/src/entry.rs | 7 +++++-- rust/frameworks/tw_substrate/src/lib.rs | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rust/frameworks/tw_substrate/src/entry.rs b/rust/frameworks/tw_substrate/src/entry.rs index a91f4cd86a2..1a33f9145d3 100644 --- a/rust/frameworks/tw_substrate/src/entry.rs +++ b/rust/frameworks/tw_substrate/src/entry.rs @@ -43,8 +43,11 @@ impl SubstrateEntry { coin: &dyn CoinContext, input: T::SigningInput<'_>, ) -> SigningResult { - let keypair = self.0.get_keypair(coin, &input).ok(); - let public_key = keypair.map(|p| p.public().clone()); + let public_key = self + .0 + .get_keypair(coin, &input) + .ok() + .map(|p| p.public().clone()); let unsigned_tx = self.0.build_transaction(coin, public_key, &input)?; let pre_image = unsigned_tx.encode_payload()?; Ok(RawOwned(pre_image)) diff --git a/rust/frameworks/tw_substrate/src/lib.rs b/rust/frameworks/tw_substrate/src/lib.rs index 93bd0f2fe24..c8f227f9fe9 100644 --- a/rust/frameworks/tw_substrate/src/lib.rs +++ b/rust/frameworks/tw_substrate/src/lib.rs @@ -23,7 +23,6 @@ pub enum EncodeError { InvalidCallIndex, InvalidAddress, InvalidValue, - MissingPrivateKey, } impl From for SigningError {