Skip to content

rename senderDID to senderDid in message-handler #245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xpolygonid/js-sdk",
"version": "1.16.1",
"version": "1.17.0",
"description": "SDK to work with Polygon ID",
"main": "dist/node/cjs/index.js",
"module": "dist/node/esm/index.js",
Expand Down
8 changes: 4 additions & 4 deletions src/iden3comm/handlers/message-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class MessageHandler {
| RevocationStatusMessageHandlerOptions
| PaymentRequestMessageHandlerOptions
| PaymentHandlerOptions
| { senderDID?: DID; [key: string]: unknown }
| { senderDid?: DID; [key: string]: unknown }
): Promise<Uint8Array | null> {
const { unpackedMediaType, unpackedMessage: message } =
await this._params.packageManager.unpack(bytes);
Expand All @@ -139,10 +139,10 @@ export class MessageHandler {
}

let packerParams = {};
const senderDID = (context as { senderDID?: DID })?.senderDID;
if (unpackedMediaType === MediaType.ZKPMessage && senderDID) {
const senderDid = (context as { senderDid?: DID })?.senderDid;
if (unpackedMediaType === MediaType.ZKPMessage && senderDid) {
packerParams = {
senderDID,
senderDID: senderDid,
provingMethodAlg: proving.provingMethodGroth16AuthV2Instance.methodAlg
};
return this._params.packageManager.packMessage(unpackedMediaType, response, packerParams);
Expand Down
10 changes: 5 additions & 5 deletions src/iden3comm/handlers/revocation-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import { AbstractMessageHandler, IProtocolMessageHandler } from './message-handl

/**
* Defines the options for a RevocationStatusMessageHandler.
* @property did - The DID (Decentralized Identifier) to be used.
* @property senderDid - The DID (Decentralized Identifier) to be used.
* @property mediaType - The media type to be used.
* @property packerOptions - Optional parameters for the JWS packer.
* @property treeState - Optional tree state to be used.
*/
export type RevocationStatusMessageHandlerOptions = {
did: DID;
senderDid: DID;
mediaType: MediaType;
packerOptions?: JWSPackerParams;
treeState?: TreeState;
Expand Down Expand Up @@ -94,7 +94,7 @@ export class RevocationStatusHandler
message: BasicMessage,
context: RevocationStatusMessageHandlerOptions
): Promise<BasicMessage | null> {
if (!context.did) {
if (!context.senderDid) {
throw new Error('DID is required');
}

Expand Down Expand Up @@ -155,7 +155,7 @@ export class RevocationStatusHandler
type: PROTOCOL_MESSAGE_TYPE.REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE,
thid: rsRequest.thid ?? guid,
body: revStatus,
from: context.did.string(),
from: context.senderDid.string(),
to: rsRequest.from
};

Expand Down Expand Up @@ -195,7 +195,7 @@ export class RevocationStatusHandler
const rsRequest = await this.parseRevocationStatusRequest(request);

const response = await this.handleRevocationStatusRequestMessage(rsRequest, {
did,
senderDid: did,
mediaType: opts.mediaType,
packerOptions: opts.packerOptions,
treeState: opts.treeState
Expand Down