mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 08:15:19 +00:00
fix: set from address in cli context (#695)
This commit is contained in:
parent
6a0cc6c49d
commit
9654f9d086
@ -38,16 +38,16 @@ func getCmdClaim(cdc *codec.Codec) *cobra.Command {
|
|||||||
Use: "claim [owner] [denom]",
|
Use: "claim [owner] [denom]",
|
||||||
Short: "claim rewards for owner and denom",
|
Short: "claim rewards for owner and denom",
|
||||||
Long: strings.TrimSpace(
|
Long: strings.TrimSpace(
|
||||||
fmt.Sprintf(`Claim any outstanding rewards owned by owner for the input denom,
|
fmt.Sprintf(`Claim any outstanding rewards owned by owner for the input collateral-type and multiplier,
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
$ %s tx %s claim kava15qdefkmwswysgg4qxgqpqr35k3m49pkx2jdfnw bnb
|
$ %s tx %s claim kava15qdefkmwswysgg4qxgqpqr35k3m49pkx2jdfnw bnb-a large
|
||||||
`, version.ClientName, types.ModuleName),
|
`, version.ClientName, types.ModuleName),
|
||||||
),
|
),
|
||||||
Args: cobra.ExactArgs(3),
|
Args: cobra.ExactArgs(3),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
inBuf := bufio.NewReader(cmd.InOrStdin())
|
inBuf := bufio.NewReader(cmd.InOrStdin())
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContextWithInputAndFrom(inBuf, args[0]).WithCodec(cdc)
|
||||||
txBldr := auth.NewTxBuilderFromCLI(inBuf).WithTxEncoder(utils.GetTxEncoder(cdc))
|
txBldr := auth.NewTxBuilderFromCLI(inBuf).WithTxEncoder(utils.GetTxEncoder(cdc))
|
||||||
owner, err := sdk.AccAddressFromBech32(args[0])
|
owner, err := sdk.AccAddressFromBech32(args[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user