upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-07-22 15:26:44 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2024-07-22 15:26:44 +0100
commit0762d44a9ec3d8a5477e171933428cd9749e0659 (patch)
treecc79eaf07fff399bd5083aebf67fff09cc718952
parent8656948d488b205ee1b25ffe4c85e51ad09df345 (diff)
chore: bump rust-nostr to v0.33.0
bump all rust-nostr packages move from using patched nip46 nip05 function to profile function in v33 fix send_events_to error message
-rw-r--r--Cargo.lock40
-rw-r--r--Cargo.toml10
-rw-r--r--src/client.rs9
-rw-r--r--src/login.rs12
-rw-r--r--src/sub_commands/send.rs2
-rw-r--r--test_utils/Cargo.toml4
6 files changed, 46 insertions, 31 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 474adbb..9d5604b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1821,8 +1821,9 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be"
1821 1821
1822[[package]] 1822[[package]]
1823name = "nostr" 1823name = "nostr"
1824version = "0.32.1" 1824version = "0.33.0"
1825source = "git+https://github.com/DanConwayDev/nostr?branch=v0.32-get-nip46-from-nip05-address#429f3c1396f05bf08793f60ed1d92d7bc02ea438" 1825source = "registry+https://github.com/rust-lang/crates.io-index"
1826checksum = "f08db214560a34bf7c4c1fea09a8461b9412bae58ba06e99ce3177d89fa1e0a6"
1826dependencies = [ 1827dependencies = [
1827 "aes 0.8.4", 1828 "aes 0.8.4",
1828 "base64 0.21.7", 1829 "base64 0.21.7",
@@ -1850,8 +1851,9 @@ dependencies = [
1850 1851
1851[[package]] 1852[[package]]
1852name = "nostr-database" 1853name = "nostr-database"
1853version = "0.32.0" 1854version = "0.33.0"
1854source = "git+https://github.com/DanConwayDev/nostr?branch=v0.32-get-nip46-from-nip05-address#429f3c1396f05bf08793f60ed1d92d7bc02ea438" 1855source = "registry+https://github.com/rust-lang/crates.io-index"
1856checksum = "f9f6c72d0d0842de637f7fba6e70764f719257d29dad8fc5f7352810b0f117ad"
1855dependencies = [ 1857dependencies = [
1856 "async-trait", 1858 "async-trait",
1857 "flatbuffers", 1859 "flatbuffers",
@@ -1864,8 +1866,9 @@ dependencies = [
1864 1866
1865[[package]] 1867[[package]]
1866name = "nostr-relay-pool" 1868name = "nostr-relay-pool"
1867version = "0.32.0" 1869version = "0.33.0"
1868source = "git+https://github.com/DanConwayDev/nostr?branch=v0.32-get-nip46-from-nip05-address#429f3c1396f05bf08793f60ed1d92d7bc02ea438" 1870source = "registry+https://github.com/rust-lang/crates.io-index"
1871checksum = "afa5502a3df456790ca16d90cc688a677117d57ab56b079dcfa091390ac9f202"
1869dependencies = [ 1872dependencies = [
1870 "async-utility", 1873 "async-utility",
1871 "async-wsocket", 1874 "async-wsocket",
@@ -1879,8 +1882,9 @@ dependencies = [
1879 1882
1880[[package]] 1883[[package]]
1881name = "nostr-sdk" 1884name = "nostr-sdk"
1882version = "0.32.0" 1885version = "0.33.0"
1883source = "git+https://github.com/DanConwayDev/nostr?branch=v0.32-get-nip46-from-nip05-address#429f3c1396f05bf08793f60ed1d92d7bc02ea438" 1886source = "registry+https://github.com/rust-lang/crates.io-index"
1887checksum = "b427dceefbbb49a9dd98abb8c4e40d25fdd467e99821aaad88615252bdb915bd"
1884dependencies = [ 1888dependencies = [
1885 "async-utility", 1889 "async-utility",
1886 "atomic-destructor", 1890 "atomic-destructor",
@@ -1898,8 +1902,9 @@ dependencies = [
1898 1902
1899[[package]] 1903[[package]]
1900name = "nostr-signer" 1904name = "nostr-signer"
1901version = "0.32.0" 1905version = "0.33.0"
1902source = "git+https://github.com/DanConwayDev/nostr?branch=v0.32-get-nip46-from-nip05-address#429f3c1396f05bf08793f60ed1d92d7bc02ea438" 1906source = "registry+https://github.com/rust-lang/crates.io-index"
1907checksum = "665268b316f41cd8fa791be54b6c7935c5a239461708c380a699d6677be9af38"
1903dependencies = [ 1908dependencies = [
1904 "async-utility", 1909 "async-utility",
1905 "nostr", 1910 "nostr",
@@ -1911,8 +1916,9 @@ dependencies = [
1911 1916
1912[[package]] 1917[[package]]
1913name = "nostr-sqlite" 1918name = "nostr-sqlite"
1914version = "0.32.0" 1919version = "0.33.0"
1915source = "git+https://github.com/DanConwayDev/nostr?branch=v0.32-get-nip46-from-nip05-address#429f3c1396f05bf08793f60ed1d92d7bc02ea438" 1920source = "registry+https://github.com/rust-lang/crates.io-index"
1921checksum = "31f643ba919864f3a9bb004244c0d5c958646b07fe760823fdc33aae1c8fc0fc"
1916dependencies = [ 1922dependencies = [
1917 "async-trait", 1923 "async-trait",
1918 "nostr", 1924 "nostr",
@@ -1925,8 +1931,9 @@ dependencies = [
1925 1931
1926[[package]] 1932[[package]]
1927name = "nostr-zapper" 1933name = "nostr-zapper"
1928version = "0.32.0" 1934version = "0.33.0"
1929source = "git+https://github.com/DanConwayDev/nostr?branch=v0.32-get-nip46-from-nip05-address#429f3c1396f05bf08793f60ed1d92d7bc02ea438" 1935source = "registry+https://github.com/rust-lang/crates.io-index"
1936checksum = "69922e74f8eab1f9d287008c0c06acdec87277a2d8f44bd9d38e003422aea0ab"
1930dependencies = [ 1937dependencies = [
1931 "async-trait", 1938 "async-trait",
1932 "nostr", 1939 "nostr",
@@ -2026,8 +2033,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
2026 2033
2027[[package]] 2034[[package]]
2028name = "nwc" 2035name = "nwc"
2029version = "0.32.0" 2036version = "0.33.0"
2030source = "git+https://github.com/DanConwayDev/nostr?branch=v0.32-get-nip46-from-nip05-address#429f3c1396f05bf08793f60ed1d92d7bc02ea438" 2037source = "registry+https://github.com/rust-lang/crates.io-index"
2038checksum = "bb2e04b3edb5e9572e95b62842430625f1718e8a4a3596a30aeb04e6734764ea"
2031dependencies = [ 2039dependencies = [
2032 "async-utility", 2040 "async-utility",
2033 "nostr", 2041 "nostr",
diff --git a/Cargo.toml b/Cargo.toml
index 6248f6b..464abc8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,11 +23,11 @@ futures = "0.3.28"
23git2 = "0.18.1" 23git2 = "0.18.1"
24indicatif = "0.17.7" 24indicatif = "0.17.7"
25keyring = "2.0.5" 25keyring = "2.0.5"
26nostr = { git = "https://github.com/DanConwayDev/nostr", branch= "v0.32-get-nip46-from-nip05-address" } 26nostr = "0.33.0"
27nostr-database = { git = "https://github.com/DanConwayDev/nostr", branch= "v0.32-get-nip46-from-nip05-address" } 27nostr-database = "0.33.0"
28nostr-sdk = { git = "https://github.com/DanConwayDev/nostr", branch= "v0.32-get-nip46-from-nip05-address" } 28nostr-sdk = "0.33.0"
29nostr-signer = { git = "https://github.com/DanConwayDev/nostr", branch= "v0.32-get-nip46-from-nip05-address" } 29nostr-signer = "0.33.0"
30nostr-sqlite = { git = "https://github.com/DanConwayDev/nostr", branch= "v0.32-get-nip46-from-nip05-address" } 30nostr-sqlite = "0.33.0"
31passwords = "3.1.13" 31passwords = "3.1.13"
32scrypt = "0.11.0" 32scrypt = "0.11.0"
33serde = { version = "1.0.181", features = ["derive"] } 33serde = { version = "1.0.181", features = ["derive"] }
diff --git a/src/client.rs b/src/client.rs
index 880cb6b..29d390f 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -204,11 +204,18 @@ impl Connect for Client {
204 #[allow(clippy::large_futures)] 204 #[allow(clippy::large_futures)]
205 self.client.connect_relay(url).await?; 205 self.client.connect_relay(url).await?;
206 let res = self.client.send_event_to(vec![url], event.clone()).await?; 206 let res = self.client.send_event_to(vec![url], event.clone()).await?;
207 if let Some(err) = res.failed.get(&Url::parse(url)?) {
208 bail!(if let Some(err) = err {
209 err.to_string()
210 } else {
211 "error: unknown".to_string()
212 });
213 }
207 save_event_in_cache(git_repo_path, &event).await?; 214 save_event_in_cache(git_repo_path, &event).await?;
208 if event.kind().eq(&Kind::Custom(REPO_REF_KIND)) { 215 if event.kind().eq(&Kind::Custom(REPO_REF_KIND)) {
209 save_event_in_global_cache(git_repo_path, &event).await?; 216 save_event_in_global_cache(git_repo_path, &event).await?;
210 } 217 }
211 Ok(res) 218 Ok(event.id())
212 } 219 }
213 220
214 async fn get_events( 221 async fn get_events(
diff --git a/src/login.rs b/src/login.rs
index 9c7ca78..be358de 100644
--- a/src/login.rs
+++ b/src/login.rs
@@ -2,7 +2,7 @@ use std::{collections::HashSet, path::Path, str::FromStr, time::Duration};
2 2
3use anyhow::{bail, Context, Result}; 3use anyhow::{bail, Context, Result};
4use nostr::{ 4use nostr::{
5 nips::{nip05::get_nip46, nip46::NostrConnectURI}, 5 nips::{nip05, nip46::NostrConnectURI},
6 PublicKey, 6 PublicKey,
7}; 7};
8use nostr_sdk::{ 8use nostr_sdk::{
@@ -404,17 +404,17 @@ async fn fresh_login(
404pub async fn fetch_nip46_uri_from_nip05(nip05: &str) -> Result<NostrConnectURI> { 404pub async fn fetch_nip46_uri_from_nip05(nip05: &str) -> Result<NostrConnectURI> {
405 let term = console::Term::stderr(); 405 let term = console::Term::stderr();
406 term.write_line("contacting login service provider...")?; 406 term.write_line("contacting login service provider...")?;
407 let res = get_nip46(&nip05, None).await; 407 let res = nip05::profile(&nip05, None).await;
408 term.clear_last_lines(1)?; 408 term.clear_last_lines(1)?;
409 match res { 409 match res {
410 Ok((signer_public_key, relays)) => { 410 Ok(profile) => {
411 if relays.is_empty() { 411 if profile.nip46.is_empty() {
412 println!("nip05 provider isn't configured for remote login"); 412 println!("nip05 provider isn't configured for remote login");
413 bail!("nip05 provider isn't configured for remote login") 413 bail!("nip05 provider isn't configured for remote login")
414 } 414 }
415 Ok(NostrConnectURI::Bunker { 415 Ok(NostrConnectURI::Bunker {
416 signer_public_key, 416 signer_public_key: profile.public_key,
417 relays, 417 relays: profile.nip46,
418 secret: None, 418 secret: None,
419 }) 419 })
420 } 420 }
diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs
index 95d3eb0..33ce104 100644
--- a/src/sub_commands/send.rs
+++ b/src/sub_commands/send.rs
@@ -405,7 +405,7 @@ pub async fn send_events(
405 console::style( 405 console::style(
406 e.to_string() 406 e.to_string()
407 .replace("relay pool error:", "error:") 407 .replace("relay pool error:", "error:")
408 .replace("event not published: ", ""), 408 .replace("event not published: ", "error: "),
409 ) 409 )
410 .for_stderr() 410 .for_stderr()
411 .red() 411 .red()
diff --git a/test_utils/Cargo.toml b/test_utils/Cargo.toml
index 92f4dfd..b7010c9 100644
--- a/test_utils/Cargo.toml
+++ b/test_utils/Cargo.toml
@@ -9,8 +9,8 @@ assert_cmd = "2.0.12"
9dialoguer = "0.10.4" 9dialoguer = "0.10.4"
10directories = "5.0.1" 10directories = "5.0.1"
11git2 = "0.18.1" 11git2 = "0.18.1"
12nostr = { git = "https://github.com/DanConwayDev/nostr", branch= "v0.32-get-nip46-from-nip05-address" } 12nostr = "0.33.0"
13nostr-sdk = { git = "https://github.com/DanConwayDev/nostr", branch= "v0.32-get-nip46-from-nip05-address" } 13nostr-sdk = "0.33.0"
14once_cell = "1.18.0" 14once_cell = "1.18.0"
15rand = "0.8" 15rand = "0.8"
16rexpect = { git = "https://github.com/rust-cli/rexpect.git", rev = "9eb61dd" } 16rexpect = { git = "https://github.com/rust-cli/rexpect.git", rev = "9eb61dd" }