Skip to content

Commit

Permalink
refactor: refactor some field name and code
Browse files Browse the repository at this point in the history
  • Loading branch information
bao-sotatek committed May 7, 2024
1 parent 77fc4fc commit 635a05d
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion services/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
container_name: idw-keria
restart: unless-stopped
build:
context: github.com/WebOfTrust/keria#f24cf4b01932916cc640ff6f20ffda6f641c1ad2
context: github:cardano-foundation/signify-ts#c1422b041d2ff53b3d4456a29443722b95f35fb5
dockerfile: ./images/keria.dockerfile
environment:
- KERI_AGENT_CORS=true
Expand Down
2 changes: 1 addition & 1 deletion src/core/agent/agent.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ interface IdentifierResult {
}

enum NotificationRoute {
Credential = "/exn/ipex/grant",
ExnIpexGrant = "/exn/ipex/grant",
MultiSigIcp = "/multisig/icp",
MultiSigRot = "/multisig/rot",
ExnIpexApply = "/exn/ipex/apply",
Expand Down
8 changes: 4 additions & 4 deletions src/core/agent/services/credentialService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,16 +405,16 @@ describe("Credential service of agent", () => {
).rejects.toThrowError(CredentialService.CREDENTIAL_NOT_FOUND);
});

test("Should be able to getUnhandledIpexGrantNotifications", async () => {
test("Should be able to getExnIpexGrantpexGrantNotifications", async () => {
const notificationRecord = {
_tags: {
isDismiss: true,
route: NotificationRoute.Credential,
route: NotificationRoute.ExnIpexGrant,
},
id: "AIeGgKkS23FDK4mxpfodpbWhTydFz2tdM64DER6EdgG-",
createdAt: new Date(),
a: {
r: NotificationRoute.Credential,
r: NotificationRoute.ExnIpexGrant,
d: "EF6Nmxz8hs0oVc4loyh2J5Sq9H3Z7apQVqjO6e4chtsp",
},
};
Expand All @@ -438,7 +438,7 @@ describe("Credential service of agent", () => {
isDismissed: false,
});
expect(notificationStorage.findAllByQuery).toBeCalledWith({
route: NotificationRoute.Credential,
route: NotificationRoute.ExnIpexGrant,
isDismissed: false,
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/core/agent/services/credentialService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class CredentialService extends AgentService {
} = {}
): Promise<KeriaNotification[]> {
const results = await this.notificationStorage.findAllByQuery({
route: NotificationRoute.Credential,
route: NotificationRoute.ExnIpexGrant,
...filters,
});
return results.map((result) => {
Expand Down
20 changes: 10 additions & 10 deletions src/core/agent/services/ipexCommunicationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ class IpexCommunicationService extends AgentService {
}
const pickedCred = creds[0];
let holderSignifyName;
const holder = await this.identifierStorage.getIdentifierMetadata(
msg.exn.a.i
);
if (holder && holder.signifyName) {
holderSignifyName = holder.signifyName;
const signifyName = (
await this.identifierStorage.getIdentifierMetadata(msg.exn.a.i)
).signifyName;
if (signifyName) {
holderSignifyName = signifyName;
} else {
const identifierHolder = await this.getIdentifierById(msg.exn.a.i);
holderSignifyName = identifierHolder?.name;
Expand Down Expand Up @@ -166,11 +166,11 @@ class IpexCommunicationService extends AgentService {
}
const pickedCred = creds[0];
let holderSignifyName;
const holder = await this.identifierStorage.getIdentifierMetadata(
exnMessage.i
);
if (holder && holder.signifyName) {
holderSignifyName = holder.signifyName;
const signifyName = (
await this.identifierStorage.getIdentifierMetadata(msg.exn.a.i)
).signifyName;
if (signifyName) {
holderSignifyName = signifyName;
} else {
const identifierHolder = await this.getIdentifierById(msg.exn.a.i);
holderSignifyName = identifierHolder?.name;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/AppWrapper/AppWrapper.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ describe("AppWrapper handler", () => {
const keriNoti = {
id: "id",
a: {
r: NotificationRoute.Credential,
r: NotificationRoute.ExnIpexGrant,
},
createdAt: new Date(),
} as KeriaNotification;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/AppWrapper/AppWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const keriaNotificationsChangeHandler = async (
event: KeriaNotification,
dispatch: ReturnType<typeof useAppDispatch>
) => {
if (event?.a?.r === NotificationRoute.Credential) {
if (event?.a?.r === NotificationRoute.ExnIpexGrant) {
dispatch(
setQueueIncomingRequest({
id: event?.id,
Expand Down

0 comments on commit 635a05d

Please sign in to comment.