Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SWvheerden committed Jan 17, 2024
1 parent df3fe04 commit e475eb2
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
6 changes: 6 additions & 0 deletions applications/minotari_app_grpc/proto/wallet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ service Wallet {
rpc CancelTransaction (CancelTransactionRequest) returns (CancelTransactionResponse);
// Will trigger a complete revalidation of all wallet outputs.
rpc RevalidateAllTransactions (RevalidateRequest) returns (RevalidateResponse);
// Will trigger a validation of all wallet outputs.
rpc ValidateAllTransactions (ValidateRequest) returns (ValidateResponse);
// This will send a XTR SHA Atomic swap transaction
rpc SendShaAtomicSwapTransaction(SendShaAtomicSwapRequest) returns (SendShaAtomicSwapResponse);
// This will create a burn transaction
Expand Down Expand Up @@ -289,6 +291,10 @@ message RevalidateRequest{}

message RevalidateResponse{}

message ValidateRequest{}

message ValidateResponse{}

message SetBaseNodeRequest {
string public_key_hex = 1;
string net_address = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ use minotari_app_grpc::tari_rpc::{
TransferRequest,
TransferResponse,
TransferResult,
ValidateRequest,
ValidateResponse,
};
use minotari_wallet::{
connectivity_service::{OnlineStatus, WalletConnectivityInterface},
Expand Down Expand Up @@ -307,6 +309,23 @@ impl wallet_server::Wallet for WalletGrpcServer {
Ok(Response::new(RevalidateResponse {}))
}

async fn validate_all_transactions(
&self,
_request: Request<ValidateRequest>,
) -> Result<Response<ValidateResponse>, Status> {
let mut output_service = self.get_output_manager_service();
output_service
.validate_txos()
.await
.map_err(|e| Status::unknown(e.to_string()))?;
let mut tx_service = self.get_transaction_service();
tx_service
.validate_transactions()
.await
.map_err(|e| Status::unknown(e.to_string()))?;
Ok(Response::new(ValidateResponse {}))
}

async fn send_sha_atomic_swap_transaction(
&self,
request: Request<SendShaAtomicSwapRequest>,
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/src/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl MinerProcess {
miner_max_blocks: blocks,
miner_min_diff,
miner_max_diff,
non_interactive_mode: false,
non_interactive_mode: true,
};
run_miner(cli).await.unwrap();
}
Expand Down
2 changes: 2 additions & 0 deletions integration_tests/tests/steps/wallet_steps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ use grpc::{
ClaimShaAtomicSwapRequest,
Empty,
GetBalanceRequest,
ValidateRequest,
GetCompletedTransactionsRequest,
GetIdentityRequest,
GetTransactionInfoRequest,
Expand Down Expand Up @@ -1573,6 +1574,7 @@ async fn wallet_with_tari_connected_to_base_node(
let num_retries = 100;

for _ in 0..num_retries {
let _ = wallet_client.validate_all_transactions(ValidateRequest {}).await;
let balance_res = wallet_client
.get_balance(GetBalanceRequest {})
.await
Expand Down

0 comments on commit e475eb2

Please sign in to comment.