diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-01-26 21:32:21 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-01-26 21:32:21 +0000 |
| commit | fc3f22eac2bb81823f170f61ba9d39baff76b933 (patch) | |
| tree | b6eec0bad2850e90bdded550bd175849f8e1abff /test_utils/src/relay.rs | |
| parent | d96c8f6687be8966a0bb25c679995fea3b9f0715 (diff) | |
chore: upgrade rust-nostr v0.27.0v0.1.1
this is a contribution from jk (sectore) that I rebased and squashed
into this commit.
the tests were broken in the last few commits to rush out some fixes.
this change may introduce more issues because of
Relay.respond_standard_req.
Diffstat (limited to 'test_utils/src/relay.rs')
| -rw-r--r-- | test_utils/src/relay.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test_utils/src/relay.rs b/test_utils/src/relay.rs index 50f6337..e47ab5d 100644 --- a/test_utils/src/relay.rs +++ b/test_utils/src/relay.rs | |||
| @@ -96,18 +96,25 @@ impl<'a> Relay<'a> { | |||
| 96 | &self, | 96 | &self, |
| 97 | client_id: u64, | 97 | client_id: u64, |
| 98 | subscription_id: &nostr::SubscriptionId, | 98 | subscription_id: &nostr::SubscriptionId, |
| 99 | filters: &[nostr::Filter], | 99 | // TODO: enable filters |
| 100 | _filters: &[nostr::Filter], | ||
| 100 | ) -> Result<bool> { | 101 | ) -> Result<bool> { |
| 101 | // let t: Vec<nostr::Kind> = self.events.iter().map(|e| e.kind).collect(); | 102 | // let t: Vec<nostr::Kind> = self.events.iter().map(|e| e.kind).collect(); |
| 102 | // .filter(|e| filters.iter().any(|filter| filter.match_event(e))) | 103 | // .filter(|e| filters.iter().any(|filter| filter.match_event(e))) |
| 103 | // println!("letsgo{:?}", t); | 104 | // println!("letsgo{:?}", t); |
| 105 | |||
| 104 | self.respond_events( | 106 | self.respond_events( |
| 105 | client_id, | 107 | client_id, |
| 106 | subscription_id, | 108 | subscription_id, |
| 107 | &self | 109 | &self |
| 108 | .events | 110 | .events |
| 109 | .iter() | 111 | .iter() |
| 110 | .filter(|e| filters.iter().any(|filter| filter.match_event(e))) | 112 | // FIXME: |
| 113 | // `filter.match_events` does not exist anymore | ||
| 114 | // it has been moved to `nostr_database_::FilterIndex` | ||
| 115 | // but it's private now | ||
| 116 | // .filter(|e| filters.iter().any(|filter|filter.match_event(e))) | ||
| 117 | .filter(|_| true) | ||
| 111 | .cloned() | 118 | .cloned() |
| 112 | .collect(), | 119 | .collect(), |
| 113 | ) | 120 | ) |