Skip to content

Commit

Permalink
savepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
llbartekll committed Feb 14, 2024
1 parent 00578da commit 731b74c
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions Example/IntegrationTests/Push/NotifyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -245,29 +245,29 @@ final class NotifyTests: XCTestCase {
}
}

func testFetchHistory() async throws {
let subscribeExpectation = expectation(description: "fetch notify subscription")
let account = Account("eip155:1:0x622b17376F76d72C43527a917f59273247A917b4")!

var subscription: NotifySubscription!
walletNotifyClientA.subscriptionsPublisher
.sink { subscriptions in
subscription = subscriptions.first
subscribeExpectation.fulfill()
}.store(in: &publishers)

try await walletNotifyClientA.register(account: account, domain: gmDappDomain) { message in
let privateKey = Data(hex: "c3ff8a0ae33ac5d58e515055c5870fa2f220d070997bd6fd77a5f2c148528ff0")
let signer = MessageSignerFactory(signerFactory: DefaultSignerFactory()).create(projectId: InputConfig.projectId)
return try! signer.sign(message: message, privateKey: privateKey, type: .eip191)
}

await fulfillment(of: [subscribeExpectation], timeout: InputConfig.defaultTimeout)

let hasMore = try await walletNotifyClientA.fetchHistory(subscription: subscription, after: nil, limit: 20)
XCTAssertTrue(hasMore)
XCTAssertTrue(walletNotifyClientA.getMessageHistory(topic: subscription.topic).count == 20)
}
// func testFetchHistory() async throws {
// let subscribeExpectation = expectation(description: "fetch notify subscription")
// let account = Account("eip155:1:0x622b17376F76d72C43527a917f59273247A917b4")!
//
// var subscription: NotifySubscription!
// walletNotifyClientA.subscriptionsPublisher
// .sink { subscriptions in
// subscription = subscriptions.first
// subscribeExpectation.fulfill()
// }.store(in: &publishers)
//
// try await walletNotifyClientA.register(account: account, domain: gmDappDomain) { message in
// let privateKey = Data(hex: "c3ff8a0ae33ac5d58e515055c5870fa2f220d070997bd6fd77a5f2c148528ff0")
// let signer = MessageSignerFactory(signerFactory: DefaultSignerFactory()).create(projectId: InputConfig.projectId)
// return try! signer.sign(message: message, privateKey: privateKey, type: .eip191)
// }
//
// await fulfillment(of: [subscribeExpectation], timeout: InputConfig.defaultTimeout)
//
// let hasMore = try await walletNotifyClientA.fetchHistory(subscription: subscription, after: nil, limit: 20)
// XCTAssertTrue(hasMore)
// XCTAssertTrue(walletNotifyClientA.getMessageHistory(topic: subscription.topic).count == 20)
// }
}


Expand Down

0 comments on commit 731b74c

Please sign in to comment.