diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fdb78e0d..34361b48a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,13 +14,14 @@ changes. ### Fixed +- hotfix for ada handle and payment address validation order [Issue 3155](https://github.com/IntersectMBO/govtool/issues/3155) + ### Changed ### Removed ## [v2.0.15](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.15) 2025-03-11 - ### Added - Add support for ada handle in drep payment address [Issue 3155](https://github.com/IntersectMBO/govtool/issues/3155) diff --git a/govtool/frontend/src/utils/isValidFormat.ts b/govtool/frontend/src/utils/isValidFormat.ts index 43a6ef003..b203fcee7 100644 --- a/govtool/frontend/src/utils/isValidFormat.ts +++ b/govtool/frontend/src/utils/isValidFormat.ts @@ -49,16 +49,18 @@ export async function isReceivingAddress(address?: string) { return true; } - const receivingAddress = Address.from_bech32(address); - if (receivingAddress) { - return true; - } + // Validation for ada handles needs to go first as + // handles might be shorter then bech32 addresses const isValidAdaHandle = await adaHandleService.isValidAdaHandle(address); if (isValidAdaHandle) { return true; } + const receivingAddress = Address.from_bech32(address); + if (receivingAddress) { + return true; + } return i18n.t("forms.errors.mustBeReceivingAddress"); } catch (e) { return i18n.t("forms.errors.mustBeReceivingAddress");