Skip to content
Merged
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/utils/buildRawMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export async function validateToRawMessage (
case StrictNoSign:
if (msg.signature != null) return { valid: false, error: ValidateError.SignaturePresent }
if (msg.seqno != null) return { valid: false, error: ValidateError.SeqnoPresent }
if (msg.key != null) return { valid: false, error: ValidateError.FromPresent }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we also want to keep the validation that msg.key is not present (with a ValidateError.KeyPresent error)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is indeed such a rule, I would like to add it. The original code is consistent with the implementation of rust, and the implementation of rust does not check the key.

if (msg.from != null) return { valid: false, error: ValidateError.FromPresent }

return { valid: true, message: { type: 'unsigned', topic: msg.topic, data: msg.data ?? new Uint8Array(0) } }

Expand Down
Loading