From 7bbc1e5cb998a7309207b6d19256f3509ecbf577 Mon Sep 17 00:00:00 2001 From: JC Date: Fri, 20 Feb 2026 09:58:07 -0700 Subject: [PATCH 1/2] fix: new tx status - Failed - added --- native/Cargo.lock | 116 ++++++++++++++---- native/Cargo.toml | 22 ++-- native/src/lib.rs | 107 ++++++++++------ .../appstate/enums/ValueTransferStatusEnum.ts | 1 + .../balanceBlock/BalanceBlockHighlight.tsx | 16 +-- .../components/BalanceBlockProps.ts | 3 + src/components/dashboard/Dashboard.tsx | 4 +- .../history/components/VtItemBlock.tsx | 43 +++++-- src/components/history/components/VtModal.tsx | 106 +++++++--------- .../messages/components/MessagesItemBlock.tsx | 20 ++- src/native.node.d.ts | 3 - src/rpc/rpc.ts | 8 +- src/utils/utils.ts | 11 +- 13 files changed, 298 insertions(+), 162 deletions(-) diff --git a/native/Cargo.lock b/native/Cargo.lock index 5fc6040a..233f34be 100644 --- a/native/Cargo.lock +++ b/native/Cargo.lock @@ -467,6 +467,23 @@ dependencies = [ "zeroize", ] +[[package]] +name = "bip0039" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2758a6b386455c1586e91cc1c1ecb910cf4fb7d9d391256820e9c96efba0872" +dependencies = [ + "anyhow", + "hmac 0.12.1", + "pbkdf2", + "phf", + "phf_codegen", + "rand 0.9.2", + "sha2 0.10.9", + "unicode-normalization", + "zeroize", +] + [[package]] name = "bip32" version = "0.6.0-pre.1" @@ -477,12 +494,28 @@ dependencies = [ "hmac 0.13.0-pre.4", "rand_core 0.6.4", "ripemd 0.2.0-pre.4", - "secp256k1", + "secp256k1 0.29.1", "sha2 0.11.0-pre.4", "subtle", "zeroize", ] +[[package]] +name = "bitcoin-io" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dee39a0ee5b4095224a0cfc6bf4cc1baf0f9624b96b367e53b66d974e51d953" + +[[package]] +name = "bitcoin_hashes" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26ec84b80c482df901772e931a9a681e26a1b9ee2302edeff23cb30328745c8b" +dependencies = [ + "bitcoin-io", + "hex-conservative", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -610,6 +643,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09dc0086e469182132244e9b8d313a0742e1132da43a08c24b9dd3c18e0faf3a" dependencies = [ + "serde", "thiserror 2.0.18", ] @@ -2142,6 +2176,15 @@ dependencies = [ "serde", ] +[[package]] +name = "hex-conservative" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda06d18ac606267c40c04e41b9947729bf8b9efe74bd4e82b61a5f26a510b9f" +dependencies = [ + "arrayvec", +] + [[package]] name = "hkdf" version = "0.12.4" @@ -3414,7 +3457,7 @@ dependencies = [ [[package]] name = "pepper-sync" version = "0.1.0" -source = "git+https://github.com/zingolabs/zingolib?branch=stable#b3ffc4264977bc0176b357afa0af7d3481856579" +source = "git+https://github.com/zingolabs/zingolib?branch=dev#f86717800f6faeb63dc488d340d5017c85e10f1e" dependencies = [ "bip32", "byteorder", @@ -3476,6 +3519,16 @@ dependencies = [ "serde", ] +[[package]] +name = "phf_codegen" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" +dependencies = [ + "phf_generator", + "phf_shared", +] + [[package]] name = "phf_generator" version = "0.13.1" @@ -4596,10 +4649,21 @@ version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" dependencies = [ - "secp256k1-sys", + "secp256k1-sys 0.10.1", "serde", ] +[[package]] +name = "secp256k1" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c3c81b43dc2d8877c216a3fccf76677ee1ebccd429566d3e67447290d0c42b2" +dependencies = [ + "bitcoin_hashes", + "rand 0.9.2", + "secp256k1-sys 0.11.0", +] + [[package]] name = "secp256k1-sys" version = "0.10.1" @@ -4609,6 +4673,15 @@ dependencies = [ "cc", ] +[[package]] +name = "secp256k1-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb913707158fadaf0d8702c2db0e857de66eb003ccfdda5924b5f5ac98efb38" +dependencies = [ + "cc", +] + [[package]] name = "secrecy" version = "0.8.0" @@ -7374,7 +7447,7 @@ dependencies = [ "rayon", "rust_decimal", "sapling-crypto", - "secp256k1", + "secp256k1 0.29.1", "secrecy", "serde", "serde_json", @@ -7498,7 +7571,7 @@ dependencies = [ "redjubjub", "ripemd 0.1.3", "sapling-crypto", - "secp256k1", + "secp256k1 0.29.1", "sha2 0.10.9", "subtle", "tracing", @@ -7559,7 +7632,7 @@ dependencies = [ "bounded-vec", "hex", "ripemd 0.1.3", - "secp256k1", + "secp256k1 0.29.1", "sha1", "sha2 0.10.9", "thiserror 2.0.18", @@ -7589,7 +7662,7 @@ dependencies = [ "hex", "nonempty", "ripemd 0.1.3", - "secp256k1", + "secp256k1 0.29.1", "sha2 0.10.9", "subtle", "zcash_address", @@ -7602,9 +7675,9 @@ dependencies = [ [[package]] name = "zebra-chain" -version = "3.1.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4aa7e85afd7bdf159e8c9a973d32bfc410be42ce82c2396690ae1208933bb8" +checksum = "a15c1b579eb4d25214fa15839a74f4b9599806bc8addb910cfbec50dd59fb97f" dependencies = [ "bech32", "bitflags 2.10.0", @@ -7612,6 +7685,7 @@ dependencies = [ "bitvec", "blake2b_simd", "blake2s_simd", + "bounded-vec", "bs58", "byteorder", "chrono", @@ -7637,7 +7711,7 @@ dependencies = [ "redjubjub", "ripemd 0.1.3", "sapling-crypto", - "secp256k1", + "secp256k1 0.29.1", "serde", "serde-big-array", "serde_with", @@ -7789,7 +7863,7 @@ dependencies = [ [[package]] name = "zingo-price" version = "0.0.1" -source = "git+https://github.com/zingolabs/zingolib?branch=stable#b3ffc4264977bc0176b357afa0af7d3481856579" +source = "git+https://github.com/zingolabs/zingolib?branch=dev#f86717800f6faeb63dc488d340d5017c85e10f1e" dependencies = [ "byteorder", "reqwest", @@ -7804,17 +7878,17 @@ dependencies = [ [[package]] name = "zingo-status" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5535da49b496f5d003e4129472d557ddd4398f6918b73d7faa361a5209a2d6c" +source = "git+https://github.com/zingolabs/zingolib?branch=dev#f86717800f6faeb63dc488d340d5017c85e10f1e" dependencies = [ "byteorder", "zcash_primitives", + "zcash_protocol", ] [[package]] name = "zingo_common_components" -version = "0.1.0" -source = "git+https://github.com/zingolabs/zingo-common.git?branch=dev#bec229a0bcc47b1d1430649f316be79dcc51a956" +version = "0.2.0" +source = "git+https://github.com/zingolabs/zingo-common.git#096a79e2b3eb8b12d642e3380044bac00e7c855d" dependencies = [ "zebra-chain", ] @@ -7824,17 +7898,17 @@ name = "zingo_test_vectors" version = "0.0.1" source = "git+https://github.com/zingolabs/infrastructure.git?branch=dev#15a160df0949713c64c5917c881211ac709628c4" dependencies = [ - "bip0039", + "bip0039 0.12.0", ] [[package]] name = "zingolib" version = "2.1.2" -source = "git+https://github.com/zingolabs/zingolib?branch=stable#b3ffc4264977bc0176b357afa0af7d3481856579" +source = "git+https://github.com/zingolabs/zingolib?branch=dev#f86717800f6faeb63dc488d340d5017c85e10f1e" dependencies = [ "append-only-vec", "bech32", - "bip0039", + "bip0039 0.13.4", "bip32", "bs58", "byteorder", @@ -7861,7 +7935,7 @@ dependencies = [ "rust-embed", "rustls 0.23.36", "sapling-crypto", - "secp256k1", + "secp256k1 0.31.1", "secrecy", "serde", "serde_json", @@ -7897,7 +7971,7 @@ dependencies = [ name = "zingolib-native" version = "0.1.0" dependencies = [ - "bip0039", + "bip0039 0.13.4", "hex", "http", "json", @@ -7916,13 +7990,13 @@ dependencies = [ "zcash_encoding", "zcash_keys", "zcash_note_encryption", - "zcash_primitives", "zcash_proofs", "zcash_protocol", "zcash_transparent", "zebra-chain", "zingo_common_components", "zingolib", + "zip32", ] [[package]] diff --git a/native/Cargo.toml b/native/Cargo.toml index a35c3725..934acc70 100644 --- a/native/Cargo.toml +++ b/native/Cargo.toml @@ -12,8 +12,10 @@ crate-type = ["cdylib"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -zingolib = { git="https://github.com/zingolabs/zingolib", default-features = true, branch = "stable", features = [ "testutils" ]} -pepper-sync = { git = "https://github.com/zingolabs/zingolib", branch = "stable" } +zingolib = { git="https://github.com/zingolabs/zingolib", default-features = true, branch = "dev", features = [ + "testutils" +] } +pepper-sync = { git = "https://github.com/zingolabs/zingolib", branch = "dev" } zcash_address = { version = "0.10" } zcash_client_backend = { version = "0.21", features = [ @@ -29,18 +31,18 @@ zcash_keys = { version = "0.12", features = [ "orchard", ] } zcash_note_encryption = "0.4" -zcash_primitives = { version = "0.26" } zcash_proofs = { version = "0.26" } zcash_protocol = { version = "0.7" } zcash_transparent = { version = "0.6" } -zebra-chain = { version = "3.0" } +zebra-chain = "5.0.0" rusqlite = { version = "0.37.0", features = ["bundled"] } -zingo_common_components = { git = "https://github.com/zingolabs/zingo-common.git", branch = "dev" } +zingo_common_components = { git = "https://github.com/zingolabs/zingo-common.git", version = "0.2" } -bip0039 = { version = "0.12", features = [ "rand" ] } +bip0039 = { version = "0.13", features = [ "rand" ] } +zip32 = "0.2.0" json = "0.12" serde_json = "1" hex = "0.4" @@ -53,14 +55,6 @@ log = "0.4" once_cell = "1" lazy_static = "1.4.0" -[patch.crates-io] -# zcash_client_backend = { git = "https://github.com/zcash/librustzcash", rev = "3ba772c9b8"} -# zcash_address = { git = "https://github.com/zcash/librustzcash", rev = "3ba772c9b8"} -# zcash_keys = { git = "https://github.com/zcash/librustzcash", rev = "3ba772c9b8"} -# zcash_primitives = { git = "https://github.com/zcash/librustzcash", rev = "3ba772c9b8"} -# zcash_protocol = { git = "https://github.com/zcash/librustzcash", rev = "3ba772c9b8"} -# zcash_transparent = { git = "https://github.com/zcash/librustzcash", rev = "3ba772c9b8"} - [dependencies.neon] version = "1" default-features = true diff --git a/native/src/lib.rs b/native/src/lib.rs index d84b76c6..c3822fd0 100644 --- a/native/src/lib.rs +++ b/native/src/lib.rs @@ -21,8 +21,8 @@ use rustls::crypto::{CryptoProvider, ring::default_provider}; use zcash_address::unified::{Container, Encoding, Ufvk}; use zcash_keys::address::Address; use zcash_keys::keys::UnifiedFullViewingKey; -use zcash_primitives::consensus::BlockHeight; -use zcash_primitives::zip32::AccountId; +use zcash_protocol::consensus::BlockHeight; +use zip32::AccountId; use zcash_protocol::consensus::NetworkType; use pepper_sync::keys::transparent; @@ -41,7 +41,7 @@ use zingolib::data::receivers::Receivers; use zcash_address::ZcashAddress; use zcash_protocol::{value::Zatoshis}; use tokio::runtime::Runtime; -use zcash_primitives::memo::MemoBytes; +use zcash_protocol::memo::MemoBytes; use zingolib::data::receivers::transaction_request_from_receivers; use zingolib::data::proposal::total_fee; @@ -84,7 +84,6 @@ fn main(mut cx: ModuleContext) -> NeonResult<()> { cx.export_function("get_total_value_to_address", get_total_value_to_address)?; cx.export_function("get_total_spends_to_address", get_total_spends_to_address)?; cx.export_function("zec_price", zec_price)?; - cx.export_function("resend_transaction", resend_transaction)?; cx.export_function("remove_transaction", remove_transaction)?; cx.export_function("get_spendable_balance_with_address", get_spendable_balance_with_address)?; cx.export_function("get_spendable_balance_total", get_spendable_balance_total)?; @@ -524,14 +523,75 @@ fn init_from_b64(mut cx: FunctionContext) -> JsResult { } } +fn write_to_path(wallet_path: &std::path::Path, bytes: &[u8]) -> std::io::Result<()> { + let temp_wallet_path: std::path::PathBuf = wallet_path.with_extension( + wallet_path + .extension() + .map(|e| format!("{}.tmp", e.to_string_lossy())) + .unwrap_or_else(|| "tmp".to_string()), + ); + let file = std::fs::OpenOptions::new() + .create(true) + .truncate(true) + .write(true) + .open(&temp_wallet_path) + .map_err(|e| std::io::Error::new(e.kind(), format!("open temp {:?}: {}", temp_wallet_path, e)))?; + + let mut writer = std::io::BufWriter::new(file); + std::io::Write::write_all(&mut writer, bytes) + .map_err(|e| std::io::Error::new(e.kind(), format!("write temp {:?}: {}", temp_wallet_path, e)))?; + + let file = writer.into_inner() + .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, format!("into_inner: {}", e)))?; + + file.sync_all() + .map_err(|e| std::io::Error::new(e.kind(), format!("sync temp {:?}: {}", temp_wallet_path, e)))?; + + std::fs::rename(&temp_wallet_path, wallet_path) + .map_err(|e| std::io::Error::new(e.kind(), format!("rename {:?} -> {:?}: {}", temp_wallet_path, wallet_path, e)))?; + + #[cfg(unix)] + { + if let Some(parent) = wallet_path.parent() { + let wallet_dir = std::fs::File::open(parent) + .map_err(|e| std::io::Error::new(e.kind(), format!("open dir {:?}: {}", parent, e)))?; + wallet_dir.sync_all() + .map_err(|e| std::io::Error::new(e.kind(), format!("sync dir {:?}: {}", parent, e)))?; + } + } + + Ok(()) +} + fn save_wallet_file(mut cx: FunctionContext) -> JsResult { let promise = cx .task(move || -> Result { with_panic_guard(|| { let mut guard = LIGHTCLIENT.write().map_err(|_| ZingolibError::LightclientLockPoisoned)?; if let Some(lightclient) = &mut *guard { - RT.block_on(async move { lightclient.save_task().await }); - Ok("Launching save task...".to_string()) + Ok(RT.block_on(async move { + let wallet_path = lightclient.config.get_wallet_path(); + let mut wallet = lightclient.wallet.write().await; + match wallet.save() { + Ok(Some(wallet_bytes)) => { + match write_to_path(&wallet_path, &wallet_bytes) { + Ok(_) => { + let size = wallet_bytes.len(); + format!("Wallet saved successfully. Size: {} bytes.", size) + } + Err(e) => { + format!("Error: writing wallet file: {e}") + } + } + } + Ok(None) => { + "Wallet is empty. Nothing to save.".to_string() + } + Err(e) => { + format!("Error: {e}") + } + } + })) } else { Err(ZingolibError::LightclientNotInitialized) } @@ -711,7 +771,7 @@ fn get_latest_block_wallet(mut cx: FunctionContext) -> JsResult { if let Some(lightclient) = &mut *guard { Ok(RT.block_on(async move { let wallet = lightclient.wallet.write().await; - object! { "height" => json::JsonValue::from(wallet.sync_state.wallet_height().map(u32::from).unwrap_or(0))}.pretty(2) + object! { "height" => json::JsonValue::from(wallet.sync_state.last_known_chain_height().map_or(0, u32::from))}.pretty(2) })) } else { Err(ZingolibError::LightclientNotInitialized) @@ -1373,37 +1433,6 @@ fn zec_price(mut cx: FunctionContext) -> JsResult { Ok(promise) } -fn resend_transaction(mut cx: FunctionContext) -> JsResult { - let txid = cx.argument::(0)?.value(&mut cx); - - let promise = cx - .task(move || -> Result { - with_panic_guard(|| { - let mut guard = LIGHTCLIENT.write().map_err(|_| ZingolibError::LightclientLockPoisoned)?; - if let Some(lightclient) = &mut *guard { - let txid = match txid_from_hex_encoded_str(&txid) { - Ok(txid) => txid, - Err(e) => return Ok(format!("Error: {e}")), - }; - RT.block_on(async move { - match lightclient.resend(txid).await { - Ok(_) => Ok("Successfully resent transaction.".to_string()), - Err(e) => Ok(format!("Error: {e}")), - } - }) - } else { - Err(ZingolibError::LightclientNotInitialized) - } - }) - }) - .promise(move |mut cx, result| match result { - Ok(msg) => Ok(cx.string(msg)), - Err(err) => cx.throw_error(err.to_string()), - }); - - Ok(promise) -} - fn remove_transaction(mut cx: FunctionContext) -> JsResult { let txid = cx.argument::(0)?.value(&mut cx); @@ -1421,7 +1450,7 @@ fn remove_transaction(mut cx: FunctionContext) -> JsResult { .wallet .write() .await - .remove_unconfirmed_transaction(txid) + .remove_failed_transaction(txid) { Ok(_) => "Successfully removed transaction.".to_string(), Err(e) => format!("Error: {e}"), diff --git a/src/components/appstate/enums/ValueTransferStatusEnum.ts b/src/components/appstate/enums/ValueTransferStatusEnum.ts index a9be785c..a931a64f 100644 --- a/src/components/appstate/enums/ValueTransferStatusEnum.ts +++ b/src/components/appstate/enums/ValueTransferStatusEnum.ts @@ -4,4 +4,5 @@ export enum ValueTransferStatusEnum { transmitted = 'transmitted', mempool = 'mempool', confirmed = 'confirmed', + failed = 'failed', } \ No newline at end of file diff --git a/src/components/balanceBlock/BalanceBlockHighlight.tsx b/src/components/balanceBlock/BalanceBlockHighlight.tsx index fd6284ef..9354b0b3 100644 --- a/src/components/balanceBlock/BalanceBlockHighlight.tsx +++ b/src/components/balanceBlock/BalanceBlockHighlight.tsx @@ -1,14 +1,16 @@ import cstyles from "../common/Common.module.css"; import Utils from "../../utils/utils"; import BalanceBlockProps from "./components/BalanceBlockProps"; +import { ValueTransferStatusEnum } from "../appstate"; const BalanceBlockHighlight: React.FC = ({ zecValue, zecValueConfirmed, usdValue, usdValueConfirmed, - topLabel, currencyName, + status, + topLabel, tooltip, }) => { const { bigPart, smallPart }: {bigPart: string, smallPart: string} = @@ -31,13 +33,13 @@ const BalanceBlockHighlight: React.FC = ({ )}
- + {currencyName} {bigPart} - {smallPart} + {smallPart}
{currencyName === 'ZEC' && ( -
{usdValue}
+
{usdValue}
)} {zecValueConfirmed !== undefined && zecValue !== zecValueConfirmed && ( @@ -45,13 +47,13 @@ const BalanceBlockHighlight: React.FC = ({
{topLabel + ' Confirmed'}
- + {currencyName} {bigPartConfirmed} - {smallPartConfirmed} + {smallPartConfirmed}
{currencyName === 'ZEC' && ( -
{usdValueConfirmed}
+
{usdValueConfirmed}
)}
diff --git a/src/components/balanceBlock/components/BalanceBlockProps.ts b/src/components/balanceBlock/components/BalanceBlockProps.ts index 209de9f3..5fe8e647 100644 --- a/src/components/balanceBlock/components/BalanceBlockProps.ts +++ b/src/components/balanceBlock/components/BalanceBlockProps.ts @@ -1,9 +1,12 @@ +import { ValueTransferStatusEnum } from "../../appstate"; + type BalanceBlockProps = { zecValue: number; zecValueConfirmed?: number; usdValue: string; usdValueConfirmed?: string; currencyName: string; + status?: ValueTransferStatusEnum | ""; topLabel?: string; tooltip?: string; }; diff --git a/src/components/dashboard/Dashboard.tsx b/src/components/dashboard/Dashboard.tsx index 1659ba36..3cbfc941 100644 --- a/src/components/dashboard/Dashboard.tsx +++ b/src/components/dashboard/Dashboard.tsx @@ -58,7 +58,7 @@ const Dashboard: React.FC = ({ navigateToH usdValue={Utils.getZecToUsdString(info.zecPrice, totalBalance.totalOrchardBalance + totalBalance.totalSaplingBalance + totalBalance.totalTransparentBalance)} currencyName={info.currencyName} zecValueConfirmed={totalBalance.confirmedOrchardBalance + totalBalance.confirmedSaplingBalance + totalBalance.confirmedTransparentBalance} - usdValueConfirmed={Utils.getZecToUsdString(info.zecPrice, totalBalance.confirmedOrchardBalance + totalBalance.confirmedSaplingBalance + totalBalance.confirmedTransparentBalance)} + usdValueConfirmed={Utils.getZecToUsdString(info.zecPrice, totalBalance.confirmedOrchardBalance + totalBalance.confirmedSaplingBalance + totalBalance.confirmedTransparentBalance)} /> {orchardPool && ( = ({ navigateToH {valueTransfers .filter((_, index: number) => index < 5) .map((vt: ValueTransferClass, index: number) => ( - + ))}
navigateToHistory()}> diff --git a/src/components/history/components/VtItemBlock.tsx b/src/components/history/components/VtItemBlock.tsx index 9b4185c4..b283053d 100644 --- a/src/components/history/components/VtItemBlock.tsx +++ b/src/components/history/components/VtItemBlock.tsx @@ -49,6 +49,17 @@ const VtItemBlock: React.FC = ({ priceString = `USD ${price.toFixed(2)} / ZEC`; } + //if (index === 0) { + // vt.status = ValueTransferStatusEnum.failed; + // vt.confirmations = 0; + //} + + //if (index === 2) { + // vt.status = ValueTransferStatusEnum.failed; + // vt.type = ValueTransferKindEnum.shield; + // vt.confirmations = 0; + //} + return (
{!previousLineWithSameTxid ? ( @@ -66,12 +77,30 @@ const VtItemBlock: React.FC = ({ >
- {Utils.VTTypeWithConfirmations(vt.type, vt.confirmations)} + {Utils.VTTypeWithConfirmations(vt.type, vt.status, vt.confirmations)}
{timePart}
- {(vt.status === ValueTransferStatusEnum.calculated || vt.status === ValueTransferStatusEnum.transmitted || vt.status === ValueTransferStatusEnum.mempool) && ( -
- {vt.status === ValueTransferStatusEnum.calculated ? 'Calculated' : vt.status === ValueTransferStatusEnum.transmitted ? 'Transmitted' : vt.status === ValueTransferStatusEnum.mempool ? 'In Mempool': ''} + {(vt.status === ValueTransferStatusEnum.calculated || + vt.status === ValueTransferStatusEnum.transmitted || + vt.status === ValueTransferStatusEnum.mempool || + vt.status === ValueTransferStatusEnum.failed) && ( +
+ {vt.status === ValueTransferStatusEnum.calculated + ? 'Calculated' + : vt.status === ValueTransferStatusEnum.transmitted + ? 'Transmitted' + : vt.status === ValueTransferStatusEnum.mempool + ? 'In Mempool' + : vt.status === ValueTransferStatusEnum.failed + ? 'Failed' + : ''}
)}
@@ -146,12 +175,12 @@ const VtItemBlock: React.FC = ({ )}
- + {currencyName} {bigPart} - {smallPart} + {smallPart}
-
+
{priceString}
diff --git a/src/components/history/components/VtModal.tsx b/src/components/history/components/VtModal.tsx index 819ec858..d09e9538 100644 --- a/src/components/history/components/VtModal.tsx +++ b/src/components/history/components/VtModal.tsx @@ -42,7 +42,7 @@ const VtModalInternal: React.FC = ({ valueTransfersSliced, }) => { const context = useContext(ContextApp); - const { addressBook, addressesUnified, addressesTransparent, valueTransfers, readOnly, info, setSendTo, openErrorModal, openConfirmModal, setAddLabel } = context; + const { addressBook, addressesUnified, addressesTransparent, valueTransfers, readOnly, setSendTo, openErrorModal, openConfirmModal, setAddLabel } = context; const [valueTransfer, setValueTransfer] = useState(vt ? vt : undefined); const [valueTransferIndex, setValueTransferIndex] = useState(index); const [expandAddress, setExpandAddress] = useState(false); @@ -125,12 +125,10 @@ const VtModalInternal: React.FC = ({ }, [valueTransferIndex]); let txid: string = ""; - let type: ValueTransferKindEnum | "" = ""; let typeText: string = ""; let typeIcon: string = ""; let typeColor: string = ""; let confirmations: number = 0; - let blockHeight: number = 0; let status: ValueTransferStatusEnum | "" = ""; let address: string = ""; let memos: string[] = []; @@ -154,8 +152,7 @@ const VtModalInternal: React.FC = ({ if (valueTransfer) { txid = valueTransfer.txid; - type = valueTransfer.type; - typeText = Utils.VTTypeWithConfirmations(valueTransfer.type, valueTransfer.confirmations); + typeText = Utils.VTTypeWithConfirmations(valueTransfer.type, valueTransfer.status, valueTransfer.confirmations); if (valueTransfer.type === ValueTransferKindEnum.received || ValueTransferKindEnum.shield) { typeIcon = "fa-arrow-circle-down"; typeColor = Utils.getCssVariable('--color-primary'); @@ -168,7 +165,6 @@ const VtModalInternal: React.FC = ({ timePart = dateformat(valueTransfer.time * 1000, "hh:MM tt"); confirmations = valueTransfer.confirmations; - blockHeight = valueTransfer.blockheight; status = valueTransfer.status; amount = valueTransfer.amount; fees = valueTransfer.fee ? valueTransfer.fee : 0; @@ -204,48 +200,30 @@ const VtModalInternal: React.FC = ({ closeModal(); }; - const runAction = async (action: 'resend' | 'remove') => { + const runAction = async () => { localCloseModal(); - openConfirmModal(action === 'remove' ? 'Remove Transaction' : 'Resend Transaction', "Please confirm the Action", () => runActionConfirmed(action)); + openConfirmModal('Remove Transaction', "Please confirm the Action", () => runActionConfirmed()); }; - const runActionConfirmed = async (action: 'resend' | 'remove') => { + const runActionConfirmed = async () => { // modal while waiting. openErrorModal("Computing Transaction", "Please wait...This could take a while"); try { - let actionStr: string; - if (action === 'resend') { - actionStr = await native.resend_transaction(txid); - } else { - actionStr = await native.remove_transaction(txid); - } + let actionStr: string = await native.remove_transaction(txid); //console.log(actionStr); if (actionStr) { if (actionStr.toLowerCase().startsWith('error')) { - if (action === 'resend') { - openErrorModal("Resend", "Resend " + actionStr); - } else { - openErrorModal("Remove", "Remove " + actionStr); - } + openErrorModal("Remove", "Remove " + actionStr); } else { - if (action === 'resend') { - openErrorModal("Resend", actionStr); - } else { - openErrorModal("Remove", actionStr); - } + openErrorModal("Remove", actionStr); } } } catch (error: any) { - if (action === 'resend') { - console.log(`Critical Error Resend ${error}`); - openErrorModal("Resend", error); - } else { - console.log(`Critical Error Remove ${error}`); - openErrorModal("Remove", error); - } + console.log(`Critical Error Remove ${error}`); + openErrorModal("Remove", error); } }; @@ -313,6 +291,7 @@ const VtModalInternal: React.FC = ({ zecValue={amount} usdValue={priceString} currencyName={currencyName} + status={status} />
@@ -321,32 +300,14 @@ const VtModalInternal: React.FC = ({ <>
- {(status === ValueTransferStatusEnum.calculated || - status === ValueTransferStatusEnum.transmitted || - status === ValueTransferStatusEnum.mempool) && ( + {status === ValueTransferStatusEnum.failed && ( <>
- {(status === ValueTransferStatusEnum.calculated || - status === ValueTransferStatusEnum.transmitted) && - info.latestBlock - blockHeight < 40 && - !readOnly && ( - - )} - {type !== ValueTransferKindEnum.received && ( - - )} +
- {type !== ValueTransferKindEnum.received && ( -
- Remove transaction to restore balance -
- )} )} @@ -367,14 +328,17 @@ const VtModalInternal: React.FC = ({ )} {(status === ValueTransferStatusEnum.transmitted || status === ValueTransferStatusEnum.calculated || - status === ValueTransferStatusEnum.mempool) && ( + status === ValueTransferStatusEnum.mempool || + status === ValueTransferStatusEnum.failed) && (
= ({
{confirmations}
- {(status === ValueTransferStatusEnum.calculated || status === ValueTransferStatusEnum.transmitted || status === ValueTransferStatusEnum.mempool) && ( + {(status === ValueTransferStatusEnum.calculated || + status === ValueTransferStatusEnum.transmitted || + status === ValueTransferStatusEnum.mempool || + status === ValueTransferStatusEnum.failed) && (
Status
-
- {status === ValueTransferStatusEnum.calculated ? 'Calculated' : status === ValueTransferStatusEnum.transmitted ? 'Transmitted' : status === ValueTransferStatusEnum.mempool ? 'In Mempool': ''} +
+ {status === ValueTransferStatusEnum.calculated + ? 'Calculated' + : status === ValueTransferStatusEnum.transmitted + ? 'Transmitted' + : status === ValueTransferStatusEnum.mempool + ? 'In Mempool' + : status === ValueTransferStatusEnum.failed + ? 'Failed' + : ''}
)} diff --git a/src/components/messages/components/MessagesItemBlock.tsx b/src/components/messages/components/MessagesItemBlock.tsx index 5b2d4afc..f5b5ae98 100644 --- a/src/components/messages/components/MessagesItemBlock.tsx +++ b/src/components/messages/components/MessagesItemBlock.tsx @@ -2,7 +2,7 @@ import React, { useState } from "react"; import dateformat from "dateformat"; import styles from "../Messages.module.css"; import cstyles from "../../common/Common.module.css"; -import { ValueTransferClass, ValueTransferKindEnum } from "../../appstate"; +import { ValueTransferClass, ValueTransferKindEnum, ValueTransferStatusEnum } from "../../appstate"; import Utils from "../../../utils/utils"; const { clipboard } = window.require("electron"); @@ -40,7 +40,19 @@ const MessagesItemBlock: React.FC = ({ const { bigPart, smallPart }: {bigPart: string, smallPart: string} = Utils.splitZecAmountIntoBigSmall(amount); - return ( + //if (index === 0) { + // vt.status = ValueTransferStatusEnum.failed; + // vt.confirmations = 0; + // vt.type = ValueTransferKindEnum.sent; + //} + + //if (index === 1) { + // vt.status = ValueTransferStatusEnum.failed; + // vt.confirmations = 0; + // vt.type = ValueTransferKindEnum.shield; + //} + + return (
= ({ borderRadius: 20, borderBottomRightRadius: vt.type === ValueTransferKindEnum.received ? 20 : 0, borderBottomLeftRadius: vt.type === ValueTransferKindEnum.received ? 0 : 20, + opacity: vt.status === ValueTransferStatusEnum.failed ? 0.2 : 1, backgroundColor: vt.type === ValueTransferKindEnum.received ? Utils.getCssVariable('--color-primary-disable') : Utils.getCssVariable('--color-primary'), @@ -145,6 +158,9 @@ const MessagesItemBlock: React.FC = ({
{timePart}
)} + {vt.status === ValueTransferStatusEnum.failed && ( +
Failed
+ )}
); diff --git a/src/native.node.d.ts b/src/native.node.d.ts index 4899c4a4..2a02a859 100644 --- a/src/native.node.d.ts +++ b/src/native.node.d.ts @@ -79,9 +79,6 @@ export function get_total_spends_to_address(): Promise; export function zec_price( tor: string ): Promise; -export function resend_transaction( - txid: string -): Promise; export function remove_transaction( txid: string ): Promise; diff --git a/src/rpc/rpc.ts b/src/rpc/rpc.ts index 1efcfb2e..1566c380 100644 --- a/src/rpc/rpc.ts +++ b/src/rpc/rpc.ts @@ -737,7 +737,8 @@ export default class RPC { if ( tx.status === ValueTransferStatusEnum.calculated || tx.status === ValueTransferStatusEnum.transmitted || - tx.status === ValueTransferStatusEnum.mempool + tx.status === ValueTransferStatusEnum.mempool || + tx.status === ValueTransferStatusEnum.failed ) { currentVtList.confirmations = 0; } else if (tx.status === ValueTransferStatusEnum.confirmed) { @@ -813,12 +814,13 @@ export default class RPC { currentMList.fee = (!tx.transaction_fee ? 0 : tx.transaction_fee) / 10 ** 8; currentMList.zec_price = !tx.zec_price ? 0 : tx.zec_price; - // unconfirmed means 0 confirmations, the tx is mining already. + // unconfirmed means 0 confirmations, the tx is mining already. // 'pending' is obsolete if ( tx.status === ValueTransferStatusEnum.calculated || tx.status === ValueTransferStatusEnum.transmitted || - tx.status === ValueTransferStatusEnum.mempool + tx.status === ValueTransferStatusEnum.mempool || + tx.status === ValueTransferStatusEnum.failed ) { currentMList.confirmations = 0; } else if (tx.status === ValueTransferStatusEnum.confirmed) { diff --git a/src/utils/utils.ts b/src/utils/utils.ts index cfd3bd48..4ed552a2 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -1,4 +1,4 @@ -import { AddressKindEnum, UnifiedAddressClass, ValueTransferKindEnum } from "../components/appstate"; +import { AddressKindEnum, UnifiedAddressClass, ValueTransferKindEnum, ValueTransferStatusEnum } from "../components/appstate"; import randomColor from 'randomcolor'; import native from "../native.node"; @@ -17,9 +17,16 @@ export default class Utils { static VTTypeWithConfirmations( type: ValueTransferKindEnum | "", + status: ValueTransferStatusEnum | "", confirmations:number, ): string { - return type === ValueTransferKindEnum.sent && confirmations === 0 + return status === ValueTransferStatusEnum.failed && + type === ValueTransferKindEnum.sent + ? 'Send' + : status === ValueTransferStatusEnum.failed && + type === ValueTransferKindEnum.shield + ? 'Shield' + : type === ValueTransferKindEnum.sent && confirmations === 0 ? '...Sending...' : type === ValueTransferKindEnum.sent && confirmations > 0 ? 'Sent' From 3cb5ef49d030acb332b2c7abb00768c0d3a3a3fd Mon Sep 17 00:00:00 2001 From: JC Date: Tue, 24 Feb 2026 09:55:37 -0700 Subject: [PATCH 2/2] fix: zingolib dev branch --- native/Cargo.lock | 623 ++++++++++++++++++++++++++----------------- native/Cargo.toml | 6 +- native/src/lib.rs | 32 ++- src/native.node.d.ts | 1 + src/rpc/rpc.ts | 9 +- 5 files changed, 412 insertions(+), 259 deletions(-) diff --git a/native/Cargo.lock b/native/Cargo.lock index 233f34be..7b632934 100644 --- a/native/Cargo.lock +++ b/native/Cargo.lock @@ -125,9 +125,9 @@ checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" [[package]] name = "anyhow" -version = "1.0.100" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" [[package]] name = "append-only-vec" @@ -137,9 +137,9 @@ checksum = "2114736faba96bcd79595c700d03183f61357b9fbce14852515e59f3bee4ed4a" [[package]] name = "arc-swap" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ded5f9a03ac8f24d1b8a25101ee812cd32cdc8c50a4c50237de2c4915850e73" +checksum = "f9f3647c145568cec02c42054e07bdf9a5a698e15b466fb2341bfc393cd24aa5" dependencies = [ "rustversion", ] @@ -234,7 +234,7 @@ checksum = "3109e49b1e4909e9db6515a30c633684d68cdeaa252f215214cb4fa1a5bfee2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", "synstructure", ] @@ -246,7 +246,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -257,9 +257,9 @@ checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "async-compression" -version = "0.4.37" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d10e4f991a553474232bc0a31799f6d24b034a84c0971d80d2e2f78b2e576e40" +checksum = "7d67d43201f4d20c78bcda740c142ca52482d81da80681533d33bf3f0596c8e2" dependencies = [ "compression-codecs", "compression-core", @@ -275,7 +275,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -335,9 +335,9 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "aws-lc-rs" -version = "1.15.4" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7b6141e96a8c160799cc2d5adecd5cbbe5054cb8c7c4af53da0f83bb7ad256" +checksum = "d9a7b350e3bb1767102698302bc37256cbd48422809984b98d292c40e2579aa9" dependencies = [ "aws-lc-sys", "zeroize", @@ -345,9 +345,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.37.0" +version = "0.37.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c34dda4df7017c8db52132f0f8a2e0f8161649d15723ed63fc00c82d0f2081a" +checksum = "b092fe214090261288111db7a2b2c2118e5a7f30dc2569f1732c4069a6840549" dependencies = [ "cc", "cmake", @@ -453,20 +453,6 @@ dependencies = [ "unty", ] -[[package]] -name = "bip0039" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568b6890865156d9043af490d4c4081c385dd68ea10acd6ca15733d511e6b51c" -dependencies = [ - "hmac 0.12.1", - "pbkdf2", - "rand 0.8.5", - "sha2 0.10.9", - "unicode-normalization", - "zeroize", -] - [[package]] name = "bip0039" version = "0.13.4" @@ -524,9 +510,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" [[package]] name = "bitflags-serde-legacy" @@ -534,7 +520,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b64e60c28b6d25ad92e8b367801ff9aa12b41d05fc8798055d296bace4a60cc" dependencies = [ - "bitflags 2.10.0", + "bitflags 2.11.0", "serde", ] @@ -580,7 +566,7 @@ checksum = "e0b121a9fe0df916e362fb3271088d071159cdf11db0e4182d02152850756eff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -634,7 +620,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -670,9 +656,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.19.1" +version = "3.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" [[package]] name = "by_address" @@ -722,9 +708,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" [[package]] name = "caret" @@ -749,9 +735,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.55" +version = "1.2.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29" +checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2" dependencies = [ "find-msvc-tools", "jobserver", @@ -797,9 +783,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.43" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" dependencies = [ "iana-time-zone", "js-sys", @@ -849,18 +835,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.56" +version = "4.5.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75ca66430e33a14957acc24c5077b503e7d374151b2b4b3a10c83b4ceb4be0e" +checksum = "2797f34da339ce31042b27d23607e051786132987f595b02ba4f6a6dffb7030a" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.56" +version = "4.5.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793207c7fa6300a0608d1080b858e5fdbe713cdc1c8db9fb17777d8a13e63df0" +checksum = "24a241312cea5059b13574bb9b3861cabf758b879c15190b37b6d6fd63ab6876" dependencies = [ "anstyle", "clap_lex", @@ -868,9 +854,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.7" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" +checksum = "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831" [[package]] name = "cmake" @@ -894,9 +880,9 @@ dependencies = [ [[package]] name = "compression-codecs" -version = "0.4.36" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00828ba6fd27b45a448e57dbfe84f1029d4c9f26b368157e9a448a5f49a2ec2a" +checksum = "eb7b51a7d9c967fc26773061ba86150f19c50c0d65c887cb1fbe295fd16619b7" dependencies = [ "compression-core", "flate2", @@ -1199,7 +1185,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -1247,7 +1233,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -1269,7 +1255,7 @@ checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ "darling_core 0.21.3", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -1337,7 +1323,7 @@ dependencies = [ "quote", "sha3", "strum", - "syn 2.0.114", + "syn 2.0.117", "void", ] @@ -1349,7 +1335,7 @@ checksum = "74ef43543e701c01ad77d3a5922755c6a1d71b22d942cb8042be4994b380caff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -1402,7 +1388,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.114", + "syn 2.0.117", "unicode-xid", ] @@ -1473,7 +1459,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -1520,7 +1506,7 @@ checksum = "0b0713d5c1d52e774c5cd7bb8b043d7c0fc4f921abfb678556140bfbe6ab2364" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -1628,7 +1614,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -1640,7 +1626,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -1781,9 +1767,9 @@ checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "flate2" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b375d6465b98090a5f25b1c7703f3859783755aa9a80433b36e0379a3ec2f369" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" dependencies = [ "crc32fast", "miniz_oxide", @@ -1869,9 +1855,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" dependencies = [ "futures-channel", "futures-core", @@ -1884,9 +1870,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" dependencies = [ "futures-core", "futures-sink", @@ -1894,15 +1880,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" [[package]] name = "futures-executor" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" dependencies = [ "futures-core", "futures-task", @@ -1911,19 +1897,19 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" [[package]] name = "futures-macro" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -1939,21 +1925,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" [[package]] name = "futures-task" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" [[package]] name = "futures-util" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" dependencies = [ "futures-channel", "futures-core", @@ -1963,7 +1949,6 @@ dependencies = [ "futures-task", "memchr", "pin-project-lite", - "pin-utils", "slab", ] @@ -2005,6 +1990,19 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "getrandom" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", + "wasip3", +] + [[package]] name = "getset" version = "0.1.6" @@ -2014,7 +2012,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -2336,7 +2334,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", - "webpki-roots 1.0.5", + "webpki-roots 1.0.6", ] [[package]] @@ -2480,6 +2478,12 @@ dependencies = [ "zerovec", ] +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + [[package]] name = "ident_case" version = "1.0.1" @@ -2524,7 +2528,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -2565,7 +2569,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" dependencies = [ - "bitflags 2.10.0", + "bitflags 2.11.0", "inotify-sys", "libc", ] @@ -2590,9 +2594,9 @@ dependencies = [ [[package]] name = "inventory" -version = "0.3.21" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc61209c082fbeb19919bee74b176221b27223e27b65d781eb91af24eb1fb46e" +checksum = "009ae045c87e7082cb72dab0ccd01ae075dd00141ddc108f43a0ea150a9e7227" dependencies = [ "rustversion", ] @@ -2649,9 +2653,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.85" +version = "0.3.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" +checksum = "c7e709f3e3d22866f9c25b3aff01af289b18422cc8b4262fb19103ee80fe513d" dependencies = [ "once_cell", "wasm-bindgen", @@ -2679,18 +2683,18 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +checksum = "cb26cec98cce3a3d96cbb7bced3c4b16e3d13f27ec56dbd62cbc8f39cfb9d653" dependencies = [ "cpufeatures", ] [[package]] name = "known-folders" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d463f34ca3c400fde3a054da0e0b8c6ffa21e4590922f3e18281bb5eeef4cbdc" +checksum = "770919970f7d2f74fea948900d35e2ef64f44129e8ae4015f59de1f0aca7c2a5" dependencies = [ "windows-sys 0.61.2", ] @@ -2724,11 +2728,17 @@ dependencies = [ "spin", ] +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + [[package]] name = "libc" -version = "0.2.180" +version = "0.2.182" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" +checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" [[package]] name = "libloading" @@ -2742,9 +2752,9 @@ dependencies = [ [[package]] name = "liblzma" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73c36d08cad03a3fbe2c4e7bb3a9e84c57e4ee4135ed0b065cade3d98480c648" +checksum = "b6033b77c21d1f56deeae8014eb9fbe7bdf1765185a6c508b5ca82eeaed7f899" dependencies = [ "liblzma-sys", ] @@ -2772,9 +2782,9 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" dependencies = [ - "bitflags 2.10.0", + "bitflags 2.11.0", "libc", - "redox_syscall 0.7.0", + "redox_syscall 0.7.1", ] [[package]] @@ -2805,14 +2815,14 @@ checksum = "e5cec0ec4228b4853bb129c84dbf093a27e6c7a20526da046defc334a1b017f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] name = "linux-raw-sys" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "litemap" @@ -2912,15 +2922,15 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.6" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" [[package]] name = "memmap2" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744133e4a0e0a658e1374cf3bf8e415c4052a15a111acd372764c55b4177d490" +checksum = "714098028fe011992e1c3962653c96b2d578c4b4bce9036e15ff220319b1e0e3" dependencies = [ "libc", ] @@ -3025,7 +3035,7 @@ checksum = "c39e43767817fc963f90f400600967a2b2403602c6440685d09a6bc4e02b70b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -3056,7 +3066,7 @@ version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" dependencies = [ - "bitflags 2.10.0", + "bitflags 2.11.0", "inotify", "kqueue", "libc", @@ -3073,14 +3083,14 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42b8cfee0e339a0337359f3c88165702ac6e600dc01c0cc9579a92d62b08477a" dependencies = [ - "bitflags 2.10.0", + "bitflags 2.11.0", ] [[package]] name = "ntapi" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c70f219e21142367c70c0b30c6a9e3a14d55b4d12a204d897fbec83a0363f081" +checksum = "c3b335231dfd352ffb0f8017f3b6027a4917f7df785ea2143d8af2adc66980ae" dependencies = [ "winapi", ] @@ -3185,7 +3195,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -3194,7 +3204,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ - "bitflags 2.10.0", + "bitflags 2.11.0", ] [[package]] @@ -3371,7 +3381,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -3457,7 +3467,7 @@ dependencies = [ [[package]] name = "pepper-sync" version = "0.1.0" -source = "git+https://github.com/zingolabs/zingolib?branch=dev#f86717800f6faeb63dc488d340d5017c85e10f1e" +source = "git+https://github.com/zingolabs/zingolib?branch=dev#36f003258392c5145c48c8ce8f7a318c119da7d8" dependencies = [ "bip32", "byteorder", @@ -3549,7 +3559,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -3578,7 +3588,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -3659,15 +3669,6 @@ dependencies = [ "universal-hash", ] -[[package]] -name = "portpicker" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be97d76faf1bfab666e1375477b23fde79eccf0276e9b63b92a39d676a889ba9" -dependencies = [ - "rand 0.8.5", -] - [[package]] name = "postage" version = "0.5.0" @@ -3714,7 +3715,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -3776,7 +3777,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -3813,7 +3814,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.114", + "syn 2.0.117", "tempfile", ] @@ -3827,7 +3828,7 @@ dependencies = [ "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -4099,16 +4100,16 @@ version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.10.0", + "bitflags 2.11.0", ] [[package]] name = "redox_syscall" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f3fe0889e69e2ae9e41f4d6c4c0181701d00e4697b356fb1f74173a5e0ee27" +checksum = "35985aa610addc02e24fc232012c86fd11f14111180f902b67e2d5331f8ebf2b" dependencies = [ - "bitflags 2.10.0", + "bitflags 2.11.0", ] [[package]] @@ -4139,14 +4140,14 @@ checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] name = "regex" -version = "1.12.2" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" dependencies = [ "aho-corasick", "memchr", @@ -4156,9 +4157,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" dependencies = [ "aho-corasick", "memchr", @@ -4167,9 +4168,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" +checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" [[package]] name = "rend" @@ -4217,7 +4218,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 1.0.5", + "webpki-roots 1.0.6", ] [[package]] @@ -4324,7 +4325,7 @@ version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "165ca6e57b20e1351573e3729b958bc62f0e48025386970b6e4d29e7a7e71f3f" dependencies = [ - "bitflags 2.10.0", + "bitflags 2.11.0", "fallible-iterator", "fallible-streaming-iterator", "hashlink", @@ -4353,7 +4354,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.114", + "syn 2.0.117", "walkdir", ] @@ -4415,11 +4416,11 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.10.0", + "bitflags 2.11.0", "errno", "libc", "linux-raw-sys", @@ -4506,9 +4507,9 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" [[package]] name = "safelog" @@ -4693,11 +4694,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "3.5.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ - "bitflags 2.10.0", + "bitflags 2.11.0", "core-foundation", "core-foundation-sys", "libc", @@ -4706,9 +4707,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.15.0" +version = "2.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" dependencies = [ "core-foundation-sys", "libc", @@ -4772,7 +4773,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -4856,7 +4857,7 @@ dependencies = [ "darling 0.21.3", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -4926,11 +4927,11 @@ dependencies = [ [[package]] name = "shardtree" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "637e95dcd06bc1bb3f86ed9db1e1832a70125f32daae071ef37dcb7701b7d4fe" +checksum = "359e552886ae54d1642091645980d83f7db465fd9b5b0248e3680713c1773388" dependencies = [ - "bitflags 2.10.0", + "bitflags 2.11.0", "either", "incrementalmerkletree", "tracing", @@ -4938,9 +4939,9 @@ dependencies = [ [[package]] name = "shellexpand" -version = "3.1.1" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1fdf65dd6331831494dd616b30351c38e96e45921a27745cf98490458b90bb" +checksum = "32824fab5e16e6c4d86dc1ba84489390419a39f97699852b66480bb87d297ed8" dependencies = [ "bstr", "dirs", @@ -5153,7 +5154,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -5175,9 +5176,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.114" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -5201,7 +5202,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -5226,12 +5227,12 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.24.0" +version = "3.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" +checksum = "0136791f7c95b1f6dd99f9cc786b91bb81c3800b639b3478e561ddb7be95e5f1" dependencies = [ "fastrand", - "getrandom 0.3.4", + "getrandom 0.4.1", "once_cell", "rustix", "windows-sys 0.61.2", @@ -5263,7 +5264,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -5274,7 +5275,7 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -5388,7 +5389,7 @@ checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -5440,9 +5441,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.9.11+spec-1.1.0" +version = "0.9.12+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3afc9a848309fe1aaffaed6e1546a7a14de1f935dc9d89d32afd9a44bab7c46" +checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" dependencies = [ "indexmap 2.13.0", "serde_core", @@ -5499,9 +5500,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.0.6+spec-1.1.0" +version = "1.0.9+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" +checksum = "702d4415e08923e7e1ef96cd5727c0dfed80b4d2fa25db9647fe5eb6f7c5a4c4" dependencies = [ "winnow", ] @@ -5520,9 +5521,9 @@ checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" [[package]] name = "tonic" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a286e33f82f8a1ee2df63f4fa35c0becf4a85a0cb03091a15fd7bf0b402dc94a" +checksum = "fec7c61a0695dc1887c1b53952990f3ad2e3a31453e1f49f10e75424943a93ec" dependencies = [ "async-trait", "axum", @@ -5546,26 +5547,26 @@ dependencies = [ "tower-layer", "tower-service", "tracing", - "webpki-roots 1.0.5", + "webpki-roots 1.0.6", ] [[package]] name = "tonic-build" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27aac809edf60b741e2d7db6367214d078856b8a5bff0087e94ff330fb97b6fc" +checksum = "1882ac3bf5ef12877d7ed57aad87e75154c11931c2ba7e6cde5e22d63522c734" dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] name = "tonic-prost" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c55a2d6a14174563de34409c9f92ff981d006f56da9c6ecd40d9d4a31500b0" +checksum = "a55376a0bbaa4975a3f10d009ad763d8f4108f067c7c2e74f3001fb49778d309" dependencies = [ "bytes", "prost", @@ -5574,16 +5575,16 @@ dependencies = [ [[package]] name = "tonic-prost-build" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4556786613791cfef4ed134aa670b61a85cfcacf71543ef33e8d801abae988f" +checksum = "f3144df636917574672e93d0f56d7edec49f90305749c668df5101751bb8f95a" dependencies = [ "prettyplease", "proc-macro2", "prost-build", "prost-types", "quote", - "syn 2.0.114", + "syn 2.0.117", "tempfile", "tonic-build", ] @@ -5648,7 +5649,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79ba1b43f22fab2daee3e0c902f1455b3aed8e086b2d83d8c60b36523b173d25" dependencies = [ "amplify", - "bitflags 2.10.0", + "bitflags 2.11.0", "bytes", "caret", "derive-deftly", @@ -5809,7 +5810,7 @@ dependencies = [ "serde_ignored", "strum", "thiserror 2.0.18", - "toml 0.9.11+spec-1.1.0", + "toml 0.9.12+spec-1.1.0", "tor-basic-utils", "tor-error", "tor-rtcompat", @@ -6227,7 +6228,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "638b4e6507e3786488859d3c463fa73addbad4f788806c6972603727e527672e" dependencies = [ "async-trait", - "bitflags 2.10.0", + "bitflags 2.11.0", "derive_more", "futures", "humantime", @@ -6256,7 +6257,7 @@ checksum = "1dbc32d89e7ea2e2799168d0c453061647a727e39fc66f52e1bcb4c38c8dc433" dependencies = [ "amplify", "base64ct", - "bitflags 2.10.0", + "bitflags 2.11.0", "cipher", "derive-deftly", "derive_builder_fork_arti", @@ -6523,7 +6524,7 @@ version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ - "bitflags 2.10.0", + "bitflags 2.11.0", "bytes", "futures-util", "http", @@ -6566,7 +6567,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -6610,9 +6611,9 @@ dependencies = [ [[package]] name = "tracing-test" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "557b891436fe0d5e0e363427fc7f217abf9ccd510d5136549847bdcbcd011d68" +checksum = "19a4c448db514d4f24c5ddb9f73f2ee71bfb24c526cf0c570ba142d1119e0051" dependencies = [ "tracing-core", "tracing-subscriber", @@ -6621,12 +6622,12 @@ dependencies = [ [[package]] name = "tracing-test-macro" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" +checksum = "ad06847b7afb65c7866a36664b75c40b895e318cea4f71299f013fb22965329d" dependencies = [ "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -6637,7 +6638,7 @@ checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -6706,9 +6707,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.22" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "unicode-normalization" @@ -6788,9 +6789,9 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.20.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee48d38b119b0cd71fe4141b30f5ba9c7c5d9f4e7a3a8b4a674e4b6ef789976f" +checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb" dependencies = [ "js-sys", "wasm-bindgen", @@ -6822,7 +6823,7 @@ checksum = "d674d135b4a8c1d7e813e2f8d1c9a58308aee4a680323066025e53132218bd91" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -6865,6 +6866,15 @@ dependencies = [ "wit-bindgen", ] +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen", +] + [[package]] name = "wasix" version = "0.13.1" @@ -6876,9 +6886,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.108" +version = "0.2.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" +checksum = "ec1adf1535672f5b7824f817792b1afd731d7e843d2d04ec8f27e8cb51edd8ac" dependencies = [ "cfg-if", "once_cell", @@ -6889,9 +6899,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.58" +version = "0.4.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" +checksum = "fe88540d1c934c4ec8e6db0afa536876c5441289d7f9f9123d4f065ac1250a6b" dependencies = [ "cfg-if", "futures-util", @@ -6903,9 +6913,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.108" +version = "0.2.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" +checksum = "19e638317c08b21663aed4d2b9a2091450548954695ff4efa75bff5fa546b3b1" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6913,26 +6923,60 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.108" +version = "0.2.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" +checksum = "2c64760850114d03d5f65457e96fc988f11f01d38fbaa51b254e4ab5809102af" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.108" +version = "0.2.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" +checksum = "60eecd4fe26177cfa3339eb00b4a36445889ba3ad37080c2429879718e20ca41" dependencies = [ "unicode-ident", ] +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap 2.13.0", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags 2.11.0", + "hashbrown 0.15.5", + "indexmap 2.13.0", + "semver", +] + [[package]] name = "weak-table" version = "0.3.2" @@ -6941,9 +6985,9 @@ checksum = "323f4da9523e9a669e1eaf9c6e763892769b1d38c623913647bfdc1532fe4549" [[package]] name = "web-sys" -version = "0.3.85" +version = "0.3.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" +checksum = "9d6bb20ed2d9572df8584f6dc81d68a41a625cadc6f15999d649a70ce7e3597a" dependencies = [ "js-sys", "wasm-bindgen", @@ -6967,9 +7011,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12bed680863276c63889429bfd6cab3b99943659923822de1c8a39c49e4d722c" +checksum = "22cfaf3c063993ff62e73cb4311efde4db1efb31ab78a3e5c457939ad5cc0bed" dependencies = [ "rustls-pki-types", ] @@ -7083,7 +7127,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -7094,7 +7138,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -7340,6 +7384,88 @@ name = "wit-bindgen" version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap 2.13.0", + "prettyplease", + "syn 2.0.117", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn 2.0.117", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags 2.11.0", + "indexmap 2.13.0", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.13.0", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] [[package]] name = "writeable" @@ -7393,7 +7519,7 @@ checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", "synstructure", ] @@ -7464,7 +7590,7 @@ dependencies = [ "tower", "tracing", "trait-variant", - "webpki-roots 1.0.5", + "webpki-roots 1.0.6", "which", "zcash_address", "zcash_encoding", @@ -7628,7 +7754,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bed6cf5b2b4361105d4ea06b2752f0c8af4641756c7fbc9858a80af186c234f" dependencies = [ "bip32", - "bitflags 2.10.0", + "bitflags 2.11.0", "bounded-vec", "hex", "ripemd 0.1.3", @@ -7680,7 +7806,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a15c1b579eb4d25214fa15839a74f4b9599806bc8addb910cfbec50dd59fb97f" dependencies = [ "bech32", - "bitflags 2.10.0", + "bitflags 2.11.0", "bitflags-serde-legacy", "bitvec", "blake2b_simd", @@ -7735,22 +7861,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.37" +version = "0.8.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7456cf00f0685ad319c5b1693f291a650eaf345e941d082fc4e03df8a03996ac" +checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.37" +version = "0.8.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1328722bbf2115db7e19d69ebcc15e795719e2d66b60827c6a69a117365e37a0" +checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -7770,7 +7896,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", "synstructure", ] @@ -7791,7 +7917,7 @@ checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -7825,7 +7951,7 @@ checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -7863,7 +7989,7 @@ dependencies = [ [[package]] name = "zingo-price" version = "0.0.1" -source = "git+https://github.com/zingolabs/zingolib?branch=dev#f86717800f6faeb63dc488d340d5017c85e10f1e" +source = "git+https://github.com/zingolabs/zingolib?branch=dev#36f003258392c5145c48c8ce8f7a318c119da7d8" dependencies = [ "byteorder", "reqwest", @@ -7878,7 +8004,7 @@ dependencies = [ [[package]] name = "zingo-status" version = "0.1.0" -source = "git+https://github.com/zingolabs/zingolib?branch=dev#f86717800f6faeb63dc488d340d5017c85e10f1e" +source = "git+https://github.com/zingolabs/zingolib?branch=dev#36f003258392c5145c48c8ce8f7a318c119da7d8" dependencies = [ "byteorder", "zcash_primitives", @@ -7888,27 +8014,25 @@ dependencies = [ [[package]] name = "zingo_common_components" version = "0.2.0" -source = "git+https://github.com/zingolabs/zingo-common.git#096a79e2b3eb8b12d642e3380044bac00e7c855d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b842ab061189fd4277f8773af2134b4949b82db8623deb86c315cb97bdfdcb" dependencies = [ "zebra-chain", ] [[package]] -name = "zingo_test_vectors" -version = "0.0.1" -source = "git+https://github.com/zingolabs/infrastructure.git?branch=dev#15a160df0949713c64c5917c881211ac709628c4" -dependencies = [ - "bip0039 0.12.0", -] +name = "zingo_common_components" +version = "0.2.0" +source = "git+https://github.com/zingolabs/zingo-common.git#85a61dcedbccd01e26b6b07bad003770ad30ac1b" [[package]] name = "zingolib" version = "2.1.2" -source = "git+https://github.com/zingolabs/zingolib?branch=dev#f86717800f6faeb63dc488d340d5017c85e10f1e" +source = "git+https://github.com/zingolabs/zingolib?branch=dev#36f003258392c5145c48c8ce8f7a318c119da7d8" dependencies = [ "append-only-vec", "bech32", - "bip0039 0.13.4", + "bip0039", "bip32", "bs58", "byteorder", @@ -7928,7 +8052,6 @@ dependencies = [ "nonempty", "orchard", "pepper-sync", - "portpicker", "prost", "rand 0.8.5", "ring", @@ -7940,7 +8063,6 @@ dependencies = [ "serde", "serde_json", "shardtree", - "tempfile", "thiserror 2.0.18", "tokio", "tokio-rustls", @@ -7948,7 +8070,7 @@ dependencies = [ "tower", "tracing", "tracing-subscriber", - "webpki-roots 0.25.4", + "webpki-roots 1.0.6", "zcash_address", "zcash_client_backend", "zcash_encoding", @@ -7962,8 +8084,7 @@ dependencies = [ "zingo-netutils", "zingo-price", "zingo-status", - "zingo_common_components", - "zingo_test_vectors", + "zingo_common_components 0.2.0 (git+https://github.com/zingolabs/zingo-common.git)", "zip32", ] @@ -7971,7 +8092,7 @@ dependencies = [ name = "zingolib-native" version = "0.1.0" dependencies = [ - "bip0039 0.13.4", + "bip0039", "hex", "http", "json", @@ -7994,7 +8115,7 @@ dependencies = [ "zcash_protocol", "zcash_transparent", "zebra-chain", - "zingo_common_components", + "zingo_common_components 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "zingolib", "zip32", ] @@ -8027,9 +8148,9 @@ dependencies = [ [[package]] name = "zmij" -version = "1.0.19" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff05f8caa9038894637571ae6b9e29466c1f4f829d26c9b28f869a29cbe3445" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" [[package]] name = "zstd" diff --git a/native/Cargo.toml b/native/Cargo.toml index 934acc70..7df2e7d4 100644 --- a/native/Cargo.toml +++ b/native/Cargo.toml @@ -12,9 +12,7 @@ crate-type = ["cdylib"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -zingolib = { git="https://github.com/zingolabs/zingolib", default-features = true, branch = "dev", features = [ - "testutils" -] } +zingolib = { git="https://github.com/zingolabs/zingolib", default-features = true, branch = "dev" } pepper-sync = { git = "https://github.com/zingolabs/zingolib", branch = "dev" } zcash_address = { version = "0.10" } @@ -39,7 +37,7 @@ zebra-chain = "5.0.0" rusqlite = { version = "0.37.0", features = ["bundled"] } -zingo_common_components = { git = "https://github.com/zingolabs/zingo-common.git", version = "0.2" } +zingo_common_components = { version = "0.2", features = ["for_test"] } bip0039 = { version = "0.13", features = [ "rand" ] } zip32 = "0.2.0" diff --git a/native/src/lib.rs b/native/src/lib.rs index c3822fd0..c64a410e 100644 --- a/native/src/lib.rs +++ b/native/src/lib.rs @@ -58,6 +58,7 @@ fn main(mut cx: ModuleContext) -> NeonResult<()> { cx.export_function("init_from_ufvk", init_from_ufvk)?; cx.export_function("init_from_b64", init_from_b64)?; cx.export_function("save_wallet_file", save_wallet_file)?; + cx.export_function("check_save_error", check_save_error)?; cx.export_function("get_developer_donation_address", get_developer_donation_address)?; cx.export_function("get_zennies_for_zingo_donation_address", get_zennies_for_zingo_donation_address)?; cx.export_function("set_crypto_default_provider_to_ring", set_crypto_default_provider_to_ring)?; @@ -505,13 +506,15 @@ fn init_from_b64(mut cx: FunctionContext) -> JsResult { Ok(c) => c, Err(e) => return Ok(format!("Error: {e}")), }; - let lightclient = match LightClient::create_from_wallet_path(config) { + let mut lightclient = match LightClient::create_from_wallet_path(config) { Ok(l) => l, Err(e) => return Ok(format!("Error: {e}")), }; let has_seed = RT.block_on(async { lightclient.wallet.read().await.mnemonic().is_some() }); + // save the wallet file here + RT.block_on(async { lightclient.save_task().await }); let _ = store_client(lightclient); Ok(if has_seed { get_seed_string() } else { get_ufvk_string() }) @@ -605,6 +608,33 @@ fn save_wallet_file(mut cx: FunctionContext) -> JsResult { Ok(promise) } +fn check_save_error(mut cx: FunctionContext) -> JsResult { + let promise = cx + .task(move || -> Result { + with_panic_guard(|| { + let mut guard = LIGHTCLIENT.write().map_err(|_| ZingolibError::LightclientLockPoisoned)?; + if let Some(lightclient) = &mut *guard { + Ok(RT.block_on(async move { + match lightclient.check_save_error().await { + Ok(()) => String::new(), + Err(e) => { + format!("Error: save failed. {e}\nRestarting save task...") + } + } + })) + } else { + Err(ZingolibError::LightclientNotInitialized) + } + }) + }) + .promise(move |mut cx, result| match result { + Ok(msg) => Ok(cx.string(msg)), + Err(err) => cx.throw_error(err.to_string()), + }); + + Ok(promise) +} + fn get_developer_donation_address(mut cx: FunctionContext) -> JsResult { let res: Result = with_panic_guard(|| { let resp = zingolib::config::DEVELOPER_DONATION_ADDRESS.to_string(); diff --git a/src/native.node.d.ts b/src/native.node.d.ts index 2a02a859..26f9ed34 100644 --- a/src/native.node.d.ts +++ b/src/native.node.d.ts @@ -41,6 +41,7 @@ export function init_from_b64( wallet_name: string ): string; export function save_wallet_file(): Promise; +export function check_save_error(): Promise; export function get_developer_donation_address(): string; export function get_zennies_for_zingo_donation_address(): string; export function set_crypto_default_provider_to_ring(): string; diff --git a/src/rpc/rpc.ts b/src/rpc/rpc.ts index 1566c380..7912e957 100644 --- a/src/rpc/rpc.ts +++ b/src/rpc/rpc.ts @@ -186,11 +186,14 @@ export default class RPC { static async doSave() { try { - const syncstr: string = await native.save_wallet_file(); - console.log(`wallet saved: ${syncstr}`); + // no need to check this status anymore + //const saveRequiredStr: string = await native.get_wallet_save_required(); + //console.log(`Save required? ${saveRequiredStr}`); + const syncstr: string = await native.check_save_error(); + console.log(`wallet check saved: ${syncstr}`); return syncstr; }catch (error: any) { - console.log(`Critical Error save wallet ${error}`); + console.log(`Critical Error check save wallet ${error}`); return error; } }