chore: types audit (#14258)
This commit is contained in:
parent
d247e7a3b0
commit
682b72c157
File diff suppressed because one or more lines are too long
@ -33,7 +33,6 @@ func AddressGenerator(t *rapid.T) *rapid.Generator[sdk.AccAddress] {
|
||||
}
|
||||
|
||||
func testMempoolProperties(t *rapid.T) {
|
||||
|
||||
ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger())
|
||||
mp := mempool.NewSenderNonceMempool()
|
||||
|
||||
|
||||
@ -166,7 +166,6 @@ func (s *MempoolTestSuite) TestMaxTx() {
|
||||
ctx = ctx.WithPriority(tx.priority)
|
||||
err = mp.Insert(ctx, tx2)
|
||||
require.Equal(t, mempool.ErrMempoolTxMaxCapacity, err)
|
||||
|
||||
}
|
||||
|
||||
func (s *MempoolTestSuite) TestTxNotFoundOnSender() {
|
||||
@ -192,5 +191,4 @@ func (s *MempoolTestSuite) TestTxNotFoundOnSender() {
|
||||
require.NoError(t, err)
|
||||
err = mp.Remove(tx)
|
||||
require.Equal(t, mempool.ErrTxNotFound, err)
|
||||
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ func FuzzPagination(f *testing.F) {
|
||||
// 1. Set up some seeds.
|
||||
seeds := []*query.PageRequest{
|
||||
new(query.PageRequest),
|
||||
&query.PageRequest{
|
||||
{
|
||||
Offset: 0,
|
||||
Limit: 10,
|
||||
},
|
||||
|
||||
@ -4,24 +4,6 @@ import (
|
||||
"regexp"
|
||||
)
|
||||
|
||||
var (
|
||||
// IsAlphaNumeric defines a regular expression for matching against alpha-numeric
|
||||
// values.
|
||||
IsAlphaNumeric = regexp.MustCompile(`^[a-zA-Z0-9]+$`).MatchString
|
||||
|
||||
// IsAlphaLower defines regular expression to check if the string has lowercase
|
||||
// alphabetic characters only.
|
||||
IsAlphaLower = regexp.MustCompile(`^[a-z]+$`).MatchString
|
||||
|
||||
// IsAlphaUpper defines regular expression to check if the string has uppercase
|
||||
// alphabetic characters only.
|
||||
IsAlphaUpper = regexp.MustCompile(`^[A-Z]+$`).MatchString
|
||||
|
||||
// IsAlpha defines regular expression to check if the string has alphabetic
|
||||
// characters only.
|
||||
IsAlpha = regexp.MustCompile(`^[a-zA-Z]+$`).MatchString
|
||||
|
||||
// IsNumeric defines regular expression to check if the string has numeric
|
||||
// characters only.
|
||||
IsNumeric = regexp.MustCompile(`^[0-9]+$`).MatchString
|
||||
)
|
||||
// IsAlphaNumeric defines a regular expression for matching against alpha-numeric
|
||||
// values.
|
||||
var IsAlphaNumeric = regexp.MustCompile(`^[a-zA-Z0-9]+$`).MatchString
|
||||
|
||||
@ -142,15 +142,3 @@ func LogDeferred(logger log.Logger, f func() error) {
|
||||
logger.Error(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
// SliceContains implements a generic function for checking if a slice contains
|
||||
// a certain value.
|
||||
func SliceContains[T comparable](elements []T, v T) bool {
|
||||
for _, s := range elements {
|
||||
if v == s {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user