Refactor similar types for query
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 209
- Forks
- 87
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 3
Description
We should make sure we don't define similar types, one example is BlockQuery and ScriptQuery. They can both be represented by BlockQuery. Another maybe better approach would be to introduce builder parameters. So we could call a function like so: ExecuteScript(ctx, script, AtHeight(100)) or ExecuteScript(ctx, script) (for latest).
The other problem with the current implementation no matter the above-taken approach is that it doesn't provide sensible defaults. That should be improved, and with functional arguments can be done as in the example.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in flowkit/flowkit.go, at BlockQuery and ScriptQuery, and trace their query call sites. Compare consolidating the types with introducing builder or functional parameters, including the requested latest-value defaults. Done means similar query types are no longer duplicated and query execution has sensible defaults, but the issue does not identify tests to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100