-
Notifications
You must be signed in to change notification settings - Fork 9
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
[ABW-1315] Radix Connect requset to CE and response from CE #444
Conversation
Sources/Core/SharedModels/P2P/ConnectorExtension/ConnectorExtension+Messages.swift
Outdated
Show resolved
Hide resolved
Sources/Core/SharedModels/P2P/ConnectorExtension/ConnectorExtension+Messages.swift
Outdated
Show resolved
Hide resolved
Sources/Core/SharedModels/P2P/ConnectorExtension/P2P+ToConnectorExtension.swift
Outdated
Show resolved
Hide resolved
Sources/Core/SharedModels/P2P/ConnectorExtension/P2P+ToConnectorExtension.swift
Outdated
Show resolved
Hide resolved
Sources/Core/SharedModels/P2P/ConnectorExtension/P2P+ToConnectorExtension.swift
Outdated
Show resolved
Hide resolved
Sources/Core/SharedModels/P2P/ConnectorExtension/P2P+ToConnectorExtension.swift
Outdated
Show resolved
Hide resolved
Sources/Features/AddLedgerNanoFactorSource/AddLedgerNanoFactorSource.swift
Outdated
Show resolved
Hide resolved
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.
Awesome
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.
Looks very very promising, added some first comments.
Sources/Core/SharedModels/P2P/ConnectorExtension/ConnectorExtension+Messages.swift
Outdated
Show resolved
Hide resolved
Sources/Features/AddLedgerNanoFactorSource/AddLedgerNanoFactorSource.swift
Outdated
Show resolved
Hide resolved
Sources/Features/AddLedgerNanoFactorSource/AddLedgerNanoFactorSource.swift
Outdated
Show resolved
Hide resolved
Sources/Features/AddLedgerNanoFactorSource/AddLedgerNanoFactorSource.swift
Outdated
Show resolved
Hide resolved
Sources/Features/DappInteractionFeature/Interactor/DappInteractor.swift
Outdated
Show resolved
Hide resolved
@@ -23,7 +23,8 @@ public struct RadixConnectClient: DependencyKey, Sendable { | |||
public var addP2PWithPassword: AddP2PWithPassword | |||
|
|||
public var receiveMessages: ReceiveMessages | |||
public var sendMessage: SendMessage | |||
public var sendResponse: SendResponse |
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.
A response is for now typically a response back to a Dapp for some "wallet interaction".
@@ -23,7 +23,8 @@ public struct RadixConnectClient: DependencyKey, Sendable { | |||
public var addP2PWithPassword: AddP2PWithPassword | |||
|
|||
public var receiveMessages: ReceiveMessages | |||
public var sendMessage: SendMessage | |||
public var sendResponse: SendResponse | |||
public var sendRequest: SendRequest |
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.
A request is a new message, typically a request to Connector extension to execute some Ledger Hardware device command, recipient RTC peer is unknown, see SendStrategy
below.
|
||
extension P2P { | ||
/// Recipient of sender of an RTC message | ||
public struct RTCRoute: Sendable, Hashable { |
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.
A since long missing tuple with the information on HOW to send an RTC message.
/// either a `response` or a `request`. | ||
public enum RTCMessageFromPeer: Sendable, Hashable { | ||
/// A response from a peer to some request we have sent over RTC | ||
case response(Response) |
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.
@GhenadieVP I was able to remove the RTCRoute
from here, was no needed.
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.
Awesome work 🚀 ! Added some comments that need to be addressed.
Sources/Features/AddLedgerNanoFactorSource/AddLedgerNanoFactorSource.swift
Outdated
Show resolved
Hide resolved
Sources/Features/DappInteractionFeature/Interactor/DappInteractor.swift
Outdated
Show resolved
Hide resolved
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.
Even better, only one question really.
Sources/Core/SharedModels/P2P/ConnectorExtension/ConnectorExtension+Messages.swift
Outdated
Show resolved
Hide resolved
Sources/Core/SharedModels/P2P/Application/IncomingMessage/P2P+RTCIncomingMessage.swift
Outdated
Show resolved
Hide resolved
Sources/Clients/RadixConnectClient/RadixConnectClient+Live.swift
Outdated
Show resolved
Hide resolved
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.
CasePath is a nice solution here. Since you're only using the extract part, I first wanted to say that you should take only that as an argument:
extract: @escaping (P2P.RTCMessageFromPeer) -> Case?
but since you also use the ..
composing functionality it might be worth it!
Late to the party, but awesome work 💯 🚀!!! |
(Sorry the confusing branch name...)
Description
This PR "upgrades" RadixConnect to work not only with Dapp request/response but with other request/response as well, e.g. messaging to/from ConnectorExtension for Ledger Nano commands.
Furthermore the Ledger related response and request models have been implemented.
PR submission checklist