Skip to content

Commit

Permalink
fix(connections): store imageUrl when using DIDExchange (#1433)
Browse files Browse the repository at this point in the history
Signed-off-by: Ariel Gentile <[email protected]>
  • Loading branch information
genaris authored Apr 14, 2023
1 parent de90caf commit 66afda2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export class DidExchangeProtocol {
autoAcceptConnection: outOfBandRecord.autoAcceptConnection,
outOfBandId: outOfBandRecord.id,
invitationDid,
imageUrl: outOfBandInvitation.imageUrl,
})

DidExchangeStateMachine.assertCreateMessageState(DidExchangeRequestMessage.type, connectionRecord)
Expand Down
3 changes: 3 additions & 0 deletions packages/core/tests/oob.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ describe('out of band', () => {
goalCode: 'p2p-messaging',
label: 'Faber College',
alias: `Faber's connection with Alice`,
imageUrl: 'http://faber.image.url',
}

const issueCredentialConfig = {
Expand Down Expand Up @@ -186,6 +187,7 @@ describe('out of band', () => {
expect(outOfBandRecord.outOfBandInvitation.goal).toBe(makeConnectionConfig.goal)
expect(outOfBandRecord.outOfBandInvitation.goalCode).toBe(makeConnectionConfig.goalCode)
expect(outOfBandRecord.outOfBandInvitation.label).toBe(makeConnectionConfig.label)
expect(outOfBandRecord.outOfBandInvitation.imageUrl).toBe(makeConnectionConfig.imageUrl)
})

test('create OOB message only with handshake', async () => {
Expand Down Expand Up @@ -316,6 +318,7 @@ describe('out of band', () => {
expect(faberAliceConnection?.state).toBe(DidExchangeState.Completed)

expect(aliceFaberConnection).toBeConnectedWith(faberAliceConnection!)
expect(aliceFaberConnection.imageUrl).toBe(makeConnectionConfig.imageUrl)
expect(faberAliceConnection).toBeConnectedWith(aliceFaberConnection)
expect(faberAliceConnection.alias).toBe(makeConnectionConfig.alias)
})
Expand Down

0 comments on commit 66afda2

Please sign in to comment.