Skip to content

Commit 1f7c168

Browse files
committed
test fix
1 parent 929bb0c commit 1f7c168

File tree

3 files changed

+16
-91
lines changed

3 files changed

+16
-91
lines changed

FearlessTestCaravan/ChainModelsEquatableTests.swift

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ final class ChainSyncServiceTests: XCTestCase, EventVisitorProtocol {
1010
private var service: fearless.ChainSyncService?
1111
private let eventCenter = EventCenter.shared
1212

13-
private var expectation = XCTestExpectation()
13+
private var rootInteractorExpectation: XCTestExpectation?
14+
private var testExpectation: XCTestExpectation?
1415
private var newOrUpdatedChainsCount: Int?
1516
private var removedChainsCount: Int?
1617

@@ -46,18 +47,25 @@ final class ChainSyncServiceTests: XCTestCase, EventVisitorProtocol {
4647
}
4748

4849
func testEquatable() throws {
50+
rootInteractorExpectation = XCTestExpectation()
51+
wait(for: [rootInteractorExpectation].compactMap { $0 }, timeout: 1)
4952
service?.syncUp()
50-
expectation.expectedFulfillmentCount = 2
51-
wait(for: [expectation], timeout: 1)
53+
testExpectation = XCTestExpectation()
54+
wait(for: [testExpectation].compactMap { $0 }, timeout: 1)
5255
XCTAssertEqual(newOrUpdatedChainsCount, 0)
5356
XCTAssertEqual(removedChainsCount, 0)
5457
}
5558

5659
// MARK: - EventVisitorProtocol
5760

5861
func processChainSyncDidComplete(event: ChainSyncDidComplete) {
59-
newOrUpdatedChainsCount = event.newOrUpdatedChains.count
60-
removedChainsCount = event.removedChains.count
61-
expectation.fulfill()
62+
if let rootInteractorExpectation {
63+
rootInteractorExpectation.fulfill()
64+
}
65+
if let testExpectation {
66+
testExpectation.fulfill()
67+
newOrUpdatedChainsCount = event.newOrUpdatedChains.count
68+
removedChainsCount = event.removedChains.count
69+
}
6270
}
6371
}

fearless/Common/Services/ChainRegistry/ChainSyncService.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ final class ChainSyncService {
7171
let event = ChainSyncDidStart()
7272
eventCenter.notify(with: event)
7373

74+
isSyncing = true
7475
executeSync()
7576
}
7677

@@ -82,7 +83,7 @@ final class ChainSyncService {
8283
}
8384

8485
private func executeSync() {
85-
if Self.fetchLocalData {
86+
if Self.fetchLocalData || ProcessInfo.processInfo.environment["XCTestConfigurationFilePath"] != nil {
8687
do {
8788
let localData = try fetchLocalData()
8889
handle(remoteChains: localData)

fearless/Modules/LiquidityPools/LiquidityPoolDetails/Resources/chains.json

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -7604,90 +7604,6 @@
76047604
"icon": "https://raw.githubusercontent.com/soramitsu/shared-features-utils/master/icons/chains/white/Enjin.svg",
76057605
"addressPrefix": 2135
76067606
},
7607-
{
7608-
"disabled": false,
7609-
"chainId": "6bd89e052d67a45bb60a9a23e8581053d5e0d619f15cb9865946937e690c42d6",
7610-
"name": "Liberland",
7611-
"assets": [
7612-
{
7613-
"id": "a6b83d39-a488-4b34-8352-280705a792ea",
7614-
"name": "liberland dollar",
7615-
"symbol": "lld",
7616-
"precision": 12,
7617-
"priceId": "liberland-lld",
7618-
"icon": "https://raw.githubusercontent.com/soramitsu/shared-features-utils/master/icons/tokens/coloured/LLD.svg",
7619-
"color": "00437F",
7620-
"isUtility": true,
7621-
"type": "normal"
7622-
},
7623-
{
7624-
"id": "30b43eb9-36b4-4b40-bf72-330d2e20ee86",
7625-
"name": "liberland merit",
7626-
"symbol": "llm",
7627-
"precision": 12,
7628-
"currencyId": "1",
7629-
"icon": "https://raw.githubusercontent.com/soramitsu/shared-features-utils/master/icons/tokens/coloured/LLM.svg",
7630-
"color": "EFB900",
7631-
"type": "assets"
7632-
},
7633-
{
7634-
"id": "2e7179c9-4308-420e-a654-43c92d119717",
7635-
"name": "sora xor",
7636-
"symbol": "xor",
7637-
"precision": 12,
7638-
"currencyId": "774441749",
7639-
"icon": "https://raw.githubusercontent.com/soramitsu/shared-features-utils/master/icons/tokens/coloured/XOR.svg",
7640-
"color": "EE2233",
7641-
"type": "assets"
7642-
}
7643-
],
7644-
"xcm": {
7645-
"xcmVersion": "v3",
7646-
"availableAssets": [
7647-
{
7648-
"id": "a6b83d39-a488-4b34-8352-280705a792e",
7649-
"symbol": "LLD"
7650-
},
7651-
{
7652-
"id": "30b43eb9-36b4-4b40-bf72-330d2e20ee86",
7653-
"symbol": "LLM"
7654-
},
7655-
{
7656-
"id": "2e7179c9-4308-420e-a654-43c92d119717",
7657-
"symbol": "XOR"
7658-
}
7659-
],
7660-
"availableDestinations": [
7661-
{
7662-
"chainId": "7e4e32d0feafd4f9c9414b0be86373f9a1efa904809b683453a9af6856d38ad5",
7663-
"assets": [
7664-
{
7665-
"id": "a6b83d39-a488-4b34-8352-280705a792e",
7666-
"symbol": "LLD",
7667-
"minAmount": "1000000000000"
7668-
},
7669-
{
7670-
"id": "30b43eb9-36b4-4b40-bf72-330d2e20ee86",
7671-
"symbol": "LLM"
7672-
},
7673-
{
7674-
"id": "2e7179c9-4308-420e-a654-43c92d119717",
7675-
"symbol": "XOR"
7676-
}
7677-
7678-
]
7679-
}
7680-
]
7681-
},
7682-
"nodes": [
7683-
{
7684-
"url": "wss://mainnet.liberland.org",
7685-
"name": "Liberland node"
7686-
}
7687-
],
7688-
"icon": "https://raw.githubusercontent.com/soramitsu/shared-features-utils/master/icons/chains/white/liberland.svg",
7689-
"addressPrefix": 42
7690-
},
76917607
{
76927608
"disabled": false,
76937609
"chainId": "f3c7ad88f6a80f366c4be216691411ef0622e8b809b1046ea297ef106058d4eb",

0 commit comments

Comments
 (0)