|
|
@@ -51,25 +51,17 @@ func init() {
|
|
|
}
|
|
|
|
|
|
func postMessage(cmd *cobra.Command, args []string) {
|
|
|
- nonce, err := strconv.Atoi(args[0])
|
|
|
+ nonce, err := strconv.ParseUint(args[0], 10, 32)
|
|
|
if err != nil {
|
|
|
cmd.PrintErrln("Could not parse nonce", err)
|
|
|
os.Exit(1)
|
|
|
}
|
|
|
- if nonce > math.MaxUint32 {
|
|
|
- cmd.PrintErrln("Nonce must not exceed MaxUint32", err)
|
|
|
- os.Exit(1)
|
|
|
- }
|
|
|
|
|
|
- consistencyLevel, err := strconv.Atoi(args[1])
|
|
|
+ consistencyLevel, err := strconv.ParseUint(args[1], 10, 8)
|
|
|
if err != nil {
|
|
|
cmd.PrintErrln("Could not parse confirmation number", err)
|
|
|
os.Exit(1)
|
|
|
}
|
|
|
- if consistencyLevel > math.MaxUint8 {
|
|
|
- cmd.PrintErrln("Confirmation number must not exceed 255", err)
|
|
|
- os.Exit(1)
|
|
|
- }
|
|
|
|
|
|
message := common.Hex2Bytes(args[2])
|
|
|
|