forked from celestiaorg/celestia-app
-
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.
test: implements deterministic random transaction generation function (…
…celestiaorg#1975) ## Overview Closes celestiaorg#1942 Some improvement ideas: 1. This PR introduces a `rand` parameter to some of the test utilities, using which will generate some randomness internally. The type of this new parameter is currently fixed to the `Rand` type from the Tendermint package. However, an alternative approach would be to define our own Rand interface and change the `rand` parameter type (that has been added to some of the test utils in this PR) to accept any type that satisfies that interface. In this PR, I chose not to follow this approach because I wasn't sure if it would be necessary. Additionally, considering the current organization of the test utilities, introducing such an interface would only increase the complexity of the code. Nevertheless, I am open to hearing your thoughts on this matter. 2. There is significant room for improvement in the organization of the test utilities (not related to this PR). For example, we are currently using this [function](https://github.com/celestiaorg/celestia-app/blob/8146ae75f255f7bb5a2c87f32e7823d506266a53/pkg/square/builder_test.go#L78) from another test file for square fuzz testing. Ideally, such utilities are better to be consolidated under one package, and all other packages should utilize them. However, in order to maintain consistency with the existing architecture, I refrained from introducing any changes related to the code organization. As a result, I kept all the unit tests for the test helpers next to their respective locations. We can actually have another issue to discuss this aspect as well. ## Checklist - [x] New and updated code has appropriate documentation - [x] New and updated code has new and/or updated testing - [x] Required CI checks are passing - [x] Visual proof for any user facing features like CLI or documentation updates - [x] Linked issues closed with keywords
- Loading branch information
Showing
16 changed files
with
251 additions
and
77 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
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
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
Oops, something went wrong.