Skip to content

Commit

Permalink
Removed dump methods that have no usage and code coverage (#602)
Browse files Browse the repository at this point in the history
  • Loading branch information
thehenrytsai committed Nov 7, 2023
1 parent e3af260 commit f97000a
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 72 deletions.
3 changes: 0 additions & 3 deletions src/did/did-ion-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,4 @@ export class DidIonResolver implements DidMethodResolver {
const didResolutionResult = await response.json();
return didResolutionResult;
}

async dump(): Promise<void> {
}
}
3 changes: 0 additions & 3 deletions src/did/did-key-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,4 @@ export class DidKeyResolver implements DidMethodResolver {
const keyId = `${did}#${methodSpecificId}`;
return keyId;
};

async dump(): Promise<void> {
}
}
16 changes: 0 additions & 16 deletions src/did/did-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,4 @@ export class DidResolver {

return resolutionResult;
}

async dump(): Promise<void> {
console.group('didResolvers');
for (const [ key, value ] of this.didResolvers) {
console.group(key);
// @ts-ignore
await value['dump']?.();
console.groupEnd();
}
console.groupEnd();

console.group('didCache');
// @ts-ignore
await this.cache['dump']?.();
console.groupEnd();
}
}
6 changes: 0 additions & 6 deletions src/event-log/event-log-level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,4 @@ export class EventLogLevel implements EventLog {

return numEventsDeleted;
}

async dump(): Promise<void> {
console.group('db');
await this.db['dump']?.();
console.groupEnd();
}
}
6 changes: 0 additions & 6 deletions src/store/blockstore-level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,6 @@ export class BlockstoreLevel implements Blockstore {
async clear(): Promise<void> {
return this.db.clear();
}

async dump(): Promise<void> {
console.group('db');
await this.db['dump']?.();
console.groupEnd();
}
}

type BlockstoreLevelConfig = {
Expand Down
6 changes: 0 additions & 6 deletions src/store/data-store-level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,6 @@ export class DataStoreLevel implements DataStore {
await this.blockstore.clear();
}

async dump() : Promise<void> {
console.group('blockstore');
await this.blockstore['dump']?.();
console.groupEnd();
}

/**
* Gets the blockstore used for reference counting purposes for the given `dataCid` in the given `tenant`.
*/
Expand Down
6 changes: 0 additions & 6 deletions src/store/index-level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,6 @@ export class IndexLevel {
private join(...values: unknown[]): string {
return values.join(IndexLevel.delimiter);
}

async dump(): Promise<void> {
console.group('db');
await this.db['dump']?.();
console.groupEnd();
}
}

type IndexLevelConfig = {
Expand Down
10 changes: 0 additions & 10 deletions src/store/level-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,6 @@ export class LevelWrapper<V> {
valueEncoding : this.config.valueEncoding
});
}

async dump(): Promise<void> {
if (!this.db) {
return;
}

for await (const [ key, value ] of this.db.iterator()) {
console.debug(key, value);
}
}
}

type LevelWrapperConfig<V> = CreateLevelDatabaseOptions<V> & {
Expand Down
10 changes: 0 additions & 10 deletions src/store/message-store-level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,6 @@ export class MessageStoreLevel implements MessageStore {
await this.blockstore.clear();
await this.index.clear();
}

async dump(): Promise<void> {
console.group('blockstore');
await this.blockstore['dump']?.();
console.groupEnd();

console.group('index');
await this.index['dump']?.();
console.groupEnd();
}
}

type MessageStoreLevelConfig = {
Expand Down
6 changes: 0 additions & 6 deletions src/utils/memory-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,4 @@ export class MemoryCache implements Cache {
async get(key: string): Promise<any | undefined> {
return this.cache.get(key);
}

async dump(): Promise<void> {
for (const [ key, value ] of this.cache) {
console.debug(key, value);
}
}
}

0 comments on commit f97000a

Please sign in to comment.