diff --git a/CHANGELOG.md b/CHANGELOG.md index 81b65ed3763d..ef203bbd07f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## TBD +## PENDING BREAKING CHANGES @@ -8,6 +8,7 @@ FEATURES * [lcd] Can now query governance proposals by ProposalStatus IMPROVEMENTS +* [baseapp] Allow any alphanumeric character in route BUG FIXES diff --git a/baseapp/baseapp_test.go b/baseapp/baseapp_test.go index 00897392ecaa..b2e0760eab0f 100644 --- a/baseapp/baseapp_test.go +++ b/baseapp/baseapp_test.go @@ -290,7 +290,7 @@ func (tx txTest) GetMsgs() []sdk.Msg { return tx.Msgs } const ( typeMsgCounter = "msgCounter" - typeMsgCounter2 = "msgCounterTwo" // NOTE: no numerics (?) + typeMsgCounter2 = "msgCounter2" ) // ValidateBasic() fails on negative counters. diff --git a/baseapp/router.go b/baseapp/router.go index abbbf9e1217b..4be3aec74ae4 100644 --- a/baseapp/router.go +++ b/baseapp/router.go @@ -31,12 +31,12 @@ func NewRouter() *router { } } -var isAlpha = regexp.MustCompile(`^[a-zA-Z]+$`).MatchString +var isAlphaNumeric = regexp.MustCompile(`^[a-zA-Z0-9]+$`).MatchString // AddRoute - TODO add description func (rtr *router) AddRoute(r string, h sdk.Handler) Router { - if !isAlpha(r) { - panic("route expressions can only contain alphabet characters") + if !isAlphaNumeric(r) { + panic("route expressions can only contain alphanumeric characters") } rtr.routes = append(rtr.routes, route{r, h})