replace deprecated functions in multiple places.

This commit is contained in:
fiatjaf
2025-03-10 02:54:34 -03:00
parent 8d869009b0
commit 459273216c
7 changed files with 19 additions and 27 deletions

View File

@@ -32,7 +32,7 @@ func TestMetadataAndEvents(t *testing.T) {
Limit: 5,
}
events := make([]*nostr.Event, 0, 5)
for ie := range sys.Pool.SubManyEose(ctx, relays, nostr.Filters{filter}) {
for ie := range sys.Pool.FetchMany(ctx, relays, filter) {
events = append(events, ie.Event)
}
require.NoError(t, err)

View File

@@ -10,11 +10,9 @@ func (sys *System) SearchUsers(ctx context.Context, query string) []ProfileMetad
limit := 10
profiles := make([]ProfileMetadata, 0, limit*len(sys.UserSearchRelays.URLs))
for ie := range sys.Pool.SubManyEose(ctx, sys.UserSearchRelays.URLs, nostr.Filters{
{
Search: query,
Limit: limit,
},
for ie := range sys.Pool.FetchMany(ctx, sys.UserSearchRelays.URLs, nostr.Filter{
Search: query,
Limit: limit,
}, nostr.WithLabel("search")) {
m, _ := ParseMetadata(ie.Event)
profiles = append(profiles, m)