Skip to content

Commit

Permalink
fix errorReuslt
Browse files Browse the repository at this point in the history
  • Loading branch information
xueyuejie committed Oct 27, 2022
1 parent 4bc7dd6 commit 8a58f3a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/AptosSwift/Clients/AptosClient+Models.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import AnyCodable

extension AptosClient {
public struct Error: Decodable {
public let code: Int
public let errorCode: String
public let message: String
}

Expand Down
17 changes: 17 additions & 0 deletions Tests/AptosSwiftTests/AptosSwiftTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,21 @@ final class AptosSwiftTests: XCTestCase {
}
wait(for: [reqeustExpectation], timeout: 30)
}
func testGetResourceExamples() throws {
let reqeustExpectation = expectation(description: "Tests")
let client = AptosClient(url: self.nodeUrl)
let account = try! AptosAddress("0xa2e71c2e63610a0483b9e2dacec2d3072ee9a0dd8f9cd62df5a2298b44ead2c7")
let usdtResource = "0x1::coin::CoinStore<0xf22bede237a07e121b56d91a491eb7bcdfd1f5907926a9e58338f964a01b17fa::asset::USDT>"
DispatchQueue.global().async {
do {
let accountResource = try client.getAccountResource(address: account, resourceType: usdtResource).wait()
print(accountResource.type)
reqeustExpectation.fulfill()
} catch let error {
print(error.localizedDescription)
reqeustExpectation.fulfill()
}
}
wait(for: [reqeustExpectation], timeout: 30)
}
}

0 comments on commit 8a58f3a

Please sign in to comment.