forked from bosagora/agora
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
67 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/******************************************************************************* | ||
Contains the simplest empty block creating test | ||
Copyright: | ||
Copyright (c) 2019-2021 BOSAGORA Foundation | ||
All rights reserved. | ||
License: | ||
MIT License. See LICENSE for details. | ||
*******************************************************************************/ | ||
|
||
module agora.test.EmptyBlocks; | ||
|
||
version (unittest): | ||
|
||
import agora.api.Validator; | ||
import agora.consensus.data.Transaction; | ||
import agora.test.Base; | ||
|
||
/// EmptyBlocks test | ||
unittest | ||
{ | ||
auto network = makeTestNetwork!TestAPIManager(TestConf.init); | ||
network.start(); | ||
scope(exit) network.shutdown(); | ||
scope(failure) network.printLogs(); | ||
network.waitForDiscovery(); | ||
|
||
auto nodes = network.clients; | ||
auto node_1 = nodes[0]; | ||
|
||
// Create blocks for 2 validator cycles and a couple more | ||
auto target_height = Height(2 * GenesisValidatorCycle + 2); | ||
network.generateBlocks(target_height, true); | ||
network.assertSameBlocks(target_height); | ||
} |