From b786abb8f31e04c1e740b873de9fbf2231d99e6b Mon Sep 17 00:00:00 2001 From: SW van Heerden Date: Thu, 29 Jul 2021 11:47:15 +0200 Subject: [PATCH] Move not found to status, and not boolean flag --- applications/tari_app_grpc/proto/wallet.proto | 3 ++- applications/tari_app_grpc/src/conversions/transaction.rs | 2 +- .../tari_console_wallet/src/grpc/wallet_grpc_server.rs | 4 ---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/applications/tari_app_grpc/proto/wallet.proto b/applications/tari_app_grpc/proto/wallet.proto index 74747787be..7fd6d3606f 100644 --- a/applications/tari_app_grpc/proto/wallet.proto +++ b/applications/tari_app_grpc/proto/wallet.proto @@ -114,7 +114,6 @@ message TransactionInfo { google.protobuf.Timestamp timestamp = 10; string message = 11; bool valid = 12; - bool is_found = 13; } enum TransactionDirection { @@ -138,6 +137,8 @@ enum TransactionStatus { TRANSACTION_STATUS_COINBASE = 5; // This transaction is mined and confirmed at the current base node's height TRANSACTION_STATUS_MINED_CONFIRMED = 6; + // The transaction was not found by the wallet its in transaction database + TRANSACTION_STATUS_NOT_FOUND = 7; } message GetCompletedTransactionsRequest { } diff --git a/applications/tari_app_grpc/src/conversions/transaction.rs b/applications/tari_app_grpc/src/conversions/transaction.rs index 323149fa3a..97dcaf8795 100644 --- a/applications/tari_app_grpc/src/conversions/transaction.rs +++ b/applications/tari_app_grpc/src/conversions/transaction.rs @@ -83,7 +83,7 @@ impl grpc::TransactionInfo { pub fn not_found(tx_id: TxId) -> Self { Self { tx_id, - is_found: false, + status: grpc::TransactionStatus::NotFound as i32, ..Default::default() } } diff --git a/applications/tari_console_wallet/src/grpc/wallet_grpc_server.rs b/applications/tari_console_wallet/src/grpc/wallet_grpc_server.rs index e0edaf86a1..34797d8d92 100644 --- a/applications/tari_console_wallet/src/grpc/wallet_grpc_server.rs +++ b/applications/tari_console_wallet/src/grpc/wallet_grpc_server.rs @@ -266,7 +266,6 @@ impl wallet_server::Wallet for WalletGrpcServer { .to_vec(), message: txn.message, valid: txn.valid, - is_found: true, }), }; match sender.send(Ok(response)).await { @@ -415,7 +414,6 @@ fn convert_wallet_transaction_into_transaction_info( timestamp: Some(naive_datetime_to_timestamp(tx.timestamp)), message: tx.message, valid: true, - is_found: true, }, PendingOutbound(tx) => TransactionInfo { tx_id: tx.tx_id, @@ -430,7 +428,6 @@ fn convert_wallet_transaction_into_transaction_info( timestamp: Some(naive_datetime_to_timestamp(tx.timestamp)), message: tx.message, valid: true, - is_found: true, }, Completed(tx) => TransactionInfo { tx_id: tx.tx_id, @@ -449,7 +446,6 @@ fn convert_wallet_transaction_into_transaction_info( .unwrap_or_default(), message: tx.message, valid: tx.valid, - is_found: true, }, } }