diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-06-11 16:21:44 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-06-13 09:09:00 +0100 |
| commit | f1b3fcc40ab666d8def97096d1942c274da9b279 (patch) | |
| tree | 05d6af0c5c1ad9baedb90ef652152fba6d46abf5 /src/key_handling/users.rs | |
| parent | 7c6a5ab4c5e7a81c7442061029b9230748a6639d (diff) | |
chore: bump rust-nostr to v0.32.0
both nostr and nostr-sdk packages and also in test_utils
fix the many breaking changes
fix: ignore trailing slash when depuplicate relays for send events.
this was picked up as TagStandard::RelayMetadata has started adding
a traling slash.
refactor cli output test function `expect_send_with_progress` so that
relays can succeed / fail in a random order
Diffstat (limited to 'src/key_handling/users.rs')
| -rw-r--r-- | src/key_handling/users.rs | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/src/key_handling/users.rs b/src/key_handling/users.rs index 1dd75a8..a79a977 100644 --- a/src/key_handling/users.rs +++ b/src/key_handling/users.rs | |||
| @@ -567,15 +567,18 @@ mod tests { | |||
| 567 | nostr::Kind::RelayList, | 567 | nostr::Kind::RelayList, |
| 568 | "", | 568 | "", |
| 569 | [ | 569 | [ |
| 570 | nostr::Tag::RelayMetadata( | 570 | nostr::Tag::from_standardized(nostr::TagStandard::RelayMetadata { |
| 571 | "wss://fredswrite1.relay".into(), | 571 | relay_url: nostr::Url::from_str("wss://fredswrite1.relay/").unwrap(), |
| 572 | Some(nostr::RelayMetadata::Write), | 572 | metadata: Some(RelayMetadata::Write), |
| 573 | ), | 573 | }), |
| 574 | nostr::Tag::RelayMetadata( | 574 | nostr::Tag::from_standardized(nostr::TagStandard::RelayMetadata { |
| 575 | "wss://fredsread1.relay".into(), | 575 | relay_url: nostr::Url::from_str("wss://fredsread1.relay/").unwrap(), |
| 576 | Some(nostr::RelayMetadata::Read), | 576 | metadata: Some(RelayMetadata::Read), |
| 577 | ), | 577 | }), |
| 578 | nostr::Tag::RelayMetadata("wss://fredsreadwrite.relay".into(), None), | 578 | nostr::Tag::from_standardized(nostr::TagStandard::RelayMetadata { |
| 579 | relay_url: nostr::Url::from_str("wss://fredsreadwrite.relay/").unwrap(), | ||
| 580 | metadata: None, | ||
| 581 | }), | ||
| 579 | ], | 582 | ], |
| 580 | ) | 583 | ) |
| 581 | .to_event(&TEST_KEY_1_KEYS) | 584 | .to_event(&TEST_KEY_1_KEYS) |
| @@ -587,15 +590,18 @@ mod tests { | |||
| 587 | nostr::Kind::RelayList, | 590 | nostr::Kind::RelayList, |
| 588 | "", | 591 | "", |
| 589 | [ | 592 | [ |
| 590 | nostr::Tag::RelayMetadata( | 593 | nostr::Tag::from_standardized(nostr::TagStandard::RelayMetadata { |
| 591 | "wss://carolswrite1.relay".into(), | 594 | relay_url: nostr::Url::from_str("wss://carolswrite1.relay/").unwrap(), |
| 592 | Some(nostr::RelayMetadata::Write), | 595 | metadata: Some(RelayMetadata::Write), |
| 593 | ), | 596 | }), |
| 594 | nostr::Tag::RelayMetadata( | 597 | nostr::Tag::from_standardized(nostr::TagStandard::RelayMetadata { |
| 595 | "wss://carolsread1.relay".into(), | 598 | relay_url: nostr::Url::from_str("wss://carolsread1.relay/").unwrap(), |
| 596 | Some(nostr::RelayMetadata::Read), | 599 | metadata: Some(RelayMetadata::Read), |
| 597 | ), | 600 | }), |
| 598 | nostr::Tag::RelayMetadata("wss://carolsreadwrite.relay".into(), None), | 601 | nostr::Tag::from_standardized(nostr::TagStandard::RelayMetadata { |
| 602 | relay_url: nostr::Url::from_str("wss://carolsreadwrite.relay/").unwrap(), | ||
| 603 | metadata: None, | ||
| 604 | }), | ||
| 599 | ], | 605 | ], |
| 600 | ) | 606 | ) |
| 601 | .to_event(&TEST_KEY_2_KEYS) | 607 | .to_event(&TEST_KEY_2_KEYS) |
| @@ -652,7 +658,7 @@ mod tests { | |||
| 652 | 658 | ||
| 653 | fn expected_userrelayrefs_write1() -> UserRelayRef { | 659 | fn expected_userrelayrefs_write1() -> UserRelayRef { |
| 654 | UserRelayRef { | 660 | UserRelayRef { |
| 655 | url: "wss://fredswrite1.relay".into(), | 661 | url: "wss://fredswrite1.relay/".into(), |
| 656 | read: false, | 662 | read: false, |
| 657 | write: true, | 663 | write: true, |
| 658 | } | 664 | } |
| @@ -661,7 +667,7 @@ mod tests { | |||
| 661 | 667 | ||
| 662 | fn expected_userrelayrefs_read_write1() -> UserRelayRef { | 668 | fn expected_userrelayrefs_read_write1() -> UserRelayRef { |
| 663 | UserRelayRef { | 669 | UserRelayRef { |
| 664 | url: "wss://fredsreadwrite.relay".into(), | 670 | url: "wss://fredsreadwrite.relay/".into(), |
| 665 | read: true, | 671 | read: true, |
| 666 | write: true, | 672 | write: true, |
| 667 | } | 673 | } |
| @@ -672,7 +678,7 @@ mod tests { | |||
| 672 | vec![ | 678 | vec![ |
| 673 | expected_userrelayrefs_write1(), | 679 | expected_userrelayrefs_write1(), |
| 674 | UserRelayRef { | 680 | UserRelayRef { |
| 675 | url: "wss://fredsread1.relay".into(), | 681 | url: "wss://fredsread1.relay/".into(), |
| 676 | read: true, | 682 | read: true, |
| 677 | write: false, | 683 | write: false, |
| 678 | }, | 684 | }, |