-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:WalletConnect/WalletConnectSwift…
…V2 into #453-invalid-signature-erroe complete testRespondSignatureVerificationFailed
- Loading branch information
Showing
14 changed files
with
224 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import Foundation | ||
|
||
public enum AuthError: Codable, Equatable, Error { | ||
case userRejeted | ||
case malformedResponseParams | ||
case malformedRequestParams | ||
case messageCompromised | ||
case signatureVerificationFailed | ||
} | ||
|
||
extension AuthError: Reason { | ||
|
||
public var code: Int { | ||
switch self { | ||
case .userRejeted: | ||
return 14001 | ||
case .malformedResponseParams: | ||
return 12001 | ||
case .malformedRequestParams: | ||
return 12002 | ||
case .messageCompromised: | ||
return 12003 | ||
case .signatureVerificationFailed: | ||
return 12004 | ||
} | ||
} | ||
|
||
public var message: String { | ||
switch self { | ||
case .userRejeted: | ||
return "Auth request rejected by user" | ||
case .malformedResponseParams: | ||
return "Response params malformed" | ||
case .malformedRequestParams: | ||
return "Request params malformed" | ||
case .messageCompromised: | ||
return "Original message compromised" | ||
case .signatureVerificationFailed: | ||
return "Message verification failed" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Foundation | ||
|
||
protocol Reason { | ||
var code: Int { get } | ||
var message: String { get } | ||
} | ||
|
Oops, something went wrong.