From 71efa038968133f46b8a7c501fb748b12df0ea59 Mon Sep 17 00:00:00 2001 From: SW van Heerden Date: Fri, 13 Dec 2024 13:00:33 +0200 Subject: [PATCH] feat: add block height in into info (#6727) Description --- adds block height into gprc info --- applications/minotari_app_grpc/proto/wallet.proto | 1 + .../minotari_console_wallet/src/grpc/wallet_grpc_server.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/applications/minotari_app_grpc/proto/wallet.proto b/applications/minotari_app_grpc/proto/wallet.proto index 9676b4a68d..6debeb36ab 100644 --- a/applications/minotari_app_grpc/proto/wallet.proto +++ b/applications/minotari_app_grpc/proto/wallet.proto @@ -191,6 +191,7 @@ message TransactionInfo { bytes excess_sig = 9; uint64 timestamp = 10; bytes payment_id = 12; + uint64 mined_in_block_height = 13; } enum TransactionDirection { diff --git a/applications/minotari_console_wallet/src/grpc/wallet_grpc_server.rs b/applications/minotari_console_wallet/src/grpc/wallet_grpc_server.rs index 67629b73d4..5e1490d508 100644 --- a/applications/minotari_console_wallet/src/grpc/wallet_grpc_server.rs +++ b/applications/minotari_console_wallet/src/grpc/wallet_grpc_server.rs @@ -790,6 +790,7 @@ impl wallet_server::Wallet for WalletGrpcServer { .get_signature() .to_vec(), payment_id: txn.payment_id.to_bytes(), + mined_in_block_height: txn.mined_height.unwrap_or(0), }), }; match sender.send(Ok(response)).await { @@ -1132,6 +1133,7 @@ fn convert_wallet_transaction_into_transaction_info( excess_sig: Default::default(), timestamp: tx.timestamp.timestamp() as u64, payment_id: tx.payment_id.to_bytes(), + mined_in_block_height: 0, }, PendingOutbound(tx) => TransactionInfo { tx_id: tx.tx_id.into(), @@ -1145,6 +1147,7 @@ fn convert_wallet_transaction_into_transaction_info( excess_sig: Default::default(), timestamp: tx.timestamp.timestamp() as u64, payment_id: tx.payment_id.to_bytes(), + mined_in_block_height: 0, }, Completed(tx) => TransactionInfo { tx_id: tx.tx_id.into(), @@ -1162,6 +1165,7 @@ fn convert_wallet_transaction_into_transaction_info( .map(|s| s.get_signature().to_vec()) .unwrap_or_default(), payment_id: tx.payment_id.to_bytes(), + mined_in_block_height: tx.mined_height.unwrap_or(0), }, } }