Skip to content

Commit

Permalink
refactor(rpc/state): remove submitPFBCmd
Browse files Browse the repository at this point in the history
  • Loading branch information
vgonkivs committed Sep 26, 2023
1 parent 8fe4fa7 commit 13e8928
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions nodebuilder/state/cmd/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import (
"strconv"

"cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/types"
"github.com/spf13/cobra"

"github.com/celestiaorg/celestia-node/blob"
cmdnode "github.com/celestiaorg/celestia-node/cmd"
"github.com/celestiaorg/celestia-node/state"
)
Expand All @@ -21,7 +19,6 @@ func init() {
balanceForAddressCmd,
transferCmd,
submitTxCmd,
submitPFBCmd,
cancelUnbondingDelegationCmd,
beginRedelegateCmd,
undelegateCmd,
Expand Down Expand Up @@ -156,47 +153,6 @@ var submitTxCmd = &cobra.Command{
},
}

var submitPFBCmd = &cobra.Command{
Use: "submit-pfb [namespace] [data] [fee] [gasLim]",
Short: "Allows to submit PFBs",
Args: cobra.ExactArgs(4),
RunE: func(cmd *cobra.Command, args []string) error {
client, err := cmdnode.ParseClientFromCtx(cmd.Context())
if err != nil {
return err
}
defer client.Close()

namespace, err := cmdnode.ParseV0Namespace(args[0])
if err != nil {
return fmt.Errorf("error parsing a namespace:%v", err)
}

fee, err := strconv.ParseInt(args[2], 10, 64)
if err != nil {
return fmt.Errorf("error parsing a fee:%v", err)
}

gasLimit, err := strconv.ParseUint(args[3], 10, 64)
if err != nil {
return fmt.Errorf("error parsing a gasLim:%v", err)
}

parsedBlob, err := blob.NewBlobV0(namespace, []byte(args[1]))
if err != nil {
return fmt.Errorf("error creating a blob:%v", err)
}

txResp, err := client.State.SubmitPayForBlob(
cmd.Context(),
types.NewInt(fee),
gasLimit,
[]*blob.Blob{parsedBlob},
)
return cmdnode.PrintOutput(txResp, err, nil)
},
}

var cancelUnbondingDelegationCmd = &cobra.Command{
Use: "cancel-unbonding-delegation [address] [amount] [height] [fee] [gasLimit]",
Short: "Cancels a user's pending undelegation from a validator.",
Expand Down

0 comments on commit 13e8928

Please sign in to comment.