Skip to content
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

feat: implement txs generate and txs clear command #1988

Closed
wants to merge 15 commits into from

Conversation

harry-hov
Copy link
Contributor

@harry-hov harry-hov commented Apr 27, 2024

Adds generate and clear to gnoland genesis txs command

generate  generates addpkg txs from dir and add them to genesis.json
clear     clears all the transactions from the genesis.json

With these changes, initial set of packages can be added to genesis.json using gnoland genesis txs generate /examples. Next step is to remove genesis generation logic from gnoland start; so that gnoland start can only focus on starting the node properly.

Related: #1952

@github-actions github-actions bot added the 📦 ⛰️ gno.land Issues or PRs gno.land package related label Apr 27, 2024
Copy link

codecov bot commented Apr 27, 2024

Codecov Report

Attention: Patch coverage is 76.25000% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 48.40%. Comparing base (edb321f) to head (9d788e8).

Files Patch % Lines
gno.land/pkg/gnoland/genesis.go 0.00% 7 Missing ⚠️
gno.land/cmd/gnoland/genesis_txs_add.go 58.33% 2 Missing and 3 partials ⚠️
gno.land/cmd/gnoland/genesis_txs_generate.go 86.20% 2 Missing and 2 partials ⚠️
gno.land/cmd/gnoland/genesis_txs_clear.go 92.85% 1 Missing and 1 partial ⚠️
gno.land/pkg/integration/testing_node.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1988      +/-   ##
==========================================
- Coverage   54.64%   48.40%   -6.25%     
==========================================
  Files         578      411     -167     
  Lines       77870    62408   -15462     
==========================================
- Hits        42551    30207   -12344     
+ Misses      32149    29684    -2465     
+ Partials     3170     2517     -653     
Flag Coverage Δ
contribs/gnodev ?
contribs/gnofaucet ?
contribs/gnokeykc ?
contribs/gnomd ?
gno.land 61.97% <76.25%> (+0.33%) ⬆️
gnovm ?
misc/autocounterd ?
misc/genproto ?
misc/genstd ?
misc/goscan ?
misc/logos ?
misc/loop ?
tm2 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@harry-hov harry-hov requested a review from a team May 2, 2024 14:33
@harry-hov harry-hov marked this pull request as ready for review May 2, 2024 14:34
Copy link
Member

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR is overcomplicating already existing functionality (genesis txs). The subcommands are practically copy pasted from the mentioned command suite.

  • add - what do we accomplish with this, that we don't already with genesis txs add?
  • clear - this would've been a good addition to genesis txs
  • list - this would've been a good addition to genesis txs
  • get - I'm not sure when anybody would use this
  • del - what do we accomplish with this, that we don't already with genesis txs remove?

What I'm trying to say is -- we already had this functionality in some form or another, so there is no need to define an entirely new command suite for it (that we have to maintain). Please consider refactoring this PR to improve the existing genesis txs command suite with additional / more richer functionality 🙏

@harry-hov harry-hov requested a review from a team as a code owner June 1, 2024 00:05
@harry-hov harry-hov changed the title feat: implement genesis packages command suite feat: implement txs generate and txs clear command Jun 1, 2024
@harry-hov
Copy link
Contributor Author

harry-hov commented Jun 1, 2024

@zivkovicmilos I have applied the changes as requested

Added these subcommands to genesis txs:

generate  generates addpkg txs from dir and add them to genesis.json
clear     clears all the transactions from the genesis.json

@zivkovicmilos
Copy link
Member

Closing in favor of #2327

zivkovicmilos added a commit that referenced this pull request Jun 11, 2024
## Description

This PR introduces the ability to specify a package directory that will
recursively be added (deployed) to the `genesis.json`, utilizing the
existing `gnoland genesis txs add` command.

It also separates out the logic from `gnoland genesis txs add` into:
- `gnoland genesis txs add sheets` for individual tx sheet files (ex.
from tx-archive output)
- `gnoland genesis txs add packages` for recursively adding packages
(ex. `examples`)


![sample](https://github.com/gnolang/gno/assets/16712663/e88b363f-2911-454e-8002-46ee4cbecde6)

Related:
- #1952 
- #1988

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>

---------

Co-authored-by: Guilhem Fanton <8671905+gfanton@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 ⛰️ gno.land Issues or PRs gno.land package related
Projects
Status: Done
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants