feat(x/bank): Replace regex parsing of denom validation to generated parsing (#19511)
This commit is contained in:
@@ -33,7 +33,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
denomRegex = sdk.DefaultCoinDenomRegex()
|
||||
denomRegex = `[a-zA-Z][a-zA-Z0-9/:._-]{2,127}`
|
||||
addr1 = sdk.MustAccAddressFromBech32("cosmos139f7kncmglres2nf3h4hc4tade85ekfr8sulz5")
|
||||
coin1 = sdk.NewCoin("denom", math.NewInt(10))
|
||||
metadataAtom = banktypes.Metadata{
|
||||
|
||||
@@ -859,9 +859,10 @@ func TestGRPCRedelegations(t *testing.T) {
|
||||
func TestGRPCParams(t *testing.T) {
|
||||
t.Parallel()
|
||||
f := initDeterministicFixture(t)
|
||||
coinDenomRegex := `[a-zA-Z][a-zA-Z0-9/:._-]{2,127}`
|
||||
|
||||
rapid.Check(t, func(rt *rapid.T) {
|
||||
bondDenom := rapid.StringMatching(sdk.DefaultCoinDenomRegex()).Draw(rt, "bond-denom")
|
||||
bondDenom := rapid.StringMatching(coinDenomRegex).Draw(rt, "bond-denom")
|
||||
params := stakingtypes.Params{
|
||||
BondDenom: bondDenom,
|
||||
UnbondingTime: durationGenerator().Draw(rt, "duration"),
|
||||
|
||||
Reference in New Issue
Block a user