Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Aug 5, 2024
2 parents 6843710 + c7745c8 commit 6eda659
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 15 deletions.
16 changes: 8 additions & 8 deletions .updater/latest.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"version": "0.1.13",
"version": "0.1.16",
"notes": "Tari Universe - See the assets to download this version and install",
"pub_date": "2024-08-03T07:56:29.007Z",
"pub_date": "2024-08-05T20:15:15.500Z",
"platforms": {
"darwin-aarch64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFd4QTNrbVpkZy82Y2xsbitud01adGJXdFk3UTB6V0p6VXdTL0lHd0FBUWhhS3g4Zy9qZG1DVXVxa2ZmSGZ6VWlYRUw1cVNmK3lZUWpiNzNIeWJ3K1FNPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzIyNjcxMTI2CWZpbGU6dGFyaS11bml2ZXJzZS5hcHAudGFyLmd6CjBCUnc4RERvZmFqcFU4Q2NFcUVsalV5NWJZNU1TZ1RycHVzdkUyUlo0azRrUktBTW83MytyaWpvNDJwcmx6YUNxY09JbDh6dXVudC9mdlF2YU5aZkFnPT0K",
"url": "https://github.com/tari-project/universe/releases/download/tari_universe-v0.1.13/tari-universe-debug_universal.app.tar.gz"
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFRaL285VkNFRG1vU1NkdnptNERweG5DQk40Q3h6S0xzLzdhUWxqWUtpUm5QdStreW5YeVlWYXFtUy9wblNaa0wxeTN6dDJQaSs0eHJCVW4vVHRiQ0FrPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzIyODg4NTYwCWZpbGU6dGFyaS11bml2ZXJzZS5hcHAudGFyLmd6CkF2Z0xSWTZacThpUThvc3dDVmxZR0ZnT2VBS3ZpQ2Y4M3JTM3B5ZHJFS1paQnNsLzhTUGw0UDVmSHB2SmUzeVJuclpYYVUxbWdvWGFpa3hMUXRiOEJ3PT0K",
"url": "https://github.com/tari-project/universe/releases/download/tari_universe-v0.1.16/tari-universe-debug_universal.app.tar.gz"
},
"darwin-x86_64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFd4QTNrbVpkZy82Y2xsbitud01adGJXdFk3UTB6V0p6VXdTL0lHd0FBUWhhS3g4Zy9qZG1DVXVxa2ZmSGZ6VWlYRUw1cVNmK3lZUWpiNzNIeWJ3K1FNPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzIyNjcxMTI2CWZpbGU6dGFyaS11bml2ZXJzZS5hcHAudGFyLmd6CjBCUnc4RERvZmFqcFU4Q2NFcUVsalV5NWJZNU1TZ1RycHVzdkUyUlo0azRrUktBTW83MytyaWpvNDJwcmx6YUNxY09JbDh6dXVudC9mdlF2YU5aZkFnPT0K",
"url": "https://github.com/tari-project/universe/releases/download/tari_universe-v0.1.13/tari-universe-debug_universal.app.tar.gz"
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFRaL285VkNFRG1vU1NkdnptNERweG5DQk40Q3h6S0xzLzdhUWxqWUtpUm5QdStreW5YeVlWYXFtUy9wblNaa0wxeTN6dDJQaSs0eHJCVW4vVHRiQ0FrPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzIyODg4NTYwCWZpbGU6dGFyaS11bml2ZXJzZS5hcHAudGFyLmd6CkF2Z0xSWTZacThpUThvc3dDVmxZR0ZnT2VBS3ZpQ2Y4M3JTM3B5ZHJFS1paQnNsLzhTUGw0UDVmSHB2SmUzeVJuclpYYVUxbWdvWGFpa3hMUXRiOEJ3PT0K",
"url": "https://github.com/tari-project/universe/releases/download/tari_universe-v0.1.16/tari-universe-debug_universal.app.tar.gz"
},
"windows-x86_64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGRENUlCNFc2dzVjWWFyekwvOUg0bHV0aXlHVjE5ZlhlUkYzeG9URkdpTzl6WmEweXdqQk5EU2tGTEFENDZMM004OW4vYmlGMTFwU2Rkd1RkTU1wUXdvPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzIyNjcxNzgzCWZpbGU6dGFyaS11bml2ZXJzZV8wLjEuMTNfeDY0X2VuLVVTLm1zaS56aXAKV3l4UVp5a3MvYS9nUDd1QU9JWlRGdFVGQmI2Q0drd2JDU2YxUkp5TkNWdnJLVTJFQU5ucFB4ZnJTTXpmK25iN2R2a2hvOGFsRWI2L1ZDZElPUmcyQkE9PQo=",
"url": "https://github.com/tari-project/universe/releases/download/tari_universe-v0.1.13/tari-universe_0.1.13_x64_en-US-debug.msi.zip"
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFM3SWlubWgzMENDV1k0K0g4VUlpQUpTYjZ4cFNpT2Q2YmxwQnl0WlhObWxzYlJSeGkxY1RkdVc2N1RaZFlJcTg2Slh4TXFPRXdWWUtYNkhXTE9pK1FzPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzIyODg4OTExCWZpbGU6dGFyaS11bml2ZXJzZV8wLjEuMTZfeDY0X2VuLVVTLm1zaS56aXAKTm43Wnk1Y056VS9MZjNFaklhMEp4T1A5VjRGU3A3bGlmU3hmMEpaMzdPcURyMVMzd211V2FVK1pkSW9Gd2p1c3BBYU44TGR4dnRVNTlnTjYvZm8zQVE9PQo=",
"url": "https://github.com/tari-project/universe/releases/download/tari_universe-v0.1.16/tari-universe_0.1.16_x64_en-US-debug.msi.zip"
}
}
}
19 changes: 13 additions & 6 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,18 @@ async fn status(state: tauri::State<'_, UniverseAppState>) -> Result<AppStatus,
}
};

let wallet_balance = state
.wallet_manager
.get_balance()
.await
.map_err(|e| e.to_string())?;
let wallet_balance = match state.wallet_manager.get_balance().await {
Ok(w) => w,
Err(e) => {
warn!(target: LOG_TARGET, "Error getting wallet balance: {:?}", e);
WalletBalance {
available_balance: MicroMinotari(0),
pending_incoming_balance: MicroMinotari(0),
pending_outgoing_balance: MicroMinotari(0),
timelocked_balance: MicroMinotari(0),
}
}
};

Ok(AppStatus {
cpu,
Expand Down Expand Up @@ -319,7 +326,7 @@ fn main() {
info!(target: LOG_TARGET, "App shutdown caught");
shutdown.trigger();
// TODO: Find a better way of knowing that all miners have stopped
sleep(std::time::Duration::from_secs(3));
sleep(std::time::Duration::from_secs(5));
info!(target: LOG_TARGET, "App shutdown complete");
}
RunEvent::MainEventsCleared => {
Expand Down
12 changes: 12 additions & 0 deletions src-tauri/src/merge_mining_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use dirs_next::data_local_dir;
use std::path::PathBuf;
use tari_common_types::tari_address::TariAddress;
use tari_shutdown::Shutdown;
use tokio::runtime::Handle;
use tokio::select;
use tokio::task::JoinHandle;

Expand Down Expand Up @@ -116,6 +117,17 @@ impl ProcessInstance for MergeMiningProxyInstance {
Ok(res)
}
}
impl Drop for MergeMiningProxyInstance {
fn drop(&mut self) {
println!("Drop being called");
self.shutdown.trigger();
if let Some(handle) = self.handle.take() {
Handle::current().block_on(async move {
handle.await.unwrap();
});
}
}
}

impl StatusMonitor for MergeMiningProxyStatusMonitor {
fn status(&self) -> Result<(), Error> {
Expand Down
14 changes: 14 additions & 0 deletions src-tauri/src/minotari_node_adapter.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::binary_resolver::{Binaries, BinaryResolver};
use crate::node_manager::NodeIdentity;
use crate::process_adapter::{ProcessAdapter, ProcessInstance, StatusMonitor};
use crate::xmrig_adapter::XmrigInstance;
use anyhow::{anyhow, Error};
use async_trait::async_trait;
use dirs_next::data_local_dir;
Expand All @@ -14,6 +15,7 @@ use tari_core::transactions::tari_amount::MicroMinotari;
use tari_crypto::ristretto::RistrettoPublicKey;
use tari_shutdown::Shutdown;
use tari_utilities::ByteArray;
use tokio::runtime::Handle;
use tokio::select;
use tokio::task::JoinHandle;
use tokio::time::Instant;
Expand Down Expand Up @@ -144,6 +146,18 @@ impl ProcessInstance for MinotariNodeInstance {
Ok(res)
}
}

impl Drop for MinotariNodeInstance {
fn drop(&mut self) {
println!("Drop being called");
self.shutdown.trigger();
if let Some(handle) = self.handle.take() {
Handle::current().block_on(async move {
handle.await.unwrap();
});
}
}
}
pub struct MinotariNodeStatusMonitor {}

impl StatusMonitor for MinotariNodeStatusMonitor {
Expand Down
13 changes: 13 additions & 0 deletions src-tauri/src/wallet_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use tari_core::transactions::tari_amount::MicroMinotari;
use tari_crypto::ristretto::RistrettoPublicKey;
use tari_shutdown::Shutdown;
use tari_utilities::hex::Hex;
use tokio::runtime::Handle;
use tokio::select;
use tokio::task::JoinHandle;

Expand Down Expand Up @@ -165,6 +166,18 @@ impl ProcessInstance for WalletInstance {
}
}

impl Drop for WalletInstance {
fn drop(&mut self) {
println!("Drop being called");
self.shutdown.trigger();
if let Some(handle) = self.handle.take() {
Handle::current().block_on(async move {
handle.await.unwrap();
});
}
}
}

pub struct WalletStatusMonitor {}

impl StatusMonitor for WalletStatusMonitor {
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"package": {
"productName": "tari-universe",
"version": "0.1.16"
"version": "0.1.17"
},
"tauri": {
"updater": {
Expand Down

0 comments on commit 6eda659

Please sign in to comment.