-
Notifications
You must be signed in to change notification settings - Fork 15
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
Relay request and response additions #151
Conversation
There's something wrong with the CI builds. I'm getting flaky results or they're breaking in a way that's unexpected. It seems that my PR shouldn't affect them, but maybe I'm missing something. |
It's not my PR. I tried the build on a different branch that's basically just the current
|
#152 fixes the build issue. |
5f5770a
to
8f7c74e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Terry!
@@ -0,0 +1 @@ | |||
["OK", "b1a649ebe8b435ec71d3784793f3bbf4b93e64e17568a741aecd4c7ddeafce30", true, "unknown: reason: unknown"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that the message will have two colons in it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's possible. Technically the relay can give us whatever it wants and not conform to NIP-01. I wanted to stress test that possibility.
Co-authored-by: Bryan Montz <[email protected]>
…o make the test code cleaner
* Reorder relay request and relay response enums to match the listed ordering in the specs for easier maintainability * Fix RelayResponse to not drop human readable messages for OK messages * Add CLOSED relay response * Add AUTH relay request and response * Apply suggestions from code review Co-authored-by: Bryan Montz <[email protected]> * Shorten struct names * Change RelayResponseDecodingTest to use XCTUnwrap instead of if let to make the test code cleaner --------- Co-authored-by: Bryan Montz <[email protected]>
Please review this PR on a per-commit basis. Otherwise, it will be difficult to review.
RelayResponse
to not drop human readable messages forOK
messagesCLOSED
relay responseAUTH
relay request and responseThis PR brings
RelayRequest
andRelayResponse
to completion per NIP-01, NIP-42 - Auth, and NIP-45 - Event counts. The implementation was previously incomplete, covering only part of the spec.Although this PR adds AUTH, there are no functions to actually authenticate on the
RelayOperating
protocol yet. That will be added as a separate PR.This issue tracks the
AUTH
work: #21