forked from gnolang/gno
-
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.
feat: add genesis command suite (gnolang#1252)
## Description This PR introduces the genesis.json command suite, as outlined in gnolang#1203. Closes gnolang#1203 and gnolang#1189 <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>
- Loading branch information
1 parent
f3d63e1
commit e7b87e2
Showing
32 changed files
with
4,220 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
|
||
"github.com/gnolang/gno/tm2/pkg/commands" | ||
) | ||
|
||
type balancesCfg struct { | ||
commonCfg | ||
} | ||
|
||
// newBalancesCmd creates the genesis balances subcommand | ||
func newBalancesCmd(io *commands.IO) *commands.Command { | ||
cfg := &balancesCfg{} | ||
|
||
cmd := commands.NewCommand( | ||
commands.Metadata{ | ||
Name: "balances", | ||
ShortUsage: "balances <subcommand> [flags]", | ||
LongHelp: "Manipulates the initial genesis.json account balances (pre-mines)", | ||
ShortHelp: "Manages genesis.json account balances", | ||
}, | ||
cfg, | ||
commands.HelpExec, | ||
) | ||
|
||
cmd.AddSubCommands( | ||
newBalancesAddCmd(cfg, io), | ||
newBalancesRemoveCmd(cfg, io), | ||
newBalancesExportCmd(cfg, io), | ||
) | ||
|
||
return cmd | ||
} | ||
|
||
func (c *balancesCfg) RegisterFlags(fs *flag.FlagSet) { | ||
c.commonCfg.RegisterFlags(fs) | ||
} |
Oops, something went wrong.