move sdk denom validation to top of validateibcdenom (#7917)
This commit is contained in:
parent
96f239db1c
commit
956e1cf68f
@ -164,6 +164,10 @@ func ValidatePrefixedDenom(denom string) error {
|
||||
// - A valid base denomination (eg: 'uatom')
|
||||
// - A valid fungible token representation (i.e 'ibc/{hash}') per ADR 001 https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-001-coin-source-tracing.md
|
||||
func ValidateIBCDenom(denom string) error {
|
||||
if err := sdk.ValidateDenom(denom); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
denomSplit := strings.SplitN(denom, "/", 2)
|
||||
|
||||
switch {
|
||||
@ -173,7 +177,7 @@ func ValidateIBCDenom(denom string) error {
|
||||
return sdkerrors.Wrapf(ErrInvalidDenomForTransfer, "denomination should be prefixed with the format 'ibc/{hash(trace + \"/\" + %s)}'", denom)
|
||||
|
||||
case denomSplit[0] == denom && strings.TrimSpace(denom) != "":
|
||||
return sdk.ValidateDenom(denom)
|
||||
return nil
|
||||
}
|
||||
|
||||
if _, err := ParseHexHash(denomSplit[1]); err != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user