Skip to content

Commit

Permalink
refactor: pr comments
Browse files Browse the repository at this point in the history
Signed-off-by: annelein <anneleinvanreijen@gmail.com>
  • Loading branch information
Annelein committed Feb 14, 2022
1 parent bd202f2 commit 48ef25d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/transport/HttpOutboundTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { AbortController } from 'abort-controller'

import { AgentConfig } from '../agent/AgentConfig'
import { AriesFrameworkError } from '../error/AriesFrameworkError'
import { validJWEStucture } from '../utils/ValidJWEStucture'
import { isValidJweStucture } from '../utils'

export class HttpOutboundTransport implements OutboundTransport {
private agent!: Agent
Expand Down Expand Up @@ -77,7 +77,7 @@ export class HttpOutboundTransport implements OutboundTransport {
this.logger.debug(`Response received`, { responseMessage, status: response.status })

try {
if (!validJWEStucture(responseMessage)) {
if (!isValidJweStucture(responseMessage)) {
throw new Error(
`Received a response from the other agent but the structure of the incoming message is not a DIDComm message: ${responseMessage}`
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { validJWEStucture } from '../ValidJWEStucture'
import { isValidJweStucture } from '../JWE'

describe('ValidJWEStructure', () => {
test('throws error when the response message has an invalid JWE structure', async () => {
const responseMessage = 'invalid JWE structure'
await expect(validJWEStucture(responseMessage)).toBeFalsy()
await expect(isValidJweStucture(responseMessage)).toBeFalsy()
})

test('valid JWE structure', async () => {
Expand All @@ -14,6 +14,6 @@ describe('ValidJWEStructure', () => {
ciphertext: 'mwRMpVg9wkF4rIZcBeWLcc0fWhs=',
tag: '0yW0Lx8-vWevj3if91R06g==',
}
await expect(validJWEStucture(responseMessage)).toBeTruthy()
await expect(isValidJweStucture(responseMessage)).toBeTruthy()
})
})
1 change: 1 addition & 0 deletions packages/core/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from './JsonTransformer'
export * from './MultiBaseEncoder'
export * from './buffer'
export * from './MultiHashEncoder'
export * from './JWE'

0 comments on commit 48ef25d

Please sign in to comment.