Skip to content

Commit

Permalink
Merge pull request #127 from gnosis/rename-protocol
Browse files Browse the repository at this point in the history
Renamed protocol
  • Loading branch information
Dmitry Bespalov authored Jul 12, 2022
2 parents 51c62d9 + 2705926 commit 14c4d3e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/PublicInterface/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public protocol ClientDelegate: AnyObject {
func client(_ client: Client, didUpdate session: Session)
}

public protocol Client2Delegate: ClientDelegate {
public protocol ClientDelegateV2: ClientDelegate {
func client(_ client: Client, dappInfoForUrl url: WCURL) -> Session.DAppInfo?
func client(_ client: Client, willReconnect session: Session)
}
Expand Down Expand Up @@ -192,7 +192,7 @@ public class Client: WalletConnect {
delegate?.client(self, didConnect: existingSession)
} else {
// establishing new connection, handshake in process
guard let dappInfo = commonDappInfo ?? (delegate as? Client2Delegate)?.client(self, dappInfoForUrl: url) else {
guard let dappInfo = commonDappInfo ?? (delegate as? ClientDelegateV2)?.client(self, dappInfoForUrl: url) else {
LogService.shared.log("WC: dAppInfo not found for \(url)")
delegate?.client(self, didFailToConnect: url)
return
Expand All @@ -212,7 +212,7 @@ public class Client: WalletConnect {
do {
let walletInfo = try response.result(as: Session.WalletInfo.self)

guard let dappInfo = commonDappInfo ?? (delegate as? Client2Delegate)?.client(self, dappInfoForUrl: response.url) else {
guard let dappInfo = commonDappInfo ?? (delegate as? ClientDelegateV2)?.client(self, dappInfoForUrl: response.url) else {
LogService.shared.log("WC: dAppInfo not found for \(response.url)")
return
}
Expand Down Expand Up @@ -309,7 +309,7 @@ public class Client: WalletConnect {
}

override func willReconnect(_ session: Session) {
if let delegate = delegate as? Client2Delegate {
if let delegate = delegate as? ClientDelegateV2 {
delegate.client(self, willReconnect: session)
}
}
Expand Down

0 comments on commit 14c4d3e

Please sign in to comment.