Skip to content

Commit

Permalink
feat(core): interface to get cred said from current ms offer said
Browse files Browse the repository at this point in the history
  • Loading branch information
iFergal committed Dec 12, 2024
1 parent 8d94dd0 commit 1c9028a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/agent/services/ipexCommunicationService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,15 @@ describe("Offer ACDC group actions", () => {
expect(operationPendingStorage.save).not.toBeCalled();
expect(eventEmitter.emit).not.toBeCalled();
});

test("Can retrieve the current offered credential SAID", async () => {
getExchangeMock.mockReturnValueOnce(multisigExnOfferForPresenting);

const result = await ipexCommunicationService.getOfferedCredentialSaid("current-said");

expect(result).toEqual("EEuFpvZ2G_YMm3smqbwZn4SWArxQOen7ZypVVfr6fVCT");
expect(getExchangeMock).toBeCalledWith("current-said");
});
});

describe("Offer ACDC group progress", () => {
Expand Down
6 changes: 6 additions & 0 deletions src/core/agent/services/ipexCommunicationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,12 @@ class IpexCommunicationService extends AgentService {
linkedGroupRequest: applyNoteRecord.linkedGroupRequest,
}
}

async getOfferedCredentialSaid(current: string): Promise<string> {
const multiSigExn = await this.props.signifyClient.exchanges().get(current);
const offerExn = multiSigExn.exn.e.exn;
return offerExn.e.acdc.d;
}
}

export { IpexCommunicationService };

0 comments on commit 1c9028a

Please sign in to comment.