From 6020ef307592cad758ef22fd936844edb33ebfe8 Mon Sep 17 00:00:00 2001 From: ngutech21 Date: Wed, 10 Apr 2024 15:53:28 +0200 Subject: [PATCH] chore: update dependencies --- Cargo.lock | 125 ++++++++++++++++------------ moksha-core/Cargo.toml | 4 +- moksha-mint/Cargo.toml | 3 +- moksha-mint/src/lightning/lnd.rs | 3 +- moksha-mint/src/lightning/strike.rs | 7 +- moksha-wallet/Cargo.toml | 16 ++-- 6 files changed, 87 insertions(+), 71 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3df643a8..58e74b41 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -372,17 +372,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "bitcoin" -version = "0.29.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0694ea59225b0c5f3cb405ff3f670e4828358ed26aec49dc352f730f0cb1a8a3" -dependencies = [ - "bech32 0.9.1", - "bitcoin_hashes 0.11.0", - "secp256k1 0.24.3", -] - [[package]] name = "bitcoin" version = "0.30.2" @@ -406,7 +395,7 @@ dependencies = [ "bech32 0.10.0-beta", "bitcoin-internals", "bitcoin_hashes 0.13.0", - "hex-conservative", + "hex-conservative 0.1.1", "hex_lit", "secp256k1 0.28.2", "serde", @@ -421,6 +410,12 @@ dependencies = [ "serde", ] +[[package]] +name = "bitcoin-io" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "340e09e8399c7bd8912f495af6aa58bea0c9214773417ffaa8f6460f93aaee56" + [[package]] name = "bitcoin-private" version = "0.1.0" @@ -450,10 +445,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" dependencies = [ "bitcoin-internals", - "hex-conservative", + "hex-conservative 0.1.1", "serde", ] +[[package]] +name = "bitcoin_hashes" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" +dependencies = [ + "bitcoin-io", + "hex-conservative 0.2.0", +] + [[package]] name = "bitcoincore-rpc" version = "0.18.0" @@ -974,9 +979,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -1381,6 +1386,15 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" +[[package]] +name = "hex-conservative" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1aa273bf451e37ed35ced41c71a5e2a4e29064afb104158f2514bcd71c2c986" +dependencies = [ + "arrayvec", +] + [[package]] name = "hex_lit" version = "0.1.1" @@ -1822,46 +1836,46 @@ dependencies = [ [[package]] name = "lightning" -version = "0.0.118" +version = "0.0.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cec5fa9382154fe9671e8df93095b800c7d77abc66e2a5ef839d672521c5e" +checksum = "5b0c1f811ae288f86c6767055c55b5f7a721ca1e61bf1897a9ae2ec663e8aba1" dependencies = [ - "bitcoin 0.29.2", + "bitcoin 0.30.2", + "hex-conservative 0.1.1", ] [[package]] name = "lightning" -version = "0.0.121" +version = "0.0.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0c1f811ae288f86c6767055c55b5f7a721ca1e61bf1897a9ae2ec663e8aba1" +checksum = "0d9b36ae12b379905bfc429ce5d4e8ca4a55c8dd3de73074309bd0bcc053bcac" dependencies = [ "bitcoin 0.30.2", - "hex-conservative", + "hex-conservative 0.1.1", ] [[package]] name = "lightning-invoice" -version = "0.26.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb24878b0f4ef75f020976c886d9ad1503867802329cc963e0ab4623ea3b25c" +checksum = "5b186aca4a605d4db3b85979922be287b9ebd5dedd8132963bb9dbeb8f7d2a04" dependencies = [ "bech32 0.9.1", - "bitcoin 0.29.2", - "bitcoin_hashes 0.11.0", - "lightning 0.0.118", + "bitcoin 0.30.2", + "lightning 0.0.121", "num-traits", - "secp256k1 0.24.3", + "secp256k1 0.27.0", ] [[package]] name = "lightning-invoice" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b186aca4a605d4db3b85979922be287b9ebd5dedd8132963bb9dbeb8f7d2a04" +checksum = "106fdb897e69df697480f45bf0a564b425af488fb0f7407e770a770c39b19a21" dependencies = [ "bech32 0.9.1", "bitcoin 0.30.2", - "lightning 0.0.121", + "lightning 0.0.122", "num-traits", "secp256k1 0.27.0", ] @@ -2011,12 +2025,12 @@ version = "0.2.1" dependencies = [ "anyhow", "base64 0.22.0", - "bitcoin_hashes 0.13.0", + "bitcoin_hashes 0.14.0", "getrandom", "hex", "itertools 0.12.1", "pretty_assertions", - "secp256k1 0.28.2", + "secp256k1 0.29.0", "serde", "serde_json", "serde_with 3.7.0", @@ -2041,7 +2055,7 @@ dependencies = [ "hex", "http-body-util", "hyper 1.2.0", - "lightning-invoice 0.26.0", + "lightning-invoice 0.30.0", "mockall", "moksha-core", "opentelemetry", @@ -2081,13 +2095,13 @@ dependencies = [ "dirs", "gloo-net", "hex", - "lightning-invoice 0.29.0", + "lightning-invoice 0.30.0", "mockall", "moksha-core", "rand", "reqwest 0.12.3", "rexie", - "secp256k1 0.28.2", + "secp256k1 0.29.0", "serde", "serde-wasm-bindgen", "serde_json", @@ -2684,9 +2698,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -3134,16 +3148,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "secp256k1" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" -dependencies = [ - "bitcoin_hashes 0.11.0", - "secp256k1-sys 0.6.1", -] - [[package]] name = "secp256k1" version = "0.27.0" @@ -3169,12 +3173,14 @@ dependencies = [ ] [[package]] -name = "secp256k1-sys" -version = "0.6.1" +name = "secp256k1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +checksum = "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3" dependencies = [ - "cc", + "rand", + "secp256k1-sys 0.10.0", + "serde", ] [[package]] @@ -3195,6 +3201,15 @@ dependencies = [ "cc", ] +[[package]] +name = "secp256k1-sys" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1433bd67156263443f14d603720b082dd3121779323fce20cba2aa07b874bc1b" +dependencies = [ + "cc", +] + [[package]] name = "serde" version = "1.0.197" @@ -3789,9 +3804,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "ef89ece63debf11bc32d1ed8d078ac870cbeb44da02afb02a9ff135ae7ca0582" dependencies = [ "deranged", "itoa", @@ -3810,9 +3825,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", diff --git a/moksha-core/Cargo.toml b/moksha-core/Cargo.toml index dcd5eaca..cfe95073 100644 --- a/moksha-core/Cargo.toml +++ b/moksha-core/Cargo.toml @@ -14,8 +14,8 @@ path = "src/lib.rs" anyhow = { workspace = true } url = { workspace = true } base64 = { workspace = true } -bitcoin_hashes = "0.13.0" -secp256k1 = { version = "0.28.2", features = ["rand", "serde"] } +bitcoin_hashes = "0.14.0" +secp256k1 = { version = "0.29.0", features = ["rand", "serde"] } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } hex = { workspace = true } diff --git a/moksha-mint/Cargo.toml b/moksha-mint/Cargo.toml index 3368d7b0..23198d43 100644 --- a/moksha-mint/Cargo.toml +++ b/moksha-mint/Cargo.toml @@ -27,11 +27,10 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } tokio = { workspace = true, features = ["full"] } tower-http = { workspace = true, features = ["cors", "fs", "set-header"] } - secp256k1 = { version = "0.28.2", default-features = false, features = ["rand", "serde"] } thiserror = { workspace = true } moksha-core = { path = "../moksha-core", version = "0.2.1" } -lightning-invoice = "0.26.0" +lightning-invoice = "0.30.0" reqwest = { workspace = true, features = ["json", "rustls-tls", "socks"] } url = { workspace = true } dotenvy = { workspace = true } diff --git a/moksha-mint/src/lightning/lnd.rs b/moksha-mint/src/lightning/lnd.rs index 781c0ae8..7b3ebdb9 100644 --- a/moksha-mint/src/lightning/lnd.rs +++ b/moksha-mint/src/lightning/lnd.rs @@ -92,7 +92,8 @@ impl Lightning for LndLightning { #[instrument(skip(self), err)] async fn is_invoice_paid(&self, payment_request: String) -> Result { let invoice = self.decode_invoice(payment_request).await?; - let payment_hash = invoice.payment_hash(); + let payment_hash: &[u8] = invoice.payment_hash().as_ref(); + let invoice_request = fedimint_tonic_lnd::lnrpc::PaymentHash { r_hash: payment_hash.to_vec(), ..Default::default() diff --git a/moksha-mint/src/lightning/strike.rs b/moksha-mint/src/lightning/strike.rs index aae06f92..6b986266 100644 --- a/moksha-mint/src/lightning/strike.rs +++ b/moksha-mint/src/lightning/strike.rs @@ -82,10 +82,10 @@ impl Lightning for StrikeLightning { let invoice = LNInvoice::from_signed(payment_request.parse::().unwrap()) .unwrap(); - let payment_hash = invoice.payment_hash().to_vec(); + let payment_hash: &[u8] = invoice.payment_hash().as_ref(); Ok(CreateInvoiceResult { - payment_hash, + payment_hash: payment_hash.to_vec(), payment_request, }) } @@ -96,7 +96,8 @@ impl Lightning for StrikeLightning { ) -> Result { // strike doesn't return the payment_hash so we have to read the invoice into a Bolt11 and extract it let invoice = self.decode_invoice(payment_request.clone()).await?; - let payment_hash = invoice.payment_hash().to_vec(); + let invoice2 = invoice.clone(); + let payment_hash: &[u8] = invoice2.payment_hash().as_ref(); let payment_quote_id = self .client diff --git a/moksha-wallet/Cargo.toml b/moksha-wallet/Cargo.toml index 808cfbba..b7b8c947 100644 --- a/moksha-wallet/Cargo.toml +++ b/moksha-wallet/Cargo.toml @@ -15,13 +15,13 @@ path = "src/lib.rs" [dependencies] anyhow = { workspace = true, features = ["backtrace"] } -secp256k1 = { version = "0.28.2", default-features = false, features = ["serde"] } +secp256k1 = { version = "0.29.0", default-features = false, features = ["serde"] } moksha-core = { version = "0.2.1", path = "../moksha-core" } serde_json = { workspace = true } serde = { workspace = true } thiserror = { workspace = true } async-trait = { workspace = true } -lightning-invoice = "0.29.0" +lightning-invoice = "0.30.0" url = { workspace = true } dirs = { workspace = true } bip32 = { workspace = true, features = ["secp256k1", "std"] } @@ -31,15 +31,15 @@ rand = { workspace = true } [target.'cfg(target_family = "wasm")'.dependencies] gloo-net = { version = "0.5.0" } -serde-wasm-bindgen = "0.6.3" -wasm-bindgen = "0.2.90" +serde-wasm-bindgen = "0.6.5" +wasm-bindgen = "0.2.92" rexie = "0.5.0" -tokio = { version = "1.37.0", features = ["rt", "sync"] } +tokio = { workspace = true, features = ["rt", "sync"] } [target.'cfg(not(target_family="wasm"))'.dependencies] -reqwest = { version = "0.12.3", features = ["json", "rustls-tls"], default-features = false } -tokio = { version = "1.37.0", features = ["rt", "rt-multi-thread", "macros"] } -sqlx = { version = "0.7.4", default-features = false, features = ["sqlite", "runtime-tokio", "tls-rustls", "migrate", "macros", "json"] } +reqwest = { workspace = true, features = ["json", "rustls-tls"], default-features = false } +tokio = { workspace = true, features = ["rt", "rt-multi-thread", "macros"] } +sqlx = { workspace = true, default-features = false, features = ["sqlite", "runtime-tokio", "tls-rustls", "migrate", "macros", "json"] } [dev-dependencies] tempfile = { workspace = true }