mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-31 02:54:21 +01:00
Add supportedNips to all storages
This commit is contained in:
@@ -56,6 +56,9 @@ class EventsDB implements EventStore {
|
||||
#db: Kysely<DittoDB>;
|
||||
#debug = Debug('ditto:db:events');
|
||||
|
||||
/** NIPs supported by this storage method. */
|
||||
supportedNips = [1, 45, 50];
|
||||
|
||||
constructor(db: Kysely<DittoDB>) {
|
||||
this.#db = db;
|
||||
}
|
||||
|
||||
@@ -8,15 +8,13 @@ class Memorelay implements EventStore {
|
||||
#debug = Debug('ditto:memorelay');
|
||||
#cache: LRUCache<string, Event>;
|
||||
|
||||
/** NIPs supported by this storage method. */
|
||||
supportedNips = [1, 45];
|
||||
|
||||
constructor(...args: ConstructorParameters<typeof LRUCache<string, Event>>) {
|
||||
this.#cache = new LRUCache<string, Event>(...args);
|
||||
}
|
||||
|
||||
/** NIPs supported by this storage method. */
|
||||
get supportedNips(): number[] {
|
||||
return [1];
|
||||
}
|
||||
|
||||
/** Iterate stored events. */
|
||||
*#events(): Generator<Event> {
|
||||
for (const event of this.#cache.values()) {
|
||||
|
||||
@@ -13,6 +13,8 @@ class Optimizer implements EventStore {
|
||||
#cache: EventStore;
|
||||
#client: EventStore;
|
||||
|
||||
supportedNips = [1];
|
||||
|
||||
constructor(opts: OptimizerOpts) {
|
||||
this.#db = opts.db;
|
||||
this.#cache = opts.cache;
|
||||
|
||||
Reference in New Issue
Block a user