Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
nerzh committed Nov 18, 2020
1 parent d3e17c7 commit 6fe4642
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 49 deletions.
9 changes: 1 addition & 8 deletions Tests/TonClientSwiftTests/NetTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,11 @@ final class NetTests: XCTestCase {
func testSubscribe_collection() throws {
testAsyncMethods { (client, group) in
group.enter()
// let finalizedStatus: Int = 3
// let anyFilter = AnyValue.object(
// [
// "account_addr" : AnyValue.object(["eq" : AnyValue.string(address)]),
// "status" : AnyValue.object(["eq" : AnyValue.int(finalizedStatus)])
// ])
let payload: TSDKParamsOfSubscribeCollection = .init(collection: "transactions",
filter: nil,
result: "id account_addr")
client.net.subscribe_collection(payload) { [group] (response) in
if response.result != nil {
XCTAssertTrue(response.result?.handle != nil)
if response.result?.handle != nil {
BindingStore.deleteResponseHandler(response.requestId)
group.leave()
return
Expand Down
31 changes: 0 additions & 31 deletions Tests/TonClientSwiftTests/ProcessingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ final class ProcessingTests: XCTestCase {
return
}
encodedMessage = responseResult
BindingStore.deleteResponseHandler(response.requestId)
group.leave()
}
group.wait()
Expand Down Expand Up @@ -124,36 +123,6 @@ final class ProcessingTests: XCTestCase {
Log.warn("address - ", result.address)
self.getGramsFromGiverSync(client, result.address)

var tokensReceived: Bool = false
var fuseCounter: Int = 0
while !tokensReceived {
group.enter()
let paramsOfWaitForCollection: TSDKParamsOfWaitForCollection = .init(collection: "accounts",
filter: .object(["id": .object(
[
"eq": .string(result.address)
])
]),
result: "id balance(format: DEC)",
timeout: nil)
client.net.wait_for_collection(paramsOfWaitForCollection) { (response) in
if let result = response.result?.result.toDictionary(), let balance: Int = Int(result["balance"] as? String ?? "") {
if balance > 0 {
tokensReceived = true
}
}
if response.finished {
group.leave()
}
}
group.wait()
fuseCounter += 1
if fuseCounter > 20 && !tokensReceived {
tokensReceived = true
XCTAssertTrue(false, "Tokens does not received form giver")
}
}

let payloadProcessMessage: TSDKParamsOfProcessMessage = .init(message_encode_params: payloadEncodeMessage, send_events: true)
var resultOfProcessMessage: TSDKResultOfProcessMessage?
group.enter()
Expand Down
10 changes: 5 additions & 5 deletions Tests/TonClientSwiftTests/TvmTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ final class TvmTests: XCTestCase {
nameTvc: nil,
address: resultOfEncodeMessage.address,
public: keys.public,
secret: keys.secret,
signerType: .Keys,
callSetFunction_name: "getSubscription",
callSetHeader: nil,
callSetInput: checkSubscribeParams)
secret: keys.secret,
signerType: .Keys,
callSetFunction_name: "getSubscription",
callSetHeader: nil,
callSetInput: checkSubscribeParams)
let paramsOfRunTvm: TSDKParamsOfRunTvm = .init(messageEncodedBase64: checkSubscriptionEncodeMessage.message,
accountEncodedBase64: account,
execution_options: nil,
Expand Down
10 changes: 5 additions & 5 deletions Tests/TonClientSwiftTests/UtilsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ final class UtilsTests: XCTestCase {
}


let accountId: String = "fcb91a3a3816d0f7b8c2c76108b8a9bc5a6b7a55bd79f8ab101c52db29232260";
let hex: String = "-1:fcb91a3a3816d0f7b8c2c76108b8a9bc5a6b7a55bd79f8ab101c52db29232260";
let hexWorkchain0: String = "0:fcb91a3a3816d0f7b8c2c76108b8a9bc5a6b7a55bd79f8ab101c52db29232260";
let base64: String = "Uf/8uRo6OBbQ97jCx2EIuKm8Wmt6Vb15+KsQHFLbKSMiYG+9";
let base64url: String = "kf_8uRo6OBbQ97jCx2EIuKm8Wmt6Vb15-KsQHFLbKSMiYIny";
let accountId: String = "fcb91a3a3816d0f7b8c2c76108b8a9bc5a6b7a55bd79f8ab101c52db29232260"
let hex: String = "-1:fcb91a3a3816d0f7b8c2c76108b8a9bc5a6b7a55bd79f8ab101c52db29232260"
let hexWorkchain0: String = "0:fcb91a3a3816d0f7b8c2c76108b8a9bc5a6b7a55bd79f8ab101c52db29232260"
let base64: String = "Uf/8uRo6OBbQ97jCx2EIuKm8Wmt6Vb15+KsQHFLbKSMiYG+9"
let base64url: String = "kf_8uRo6OBbQ97jCx2EIuKm8Wmt6Vb15-KsQHFLbKSMiYIny"
}

0 comments on commit 6fe4642

Please sign in to comment.