Skip to content

Commit 38ab8b7

Browse files
committed
Make create validator tx command more clearly
1 parent 6911ac7 commit 38ab8b7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cmd/subcommands/staking.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func handleStakingTransaction(
135135
}
136136

137137
if strings.Compare(signerAddr, from) != 0 {
138-
return errors.New("error : delegator address doesn't match with ledger hardware addresss")
138+
return errors.New("error : delegator address doesn't match with ledger hardware address")
139139
}
140140
} else {
141141
ks, acct, err = store.UnlockedKeystore(from, passphrase)
@@ -146,24 +146,24 @@ func handleStakingTransaction(
146146
}
147147

148148
if err != nil {
149-
return err
149+
return errors.WithMessage(err, "sign staking tx error")
150150
}
151151

152152
enc, err := rlp.EncodeToBytes(signed)
153153
if err != nil {
154-
return err
154+
return errors.WithMessage(err, "encode signed error")
155155
}
156156

157157
hexSignature := hexutil.Encode(enc)
158158
reply, err := networkHandler.SendRPC(rpc.Method.SendRawStakingTransaction, []interface{}{hexSignature})
159159
if err != nil {
160-
return err
160+
return errors.WithMessage(err, "sendRPC error")
161161
}
162162
r, _ := reply["result"].(string)
163163
if timeout > 0 {
164164
if err := confirmTx(networkHandler, timeout, r); err != nil {
165165
fmt.Println(fmt.Sprintf(`{"transaction-hash":"%s"}`, r))
166-
return err
166+
return errors.WithMessage(err, "confirmTx error")
167167
}
168168
} else {
169169
fmt.Println(fmt.Sprintf(`{"transaction-receipt":"%s"}`, r))

0 commit comments

Comments
 (0)