forked from exonum/exonum
-
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.
SandboxBuilder and tests for dynamic propose timeout [ECR-2033] (exon…
…um#850) * Introduce SandboxBuilder This commit introduces a new way to configure Sandbox for tests. Currently most of the tests use timestamping_sandbox() function which creates the default Sandbox environment. However, some tests may have different needs. SandboxBuilder introduces a consistent way of configuring the sandbox. SandboxBuilder in its current form does not introduce any new features, supporting only current use cases. Existing code is updated to use the builder. - Function sandbox_with_services_uninitialized() has been made private and sandbox_with_services() has been removed. - Function timestamping_sandbox() remains available as it used almost everywhere. It still provides a default sandbox configuration. - New function timestamping_sandbox_builder() returns a builder with the same configuration as for timestamping_sandbox(). This may be useful if you only want to tweak the default sandbox. * Tweakable ConsensusConfig in SandboxBuilder Currently builder's implementaion is still one giant tangle of code in sandbox_with_services_uninitialized(). This shows how we can extract parts of the configuration and make them tweakable from within the builder. * Add tests for expedited Proposal injection Here is main course of this patch set. We add some tests to verify that Proposals are actually injected with minimal timeout if the transaction pool goes over the threshold. For this we will need to tweak the default sandbox configuration so that proposal values make more sense. However, we must take care to not touch the rest of tests which rely on the default behavior. * Reformat code according to cargo +1.27.0 fmt We're still using 'oldstable' version of Rust on the CI server and it expects the code to be formatted in accordance with 1.27 which is different from the new 1.28 format.
- Loading branch information
1 parent
674cbad
commit 9493c50
Showing
3 changed files
with
149 additions
and
31 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
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