mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-07 13:55:17 +00:00
@@ -15,11 +15,11 @@ var (
|
||||
dotAtom = atom + `(?:\.` + atom + `)*`
|
||||
domain = `[A-Z0-9.-]+\.[A-Z]{2,4}`
|
||||
|
||||
RE_INT = regexp.MustCompile(`^-?[0-9]+$`)
|
||||
RE_HEX = regexp.MustCompile(`^(?i)[a-f0-9]+$`)
|
||||
RE_EMAIL = regexp.MustCompile(`^(?i)(` + dotAtom + `)@(` + dotAtom + `)$`)
|
||||
RE_ADDRESS = regexp.MustCompile(`^(?i)[a-z0-9]{25,34}$`)
|
||||
RE_HOST = regexp.MustCompile(`^(?i)(` + domain + `)$`)
|
||||
ReInt = regexp.MustCompile(`^-?[0-9]+$`)
|
||||
ReHex = regexp.MustCompile(`^(?i)[a-f0-9]+$`)
|
||||
ReEmail = regexp.MustCompile(`^(?i)(` + dotAtom + `)@(` + dotAtom + `)$`)
|
||||
ReAddress = regexp.MustCompile(`^(?i)[a-z0-9]{25,34}$`)
|
||||
ReHost = regexp.MustCompile(`^(?i)(` + domain + `)$`)
|
||||
|
||||
//RE_ID12 = regexp.MustCompile(`^[a-zA-Z0-9]{12}$`)
|
||||
)
|
||||
|
||||
@@ -130,7 +130,7 @@ func nonJSONStringToArg(cdc *amino.Codec, rt reflect.Type, arg string) (reflect.
|
||||
|
||||
// NOTE: rt.Kind() isn't a pointer.
|
||||
func _nonJSONStringToArg(cdc *amino.Codec, rt reflect.Type, arg string) (reflect.Value, bool, error) {
|
||||
isIntString := RE_INT.Match([]byte(arg))
|
||||
isIntString := ReInt.Match([]byte(arg))
|
||||
isQuotedString := strings.HasPrefix(arg, `"`) && strings.HasSuffix(arg, `"`)
|
||||
isHexString := strings.HasPrefix(strings.ToLower(arg), "0x")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user