Skip to content

Commit 298bd77

Browse files
committed
improve tests
1 parent 2017156 commit 298bd77

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Blockchain/Tests/BlockchainTests/ValidatorServiceTests.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ struct ValidatorServiceTests {
8989
}
9090

9191
// try different genesis time offset to ensure edge cases are covered
92-
@Test(arguments: [988, 1000, 1003, 1020])
92+
@Test(arguments: [988, 1000, 1003, 1021])
9393
func makeManyBlocks(time: Int) async throws {
9494
let (services, validatorService) = try await setup(time: TimeInterval(time))
9595
let genesisState = services.genesisState
@@ -101,7 +101,10 @@ struct ValidatorServiceTests {
101101

102102
await storeMiddleware.wait()
103103

104-
await scheduler.advance(by: TimeInterval(config.value.slotPeriodSeconds) * 25 - 1)
104+
for _ in 0 ..< 25 {
105+
await scheduler.advance(by: TimeInterval(config.value.slotPeriodSeconds))
106+
await storeMiddleware.wait() // let events to be processed
107+
}
105108

106109
let events = await storeMiddleware.wait()
107110

Utils/Sources/Utils/FixedSizeData.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ extension FixedSizeData: CustomStringConvertible, CustomDebugStringConvertible {
4242
}
4343

4444
public var debugDescription: String {
45-
"Data\(T.value)(\(description))"
45+
description
4646
}
4747
}
4848

0 commit comments

Comments
 (0)