Skip to content

Commit e475eb2

Browse files
committed
fix tests
1 parent df3fe04 commit e475eb2

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

applications/minotari_app_grpc/proto/wallet.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ service Wallet {
6363
rpc CancelTransaction (CancelTransactionRequest) returns (CancelTransactionResponse);
6464
// Will trigger a complete revalidation of all wallet outputs.
6565
rpc RevalidateAllTransactions (RevalidateRequest) returns (RevalidateResponse);
66+
// Will trigger a validation of all wallet outputs.
67+
rpc ValidateAllTransactions (ValidateRequest) returns (ValidateResponse);
6668
// This will send a XTR SHA Atomic swap transaction
6769
rpc SendShaAtomicSwapTransaction(SendShaAtomicSwapRequest) returns (SendShaAtomicSwapResponse);
6870
// This will create a burn transaction
@@ -289,6 +291,10 @@ message RevalidateRequest{}
289291

290292
message RevalidateResponse{}
291293

294+
message ValidateRequest{}
295+
296+
message ValidateResponse{}
297+
292298
message SetBaseNodeRequest {
293299
string public_key_hex = 1;
294300
string net_address = 2;

applications/minotari_console_wallet/src/grpc/wallet_grpc_server.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ use minotari_app_grpc::tari_rpc::{
7676
TransferRequest,
7777
TransferResponse,
7878
TransferResult,
79+
ValidateRequest,
80+
ValidateResponse,
7981
};
8082
use minotari_wallet::{
8183
connectivity_service::{OnlineStatus, WalletConnectivityInterface},
@@ -307,6 +309,23 @@ impl wallet_server::Wallet for WalletGrpcServer {
307309
Ok(Response::new(RevalidateResponse {}))
308310
}
309311

312+
async fn validate_all_transactions(
313+
&self,
314+
_request: Request<ValidateRequest>,
315+
) -> Result<Response<ValidateResponse>, Status> {
316+
let mut output_service = self.get_output_manager_service();
317+
output_service
318+
.validate_txos()
319+
.await
320+
.map_err(|e| Status::unknown(e.to_string()))?;
321+
let mut tx_service = self.get_transaction_service();
322+
tx_service
323+
.validate_transactions()
324+
.await
325+
.map_err(|e| Status::unknown(e.to_string()))?;
326+
Ok(Response::new(ValidateResponse {}))
327+
}
328+
310329
async fn send_sha_atomic_swap_transaction(
311330
&self,
312331
request: Request<SendShaAtomicSwapRequest>,

integration_tests/src/miner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl MinerProcess {
138138
miner_max_blocks: blocks,
139139
miner_min_diff,
140140
miner_max_diff,
141-
non_interactive_mode: false,
141+
non_interactive_mode: true,
142142
};
143143
run_miner(cli).await.unwrap();
144144
}

integration_tests/tests/steps/wallet_steps.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use grpc::{
3030
ClaimShaAtomicSwapRequest,
3131
Empty,
3232
GetBalanceRequest,
33+
ValidateRequest,
3334
GetCompletedTransactionsRequest,
3435
GetIdentityRequest,
3536
GetTransactionInfoRequest,
@@ -1573,6 +1574,7 @@ async fn wallet_with_tari_connected_to_base_node(
15731574
let num_retries = 100;
15741575

15751576
for _ in 0..num_retries {
1577+
let _ = wallet_client.validate_all_transactions(ValidateRequest {}).await;
15761578
let balance_res = wallet_client
15771579
.get_balance(GetBalanceRequest {})
15781580
.await

0 commit comments

Comments
 (0)