From 4c2636ead75557c7a6639fffae57065ae439b089 Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Wed, 27 Mar 2024 17:28:35 +0100 Subject: [PATCH] Remove logs --- .../api/block_builder/transaction_builder/mod.rs | 12 ++++-------- .../block_builder/transaction_builder/remainder.rs | 10 +++------- .../transaction_builder/requirement/mana.rs | 8 +------- sdk/src/client/secret/mod.rs | 5 +---- 4 files changed, 9 insertions(+), 26 deletions(-) diff --git a/sdk/src/client/api/block_builder/transaction_builder/mod.rs b/sdk/src/client/api/block_builder/transaction_builder/mod.rs index c6f0fb0659..1d5f68bb38 100644 --- a/sdk/src/client/api/block_builder/transaction_builder/mod.rs +++ b/sdk/src/client/api/block_builder/transaction_builder/mod.rs @@ -379,14 +379,10 @@ impl TransactionBuilder { return Err(TransactionBuilderError::InvalidInputCount(self.selected_inputs.len())); } - let remainder_address = match self.get_remainder_address()? { - Some(a) => a, - None => { - log::debug!("MissingInputWithEd25519Address from finish"); - return Err(TransactionBuilderError::MissingInputWithEd25519Address); - } - } - .0; + let remainder_address = self + .get_remainder_address()? + .ok_or(TransactionBuilderError::MissingInputWithEd25519Address)? + .0; let mut added_amount_mana = HashMap::, (u64, u64)>::new(); for (chain_id, added_amount) in self.remainders.added_amount.drain() { diff --git a/sdk/src/client/api/block_builder/transaction_builder/remainder.rs b/sdk/src/client/api/block_builder/transaction_builder/remainder.rs index 838f1b498c..66dcb1cf5e 100644 --- a/sdk/src/client/api/block_builder/transaction_builder/remainder.rs +++ b/sdk/src/client/api/block_builder/transaction_builder/remainder.rs @@ -62,13 +62,9 @@ impl TransactionBuilder { mana_diff = mana_diff.saturating_sub(self.initial_mana_excess()?); } - let (remainder_address, chain) = match self.get_remainder_address()? { - Some(a) => a, - None => { - log::debug!("MissingInputWithEd25519Address from update_remainders"); - return Err(TransactionBuilderError::MissingInputWithEd25519Address); - } - }; + let (remainder_address, chain) = self + .get_remainder_address()? + .ok_or(TransactionBuilderError::MissingInputWithEd25519Address)?; // Amount can be just multiplied, because all remainder outputs with a native token have the same storage // cost. diff --git a/sdk/src/client/api/block_builder/transaction_builder/requirement/mana.rs b/sdk/src/client/api/block_builder/transaction_builder/requirement/mana.rs index 77ecb885c1..6aec255ce6 100644 --- a/sdk/src/client/api/block_builder/transaction_builder/requirement/mana.rs +++ b/sdk/src/client/api/block_builder/transaction_builder/requirement/mana.rs @@ -201,13 +201,7 @@ impl TransactionBuilder { // than the current block index match &required_address { Address::Ed25519(_) | Address::ImplicitAccountCreation(_) => {} - _ => { - log::debug!( - "MissingInputWithEd25519Address from null_transaction_unlocks required_address {required_address:?}" - ); - log::debug!("Tx Builder {self:#?}"); - Err(TransactionBuilderError::MissingInputWithEd25519Address)? - } + _ => Err(TransactionBuilderError::MissingInputWithEd25519Address)?, } let block = SignatureUnlock::new( diff --git a/sdk/src/client/secret/mod.rs b/sdk/src/client/secret/mod.rs index da2c480bbb..dccb4e6839 100644 --- a/sdk/src/client/secret/mod.rs +++ b/sdk/src/client/secret/mod.rs @@ -609,10 +609,7 @@ where // than the current block index match &required_address { Address::Ed25519(_) | Address::ImplicitAccountCreation(_) => {} - _ => { - log::debug!("MissingInputWithEd25519Address from default_transaction_unlocks, required_address {required_address:?}"); - Err(TransactionBuilderError::MissingInputWithEd25519Address)? - } + _ => Err(TransactionBuilderError::MissingInputWithEd25519Address)?, } let chain = input.chain.ok_or(ClientError::MissingBip32Chain)?;