fix: send with declared nonce 0

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-12-03 18:36:34 +01:00
parent 3196b2cfd5
commit 07afd93443
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -43,10 +43,10 @@ var sendCmd = &cli.Command{
Usage: "specify gas limit", Usage: "specify gas limit",
Value: 0, Value: 0,
}, },
&cli.Int64Flag{ &cli.Uint64Flag{
Name: "nonce", Name: "nonce",
Usage: "specify the nonce to use", Usage: "specify the nonce to use",
Value: -1, Value: 0,
}, },
&cli.Uint64Flag{ &cli.Uint64Flag{
Name: "method", Name: "method",
@ -143,8 +143,8 @@ var sendCmd = &cli.Command{
Params: params, Params: params,
} }
if cctx.Int64("nonce") > 0 { if cctx.IsSet("nonce") {
msg.Nonce = uint64(cctx.Int64("nonce")) msg.Nonce = cctx.Uint64("nonce")
sm, err := api.WalletSignMessage(ctx, fromAddr, msg) sm, err := api.WalletSignMessage(ctx, fromAddr, msg)
if err != nil { if err != nil {
return err return err