Skip to content

Commit

Permalink
Merge pull request #2593 from mgoelzer/paych_get_parse_as_fil
Browse files Browse the repository at this point in the history
Parse amount as FIL in paych get
  • Loading branch information
magik6k authored Jul 25, 2020
2 parents f69cce4 + b409c8f commit c459a13
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cli/paych.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var paychGetCmd = &cli.Command{
ArgsUsage: "[fromAddress toAddress amount]",
Action: func(cctx *cli.Context) error {
if cctx.Args().Len() != 3 {
return fmt.Errorf("must pass three arguments: <from> <to> <available funds>")
return fmt.Errorf("must pass three arguments: <from> <to> <available funds in FIL>")
}

from, err := address.NewFromString(cctx.Args().Get(0))
Expand All @@ -42,9 +42,9 @@ var paychGetCmd = &cli.Command{
return fmt.Errorf("failed to parse to address: %s", err)
}

amt, err := types.BigFromString(cctx.Args().Get(2))
amt, err := types.ParseFIL(cctx.Args().Get(2))
if err != nil {
return fmt.Errorf("parsing amount failed: %s", err)
return fmt.Errorf("parsing amount as whole FIL failed: %s", err)
}

api, closer, err := GetFullNodeAPI(cctx)
Expand All @@ -55,7 +55,7 @@ var paychGetCmd = &cli.Command{

ctx := ReqContext(cctx)

info, err := api.PaychGet(ctx, from, to, amt)
info, err := api.PaychGet(ctx, from, to, types.BigInt(amt))
if err != nil {
return err
}
Expand Down

0 comments on commit c459a13

Please sign in to comment.