From 91dcd1247e217b023e107e50af452db3896fadf7 Mon Sep 17 00:00:00 2001 From: Milos Zivkovic Date: Thu, 18 Apr 2024 17:59:59 +0200 Subject: [PATCH 1/3] Move genesis to gnoland genesis --- gno.land/cmd/{genesis => gnoland}/balances.go | 0 .../cmd/{genesis => gnoland}/balances_add.go | 0 .../{genesis => gnoland}/balances_add_test.go | 7 +++++++ .../cmd/{genesis => gnoland}/balances_export.go | 0 .../{genesis => gnoland}/balances_export_test.go | 4 ++++ .../cmd/{genesis => gnoland}/balances_remove.go | 0 .../{genesis => gnoland}/balances_remove_test.go | 4 ++++ gno.land/cmd/{genesis => gnoland}/generate.go | 0 .../cmd/{genesis => gnoland}/generate_test.go | 7 +++++++ .../cmd/{genesis/main.go => gnoland/genesis.go} | 16 ++++------------ gno.land/cmd/gnoland/root.go | 1 + gno.land/cmd/{genesis => gnoland}/txs.go | 0 gno.land/cmd/{genesis => gnoland}/txs_add.go | 0 .../cmd/{genesis => gnoland}/txs_add_test.go | 6 ++++++ gno.land/cmd/{genesis => gnoland}/txs_export.go | 0 .../cmd/{genesis => gnoland}/txs_export_test.go | 4 ++++ gno.land/cmd/{genesis => gnoland}/txs_remove.go | 0 .../cmd/{genesis => gnoland}/txs_remove_test.go | 4 ++++ gno.land/cmd/{genesis => gnoland}/types.go | 0 gno.land/cmd/{genesis => gnoland}/validator.go | 0 .../cmd/{genesis => gnoland}/validator_add.go | 12 ++++++------ .../{genesis => gnoland}/validator_add_test.go | 10 +++++++++- .../cmd/{genesis => gnoland}/validator_remove.go | 0 .../validator_remove_test.go | 4 ++++ gno.land/cmd/{genesis => gnoland}/verify.go | 0 gno.land/cmd/{genesis => gnoland}/verify_test.go | 5 +++++ 26 files changed, 65 insertions(+), 19 deletions(-) rename gno.land/cmd/{genesis => gnoland}/balances.go (100%) rename gno.land/cmd/{genesis => gnoland}/balances_add.go (100%) rename gno.land/cmd/{genesis => gnoland}/balances_add_test.go (99%) rename gno.land/cmd/{genesis => gnoland}/balances_export.go (100%) rename gno.land/cmd/{genesis => gnoland}/balances_export_test.go (98%) rename gno.land/cmd/{genesis => gnoland}/balances_remove.go (100%) rename gno.land/cmd/{genesis => gnoland}/balances_remove_test.go (98%) rename gno.land/cmd/{genesis => gnoland}/generate.go (100%) rename gno.land/cmd/{genesis => gnoland}/generate_test.go (98%) rename gno.land/cmd/{genesis/main.go => gnoland/genesis.go} (68%) rename gno.land/cmd/{genesis => gnoland}/txs.go (100%) rename gno.land/cmd/{genesis => gnoland}/txs_add.go (100%) rename gno.land/cmd/{genesis => gnoland}/txs_add_test.go (98%) rename gno.land/cmd/{genesis => gnoland}/txs_export.go (100%) rename gno.land/cmd/{genesis => gnoland}/txs_export_test.go (98%) rename gno.land/cmd/{genesis => gnoland}/txs_remove.go (100%) rename gno.land/cmd/{genesis => gnoland}/txs_remove_test.go (98%) rename gno.land/cmd/{genesis => gnoland}/types.go (100%) rename gno.land/cmd/{genesis => gnoland}/validator.go (100%) rename gno.land/cmd/{genesis => gnoland}/validator_add.go (86%) rename gno.land/cmd/{genesis => gnoland}/validator_add_test.go (97%) rename gno.land/cmd/{genesis => gnoland}/validator_remove.go (100%) rename gno.land/cmd/{genesis => gnoland}/validator_remove_test.go (98%) rename gno.land/cmd/{genesis => gnoland}/verify.go (100%) rename gno.land/cmd/{genesis => gnoland}/verify_test.go (98%) diff --git a/gno.land/cmd/genesis/balances.go b/gno.land/cmd/gnoland/balances.go similarity index 100% rename from gno.land/cmd/genesis/balances.go rename to gno.land/cmd/gnoland/balances.go diff --git a/gno.land/cmd/genesis/balances_add.go b/gno.land/cmd/gnoland/balances_add.go similarity index 100% rename from gno.land/cmd/genesis/balances_add.go rename to gno.land/cmd/gnoland/balances_add.go diff --git a/gno.land/cmd/genesis/balances_add_test.go b/gno.land/cmd/gnoland/balances_add_test.go similarity index 99% rename from gno.land/cmd/genesis/balances_add_test.go rename to gno.land/cmd/gnoland/balances_add_test.go index 0dd3366869f..3f97acd1aba 100644 --- a/gno.land/cmd/genesis/balances_add_test.go +++ b/gno.land/cmd/gnoland/balances_add_test.go @@ -27,6 +27,7 @@ func TestGenesis_Balances_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "balances", "add", "--genesis-path", @@ -50,6 +51,7 @@ func TestGenesis_Balances_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "balances", "add", "--genesis-path", @@ -67,6 +69,7 @@ func TestGenesis_Balances_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "balances", "add", "--genesis-path", @@ -92,6 +95,7 @@ func TestGenesis_Balances_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "balances", "add", "--genesis-path", @@ -181,6 +185,7 @@ func TestGenesis_Balances_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "balances", "add", "--genesis-path", @@ -280,6 +285,7 @@ func TestGenesis_Balances_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "balances", "add", "--genesis-path", @@ -353,6 +359,7 @@ func TestGenesis_Balances_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "balances", "add", "--genesis-path", diff --git a/gno.land/cmd/genesis/balances_export.go b/gno.land/cmd/gnoland/balances_export.go similarity index 100% rename from gno.land/cmd/genesis/balances_export.go rename to gno.land/cmd/gnoland/balances_export.go diff --git a/gno.land/cmd/genesis/balances_export_test.go b/gno.land/cmd/gnoland/balances_export_test.go similarity index 98% rename from gno.land/cmd/genesis/balances_export_test.go rename to gno.land/cmd/gnoland/balances_export_test.go index d7441fd438f..ee88af4c56b 100644 --- a/gno.land/cmd/genesis/balances_export_test.go +++ b/gno.land/cmd/gnoland/balances_export_test.go @@ -41,6 +41,7 @@ func TestGenesis_Balances_Export(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "balances", "export", "--genesis-path", @@ -65,6 +66,7 @@ func TestGenesis_Balances_Export(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "balances", "export", "--genesis-path", @@ -91,6 +93,7 @@ func TestGenesis_Balances_Export(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "balances", "export", "--genesis-path", @@ -124,6 +127,7 @@ func TestGenesis_Balances_Export(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "balances", "export", "--genesis-path", diff --git a/gno.land/cmd/genesis/balances_remove.go b/gno.land/cmd/gnoland/balances_remove.go similarity index 100% rename from gno.land/cmd/genesis/balances_remove.go rename to gno.land/cmd/gnoland/balances_remove.go diff --git a/gno.land/cmd/genesis/balances_remove_test.go b/gno.land/cmd/gnoland/balances_remove_test.go similarity index 98% rename from gno.land/cmd/genesis/balances_remove_test.go rename to gno.land/cmd/gnoland/balances_remove_test.go index b9d10d0db08..a8ec6ddac10 100644 --- a/gno.land/cmd/genesis/balances_remove_test.go +++ b/gno.land/cmd/gnoland/balances_remove_test.go @@ -20,6 +20,7 @@ func TestGenesis_Balances_Remove(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "balances", "remove", "--genesis-path", @@ -46,6 +47,7 @@ func TestGenesis_Balances_Remove(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "balances", "remove", "--genesis-path", @@ -83,6 +85,7 @@ func TestGenesis_Balances_Remove(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "balances", "remove", "--genesis-path", @@ -125,6 +128,7 @@ func TestGenesis_Balances_Remove(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "balances", "remove", "--genesis-path", diff --git a/gno.land/cmd/genesis/generate.go b/gno.land/cmd/gnoland/generate.go similarity index 100% rename from gno.land/cmd/genesis/generate.go rename to gno.land/cmd/gnoland/generate.go diff --git a/gno.land/cmd/genesis/generate_test.go b/gno.land/cmd/gnoland/generate_test.go similarity index 98% rename from gno.land/cmd/genesis/generate_test.go rename to gno.land/cmd/gnoland/generate_test.go index ca742e55150..f078a161662 100644 --- a/gno.land/cmd/genesis/generate_test.go +++ b/gno.land/cmd/gnoland/generate_test.go @@ -27,6 +27,7 @@ func TestGenesis_Generate(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "generate", "--output-path", genesisPath, @@ -60,6 +61,7 @@ func TestGenesis_Generate(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "generate", "--chain-id", chainID, @@ -91,6 +93,7 @@ func TestGenesis_Generate(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "generate", "--block-max-tx-bytes", fmt.Sprintf("%d", blockMaxTxBytes), @@ -126,6 +129,7 @@ func TestGenesis_Generate(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "generate", "--block-max-data-bytes", fmt.Sprintf("%d", blockMaxDataBytes), @@ -161,6 +165,7 @@ func TestGenesis_Generate(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "generate", "--block-max-gas", fmt.Sprintf("%d", blockMaxGas), @@ -196,6 +201,7 @@ func TestGenesis_Generate(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "generate", "--block-time-iota", fmt.Sprintf("%d", blockTimeIota), @@ -231,6 +237,7 @@ func TestGenesis_Generate(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "generate", "--chain-id", invalidChainID, diff --git a/gno.land/cmd/genesis/main.go b/gno.land/cmd/gnoland/genesis.go similarity index 68% rename from gno.land/cmd/genesis/main.go rename to gno.land/cmd/gnoland/genesis.go index 53bb48c3c64..23f53b138b5 100644 --- a/gno.land/cmd/genesis/main.go +++ b/gno.land/cmd/gnoland/genesis.go @@ -1,25 +1,17 @@ package main import ( - "context" "flag" - "os" "github.com/gnolang/gno/tm2/pkg/commands" ) -func main() { - io := commands.NewDefaultIO() - cmd := newRootCmd(io) - - cmd.Execute(context.Background(), os.Args[1:]) -} - -func newRootCmd(io commands.IO) *commands.Command { +func newGenesisCmd(io commands.IO) *commands.Command { cmd := commands.NewCommand( commands.Metadata{ - ShortUsage: " [flags] [...]", - LongHelp: "Gno Genesis manipulation suite", + Name: "genesis", + ShortUsage: "genesis [flags] [...]", + LongHelp: "gno genesis manipulation suite", }, commands.NewEmptyConfig(), commands.HelpExec, diff --git a/gno.land/cmd/gnoland/root.go b/gno.land/cmd/gnoland/root.go index acef192e0c6..d670151b358 100644 --- a/gno.land/cmd/gnoland/root.go +++ b/gno.land/cmd/gnoland/root.go @@ -35,6 +35,7 @@ func newRootCmd(io commands.IO) *commands.Command { newStartCmd(io), newSecretsCmd(io), newConfigCmd(io), + newGenesisCmd(io), ) return cmd diff --git a/gno.land/cmd/genesis/txs.go b/gno.land/cmd/gnoland/txs.go similarity index 100% rename from gno.land/cmd/genesis/txs.go rename to gno.land/cmd/gnoland/txs.go diff --git a/gno.land/cmd/genesis/txs_add.go b/gno.land/cmd/gnoland/txs_add.go similarity index 100% rename from gno.land/cmd/genesis/txs_add.go rename to gno.land/cmd/gnoland/txs_add.go diff --git a/gno.land/cmd/genesis/txs_add_test.go b/gno.land/cmd/gnoland/txs_add_test.go similarity index 98% rename from gno.land/cmd/genesis/txs_add_test.go rename to gno.land/cmd/gnoland/txs_add_test.go index 7d194182fb0..048aaf889be 100644 --- a/gno.land/cmd/genesis/txs_add_test.go +++ b/gno.land/cmd/gnoland/txs_add_test.go @@ -71,6 +71,7 @@ func TestGenesis_Txs_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "txs", "add", "--genesis-path", @@ -94,6 +95,7 @@ func TestGenesis_Txs_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "txs", "add", "--genesis-path", @@ -118,6 +120,7 @@ func TestGenesis_Txs_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "txs", "add", "--genesis-path", @@ -141,6 +144,7 @@ func TestGenesis_Txs_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "txs", "add", "--genesis-path", @@ -180,6 +184,7 @@ func TestGenesis_Txs_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "txs", "add", "--genesis-path", @@ -238,6 +243,7 @@ func TestGenesis_Txs_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "txs", "add", "--genesis-path", diff --git a/gno.land/cmd/genesis/txs_export.go b/gno.land/cmd/gnoland/txs_export.go similarity index 100% rename from gno.land/cmd/genesis/txs_export.go rename to gno.land/cmd/gnoland/txs_export.go diff --git a/gno.land/cmd/genesis/txs_export_test.go b/gno.land/cmd/gnoland/txs_export_test.go similarity index 98% rename from gno.land/cmd/genesis/txs_export_test.go rename to gno.land/cmd/gnoland/txs_export_test.go index bc84bc45f73..9927f671efb 100644 --- a/gno.land/cmd/genesis/txs_export_test.go +++ b/gno.land/cmd/gnoland/txs_export_test.go @@ -23,6 +23,7 @@ func TestGenesis_Txs_Export(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "txs", "export", "--genesis-path", @@ -47,6 +48,7 @@ func TestGenesis_Txs_Export(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "txs", "export", "--genesis-path", @@ -73,6 +75,7 @@ func TestGenesis_Txs_Export(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "txs", "export", "--genesis-path", @@ -106,6 +109,7 @@ func TestGenesis_Txs_Export(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "txs", "export", "--genesis-path", diff --git a/gno.land/cmd/genesis/txs_remove.go b/gno.land/cmd/gnoland/txs_remove.go similarity index 100% rename from gno.land/cmd/genesis/txs_remove.go rename to gno.land/cmd/gnoland/txs_remove.go diff --git a/gno.land/cmd/genesis/txs_remove_test.go b/gno.land/cmd/gnoland/txs_remove_test.go similarity index 98% rename from gno.land/cmd/genesis/txs_remove_test.go rename to gno.land/cmd/gnoland/txs_remove_test.go index b89f2af761a..ff5af479449 100644 --- a/gno.land/cmd/genesis/txs_remove_test.go +++ b/gno.land/cmd/gnoland/txs_remove_test.go @@ -21,6 +21,7 @@ func TestGenesis_Txs_Remove(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "txs", "remove", "--genesis-path", @@ -45,6 +46,7 @@ func TestGenesis_Txs_Remove(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "txs", "remove", "--genesis-path", @@ -73,6 +75,7 @@ func TestGenesis_Txs_Remove(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "txs", "remove", "--genesis-path", @@ -105,6 +108,7 @@ func TestGenesis_Txs_Remove(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "txs", "remove", "--genesis-path", diff --git a/gno.land/cmd/genesis/types.go b/gno.land/cmd/gnoland/types.go similarity index 100% rename from gno.land/cmd/genesis/types.go rename to gno.land/cmd/gnoland/types.go diff --git a/gno.land/cmd/genesis/validator.go b/gno.land/cmd/gnoland/validator.go similarity index 100% rename from gno.land/cmd/genesis/validator.go rename to gno.land/cmd/gnoland/validator.go diff --git a/gno.land/cmd/genesis/validator_add.go b/gno.land/cmd/gnoland/validator_add.go similarity index 86% rename from gno.land/cmd/genesis/validator_add.go rename to gno.land/cmd/gnoland/validator_add.go index 502b572effb..dc232ab6e4e 100644 --- a/gno.land/cmd/genesis/validator_add.go +++ b/gno.land/cmd/gnoland/validator_add.go @@ -13,10 +13,10 @@ import ( ) var ( - errInvalidPower = errors.New("invalid validator power") - errInvalidName = errors.New("invalid validator name") - errPublicKeyMismatch = errors.New("provided public key and address do not match") - errAddressPresent = errors.New("validator with same address already present in genesis.json") + errInvalidPower = errors.New("invalid validator power") + errInvalidName = errors.New("invalid validator name") + errPublicKeyAddressMismatch = errors.New("provided public key and address do not match") + errAddressPresent = errors.New("validator with same address already present in genesis.json") ) type validatorAddCfg struct { @@ -89,7 +89,7 @@ func execValidatorAdd(cfg *validatorAddCfg, io commands.IO) error { // Check the name if cfg.name == "" { - return errors.New("invalid validator name") + return errInvalidName } // Check the public key @@ -100,7 +100,7 @@ func execValidatorAdd(cfg *validatorAddCfg, io commands.IO) error { // Check the public key matches the address if pubKey.Address() != address { - return errors.New("provided public key and address do not match") + return errPublicKeyAddressMismatch } validator := types.GenesisValidator{ diff --git a/gno.land/cmd/genesis/validator_add_test.go b/gno.land/cmd/gnoland/validator_add_test.go similarity index 97% rename from gno.land/cmd/genesis/validator_add_test.go rename to gno.land/cmd/gnoland/validator_add_test.go index 37af4157e7c..528255b3029 100644 --- a/gno.land/cmd/genesis/validator_add_test.go +++ b/gno.land/cmd/gnoland/validator_add_test.go @@ -65,6 +65,7 @@ func TestGenesis_Validator_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "validator", "add", "--genesis-path", @@ -88,6 +89,7 @@ func TestGenesis_Validator_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "validator", "add", "--genesis-path", @@ -115,6 +117,7 @@ func TestGenesis_Validator_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "validator", "add", "--genesis-path", @@ -144,6 +147,7 @@ func TestGenesis_Validator_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "validator", "add", "--genesis-path", @@ -173,6 +177,7 @@ func TestGenesis_Validator_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "validator", "add", "--genesis-path", @@ -204,6 +209,7 @@ func TestGenesis_Validator_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "validator", "add", "--genesis-path", @@ -218,7 +224,7 @@ func TestGenesis_Validator_Add(t *testing.T) { // Run the command cmdErr := cmd.ParseAndRun(context.Background(), args) - assert.ErrorContains(t, cmdErr, errPublicKeyMismatch.Error()) + assert.ErrorContains(t, cmdErr, errPublicKeyAddressMismatch.Error()) }) t.Run("validator with same address exists", func(t *testing.T) { @@ -243,6 +249,7 @@ func TestGenesis_Validator_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "validator", "add", "--genesis-path", @@ -274,6 +281,7 @@ func TestGenesis_Validator_Add(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "validator", "add", "--genesis-path", diff --git a/gno.land/cmd/genesis/validator_remove.go b/gno.land/cmd/gnoland/validator_remove.go similarity index 100% rename from gno.land/cmd/genesis/validator_remove.go rename to gno.land/cmd/gnoland/validator_remove.go diff --git a/gno.land/cmd/genesis/validator_remove_test.go b/gno.land/cmd/gnoland/validator_remove_test.go similarity index 98% rename from gno.land/cmd/genesis/validator_remove_test.go rename to gno.land/cmd/gnoland/validator_remove_test.go index 953657afe33..e73e867c5c3 100644 --- a/gno.land/cmd/genesis/validator_remove_test.go +++ b/gno.land/cmd/gnoland/validator_remove_test.go @@ -20,6 +20,7 @@ func TestGenesis_Validator_Remove(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "validator", "remove", "--genesis-path", @@ -43,6 +44,7 @@ func TestGenesis_Validator_Remove(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "validator", "remove", "--genesis-path", @@ -78,6 +80,7 @@ func TestGenesis_Validator_Remove(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "validator", "remove", "--genesis-path", @@ -114,6 +117,7 @@ func TestGenesis_Validator_Remove(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "validator", "remove", "--genesis-path", diff --git a/gno.land/cmd/genesis/verify.go b/gno.land/cmd/gnoland/verify.go similarity index 100% rename from gno.land/cmd/genesis/verify.go rename to gno.land/cmd/gnoland/verify.go diff --git a/gno.land/cmd/genesis/verify_test.go b/gno.land/cmd/gnoland/verify_test.go similarity index 98% rename from gno.land/cmd/genesis/verify_test.go rename to gno.land/cmd/gnoland/verify_test.go index 8388949898b..9c93519e495 100644 --- a/gno.land/cmd/genesis/verify_test.go +++ b/gno.land/cmd/gnoland/verify_test.go @@ -55,6 +55,7 @@ func TestGenesis_Verify(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "verify", "--genesis-path", tempFile.Name(), @@ -85,6 +86,7 @@ func TestGenesis_Verify(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "verify", "--genesis-path", tempFile.Name(), @@ -112,6 +114,7 @@ func TestGenesis_Verify(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "verify", "--genesis-path", tempFile.Name(), @@ -134,6 +137,7 @@ func TestGenesis_Verify(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "verify", "--genesis-path", tempFile.Name(), @@ -157,6 +161,7 @@ func TestGenesis_Verify(t *testing.T) { // Create the command cmd := newRootCmd(commands.NewTestIO()) args := []string{ + "genesis", "verify", "--genesis-path", tempFile.Name(), From 7d0929f4be301ea788f028aa9362fd6550ca0fb8 Mon Sep 17 00:00:00 2001 From: Milos Zivkovic Date: Thu, 18 Apr 2024 18:17:49 +0200 Subject: [PATCH 2/3] Remove genesis binary mentions in Makefile --- gno.land/Makefile | 6 ++---- gno.land/cmd/gnoland/genesis.go | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/gno.land/Makefile b/gno.land/Makefile index ce19471ec50..b5cd5d31ad3 100644 --- a/gno.land/Makefile +++ b/gno.land/Makefile @@ -31,25 +31,23 @@ start.gnoland:; go run ./cmd/gnoland start start.gnoweb:; go run ./cmd/gnoweb .PHONY: build -build: build.gnoland build.gnokey build.gnoweb build.gnofaucet build.genesis +build: build.gnoland build.gnokey build.gnoweb build.gnofaucet build.gnoland:; go build -o build/gnoland ./cmd/gnoland build.gnoweb:; go build -o build/gnoweb ./cmd/gnoweb build.gnofaucet:; go build -o build/gnofaucet ./cmd/gnofaucet build.gnokey:; go build -o build/gnokey ./cmd/gnokey -build.genesis:; go build -o build/genesis ./cmd/genesis run.gnoland:; go run ./cmd/gnoland start run.gnoweb:; go run ./cmd/gnoweb .PHONY: install -install: install.gnoland install.gnoweb install.gnofaucet install.gnokey install.genesis +install: install.gnoland install.gnoweb install.gnofaucet install.gnokey install.gnoland:; go install ./cmd/gnoland install.gnoweb:; go install ./cmd/gnoweb install.gnofaucet:; go install ./cmd/gnofaucet install.gnokey:; go install ./cmd/gnokey -install.genesis:; go install ./cmd/genesis .PHONY: fclean fclean: clean diff --git a/gno.land/cmd/gnoland/genesis.go b/gno.land/cmd/gnoland/genesis.go index 23f53b138b5..37c0f8f2926 100644 --- a/gno.land/cmd/gnoland/genesis.go +++ b/gno.land/cmd/gnoland/genesis.go @@ -11,7 +11,8 @@ func newGenesisCmd(io commands.IO) *commands.Command { commands.Metadata{ Name: "genesis", ShortUsage: "genesis [flags] [...]", - LongHelp: "gno genesis manipulation suite", + ShortHelp: "gno genesis manipulation suite", + LongHelp: "Gno genesis.json manipulation suite, for managing genesis parameters", }, commands.NewEmptyConfig(), commands.HelpExec, From 190d51a2f5b42c4a306c93d4774233b05166f250 Mon Sep 17 00:00:00 2001 From: Milos Zivkovic Date: Fri, 19 Apr 2024 14:33:53 +0200 Subject: [PATCH 3/3] Give better naming to migrated files --- gno.land/cmd/gnoland/{balances.go => genesis_balances.go} | 0 gno.land/cmd/gnoland/{balances_add.go => genesis_balances_add.go} | 0 .../{balances_add_test.go => genesis_balances_add_test.go} | 0 .../gnoland/{balances_export.go => genesis_balances_export.go} | 0 .../{balances_export_test.go => genesis_balances_export_test.go} | 0 .../gnoland/{balances_remove.go => genesis_balances_remove.go} | 0 .../{balances_remove_test.go => genesis_balances_remove_test.go} | 0 gno.land/cmd/gnoland/{generate.go => genesis_generate.go} | 0 .../cmd/gnoland/{generate_test.go => genesis_generate_test.go} | 0 gno.land/cmd/gnoland/{txs.go => genesis_txs.go} | 0 gno.land/cmd/gnoland/{txs_add.go => genesis_txs_add.go} | 0 gno.land/cmd/gnoland/{txs_add_test.go => genesis_txs_add_test.go} | 0 gno.land/cmd/gnoland/{txs_export.go => genesis_txs_export.go} | 0 .../gnoland/{txs_export_test.go => genesis_txs_export_test.go} | 0 gno.land/cmd/gnoland/{txs_remove.go => genesis_txs_remove.go} | 0 .../gnoland/{txs_remove_test.go => genesis_txs_remove_test.go} | 0 gno.land/cmd/gnoland/{validator.go => genesis_validator.go} | 0 .../cmd/gnoland/{validator_add.go => genesis_validator_add.go} | 0 .../{validator_add_test.go => genesis_validator_add_test.go} | 0 .../gnoland/{validator_remove.go => genesis_validator_remove.go} | 0 ...{validator_remove_test.go => genesis_validator_remove_test.go} | 0 gno.land/cmd/gnoland/{verify.go => genesis_verify.go} | 0 gno.land/cmd/gnoland/{verify_test.go => genesis_verify_test.go} | 0 23 files changed, 0 insertions(+), 0 deletions(-) rename gno.land/cmd/gnoland/{balances.go => genesis_balances.go} (100%) rename gno.land/cmd/gnoland/{balances_add.go => genesis_balances_add.go} (100%) rename gno.land/cmd/gnoland/{balances_add_test.go => genesis_balances_add_test.go} (100%) rename gno.land/cmd/gnoland/{balances_export.go => genesis_balances_export.go} (100%) rename gno.land/cmd/gnoland/{balances_export_test.go => genesis_balances_export_test.go} (100%) rename gno.land/cmd/gnoland/{balances_remove.go => genesis_balances_remove.go} (100%) rename gno.land/cmd/gnoland/{balances_remove_test.go => genesis_balances_remove_test.go} (100%) rename gno.land/cmd/gnoland/{generate.go => genesis_generate.go} (100%) rename gno.land/cmd/gnoland/{generate_test.go => genesis_generate_test.go} (100%) rename gno.land/cmd/gnoland/{txs.go => genesis_txs.go} (100%) rename gno.land/cmd/gnoland/{txs_add.go => genesis_txs_add.go} (100%) rename gno.land/cmd/gnoland/{txs_add_test.go => genesis_txs_add_test.go} (100%) rename gno.land/cmd/gnoland/{txs_export.go => genesis_txs_export.go} (100%) rename gno.land/cmd/gnoland/{txs_export_test.go => genesis_txs_export_test.go} (100%) rename gno.land/cmd/gnoland/{txs_remove.go => genesis_txs_remove.go} (100%) rename gno.land/cmd/gnoland/{txs_remove_test.go => genesis_txs_remove_test.go} (100%) rename gno.land/cmd/gnoland/{validator.go => genesis_validator.go} (100%) rename gno.land/cmd/gnoland/{validator_add.go => genesis_validator_add.go} (100%) rename gno.land/cmd/gnoland/{validator_add_test.go => genesis_validator_add_test.go} (100%) rename gno.land/cmd/gnoland/{validator_remove.go => genesis_validator_remove.go} (100%) rename gno.land/cmd/gnoland/{validator_remove_test.go => genesis_validator_remove_test.go} (100%) rename gno.land/cmd/gnoland/{verify.go => genesis_verify.go} (100%) rename gno.land/cmd/gnoland/{verify_test.go => genesis_verify_test.go} (100%) diff --git a/gno.land/cmd/gnoland/balances.go b/gno.land/cmd/gnoland/genesis_balances.go similarity index 100% rename from gno.land/cmd/gnoland/balances.go rename to gno.land/cmd/gnoland/genesis_balances.go diff --git a/gno.land/cmd/gnoland/balances_add.go b/gno.land/cmd/gnoland/genesis_balances_add.go similarity index 100% rename from gno.land/cmd/gnoland/balances_add.go rename to gno.land/cmd/gnoland/genesis_balances_add.go diff --git a/gno.land/cmd/gnoland/balances_add_test.go b/gno.land/cmd/gnoland/genesis_balances_add_test.go similarity index 100% rename from gno.land/cmd/gnoland/balances_add_test.go rename to gno.land/cmd/gnoland/genesis_balances_add_test.go diff --git a/gno.land/cmd/gnoland/balances_export.go b/gno.land/cmd/gnoland/genesis_balances_export.go similarity index 100% rename from gno.land/cmd/gnoland/balances_export.go rename to gno.land/cmd/gnoland/genesis_balances_export.go diff --git a/gno.land/cmd/gnoland/balances_export_test.go b/gno.land/cmd/gnoland/genesis_balances_export_test.go similarity index 100% rename from gno.land/cmd/gnoland/balances_export_test.go rename to gno.land/cmd/gnoland/genesis_balances_export_test.go diff --git a/gno.land/cmd/gnoland/balances_remove.go b/gno.land/cmd/gnoland/genesis_balances_remove.go similarity index 100% rename from gno.land/cmd/gnoland/balances_remove.go rename to gno.land/cmd/gnoland/genesis_balances_remove.go diff --git a/gno.land/cmd/gnoland/balances_remove_test.go b/gno.land/cmd/gnoland/genesis_balances_remove_test.go similarity index 100% rename from gno.land/cmd/gnoland/balances_remove_test.go rename to gno.land/cmd/gnoland/genesis_balances_remove_test.go diff --git a/gno.land/cmd/gnoland/generate.go b/gno.land/cmd/gnoland/genesis_generate.go similarity index 100% rename from gno.land/cmd/gnoland/generate.go rename to gno.land/cmd/gnoland/genesis_generate.go diff --git a/gno.land/cmd/gnoland/generate_test.go b/gno.land/cmd/gnoland/genesis_generate_test.go similarity index 100% rename from gno.land/cmd/gnoland/generate_test.go rename to gno.land/cmd/gnoland/genesis_generate_test.go diff --git a/gno.land/cmd/gnoland/txs.go b/gno.land/cmd/gnoland/genesis_txs.go similarity index 100% rename from gno.land/cmd/gnoland/txs.go rename to gno.land/cmd/gnoland/genesis_txs.go diff --git a/gno.land/cmd/gnoland/txs_add.go b/gno.land/cmd/gnoland/genesis_txs_add.go similarity index 100% rename from gno.land/cmd/gnoland/txs_add.go rename to gno.land/cmd/gnoland/genesis_txs_add.go diff --git a/gno.land/cmd/gnoland/txs_add_test.go b/gno.land/cmd/gnoland/genesis_txs_add_test.go similarity index 100% rename from gno.land/cmd/gnoland/txs_add_test.go rename to gno.land/cmd/gnoland/genesis_txs_add_test.go diff --git a/gno.land/cmd/gnoland/txs_export.go b/gno.land/cmd/gnoland/genesis_txs_export.go similarity index 100% rename from gno.land/cmd/gnoland/txs_export.go rename to gno.land/cmd/gnoland/genesis_txs_export.go diff --git a/gno.land/cmd/gnoland/txs_export_test.go b/gno.land/cmd/gnoland/genesis_txs_export_test.go similarity index 100% rename from gno.land/cmd/gnoland/txs_export_test.go rename to gno.land/cmd/gnoland/genesis_txs_export_test.go diff --git a/gno.land/cmd/gnoland/txs_remove.go b/gno.land/cmd/gnoland/genesis_txs_remove.go similarity index 100% rename from gno.land/cmd/gnoland/txs_remove.go rename to gno.land/cmd/gnoland/genesis_txs_remove.go diff --git a/gno.land/cmd/gnoland/txs_remove_test.go b/gno.land/cmd/gnoland/genesis_txs_remove_test.go similarity index 100% rename from gno.land/cmd/gnoland/txs_remove_test.go rename to gno.land/cmd/gnoland/genesis_txs_remove_test.go diff --git a/gno.land/cmd/gnoland/validator.go b/gno.land/cmd/gnoland/genesis_validator.go similarity index 100% rename from gno.land/cmd/gnoland/validator.go rename to gno.land/cmd/gnoland/genesis_validator.go diff --git a/gno.land/cmd/gnoland/validator_add.go b/gno.land/cmd/gnoland/genesis_validator_add.go similarity index 100% rename from gno.land/cmd/gnoland/validator_add.go rename to gno.land/cmd/gnoland/genesis_validator_add.go diff --git a/gno.land/cmd/gnoland/validator_add_test.go b/gno.land/cmd/gnoland/genesis_validator_add_test.go similarity index 100% rename from gno.land/cmd/gnoland/validator_add_test.go rename to gno.land/cmd/gnoland/genesis_validator_add_test.go diff --git a/gno.land/cmd/gnoland/validator_remove.go b/gno.land/cmd/gnoland/genesis_validator_remove.go similarity index 100% rename from gno.land/cmd/gnoland/validator_remove.go rename to gno.land/cmd/gnoland/genesis_validator_remove.go diff --git a/gno.land/cmd/gnoland/validator_remove_test.go b/gno.land/cmd/gnoland/genesis_validator_remove_test.go similarity index 100% rename from gno.land/cmd/gnoland/validator_remove_test.go rename to gno.land/cmd/gnoland/genesis_validator_remove_test.go diff --git a/gno.land/cmd/gnoland/verify.go b/gno.land/cmd/gnoland/genesis_verify.go similarity index 100% rename from gno.land/cmd/gnoland/verify.go rename to gno.land/cmd/gnoland/genesis_verify.go diff --git a/gno.land/cmd/gnoland/verify_test.go b/gno.land/cmd/gnoland/genesis_verify_test.go similarity index 100% rename from gno.land/cmd/gnoland/verify_test.go rename to gno.land/cmd/gnoland/genesis_verify_test.go