diff --git a/Sources/SubVTData/Service/REST/ReportService.swift b/Sources/SubVTData/Service/REST/ReportService.swift index f774bde..f6244af 100644 --- a/Sources/SubVTData/Service/REST/ReportService.swift +++ b/Sources/SubVTData/Service/REST/ReportService.swift @@ -164,4 +164,11 @@ public final class ReportService: BaseRESTService { method: .get ) } + + public func getNetworkStatus() -> ServiceResponsePublisher { + return perform( + path: "/network/status", + method: .get + ) + } } diff --git a/Tests/SubVTDataTests/ReportServiceTests.swift b/Tests/SubVTDataTests/ReportServiceTests.swift index 76a4fd7..dea5588 100644 --- a/Tests/SubVTDataTests/ReportServiceTests.swift +++ b/Tests/SubVTDataTests/ReportServiceTests.swift @@ -200,7 +200,7 @@ final class ReportServiceTests: BaseTest { testServiceCall( publisher: service.getSessionValidatorReport( validatorAccountId: validatorAccountId, - startSessionIndex: 36217 + startSessionIndex: 39931 ) ) { (reports, error) in @@ -208,7 +208,7 @@ final class ReportServiceTests: BaseTest { XCTAssertEqual(1, reports?.count ?? 0) let report = reports![0] XCTAssertNotNil(report.paraVotesSummary) - XCTAssertNotNil(report.heartbeatEvent) + XCTAssertNil(report.heartbeatEvent) } } @@ -216,8 +216,8 @@ final class ReportServiceTests: BaseTest { testServiceCall( publisher: service.getSessionValidatorReport( validatorAccountId: validatorAccountId, - startSessionIndex: 36000, - endSessionIndex: 36009 + startSessionIndex: 39950, + endSessionIndex: 39959 ) ) { (reports, error) in @@ -235,6 +235,15 @@ final class ReportServiceTests: BaseTest { } } + func test18GetNetworkStatus() { + testServiceCall( + publisher: service.getNetworkStatus() + ) { + (networkStatus, error) in + XCTAssertNil(error) + } + } + static var allTests = [ ("test01GetSingleEraReport", test01GetSingleEraReport), ("test02GetMultipleEraReport", test02GetMultipleEraReport),