Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
llbartekll committed Jan 19, 2022
1 parent c3b4de4 commit 7083b19
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions Sources/WalletConnect/Relay/WalletConnectRelay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ protocol WalletConnectRelaying: AnyObject {
var transportConnectionPublisher: AnyPublisher<Void, Never> {get}
var wcRequestPublisher: AnyPublisher<WCRequestSubscriptionPayload, Never> {get}
func request(_ wcMethod: WCMethod, onTopic topic: String, completion: ((Result<JSONRPCResponse<AnyCodable>, JSONRPCErrorResponse>)->())?)
func request(topic: String, payload: WCRequest, completion: ((Result<JSONRPCResponse<AnyCodable>, JSONRPCErrorResponse>)->())?)
func respond(topic: String, response: JsonRpcResponseTypes, completion: @escaping ((Error?)->()))
func subscribe(topic: String)
func unsubscribe(topic: String)
Expand Down
4 changes: 2 additions & 2 deletions Sources/WalletConnect/Types/WCRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ struct WCRequest: Codable {
case method
case params
}

internal init(method: Method, params: Params, id: Int64 = generateId(), jsonrpc: String = "2.0") {
internal init(id: Int64 = generateId(), jsonrpc: String = "2.0", method: Method, params: Params) {
self.id = id
self.jsonrpc = jsonrpc
self.method = method
Expand Down
6 changes: 3 additions & 3 deletions Tests/WalletConnectTests/TestsData/SerialiserTestData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ enum SerialiserTestData {
Data(hex: "14aa7f6034dd0213be5901b472f461769855ac1e2f6bec6a8ed1157a9da3b2df08802cbd6e0d030d86ff99011040cfc831eec3636c1d46bfc22cbe055560fea3")
static let serialisedMessage = "f0d00d4274a7e9711e4e0f21820b887745c59ad0c053925072f4503a39fe579ca8b7b8fa6bf0c7297e6db8f6585ee77ffc6d3106fa827043279f9db08cd2e29a988c7272fa3cfdb739163bb9606822c714aa7f6034dd0213be5901b472f461769855ac1e2f6bec6a8ed1157a9da3b2df08802cbd6e0d030d86ff99011040cfc831eec3636c1d46bfc22cbe055560fea3"
static let pairingApproveJSONRPCRequest = WCRequest(
id: 0,
jsonrpc: "2.0",
method: WCRequest.Method.pairingApprove,
params: WCRequest.Params.pairingApprove(
PairingType.ApprovalParams(
Expand All @@ -24,9 +26,7 @@ enum SerialiserTestData {
name: "iOS",
description: nil,
url: nil,
icons: nil)))),
id: 0,
jsonrpc: "2.0"
icons: nil))))
)

static let pairingApproveJSON = """
Expand Down
2 changes: 1 addition & 1 deletion Tests/WalletConnectTests/WCRelayTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ extension WalletConnectRelayTests {
let wcRequestId: Int64 = 123456
let sessionPayloadParams = SessionType.PayloadParams(request: SessionType.PayloadParams.Request(method: "method", params: AnyCodable("params")), chainId: "")
let params = WCRequest.Params.sessionPayload(sessionPayloadParams)
let wcRequest = WCRequest(method: WCRequest.Method.sessionPayload, params: params, id: wcRequestId)
let wcRequest = WCRequest(id: wcRequestId, method: WCRequest.Method.sessionPayload, params: params)
return wcRequest
}
}
Expand Down

0 comments on commit 7083b19

Please sign in to comment.