github.com/iotexproject/iotex-core@v1.14.1-rc1/ioctl/cmd/action/actiondeploy.go (about)

     1  // Copyright (c) 2022 IoTeX Foundation
     2  // This source code is provided 'as is' and no warranties are given as to title or non-infringement, merchantability
     3  // or fitness for purpose and, to the extent permitted by law, all liability for your use of the code is disclaimed.
     4  // This source code is governed by Apache License 2.0 that can be found in the LICENSE file.
     5  
     6  package action
     7  
     8  import (
     9  	"github.com/spf13/cobra"
    10  
    11  	"github.com/iotexproject/iotex-core/ioctl/config"
    12  	"github.com/iotexproject/iotex-core/ioctl/output"
    13  )
    14  
    15  // Multi-language support
    16  var (
    17  	_deployCmdShorts = map[config.Language]string{
    18  		config.English: "Deploy smart contract on IoTeX blockchain \nWarning: 'ioctl action deploy' has been deprecated, use 'ioctl contract deploy' instead",
    19  		config.Chinese: "在IoTeX区块链上部署智能合约 \nWarning: 'ioctl action deploy' 已被废弃, 使用 'ioctl contract deploy' 代替",
    20  	}
    21  	_deployCmdUses = map[config.Language]string{
    22  		config.English: "deploy [AMOUNT_IOTX] [-s SIGNER] -b BYTE_CODE [-n NONCE] [-l GAS_LIMIT] [-p GAS_PRICE] [-P PASSWORD] [-y]",
    23  		config.Chinese: "deploy [IOTX数量] [-s 签署人] -b 类型码 [-n NONCE] [-l GAS限制] [-p GAS价格] [-P" +
    24  			" 密码] [-y]",
    25  	}
    26  )
    27  
    28  // _actionDeployCmd represents the action deploy command
    29  // Deprecated: notify users to use the new ioctl contract command
    30  // TODO: this command will be deprecated soon
    31  var _actionDeployCmd = &cobra.Command{
    32  	Use:                config.TranslateInLang(_deployCmdUses, config.UILanguage),
    33  	Short:              config.TranslateInLang(_deployCmdShorts, config.UILanguage),
    34  	Hidden:             true,
    35  	DisableFlagParsing: true,
    36  	RunE: func(cmd *cobra.Command, args []string) error {
    37  		cmd.SilenceUsage = true
    38  		var err error
    39  		return output.NewError(output.RuntimeError, "'ioctl action deploy' has been deprecated, use 'ioctl contract deploy' instead", err)
    40  	},
    41  }