mirror of
https://github.com/tendermint/tendermint.git
synced 2026-07-26 10:03:21 +00:00
Require quotes or 0x<hex> for string args
This commit is contained in:
@@ -285,5 +285,13 @@ func stringOrHexToBytes(s string) []byte {
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(s, "\"") || !strings.HasSuffix(s, "\"") {
|
||||
fmt.Printf("Invalid string arg: \"%s\". Must be quoted or a \"0x\"-prefixed hex string\n", s)
|
||||
return []byte{}
|
||||
}
|
||||
|
||||
// TODO: return errors
|
||||
|
||||
return []byte(s)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user