Skip to content

Commit

Permalink
improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xlc committed Oct 22, 2024
1 parent 2017156 commit 298bd77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Blockchain/Tests/BlockchainTests/ValidatorServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ struct ValidatorServiceTests {
}

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

await storeMiddleware.wait()

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

let events = await storeMiddleware.wait()

Expand Down
2 changes: 1 addition & 1 deletion Utils/Sources/Utils/FixedSizeData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extension FixedSizeData: CustomStringConvertible, CustomDebugStringConvertible {
}

public var debugDescription: String {
"Data\(T.value)(\(description))"
description
}
}

Expand Down

0 comments on commit 298bd77

Please sign in to comment.