Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: tx history optimizations #1304

Merged
merged 17 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ libsqlite3-sys = { version = "0.25.1", features = [
] } # Required for tari_wallet
log = "0.4.22"
log4rs = "1.3.0"
minotari_node_grpc_client = { git = "https://github.com/tari-project/tari.git", rev = "37c30be" }
minotari_wallet_grpc_client = { git = "https://github.com/tari-project/tari.git", rev = "37c30be" }
minotari_node_grpc_client = { git = "https://github.com/tari-project/tari.git", tag = "v1.9.1-rc.1" }
minotari_wallet_grpc_client = { git = "https://github.com/tari-project/tari.git", tag = "v1.9.1-rc.1" }
monero-address-creator = { git = "https://github.com/tari-project/monero-address-creator.git", rev = "6129ca0" }
nix = { version = "0.29.0", features = ["signal"] }
nvml-wrapper = "0.10.0"
Expand All @@ -58,15 +58,15 @@ sha2 = "0.10.8"
sys-locale = "0.3.1"
sysinfo = "0.31.2"
tar = "0.4.26"
tari_common = { git = "https://github.com/tari-project/tari.git", rev = "37c30be" }
tari_common_types = { git = "https://github.com/tari-project/tari.git", rev = "37c30be" }
tari_core = { git = "https://github.com/tari-project/tari.git", rev = "37c30be", features = [
tari_common = { git = "https://github.com/tari-project/tari.git", tag = "v1.9.1-rc.1" }
tari_common_types = { git = "https://github.com/tari-project/tari.git", tag = "v1.9.1-rc.1" }
tari_core = { git = "https://github.com/tari-project/tari.git", tag = "v1.9.1-rc.1", features = [
"transactions",
] }
tauri-plugin-single-instance = { git = "https://github.com/tari-project/tauri-plugins-workspace", rev = "09f29b0abe2cb1eb81365b65a3aa3f73325e4e17" }
tari_crypto = "0.21.0"
tari_key_manager = { git = "https://github.com/tari-project/tari.git", rev = "37c30be" }
tari_shutdown = { git = "https://github.com/tari-project/tari.git", rev = "37c30be" }
tari_key_manager = { git = "https://github.com/tari-project/tari.git", tag = "v1.9.1-rc.1" }
tari_shutdown = { git = "https://github.com/tari-project/tari.git", tag = "v1.9.1-rc.1" }
tari_utilities = "0.8.0"
tauri = { git = "https://github.com/tari-project/tauri.git", rev = "67a06c8a9bae94f412b8059dfa8b4d8dd8ea0a25", features = [
"macos-private-api",
Expand Down
7 changes: 7 additions & 0 deletions src-tauri/src/gpu_miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ impl GpuMiner {
pub async fn stop(&self) -> Result<(), anyhow::Error> {
info!(target: LOG_TARGET, "Stopping xtrgpuminer");
let mut process_watcher = self.watcher.write().await;
let _res = process_watcher
.adapter
.latest_status_broadcast
.send(GpuMinerStatus {
is_mining: false,
..GpuMinerStatus::default()
});
process_watcher.status_monitor = None;
process_watcher.stop().await?;
info!(target: LOG_TARGET, "xtrgpuminer stopped");
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/gpu_miner_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub(crate) struct GpuMinerAdapter {
pub(crate) coinbase_extra: String,
pub(crate) excluded_gpu_devices: Vec<u8>,
pub(crate) gpu_devices: Vec<GpuConfig>,
latest_status_broadcast: watch::Sender<GpuMinerStatus>,
pub(crate) latest_status_broadcast: watch::Sender<GpuMinerStatus>,
}

impl GpuMinerAdapter {
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/wallet_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ pub struct TransactionInfo {
pub is_cancelled: bool,
pub excess_sig: String,
pub timestamp: u64,
pub message: String,
pub payment_id: String,
pub mined_in_block_height: u64,
}

impl WalletStatusMonitor {
Expand Down Expand Up @@ -324,8 +324,8 @@ impl WalletStatusMonitor {
is_cancelled: tx.is_cancelled,
excess_sig: tx.excess_sig.to_hex(),
timestamp: tx.timestamp,
message: tx.message,
payment_id: tx.payment_id.to_hex(),
mined_in_block_height: tx.mined_in_block_height,
});
}
Ok(transactions)
Expand Down
38 changes: 19 additions & 19 deletions src/App/AppWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useEffect } from 'react';
import { defaultOptions } from 'tauri-plugin-sentry-api';
import * as Sentry from '@sentry/react';
import { IGNORE_FETCHING } from '@app/App/sentryIgnore';
// import { defaultOptions } from 'tauri-plugin-sentry-api';
// import * as Sentry from '@sentry/react';
// import { IGNORE_FETCHING } from '@app/App/sentryIgnore';
import { initSystray } from '@app/utils';

import { useDetectMode, useDisableRefresh, useLangaugeResolver, useListenForExternalDependencies } from '@app/hooks';

import packageInfo from '../../package.json';
// import packageInfo from '../../package.json';
import { useAppConfigStore } from '../store/useAppConfigStore.ts';
import setupLogger from '../utils/shared-logger.ts';
import App from './App.tsx';
Expand All @@ -15,21 +15,21 @@ import { useMiningStore } from '@app/store/useMiningStore.ts';

// FOR ANYTHING THAT NEEDS TO BE INITIALISED

const environment = import.meta.env.MODE;
const sentryOptions = {
...defaultOptions,
dsn: 'https://edd6b9c1494eb7fda6ee45590b80bcee@o4504839079002112.ingest.us.sentry.io/4507979991285760',
integrations: [Sentry.captureConsoleIntegration({ levels: ['warn', 'error'] }), Sentry.extraErrorDataIntegration()],
release: packageInfo.version,
environment,
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for tracing.
tracesSampleRate: 1.0,
attachStacktrace: true,
autoSessionTracking: false,
ignoreErrors: [...IGNORE_FETCHING],
enabled: environment !== 'development',
};
// const environment = import.meta.env.MODE;
// const sentryOptions = {
// ...defaultOptions,
// dsn: 'https://edd6b9c1494eb7fda6ee45590b80bcee@o4504839079002112.ingest.us.sentry.io/4507979991285760',
// integrations: [Sentry.captureConsoleIntegration({ levels: ['warn', 'error'] }), Sentry.extraErrorDataIntegration()],
// release: packageInfo.version,
// environment,
// // Set tracesSampleRate to 1.0 to capture 100%
// // of transactions for tracing.
// tracesSampleRate: 1.0,
// attachStacktrace: true,
// autoSessionTracking: false,
// ignoreErrors: [...IGNORE_FETCHING],
// enabled: environment !== 'development',
// };

setupLogger();

Expand Down
12 changes: 5 additions & 7 deletions src/components/ToastStack/Toast/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ export const Toast = ({ id, index, title, text, timeout = 4500, isHovered = fals
const { removeToast } = useToastStore();
const [finished, setFinished] = useState(false);

const handleHide = useCallback(
(id: number | string = 0) => {
setShow(false);
removeToast(id);
},
[removeToast]
);
const handleHide = useCallback((id: number | string = 0) => {
setShow(false);
removeToast(id);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

useEffect(() => {
setShow(true);
Expand Down
6 changes: 4 additions & 2 deletions src/containers/floating/AutoUpdateDialog/AutoUpdateDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ export default function AutoUpdateDialog() {
return () => {
unlistenPromise.then((unlisten) => unlisten());
};
}, [open, setDialogToShow]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [open]);

const handleClose = useCallback(() => {
console.info('Update declined');
setDialogToShow(null);
}, [setDialogToShow]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const handleUpdate = useCallback(() => {
console.info('Proceed with update');
Expand Down
Loading
Loading