Skip to content

Commit

Permalink
feat: remove peerConnectionStorage in AgentServicesProps
Browse files Browse the repository at this point in the history
  • Loading branch information
Sotatek-HocNguyena committed May 8, 2024
1 parent b85b3a8 commit 8ad3edb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
17 changes: 9 additions & 8 deletions src/core/agent/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Agent {
private connectionStorage!: ConnectionStorage;
private connectionNoteStorage!: ConnectionNoteStorage;
private notificationStorage!: NotificationStorage;
private peerConnectionStorage!: PeerConnectionStorage;

private signifyClient!: SignifyClient;
static ready = false;
Expand Down Expand Up @@ -126,8 +127,8 @@ class Agent {
return this.credentialService;
}

get peerConnectionStorage() {
return this.agentServicesProps.peerConnectionStorage;
get peerConnectionMetadataStorage() {
return this.peerConnectionStorage;
}

get basicStorage() {
Expand Down Expand Up @@ -204,14 +205,14 @@ class Agent {
credentialStorage: new CredentialStorage(
this.getStorageService<CredentialMetadataRecord>(this.storageSession)
),
peerConnectionStorage: new PeerConnectionStorage(
this.getStorageService<PeerConnectionMetadataRecord>(
this.storageSession
)
),
};

Agent.ready = true;
(this.peerConnectionStorage = new PeerConnectionStorage(
this.getStorageService<PeerConnectionMetadataRecord>(
this.storageSession
)
)),
(Agent.ready = true);
}
}

Expand Down
1 change: 0 additions & 1 deletion src/core/agent/agent.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ interface AgentServicesProps {
eventService: EventService;
identifierStorage: IdentifierStorage;
credentialStorage: CredentialStorage;
peerConnectionStorage: PeerConnectionStorage;
}

interface CreateIdentifierResult {
Expand Down
3 changes: 1 addition & 2 deletions src/core/agent/records/peerConnectionStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ class PeerConnectionStorage {
async getAllPeerConnectionMetadata(): Promise<
PeerConnectionMetadataRecord[]
> {
const records = await this.storageService.findAllByQuery(
{},
const records = await this.storageService.getAll(
PeerConnectionMetadataRecord
);
return records;
Expand Down

0 comments on commit 8ad3edb

Please sign in to comment.