Merge Pr #5585: client and types additions for IBC
This commit is contained in:
+2
-2
@@ -580,8 +580,8 @@ func (coins Coins) Sort() Coins {
|
||||
// Parsing
|
||||
|
||||
var (
|
||||
// Denominations can be 3 ~ 16 characters long.
|
||||
reDnmString = `[a-z][a-z0-9]{2,15}`
|
||||
// Denominations can be 3 ~ 32 characters long.
|
||||
reDnmString = `[a-z][a-z0-9/]{2,31}`
|
||||
reAmt = `[[:digit:]]+`
|
||||
reDecAmt = `[[:digit:]]*\.[[:digit:]]+`
|
||||
reSpc = `[[:space:]]*`
|
||||
|
||||
@@ -375,3 +375,14 @@ func ParseHTTPArgsWithLimit(r *http.Request, defaultLimit int) (tags []string, p
|
||||
func ParseHTTPArgs(r *http.Request) (tags []string, page, limit int, err error) {
|
||||
return ParseHTTPArgsWithLimit(r, DefaultLimit)
|
||||
}
|
||||
|
||||
// ParseQueryParamBool parses the given param to a boolean. It returns false by
|
||||
// default if the string is not parseable to bool.
|
||||
func ParseQueryParamBool(r *http.Request, param string) bool {
|
||||
valueStr := r.FormValue(param)
|
||||
value := false
|
||||
if ok, err := strconv.ParseBool(valueStr); err == nil {
|
||||
value = ok
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ const (
|
||||
// nolint - reexport
|
||||
type (
|
||||
StoreKey = types.StoreKey
|
||||
CapabilityKey = types.CapabilityKey
|
||||
KVStoreKey = types.KVStoreKey
|
||||
TransientStoreKey = types.TransientStoreKey
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user