-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: incorrect recip key with multi routing keys (#446)
* fix: incorrect recip key with multi routing keys * fix: also transform @type on forwrad messages Signed-off-by: Timo Glastra <[email protected]>
- Loading branch information
1 parent
8aad3e9
commit db76823
Showing
4 changed files
with
50 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { AgentMessage } from '../AgentMessage' | ||
|
||
class TestMessage extends AgentMessage { | ||
public readonly type = 'https://didcomm.org/connections/1.0/invitation' | ||
} | ||
|
||
describe('AgentMessage', () => { | ||
describe('toJSON', () => { | ||
it('should only use did:sov message prefix if useLegacyDidSovPrefix is true', () => { | ||
const message = new TestMessage() | ||
|
||
const jsonDidComm = message.toJSON() | ||
expect(jsonDidComm['@type']).toBe('https://didcomm.org/connections/1.0/invitation') | ||
|
||
const jsonSov = message.toJSON({ useLegacyDidSovPrefix: true }) | ||
expect(jsonSov['@type']).toBe('did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation') | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters