-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge duplicate definitions with testutil #1073
Comments
@evan-forbes @rootulp let me know if this proposal works. I have started working on the changes and can raise a PR if no concerns. Also, couldn't find any epic to link this issue, can someone point me to that if any?
Ref:
|
I don't think this falls into an existing epic but we can def answer your other questions without an epic assigned.
I get confused by the number of testutil things in this repo. I like your name proposal for a
I don't think there's a ton of value to be gained by consolidating constants used in test files but I'm not against it. For a bit of context, a PR author may create a new constant while writings tests for their PR because they're unaware that another constant may suffice. I think there is value in consolidating all the
If not in use, let's delete it 🪓 . CI should fail if it is needed. |
## Overview Closes #1073 Affected packages 1. `pkg` -> `shares` & `prove` - Remove duplicated `generateRandomTransaction`, `generateRandomlySizedTransactions`, `generateRandomBlob`, and `generateRandomlySizedBlobs` 2. `testutil` - Add `factory` package with generator method for the random transaction(s) and random blob(s) - Deprecate blobtestutil - Remove duplicated `GenerateKeyringSigner` and `generateKeyring` methods 3. `x/blob/types` - Refactor keyring generator method in separate file `test_util.go` - Reuse keyring generators from `x/blob/types` in `app` package - Use constants instead of hardcoded strings for the test account and chain id 4. `app`/`app_test` - Refactor all helper generate methods in `app` package's `test_util.go` - Reuse keyring generators from `blobtypes` - Simplify some of the helper generateTxs methods ## 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
Subtask for #832
Found duplicated function definitions for
generateRandomlySizedTransactions
andgenerateRandomlySizedBlobs
Example ref:
generateRandomlySizedTransaction(s)
celestia-app/pkg/shares/shares_test.go
Line 109 in 8b3dacb
celestia-app/pkg/shares/shares_test.go
Line 121 in 8b3dacb
celestia-app/pkg/prove/proof_test.go
Line 189 in 8b3dacb
celestia-app/pkg/prove/proof_test.go
Line 201 in 8b3dacb
Identified Duplicates:
generateRandomlySizedTransactions
,generateRandomlySizedTxs
shares
,prove
generateRandomTransaction
,generateRandomTxs
shares
,prove
generateRandomlySizedBlobs
shares
,prove
generateRandomBlob
shares
,prove
GenerateKeyringSigner
,generateKeyringSigner
,generateKeyring
app
,app_test
,testutil
,x/blob/types
GenerateManyRawWirePFB
,GenerateManyRawSendTxs
,generateRawTx
,generateManyRawWirePFB
,generateManyRawSendTxs
app
,app_test
,blobtestutil
Proposal:
factory
package insidetestutil
and move all these generators to factory packageThe text was updated successfully, but these errors were encountered: