Skip to content

Commit b0880c5

Browse files
[trello.com/c/XEj672SB] fix: node status
1 parent 348963b commit b0880c5

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

Adamant/Modules/Wallets/Lisk/LskApiCore.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ class LskApiCore: BlockchainHealthCheckableService {
4949
func getStatusInfo(node: CommonKit.Node) async -> WalletServiceResult<NodeStatusInfo> {
5050
let startTimestamp = Date.now.timeIntervalSince1970
5151

52-
return await request(node: node) { client, completion in
53-
LiskKit.Node(client: client).info { completion($0) }
52+
return await request(node: node) { client in
53+
try await LiskKit.Node(client: client).info()
5454
}.map { model in
55-
.init(
56-
ping: Date.now.timeIntervalSince1970 - startTimestamp,
57-
height: model.data.height ?? .zero,
58-
wsEnabled: false,
59-
wsPort: nil,
60-
version: nil
61-
)
55+
.init(
56+
ping: Date.now.timeIntervalSince1970 - startTimestamp,
57+
height: model.height ?? .zero,
58+
wsEnabled: false,
59+
wsPort: nil,
60+
version: nil
61+
)
6262
}
6363
}
6464
}

LiskKit/Sources/API/Node/Node.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ extension Node {
3333
extension Node {
3434

3535
/// Retrieve the status of a Lisk Node
36-
public func status(completionHandler: @escaping (Response<NodeStatusResponse>) -> Void) {
37-
client.get(path: "node/status", completionHandler: completionHandler)
38-
}
39-
40-
public func info(completionHandler: @escaping (Response<NodeInfoResponse>) -> Void) {
41-
client.get(path: "node/info", completionHandler: completionHandler)
36+
public func info() async throws -> NodeInfoModel {
37+
try await client.request(method: "system_getNodeInfo", params: [:])
4238
}
4339
}

LiskKit/Sources/API/Service/Service.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public struct Service: APIService {
3535
extension Service {
3636

3737
public func getFees(completionHandler: @escaping (Response<ServiceFeeResponse>) -> Void) {
38-
client.get(path: "\(Version.v2.rawValue)/fees", completionHandler: completionHandler)
38+
client.get(path: "\(Version.v3.rawValue)/fees", completionHandler: completionHandler)
3939
}
4040

4141
public func exist(address: String, completionHandler: @escaping (Response<ExistModel>) -> Void) {

0 commit comments

Comments
 (0)