nostrdb: add profiles to nostrdb

This adds profiles to nostrdb

- Remove in-memory Profiles caches, nostrdb is as fast as an in-memory cache
- Remove ProfileDatabase and just use nostrdb directly

Changelog-Changed: Use nostrdb for profiles
This commit is contained in:
William Casarin
2023-08-28 07:52:59 -07:00
parent 8586eed635
commit bb4fd75576
42 changed files with 362 additions and 705 deletions

View File

@@ -11,8 +11,6 @@ import XCTest
final class ZapTests: XCTestCase {
override func setUpWithError() throws {
let db = ProfileDatabase()
try db.remove_all_profiles()
}
override func tearDownWithError() throws {
@@ -71,7 +69,7 @@ final class ZapTests: XCTestCase {
XCTAssertEqual(zap.target, ZapTarget.profile(profile))
XCTAssertEqual(zap_notification_title(zap), "Zap")
XCTAssertEqual(zap_notification_body(profiles: Profiles(user_search_cache: UserSearchCache()), zap: zap), "You received 1k sats from 107jk7ht:2quqncxg")
XCTAssertEqual(zap_notification_body(profiles: Profiles(user_search_cache: UserSearchCache(), ndb: .empty), zap: zap), "You received 1k sats from 107jk7ht:2quqncxg")
}
}