From c84137730f1cebf487557ecf2b5ea37c2c85e5b6 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Tue, 8 Aug 2023 15:03:26 +0200 Subject: [PATCH 1/2] chore: remove test cmd from cli --- x/blob/client/cli/testrandblob.go | 47 ------------------------------- x/blob/client/cli/tx.go | 1 - 2 files changed, 48 deletions(-) delete mode 100644 x/blob/client/cli/testrandblob.go diff --git a/x/blob/client/cli/testrandblob.go b/x/blob/client/cli/testrandblob.go deleted file mode 100644 index 67e2aa01d3..0000000000 --- a/x/blob/client/cli/testrandblob.go +++ /dev/null @@ -1,47 +0,0 @@ -package cli - -import ( - "fmt" - "strconv" - - "github.com/celestiaorg/celestia-app/pkg/appconsts" - appns "github.com/celestiaorg/celestia-app/pkg/namespace" - "github.com/celestiaorg/celestia-app/test/util/testfactory" - "github.com/celestiaorg/celestia-app/x/blob/types" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client/flags" -) - -// CmdTestRandBlob is triggered by testground's tests as part of apps' node scenario -// to increase the block size by user-defined amount. -// -// CAUTION: This func should not be used in production env! -func CmdTestRandBlob() *cobra.Command { - cmd := &cobra.Command{ - Use: "TestRandBlob [blobSize]", - Short: "Generates a random blob for a random namespace to be published to the Celestia blockchain", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - // decode the blob size - size, err := strconv.Atoi(args[0]) - if err != nil { - return fmt.Errorf("failure to decode blob size: %w", err) - } - - ns := appns.RandomBlobNamespace() - coreBlob := testfactory.GenerateBlobsWithNamespace(1, size, ns) - blob, err := types.NewBlob(ns, coreBlob[0].Data, appconsts.ShareVersionZero) - if err != nil { - return fmt.Errorf("failure on generating random blob: %w", err) - } - - return broadcastPFB(cmd, blob) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/blob/client/cli/tx.go b/x/blob/client/cli/tx.go index ced762ac84..825eb6bd0b 100644 --- a/x/blob/client/cli/tx.go +++ b/x/blob/client/cli/tx.go @@ -19,7 +19,6 @@ func GetTxCmd() *cobra.Command { } cmd.AddCommand(CmdPayForBlob()) - cmd.AddCommand(CmdTestRandBlob()) return cmd } From fa94adcc4f55b620bfd4a845efe64cf6abeeb71a Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Tue, 8 Aug 2023 15:05:22 +0200 Subject: [PATCH 2/2] remove reference --- x/blob/client/cli/payforblob.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/blob/client/cli/payforblob.go b/x/blob/client/cli/payforblob.go index 4479a14bdd..418405134b 100644 --- a/x/blob/client/cli/payforblob.go +++ b/x/blob/client/cli/payforblob.go @@ -88,7 +88,7 @@ func getNamespace(namespaceID []byte, namespaceVersion uint8) (appns.Namespace, } // broadcastPFB creates the new PFB message type that will later be broadcast to tendermint nodes -// this private func is used in CmdPayForBlob and CmdTestRandBlob +// this private func is used in CmdPayForBlob func broadcastPFB(cmd *cobra.Command, blob *types.Blob) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil {