Skip to content

Commit

Permalink
RPCHistory tests resplved
Browse files Browse the repository at this point in the history
  • Loading branch information
flypaper0 committed Jan 19, 2024
1 parent a41e93c commit 7d70977
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Sources/WalletConnectUtils/RPCHistory/RPCHistory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public final class RPCHistory {
}
}

private extension RPCHistory {
extension RPCHistory {

func removeOutdated() {
let records = storage.getAll()
Expand Down
8 changes: 3 additions & 5 deletions Tests/WalletConnectUtilsTests/RPCHistoryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ final class RPCHistoryTests: XCTestCase {
try sut.set(requestB, forTopic: String.randomTopic(), emmitedBy: .local)
try sut.resolve(responseA)
try sut.resolve(responseB)
let recordA = sut.get(recordId: requestA.id!)
let recordB = sut.get(recordId: requestB.id!)
XCTAssertEqual(recordA?.response, responseA)
XCTAssertEqual(recordB?.response, responseB)
XCTAssertNil(sut.get(recordId: requestA.id!))
XCTAssertNil(sut.get(recordId: requestB.id!))
}

func testDelete() throws {
Expand Down Expand Up @@ -95,7 +93,7 @@ final class RPCHistoryTests: XCTestCase {
}

func testResolveDuplicateResponse() throws {
let expectedError = RPCHistory.HistoryError.responseDuplicateNotAllowed
let expectedError = RPCHistory.HistoryError.requestMatchingResponseNotFound

let request = RPCRequest.stub()
let responseA = RPCResponse(matchingRequest: request, result: true)
Expand Down

0 comments on commit 7d70977

Please sign in to comment.