Skip to content

Commit

Permalink
Make lint happy, make comment more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
mattverse committed Mar 7, 2024
1 parent e81f4c9 commit 7018ae4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
7 changes: 2 additions & 5 deletions types/coin.go
Original file line number Diff line number Diff line change
Expand Up @@ -871,11 +871,8 @@ func ValidateDenom(denom string) error {
if !MatchDenom(denomBytes) {
return fmt.Errorf("invalid denom: %s", denom)
}
} else {
// If reDnm has been initialized, use it for matching.
if !reDnm.MatchString(denom) {
return fmt.Errorf("invalid denom: %s", denom)
}
} else if !reDnm.MatchString(denom) { // If reDnm has been initialized, use it for matching.
return fmt.Errorf("invalid denom: %s", denom)
}

return nil
Expand Down
19 changes: 10 additions & 9 deletions types/coin_regex.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

//line coin_regex.rl:1
// Code generated by regel using `ragel -Z coin_regex.rl`.
// `coin_regex.go` is generated by regel using `ragel -Z coin_regex.rl`.
// do not directly edit `coin_regex.go`.
// source: types/coin_regex.rl
// nolint:gocritic,unused,ineffassign

Expand All @@ -17,9 +18,9 @@ package types

func MatchDenom(data []byte) bool {

//line coin_regex.rl:18
//line coin_regex.rl:19

//line coin_regex.go:23
//line coin_regex.go:24
var _scanner_actions []byte = []byte{
0, 1, 0,
}
Expand Down Expand Up @@ -65,20 +66,20 @@ const scanner_error int = 0
const scanner_en_main int = 1


//line coin_regex.rl:19
//line coin_regex.rl:20

if len(data) < 3 || len(data) > 128 {
return false
}
cs, p, pe, eof := 0, 0, len(data), len(data)
_ = eof

//line coin_regex.go:77
//line coin_regex.go:78
{
cs = scanner_start
}

//line coin_regex.go:82
//line coin_regex.go:83
{
var _klen int
var _trans int
Expand Down Expand Up @@ -158,9 +159,9 @@ _match:
_acts++
switch _scanner_actions[_acts-1] {
case 0:
//line coin_regex.rl:33
//line coin_regex.rl:34
return true
//line coin_regex.go:164
//line coin_regex.go:165
}
}

Expand All @@ -176,7 +177,7 @@ _again:
_out: {}
}

//line coin_regex.rl:37
//line coin_regex.rl:38

return false
}
3 changes: 2 additions & 1 deletion types/coin_regex.rl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Code generated by regel using `ragel -Z coin_regex.rl`.
// `coin_regex.go` is generated by regel using `ragel -Z coin_regex.rl`.
// do not directly edit `coin_regex.go`.
// source: types/coin_regex.rl
// nolint:gocritic,unused,ineffassign

Expand Down

0 comments on commit 7018ae4

Please sign in to comment.