Skip to content

Commit

Permalink
Refactor get requests method
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Koci <jakub.koci@gmail.com>
  • Loading branch information
jakubkoci committed Jan 13, 2022
1 parent 7a6ea0e commit 5362467
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions packages/core/src/modules/oob/messages/OutOfBandMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,7 @@ export class OutOfBandMessage extends AgentMessage {
}

public getRequests(): PlaintextMessage[] | undefined {
return this.requests?.map((request) => {
if (request.data.base64) {
return JsonEncoder.fromBase64(request.data.base64)
}

if (request.data.json) {
return request.data.json
}

throw new AriesFrameworkError('There is no supported data attribute in attachment')
})
return this.requests?.map((request) => request.data.getDataAsJson())
}

public toUrl({ domain }: { domain: string }) {
Expand Down

0 comments on commit 5362467

Please sign in to comment.