Skip to content

Commit

Permalink
fixing up test issues from rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
emmacasolin committed Nov 2, 2021
1 parent 9a559d1 commit 00fd0cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
11 changes: 0 additions & 11 deletions src/client/clientService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type { NotificationsManager } from '../notifications';
import type { Discovery } from '../discovery';
import type { ForwardProxy, ReverseProxy } from '../network';
import type { GRPCServer } from '../grpc';
import { Sigchain } from '../sigchain';

import { promisify } from 'util';
import * as grpc from '@grpc/grpc-js';
Expand All @@ -17,14 +16,7 @@ import {
IClientServiceServer,
} from '../proto/js/polykey/v1/client_service_grpc_pb';
import * as utilsPB from '../proto/js/polykey/v1/utils/utils_pb';
import * as vaultsPB from '../proto/js/polykey/v1/vaults/vaults_pb';
import * as nodesPB from '../proto/js/polykey/v1/nodes/nodes_pb';
import * as notificationsPB from '../proto/js/polykey/v1/notifications/notifications_pb';
import * as sessionsPB from '../proto/js/polykey/v1/sessions/sessions_pb';
import * as gestaltsPB from '../proto/js/polykey/v1/gestalts/gestalts_pb';
import * as identitiesPB from '../proto/js/polykey/v1/identities/identities_pb';
import * as keysPB from '../proto/js/polykey/v1/keys/keys_pb';
import * as permissionsPB from '../proto/js/polykey/v1/permissions/permissions_pb';
import createEchoRPC from './rpcEcho';
import createSessionRPC from './rpcSession';
import createVaultRPC from './rpcVaults';
Expand All @@ -50,7 +42,6 @@ function createClientService({
identitiesManager,
gestaltGraph,
sessionManager,
sigchain,
notificationsManager,
discovery,
fwdProxy,
Expand All @@ -64,7 +55,6 @@ function createClientService({
identitiesManager: IdentitiesManager;
gestaltGraph: GestaltGraph;
sessionManager: SessionManager;
sigchain: Sigchain;
notificationsManager: NotificationsManager;
discovery: Discovery;
fwdProxy: ForwardProxy;
Expand Down Expand Up @@ -93,7 +83,6 @@ function createClientService({
}),
...createIdentitiesRPC({
identitiesManager,
sigchain,
gestaltGraph,
nodeManager,
sessionManager,
Expand Down
13 changes: 4 additions & 9 deletions src/client/rpcIdentities.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { NodeManager } from '../nodes';
import type { GestaltGraph } from '../gestalts';
import type { SessionManager } from '../sessions';
import type { Sigchain } from '../sigchain';
import type { IdentitiesManager } from '../identities';
import type { ClaimLinkIdentity, ClaimType } from '../claims/types';
import type {
IdentityId,
ProviderId,
Expand All @@ -20,13 +18,11 @@ import * as identitiesPB from '../proto/js/polykey/v1/identities/identities_pb';

const createIdentitiesRPC = ({
identitiesManager,
sigchain,
nodeManager,
gestaltGraph,
sessionManager,
}: {
identitiesManager: IdentitiesManager;
sigchain: Sigchain;
nodeManager: NodeManager;
gestaltGraph: GestaltGraph;
sessionManager: SessionManager;
Expand Down Expand Up @@ -234,10 +230,10 @@ const createIdentitiesRPC = ({
* Augments the keynode with a new identity.
*/
identitiesClaim: async (
call: grpc.ServerUnaryCall<identitiesPB.Provider, utilsPB.EmptyMessage>,
callback: grpc.sendUnaryData<utilsPB.EmptyMessage>,
call: grpc.ServerUnaryCall<identitiesPB.Provider, identitiesPB.Claim>,
callback: grpc.sendUnaryData<identitiesPB.Claim>,
): Promise<void> => {
const response = new clientPB.IdentityClaimMessage();
const response = new identitiesPB.Claim();
try {
await sessionManager.verifyToken(utils.getToken(call.metadata));
const responseMeta = utils.createMetaTokenResponse(
Expand Down Expand Up @@ -273,8 +269,7 @@ const createIdentitiesRPC = ({
} catch (err) {
callback(grpcUtils.fromError(err), null);
}
const emptyMessage = new utilsPB.EmptyMessage();
callback(null, emptyMessage);
callback(null, response);
},
};
};
Expand Down
2 changes: 1 addition & 1 deletion tests/client/clientService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,7 @@ describe('Client service', () => {
});
test('should augment a keynode.', async () => {
const identitiesAugmentKeynode =
grpcUtils.promisifyUnaryCall<utilsPB.EmptyMessage>(
grpcUtils.promisifyUnaryCall<identitiesPB.Claim>(
client,
client.identitiesClaim,
);
Expand Down

0 comments on commit 00fd0cf

Please sign in to comment.