Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
SWvheerden committed Dec 8, 2022
1 parent 2b412cf commit c87e075
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,6 @@ enum BanReason {
ValidationFailed(#[from] ValidationError),
#[error("Peer could not find the location of a chain split")]
ChainSplitNotFound,
#[error("Failed to synchronize headers from peer: {0}")]
GeneralHeaderSyncFailure(BlockHeaderSyncError),
#[error("Peer did not respond timeously during RPC negotiation")]
RpcNegotiationTimedOut,
#[error("Header at height {height} did not form a chain. Expected {actual} to equal the previous hash {expected}")]
Expand Down
2 changes: 1 addition & 1 deletion base_layer/wallet/tests/utxo_scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use tari_comms::{
};
use tari_core::{
base_node::rpc::BaseNodeWalletRpcServer,
blocks::{genesis_block, BlockHeader},
blocks::BlockHeader,
proto::base_node::{ChainMetadata, TipInfoResponse},
transactions::{tari_amount::MicroTari, transaction_components::UnblindedOutput, CryptoFactories},
};
Expand Down
123 changes: 123 additions & 0 deletions base_layer/wallet_ffi/a wave in teahupoo
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
2022-12-08 12:29:49.006596000 [wallet_ffi] DEBUG Logging started
2022-12-08 12:29:49.006914000 [wallet_ffi] INFO Starting Tari Wallet FFI version: 0.42.0-5acd666e018b47081b2adbd931478451f1234e6a-debug
2022-12-08 12:29:49.006936000 [wallet_ffi] INFO network set to dibbler
2022-12-08 12:29:49.117034000 [wallet::transaction_service::service] ERROR Error starting Broadcast Protocol after completed Send Transaction Protocol : NoBaseNodeKeysProvided
2022-12-08 12:29:49.119989000 [wallet::utxo_scanning] INFO UTXO scanning service shutting down because it received the shutdown signal
2022-12-08 12:29:49.120198000 [wallet::transaction_service::service] INFO Transaction service shutting down because it received the shutdown signal
2022-12-08 12:29:49.120491000 [wallet::output_manager_service] INFO Output manager service shutting down because it received the shutdown signal
2022-12-08 12:29:49.120608000 [wallet::transaction_service::callback_handler] INFO Transaction Callback Handler shutting down because the shutdown signal was received
2022-12-08 12:29:49.120670000 [wallet:contacts_service] INFO Contacts service shutting down because it received the shutdown signal
2022-12-08 12:29:49.120751000 [wallet:contacts_service] INFO Contacts Service ended
2022-12-08 12:29:49.120781000 [wallet::base_node_service::service] INFO Wallet Base Node Service shutting down because the shutdown signal was received
2022-12-08 12:29:49.120956000 [wallet::transaction_service::service] INFO Transaction service shut down
2022-12-08 12:29:49.120984000 [wallet::output_manager_service] INFO Output Manager Service ended
2022-12-08 12:29:49.121009000 [wallet::utxo_scanner_service::initializer] INFO Utxo scanner service shutdown
2022-12-08 12:29:49.121036000 [wallet::output_manager_service::initializer] INFO Output manager service shutdown
2022-12-08 12:29:49.121063000 [wallet::base_node_service] INFO Wallet Base Node Service shutdown with result Ok(())
2022-12-08 12:29:49.121114000 [wallet::contacts_service::initializer] INFO Contacts service shutdown
2022-12-08 12:29:49.127324000 [wallet::transaction_service] INFO Transaction Service shutdown
2022-12-08 12:29:49.686679000 [wallet_ffi] DEBUG Running Wallet database migrations
2022-12-08 12:29:49.687293000 [r2d2] ERROR database is locked
2022-12-08 12:29:50.252611000 [wallet::transaction_service::callback_handler] DEBUG Calling Connectivity Status changed callback function
2022-12-08 12:29:50.350436000 [wallet_ffi] INFO Starting Tari Wallet FFI version: 0.42.0-5acd666e018b47081b2adbd931478451f1234e6a-debug
2022-12-08 12:29:50.350556000 [wallet_ffi] INFO network set to dibbler
2022-12-08 12:29:50.357078000 [wallet_ffi] DEBUG Running Wallet database migrations
2022-12-08 12:29:51.441521000 [wallet_ffi] DEBUG Databases Initialized
2022-12-08 12:29:52.127258000 [wallet] DEBUG Wallet Initializing
2022-12-08 12:29:52.127321000 [wallet] INFO Transaction sending mechanism is 'DirectAndStoreAndForward'
2022-12-08 12:29:52.127856000 [lmdb] DEBUG Resize check: Used bytes: 16384, Remaining bytes: 16760832
2022-12-08 12:29:52.127877000 [lmdb] DEBUG (/var/folders/47/s77gktfj4gj65ddlms6xrghm0000gn/T/.tmpFv6zJ4) LMDB environment created with a capacity of 16 MB, 15 MB remaining.
2022-12-08 12:29:52.133004000 [wallet::base_node_service] INFO Wallet base node service initializing.
2022-12-08 12:29:52.133268000 [wallet::connectivity] DEBUG Wallet connectivity service has started.
2022-12-08 12:29:52.133455000 [wallet::base_node_service::service] DEBUG Wallet Base Node Service started
2022-12-08 12:29:52.133586000 [tracing::span] DEBUG comms::connection_manager::run;
2022-12-08 12:29:52.133688000 [wallet::transaction_service::service] DEBUG Transaction Service started
2022-12-08 12:29:52.133762000 [wallet::utxo_scanning] INFO UTXO scanning service starting
2022-12-08 12:29:52.133858000 [wallet:contacts_service] DEBUG Contacts Service started
2022-12-08 12:29:52.133935000 [wallet::connectivity] WARN 1 requests are waiting for base node to be set
2022-12-08 12:29:52.133967000 [wallet::utxo_scanning] ERROR Error scanning UTXOs: Utxo Scanning Error: 'Failed to scan UTXO's after 2 attempt(s) using sync peer(s). Aborting...
2022-12-08 12:29:52.134027000 [wallet::utxo_scanning] DEBUG UTXO scanning round completed
2022-12-08 12:29:52.134251000 [wallet::output_manager_service] DEBUG Output Manager Service started
2022-12-08 12:29:52.134355000 [wallet::output_manager_service] DEBUG Adding new script to output manager service
2022-12-08 12:29:52.134816000 [wallet::transaction_service::callback_handler] INFO ReceivedTransactionCallback -> Assigning Fn: 0x105277880
2022-12-08 12:29:52.134840000 [wallet::transaction_service::callback_handler] INFO ReceivedTransactionReplyCallback -> Assigning Fn: 0x105277a94
2022-12-08 12:29:52.134854000 [wallet::transaction_service::callback_handler] INFO ReceivedFinalizedTransactionCallback -> Assigning Fn: 0x105277d2c
2022-12-08 12:29:52.134868000 [wallet::transaction_service::callback_handler] INFO TransactionBroadcastCallback -> Assigning Fn: 0x105277fc4
2022-12-08 12:29:52.134882000 [wallet::transaction_service::callback_handler] INFO TransactionMinedCallback -> Assigning Fn: 0x105278260
2022-12-08 12:29:52.134895000 [wallet::transaction_service::callback_handler] INFO TransactionMinedUnconfirmedCallback -> Assigning Fn: 0x1052784f8
2022-12-08 12:29:52.134909000 [wallet::transaction_service::callback_handler] INFO FauxTransactionConfirmedCallback -> Assigning Fn: 0x105278b58
2022-12-08 12:29:52.134922000 [wallet::transaction_service::callback_handler] INFO FauxTransactionUnconfirmedCallback -> Assigning Fn: 0x105278df0
2022-12-08 12:29:52.134935000 [wallet::transaction_service::callback_handler] INFO TransactionSendResultCallback -> Assigning Fn: 0x105279450
2022-12-08 12:29:52.134948000 [wallet::transaction_service::callback_handler] INFO TransactionCancellationCallback -> Assigning Fn: 0x1052795e4
2022-12-08 12:29:52.134961000 [wallet::transaction_service::callback_handler] INFO TxoValidationCompleteCallback -> Assigning Fn: 0x105279750
2022-12-08 12:29:52.134974000 [wallet::transaction_service::callback_handler] INFO ContactsLivenessDataUpdatedCallback -> Assigning Fn: 0x105279764
2022-12-08 12:29:52.134987000 [wallet::transaction_service::callback_handler] INFO BalanceUpdatedCallback -> Assigning Fn: 0x105279774
2022-12-08 12:29:52.134999000 [wallet::transaction_service::callback_handler] INFO TransactionValidationCompleteCallback -> Assigning Fn: 0x105279784
2022-12-08 12:29:52.135012000 [wallet::transaction_service::callback_handler] INFO SafMessagesReceivedCallback -> Assigning Fn: 0x105279798
2022-12-08 12:29:52.135025000 [wallet::transaction_service::callback_handler] INFO ConnectivityStatusCallback -> Assigning Fn: 0x10527979c
2022-12-08 12:29:52.135073000 [wallet::transaction_service::callback_handler] INFO Transaction Service Callback Handler starting
2022-12-08 12:29:52.135173000 [wallet::transaction_service::callback_handler] DEBUG Calling Connectivity Status changed callback function
2022-12-08 12:29:52.257608000 [wallet::transaction_service::callback_handler] DEBUG Calling Connectivity Status changed callback function
2022-12-08 12:29:52.388970000 [wallet_ffi] DEBUG Databases Initialized
2022-12-08 12:29:52.625385000 [wallet::connectivity] DEBUG No connection. Attempting to connect...
2022-12-08 12:29:52.625671000 [wallet::transaction_service::callback_handler] DEBUG Calling Connectivity Status changed callback function
2022-12-08 12:29:53.062478000 [wallet] DEBUG Wallet Initializing
2022-12-08 12:29:53.062543000 [wallet] INFO Transaction sending mechanism is 'DirectAndStoreAndForward'
2022-12-08 12:29:53.063023000 [lmdb] DEBUG Resize check: Used bytes: 81920, Remaining bytes: 16695296
2022-12-08 12:29:53.063044000 [lmdb] DEBUG (/var/folders/47/s77gktfj4gj65ddlms6xrghm0000gn/T/.tmpPv8PI7) LMDB environment created with a capacity of 16 MB, 15 MB remaining.
2022-12-08 12:29:53.065702000 [wallet::base_node_service] INFO Wallet base node service initializing.
2022-12-08 12:29:53.065925000 [wallet::utxo_scanning] INFO UTXO scanning service starting
2022-12-08 12:29:53.066064000 [wallet::connectivity] DEBUG Wallet connectivity service has started.
2022-12-08 12:29:53.066237000 [tracing::span] DEBUG comms::connection_manager::run;
2022-12-08 12:29:53.066326000 [wallet::transaction_service::service] DEBUG Transaction Service started
2022-12-08 12:29:53.066423000 [wallet::base_node_service::service] DEBUG Wallet Base Node Service started
2022-12-08 12:29:53.066514000 [wallet:contacts_service] DEBUG Contacts Service started
2022-12-08 12:29:53.066624000 [wallet::utxo_scanning] ERROR Error scanning UTXOs: Utxo Scanning Error: 'Failed to scan UTXO's after 2 attempt(s) using sync peer(s). Aborting...
2022-12-08 12:29:53.066664000 [wallet::utxo_scanning] DEBUG UTXO scanning round completed
2022-12-08 12:29:53.066695000 [wallet::connectivity] WARN 1 requests are waiting for base node to be set
2022-12-08 12:29:53.066728000 [wallet::output_manager_service] DEBUG Output Manager Service started
2022-12-08 12:29:53.066797000 [wallet::output_manager_service] DEBUG Adding new script to output manager service
2022-12-08 12:29:53.067712000 [wallet::transaction_service::callback_handler] INFO ReceivedTransactionCallback -> Assigning Fn: 0x105277880
2022-12-08 12:29:53.067731000 [wallet::transaction_service::callback_handler] INFO ReceivedTransactionReplyCallback -> Assigning Fn: 0x105277a94
2022-12-08 12:29:53.067745000 [wallet::transaction_service::callback_handler] INFO ReceivedFinalizedTransactionCallback -> Assigning Fn: 0x105277d2c
2022-12-08 12:29:53.067758000 [wallet::transaction_service::callback_handler] INFO TransactionBroadcastCallback -> Assigning Fn: 0x105277fc4
2022-12-08 12:29:53.067771000 [wallet::transaction_service::callback_handler] INFO TransactionMinedCallback -> Assigning Fn: 0x105278260
2022-12-08 12:29:53.067784000 [wallet::transaction_service::callback_handler] INFO TransactionMinedUnconfirmedCallback -> Assigning Fn: 0x1052784f8
2022-12-08 12:29:53.067797000 [wallet::transaction_service::callback_handler] INFO FauxTransactionConfirmedCallback -> Assigning Fn: 0x105278b58
2022-12-08 12:29:53.067809000 [wallet::transaction_service::callback_handler] INFO FauxTransactionUnconfirmedCallback -> Assigning Fn: 0x105278df0
2022-12-08 12:29:53.067826000 [wallet::transaction_service::callback_handler] INFO TransactionSendResultCallback -> Assigning Fn: 0x105279450
2022-12-08 12:29:53.067838000 [wallet::transaction_service::callback_handler] INFO TransactionCancellationCallback -> Assigning Fn: 0x1052795e4
2022-12-08 12:29:53.067850000 [wallet::transaction_service::callback_handler] INFO TxoValidationCompleteCallback -> Assigning Fn: 0x105279750
2022-12-08 12:29:53.067863000 [wallet::transaction_service::callback_handler] INFO ContactsLivenessDataUpdatedCallback -> Assigning Fn: 0x105279764
2022-12-08 12:29:53.067875000 [wallet::transaction_service::callback_handler] INFO BalanceUpdatedCallback -> Assigning Fn: 0x105279774
2022-12-08 12:29:53.067887000 [wallet::transaction_service::callback_handler] INFO TransactionValidationCompleteCallback -> Assigning Fn: 0x105279784
2022-12-08 12:29:53.067900000 [wallet::transaction_service::callback_handler] INFO SafMessagesReceivedCallback -> Assigning Fn: 0x105279798
2022-12-08 12:29:53.067912000 [wallet::transaction_service::callback_handler] INFO ConnectivityStatusCallback -> Assigning Fn: 0x10527979c
2022-12-08 12:29:53.067961000 [wallet::transaction_service::callback_handler] INFO Transaction Service Callback Handler starting
2022-12-08 12:29:53.068053000 [wallet::transaction_service::callback_handler] DEBUG Calling Connectivity Status changed callback function
2022-12-08 12:29:53.068325000 [wallet:contacts_service] INFO Contacts service shutting down because it received the shutdown signal
2022-12-08 12:29:53.068350000 [wallet:contacts_service] INFO Contacts Service ended
2022-12-08 12:29:53.068379000 [wallet::utxo_scanning] INFO UTXO scanning service shutting down because it received the shutdown signal
2022-12-08 12:29:53.068415000 [wallet::output_manager_service] INFO Output manager service shutting down because it received the shutdown signal
2022-12-08 12:29:53.068441000 [wallet::transaction_service::callback_handler] INFO Transaction Callback Handler shutting down because the shutdown signal was received
2022-12-08 12:29:53.068477000 [wallet::base_node_service::service] INFO Wallet Base Node Service shutting down because the shutdown signal was received
2022-12-08 12:29:53.068510000 [wallet::base_node_service] INFO Wallet Base Node Service shutdown with result Ok(())
2022-12-08 12:29:53.068533000 [wallet::contacts_service::initializer] INFO Contacts service shutdown
2022-12-08 12:29:53.068563000 [wallet::output_manager_service] INFO Output Manager Service ended
2022-12-08 12:29:53.068592000 [wallet::transaction_service::service] INFO Transaction service shutting down because it received the shutdown signal
2022-12-08 12:29:53.068617000 [wallet::transaction_service::service] INFO Transaction service shut down
2022-12-08 12:29:53.068640000 [wallet::output_manager_service::initializer] INFO Output manager service shutdown
2022-12-08 12:29:53.068675000 [wallet::utxo_scanner_service::initializer] INFO Utxo scanner service shutdown
2022-12-08 12:29:53.073804000 [wallet::transaction_service] INFO Transaction Service shutdown
2022-12-08 12:29:54.262597000 [wallet::transaction_service::callback_handler] DEBUG Calling Connectivity Status changed callback function
2022-12-08 12:29:55.701032000 [r2d2] ERROR database is locked
2022-12-08 12:29:57.135622000 [wallet::connectivity] DEBUG No connection. Attempting to connect...
2022-12-08 12:29:57.135764000 [wallet::transaction_service::callback_handler] DEBUG Calling Connectivity Status changed callback function
2022-12-08 12:29:57.625634000 [wallet::connectivity] DEBUG No connection. Attempting to connect...
2022-12-08 12:29:57.626058000 [wallet::transaction_service::callback_handler] DEBUG Calling Connectivity Status changed callback function
2022-12-08 12:30:02.134904000 [wallet::connectivity] DEBUG No connection. Attempting to connect...
2022-12-08 12:30:02.135733000 [wallet::transaction_service::callback_handler] DEBUG Calling Connectivity Status changed callback function
2022-12-08 12:30:02.624617000 [wallet::connectivity] DEBUG No connection. Attempting to connect...
2022-12-08 12:30:02.625360000 [wallet::transaction_service::callback_handler] DEBUG Calling Connectivity Status changed callback function
2022-12-08 12:30:04.267533000 [wallet::transaction_service::callback_handler] ERROR Error reading from Transaction Service event broadcast channel
2022-12-08 12:30:04.267842000 [wallet::transaction_service::callback_handler] INFO Transaction Callback Handler shutting down because the shutdown signal was received
15 changes: 10 additions & 5 deletions base_layer/wallet_ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8093,7 +8093,6 @@ mod test {
use libc::{c_char, c_uchar, c_uint};
use tari_common_types::{emoji, transaction::TransactionStatus, types::PrivateKey};
use tari_core::{
borsh::ToBytes,
covenant,
transactions::test_helpers::{create_test_input, create_unblinded_output, TestParams},
};
Expand Down Expand Up @@ -8958,6 +8957,7 @@ mod test {
recovery_in_progress_ptr,
error_ptr,
);
assert_eq!(error, 0);
assert!(!(*recovery_in_progress_ptr), "no recovery in progress");

assert_eq!(*error_ptr, 0, "No error expected");
Expand Down Expand Up @@ -9068,6 +9068,7 @@ mod test {
recovery_in_progress_ptr,
error_ptr,
);
assert_eq!(error, 0);

let client_key_values = vec![
("key1".to_string(), "value1".to_string()),
Expand Down Expand Up @@ -9290,6 +9291,7 @@ mod test {
error_ptr,
);

assert_eq!(error, 0);
let seed_words = wallet_get_seed_words(wallet, error_ptr);
assert_eq!(error, 0);
let public_address = wallet_get_tari_address(wallet, error_ptr);
Expand Down Expand Up @@ -9422,6 +9424,7 @@ mod test {
error_ptr,
);

assert_eq!(error, 0);
(0..10).for_each(|i| {
let (_, uout) = create_test_input((1000 * i).into(), 0, &ExtendedPedersenCommitmentFactory::default());
(*alice_wallet)
Expand Down Expand Up @@ -9565,6 +9568,7 @@ mod test {
recovery_in_progress_ptr,
error_ptr,
);
assert_eq!(error, 0);

(0..10).for_each(|i| {
let (_, uout) = create_test_input((1000 * i).into(), 0, &ExtendedPedersenCommitmentFactory::default());
Expand Down Expand Up @@ -9677,6 +9681,7 @@ mod test {
error_ptr,
);

assert_eq!(error, 0);
(1..=5).for_each(|i| {
(*alice_wallet)
.runtime
Expand Down Expand Up @@ -9869,7 +9874,7 @@ mod test {
recovery_in_progress_ptr,
error_ptr,
);

assert_eq!(error, 0);
(1..=5).for_each(|i| {
(*alice_wallet)
.runtime
Expand Down Expand Up @@ -10188,13 +10193,13 @@ mod test {
10800,
error_ptr,
);

let passphrase: *const c_char = CString::into_raw(CString::new("niao").unwrap()) as *const c_char;
let wallet_ptr = wallet_create(
config,
ptr::null(),
0,
0,
ptr::null(),
passphrase,
ptr::null(),
network_str,
received_tx_callback,
Expand All @@ -10216,7 +10221,7 @@ mod test {
recovery_in_progress_ptr,
error_ptr,
);

assert_eq!(error, 0);
let node_identity =
NodeIdentity::random(&mut OsRng, get_next_memory_address(), PeerFeatures::COMMUNICATION_NODE);
let base_node_peer_public_key_ptr = Box::into_raw(Box::new(node_identity.public_key().clone()));
Expand Down

0 comments on commit c87e075

Please sign in to comment.