Skip to content
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

refactor: messaging #18

Merged
merged 39 commits into from
Oct 5, 2023
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
40301e9
copy all types
Ad96el Aug 4, 2023
e6d2f3d
integrated messaging
Ad96el Aug 4, 2023
f442317
with messaging
Ad96el Aug 4, 2023
0ab879c
with quote
Ad96el Aug 4, 2023
7008be2
fix: make exportable
Ad96el Aug 7, 2023
5bb1159
fix: test against latest not develop
Ad96el Aug 7, 2023
819d315
fix: test against latest not develop
Ad96el Aug 7, 2023
dcc28a7
refactor: reduce types
Ad96el Aug 8, 2023
0ce054a
refactor: remove jest setup
Ad96el Aug 8, 2023
844cdbf
refactor: restructure
Ad96el Aug 9, 2023
b5042c7
chore: copyright
Ad96el Aug 9, 2023
f66bca6
remove terms
Ad96el Aug 9, 2023
e026d9c
remove newline
Ad96el Aug 9, 2023
d4fb2a0
update imports
Ad96el Aug 9, 2023
3f3aa01
add comments
Ad96el Aug 9, 2023
92f433e
docs docs docs
Ad96el Aug 9, 2023
e7dc7cc
docs docs docs
Ad96el Aug 9, 2023
d1c69c7
feat: type guards
Ad96el Aug 9, 2023
a493e93
feat: generics for message
Ad96el Aug 10, 2023
13b7dcf
feat: type guards
Ad96el Aug 10, 2023
7cc83fa
fmt
Ad96el Aug 10, 2023
7670f94
feat: errors
Ad96el Aug 10, 2023
0c97d2b
feat: catch
Ad96el Aug 10, 2023
6bfd5d8
refactor: errors
Ad96el Aug 10, 2023
878fe28
feat: default type
Ad96el Aug 10, 2023
1aa812a
newline
Ad96el Aug 11, 2023
792dc5d
refactor: change return type
Ad96el Aug 11, 2023
1b23e4c
fmt
Ad96el Aug 14, 2023
b0bb518
fix tests
Ad96el Aug 14, 2023
c76cc9b
change response
Ad96el Aug 21, 2023
dfaafcd
fix tests
Ad96el Aug 22, 2023
22073b2
namespace
Ad96el Aug 22, 2023
e06c1ec
do not export verifyMessageEnvelope
Ad96el Aug 23, 2023
0a2ffb9
reduce interface
Ad96el Aug 23, 2023
3969f72
change body type
Ad96el Aug 23, 2023
b5316c5
remove comments
Ad96el Aug 23, 2023
64f5d52
message body
Ad96el Aug 23, 2023
7d348a0
from body generic
Ad96el Aug 24, 2023
a93d110
refactor types
Ad96el Aug 29, 2023
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
6 changes: 3 additions & 3 deletions src/messaging/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import { UUID } from '@kiltprotocol/utils'
* @returns The message created.
*/

export function fromBody(
body: MessageBody,
export function fromBody<Body extends MessageBody>(
rflechtner marked this conversation as resolved.
Show resolved Hide resolved
body: Body,
sender: IMessage['sender'],
receiver: IMessage['receiver']
): IMessage<MessageBody> {
): IMessage<Body> {
return {
body,
createdAt: Date.now(),
Expand Down