Skip to content

Commit

Permalink
chore: remove un-used code (#6169)
Browse files Browse the repository at this point in the history
Description
---
remove unused code
  • Loading branch information
SWvheerden authored Feb 27, 2024
1 parent 9ccc615 commit c6f2b8d
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ use tonic::{Request, Response, Status};

use crate::{
grpc::{convert_to_transaction_event, TransactionWrapper},
notifier::{CANCELLED, CONFIRMATION, MINED, NEW_BLOCK_MINED, QUEUED, RECEIVED, SENT},
notifier::{CANCELLED, CONFIRMATION, MINED, QUEUED, RECEIVED, SENT},
};

const LOG_TARGET: &str = "wallet::ui::grpc";
Expand Down Expand Up @@ -684,19 +684,6 @@ impl wallet_server::Wallet for WalletGrpcServer {
Ok(msg) => {
use minotari_wallet::transaction_service::handle::TransactionEvent::*;
match (*msg).clone() {
NewBlockMined(tx_id) => {
match transaction_service.get_any_transaction(tx_id).await {
Ok(found_transaction) => {
if let Some(WalletTransaction::PendingOutbound(tx)) = found_transaction {
let transaction_event = convert_to_transaction_event(NEW_BLOCK_MINED.to_string(),
TransactionWrapper::Outbound(Box::new(tx)));
send_transaction_event(transaction_event, &mut sender).await;
}

},
Err(e) => error!(target: LOG_TARGET, "Transaction service error: {}", e),
}
},
ReceivedFinalizedTransaction(tx_id) => handle_completed_tx(tx_id, RECEIVED, &mut transaction_service, &mut sender).await,
TransactionMinedUnconfirmed{tx_id, num_confirmations: _, is_valid: _} | DetectedTransactionUnconfirmed{tx_id, num_confirmations: _, is_valid: _}=> handle_completed_tx(tx_id, CONFIRMATION, &mut transaction_service, &mut sender).await,
TransactionMined{tx_id, is_valid: _} | DetectedTransactionConfirmed{tx_id, is_valid: _} => handle_completed_tx(tx_id, MINED, &mut transaction_service, &mut sender).await,
Expand Down
1 change: 0 additions & 1 deletion applications/minotari_console_wallet/src/notifier/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ pub const QUEUED: &str = "queued";
pub const CONFIRMATION: &str = "confirmation";
pub const MINED: &str = "mined";
pub const CANCELLED: &str = "cancelled";
pub const NEW_BLOCK_MINED: &str = "new_block_mined";

#[derive(Clone)]
// FIXME
Expand Down
4 changes: 0 additions & 4 deletions base_layer/wallet/src/transaction_service/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ impl Display for TransactionSendStatus {
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
pub enum TransactionEvent {
MempoolBroadcastTimedOut(TxId),
NewBlockMined(TxId),
ReceivedTransaction(TxId),
ReceivedTransactionReply(TxId),
ReceivedFinalizedTransaction(TxId),
Expand Down Expand Up @@ -406,9 +405,6 @@ impl fmt::Display for TransactionEvent {
TransactionEvent::TransactionValidationFailed(operation_id, reason) => {
write!(f, "Transaction validation(#{operation_id}) failed: {reason}")
},
TransactionEvent::NewBlockMined(tx_id) => {
write!(f, "New block mined {tx_id}")
},
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ where
);
self.update_transaction_as_unmined(unmined_tx.tx_id, &unmined_tx.status)
.await?;
self.publish_event(TransactionEvent::NewBlockMined(unmined_tx.tx_id));
}
}
}
Expand Down

0 comments on commit c6f2b8d

Please sign in to comment.