diff options
| -rw-r--r-- | Cargo.lock | 40 | ||||
| -rw-r--r-- | Cargo.toml | 10 | ||||
| -rw-r--r-- | src/client.rs | 9 | ||||
| -rw-r--r-- | src/login.rs | 12 | ||||
| -rw-r--r-- | src/sub_commands/send.rs | 2 | ||||
| -rw-r--r-- | test_utils/Cargo.toml | 4 |
6 files changed, 46 insertions, 31 deletions
| @@ -1821,8 +1821,9 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" | |||
| 1821 | 1821 | ||
| 1822 | [[package]] | 1822 | [[package]] |
| 1823 | name = "nostr" | 1823 | name = "nostr" |
| 1824 | version = "0.32.1" | 1824 | version = "0.33.0" |
| 1825 | source = "git+https://github.com/DanConwayDev/nostr?branch=v0.32-get-nip46-from-nip05-address#429f3c1396f05bf08793f60ed1d92d7bc02ea438" | 1825 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1826 | checksum = "f08db214560a34bf7c4c1fea09a8461b9412bae58ba06e99ce3177d89fa1e0a6" | ||
| 1826 | dependencies = [ | 1827 | dependencies = [ |
| 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]] |
| 1852 | name = "nostr-database" | 1853 | name = "nostr-database" |
| 1853 | version = "0.32.0" | 1854 | version = "0.33.0" |
| 1854 | source = "git+https://github.com/DanConwayDev/nostr?branch=v0.32-get-nip46-from-nip05-address#429f3c1396f05bf08793f60ed1d92d7bc02ea438" | 1855 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1856 | checksum = "f9f6c72d0d0842de637f7fba6e70764f719257d29dad8fc5f7352810b0f117ad" | ||
| 1855 | dependencies = [ | 1857 | dependencies = [ |
| 1856 | "async-trait", | 1858 | "async-trait", |
| 1857 | "flatbuffers", | 1859 | "flatbuffers", |
| @@ -1864,8 +1866,9 @@ dependencies = [ | |||
| 1864 | 1866 | ||
| 1865 | [[package]] | 1867 | [[package]] |
| 1866 | name = "nostr-relay-pool" | 1868 | name = "nostr-relay-pool" |
| 1867 | version = "0.32.0" | 1869 | version = "0.33.0" |
| 1868 | source = "git+https://github.com/DanConwayDev/nostr?branch=v0.32-get-nip46-from-nip05-address#429f3c1396f05bf08793f60ed1d92d7bc02ea438" | 1870 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1871 | checksum = "afa5502a3df456790ca16d90cc688a677117d57ab56b079dcfa091390ac9f202" | ||
| 1869 | dependencies = [ | 1872 | dependencies = [ |
| 1870 | "async-utility", | 1873 | "async-utility", |
| 1871 | "async-wsocket", | 1874 | "async-wsocket", |
| @@ -1879,8 +1882,9 @@ dependencies = [ | |||
| 1879 | 1882 | ||
| 1880 | [[package]] | 1883 | [[package]] |
| 1881 | name = "nostr-sdk" | 1884 | name = "nostr-sdk" |
| 1882 | version = "0.32.0" | 1885 | version = "0.33.0" |
| 1883 | source = "git+https://github.com/DanConwayDev/nostr?branch=v0.32-get-nip46-from-nip05-address#429f3c1396f05bf08793f60ed1d92d7bc02ea438" | 1886 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1887 | checksum = "b427dceefbbb49a9dd98abb8c4e40d25fdd467e99821aaad88615252bdb915bd" | ||
| 1884 | dependencies = [ | 1888 | dependencies = [ |
| 1885 | "async-utility", | 1889 | "async-utility", |
| 1886 | "atomic-destructor", | 1890 | "atomic-destructor", |
| @@ -1898,8 +1902,9 @@ dependencies = [ | |||
| 1898 | 1902 | ||
| 1899 | [[package]] | 1903 | [[package]] |
| 1900 | name = "nostr-signer" | 1904 | name = "nostr-signer" |
| 1901 | version = "0.32.0" | 1905 | version = "0.33.0" |
| 1902 | source = "git+https://github.com/DanConwayDev/nostr?branch=v0.32-get-nip46-from-nip05-address#429f3c1396f05bf08793f60ed1d92d7bc02ea438" | 1906 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1907 | checksum = "665268b316f41cd8fa791be54b6c7935c5a239461708c380a699d6677be9af38" | ||
| 1903 | dependencies = [ | 1908 | dependencies = [ |
| 1904 | "async-utility", | 1909 | "async-utility", |
| 1905 | "nostr", | 1910 | "nostr", |
| @@ -1911,8 +1916,9 @@ dependencies = [ | |||
| 1911 | 1916 | ||
| 1912 | [[package]] | 1917 | [[package]] |
| 1913 | name = "nostr-sqlite" | 1918 | name = "nostr-sqlite" |
| 1914 | version = "0.32.0" | 1919 | version = "0.33.0" |
| 1915 | source = "git+https://github.com/DanConwayDev/nostr?branch=v0.32-get-nip46-from-nip05-address#429f3c1396f05bf08793f60ed1d92d7bc02ea438" | 1920 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1921 | checksum = "31f643ba919864f3a9bb004244c0d5c958646b07fe760823fdc33aae1c8fc0fc" | ||
| 1916 | dependencies = [ | 1922 | dependencies = [ |
| 1917 | "async-trait", | 1923 | "async-trait", |
| 1918 | "nostr", | 1924 | "nostr", |
| @@ -1925,8 +1931,9 @@ dependencies = [ | |||
| 1925 | 1931 | ||
| 1926 | [[package]] | 1932 | [[package]] |
| 1927 | name = "nostr-zapper" | 1933 | name = "nostr-zapper" |
| 1928 | version = "0.32.0" | 1934 | version = "0.33.0" |
| 1929 | source = "git+https://github.com/DanConwayDev/nostr?branch=v0.32-get-nip46-from-nip05-address#429f3c1396f05bf08793f60ed1d92d7bc02ea438" | 1935 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1936 | checksum = "69922e74f8eab1f9d287008c0c06acdec87277a2d8f44bd9d38e003422aea0ab" | ||
| 1930 | dependencies = [ | 1937 | dependencies = [ |
| 1931 | "async-trait", | 1938 | "async-trait", |
| 1932 | "nostr", | 1939 | "nostr", |
| @@ -2026,8 +2033,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" | |||
| 2026 | 2033 | ||
| 2027 | [[package]] | 2034 | [[package]] |
| 2028 | name = "nwc" | 2035 | name = "nwc" |
| 2029 | version = "0.32.0" | 2036 | version = "0.33.0" |
| 2030 | source = "git+https://github.com/DanConwayDev/nostr?branch=v0.32-get-nip46-from-nip05-address#429f3c1396f05bf08793f60ed1d92d7bc02ea438" | 2037 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 2038 | checksum = "bb2e04b3edb5e9572e95b62842430625f1718e8a4a3596a30aeb04e6734764ea" | ||
| 2031 | dependencies = [ | 2039 | dependencies = [ |
| 2032 | "async-utility", | 2040 | "async-utility", |
| 2033 | "nostr", | 2041 | "nostr", |
| @@ -23,11 +23,11 @@ futures = "0.3.28" | |||
| 23 | git2 = "0.18.1" | 23 | git2 = "0.18.1" |
| 24 | indicatif = "0.17.7" | 24 | indicatif = "0.17.7" |
| 25 | keyring = "2.0.5" | 25 | keyring = "2.0.5" |
| 26 | nostr = { git = "https://github.com/DanConwayDev/nostr", branch= "v0.32-get-nip46-from-nip05-address" } | 26 | nostr = "0.33.0" |
| 27 | nostr-database = { git = "https://github.com/DanConwayDev/nostr", branch= "v0.32-get-nip46-from-nip05-address" } | 27 | nostr-database = "0.33.0" |
| 28 | nostr-sdk = { git = "https://github.com/DanConwayDev/nostr", branch= "v0.32-get-nip46-from-nip05-address" } | 28 | nostr-sdk = "0.33.0" |
| 29 | nostr-signer = { git = "https://github.com/DanConwayDev/nostr", branch= "v0.32-get-nip46-from-nip05-address" } | 29 | nostr-signer = "0.33.0" |
| 30 | nostr-sqlite = { git = "https://github.com/DanConwayDev/nostr", branch= "v0.32-get-nip46-from-nip05-address" } | 30 | nostr-sqlite = "0.33.0" |
| 31 | passwords = "3.1.13" | 31 | passwords = "3.1.13" |
| 32 | scrypt = "0.11.0" | 32 | scrypt = "0.11.0" |
| 33 | serde = { version = "1.0.181", features = ["derive"] } | 33 | serde = { 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 | ||
| 3 | use anyhow::{bail, Context, Result}; | 3 | use anyhow::{bail, Context, Result}; |
| 4 | use nostr::{ | 4 | use nostr::{ |
| 5 | nips::{nip05::get_nip46, nip46::NostrConnectURI}, | 5 | nips::{nip05, nip46::NostrConnectURI}, |
| 6 | PublicKey, | 6 | PublicKey, |
| 7 | }; | 7 | }; |
| 8 | use nostr_sdk::{ | 8 | use nostr_sdk::{ |
| @@ -404,17 +404,17 @@ async fn fresh_login( | |||
| 404 | pub async fn fetch_nip46_uri_from_nip05(nip05: &str) -> Result<NostrConnectURI> { | 404 | pub 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" | |||
| 9 | dialoguer = "0.10.4" | 9 | dialoguer = "0.10.4" |
| 10 | directories = "5.0.1" | 10 | directories = "5.0.1" |
| 11 | git2 = "0.18.1" | 11 | git2 = "0.18.1" |
| 12 | nostr = { git = "https://github.com/DanConwayDev/nostr", branch= "v0.32-get-nip46-from-nip05-address" } | 12 | nostr = "0.33.0" |
| 13 | nostr-sdk = { git = "https://github.com/DanConwayDev/nostr", branch= "v0.32-get-nip46-from-nip05-address" } | 13 | nostr-sdk = "0.33.0" |
| 14 | once_cell = "1.18.0" | 14 | once_cell = "1.18.0" |
| 15 | rand = "0.8" | 15 | rand = "0.8" |
| 16 | rexpect = { git = "https://github.com/rust-cli/rexpect.git", rev = "9eb61dd" } | 16 | rexpect = { git = "https://github.com/rust-cli/rexpect.git", rev = "9eb61dd" } |