Skip to content

Commit 805216e

Browse files
committed
test: fix JSONRPC mock generics
Signed-off-by: William Richter <[email protected]>
1 parent 802fad6 commit 805216e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

fearlessTests/Mocks/JSONRPCEngineMock.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class MockJSONRPCEngine: JSONRPCEngine, Cuckoo.ProtocolMock, @unchecked Sendable
4747
}
4848
}
4949

50-
func callMethod<P: Encodable, T: Decodable>(
50+
func callMethod<P: Codable, T: Decodable>(
5151
_ method: String,
5252
params: P?,
5353
options: JSONRPCOptions,
@@ -66,7 +66,7 @@ class MockJSONRPCEngine: JSONRPCEngine, Cuckoo.ProtocolMock, @unchecked Sendable
6666
)
6767
}
6868

69-
func subscribe<P: Encodable, T: Decodable>(
69+
func subscribe<P: Codable, T: Decodable>(
7070
_ method: String,
7171
params: P?,
7272
updateClosure: @escaping (T) -> Void,
@@ -165,7 +165,7 @@ class MockJSONRPCEngine: JSONRPCEngine, Cuckoo.ProtocolMock, @unchecked Sendable
165165
params: M2,
166166
options: M3,
167167
completion closure: M4
168-
) -> Cuckoo.ProtocolStubThrowingFunction<(String, P?, JSONRPCOptions, ((Result<T, Error>) -> Void)?), UInt16>
168+
) -> Cuckoo.ProtocolStubThrowingFunction<(String, P?, JSONRPCOptions, ((Result<T, Error>) -> Void)?), UInt16,Swift.Error>
169169
where
170170
M1.MatchedType == String,
171171
M2.OptionalMatchedType == P,
@@ -190,7 +190,7 @@ class MockJSONRPCEngine: JSONRPCEngine, Cuckoo.ProtocolMock, @unchecked Sendable
190190
params: M2,
191191
updateClosure: M3,
192192
failureClosure: M4
193-
) -> Cuckoo.ProtocolStubThrowingFunction<(String, P?, (T) -> Void, (Error, Bool) -> Void), UInt16>
193+
) -> Cuckoo.ProtocolStubThrowingFunction<(String, P?, (T) -> Void, (Error, Bool) -> Void), UInt16,Swift.Error>
194194
where
195195
M1.MatchedType == String,
196196
M2.OptionalMatchedType == P,
@@ -404,7 +404,7 @@ class JSONRPCEngineStub: JSONRPCEngine, @unchecked Sendable {
404404
var url: URL?
405405
var pendingEngineRequests: [JSONRPCRequest] { return DefaultValueRegistry.defaultValue(for: ([JSONRPCRequest]).self) }
406406

407-
func callMethod<P: Encodable, T: Decodable>(
407+
func callMethod<P: Codable, T: Decodable>(
408408
_ method: String,
409409
params: P?,
410410
options: JSONRPCOptions,
@@ -413,7 +413,7 @@ class JSONRPCEngineStub: JSONRPCEngine, @unchecked Sendable {
413413
return DefaultValueRegistry.defaultValue(for: (UInt16).self)
414414
}
415415

416-
func subscribe<P: Encodable, T: Decodable>(
416+
func subscribe<P: Codable, T: Decodable>(
417417
_ method: String,
418418
params: P?,
419419
updateClosure: @escaping (T) -> Void,

0 commit comments

Comments
 (0)