Skip to content

Commit

Permalink
Merge branch 'master' into cleanup-1
Browse files Browse the repository at this point in the history
  • Loading branch information
quietbits authored Nov 1, 2024
2 parents ae699c9 + 102034a commit c71b5ba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/formComponentTemplateTxnOps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ export const formComponentTemplateTxnOps = ({
infoLink="https://developers.stellar.org/docs/glossary#home-domain"
/>
),
validate: null,
validate: validate.getHomeDomainError,
};
case "inflation_dest":
return {
Expand Down
2 changes: 2 additions & 0 deletions src/validate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getContractIdError } from "./methods/getContractIdError";
import { getDataNameError } from "./methods/getDataNameError";
import { getDataValueError } from "./methods/getDataValueError";
import { getEventsFiltersError } from "./methods/getEventsFiltersError";
import { getHomeDomainError } from "./methods/getHomeDomainError";
import { getMemoError } from "./methods/getMemoError";
import { getNumberFractionError } from "./methods/getNumberFractionError";
import { getOptionsSignerError } from "./methods/getOptionsSignerError";
Expand All @@ -37,6 +38,7 @@ export const validate = {
getDataNameError,
getDataValueError,
getEventsFiltersError,
getHomeDomainError,
getMemoError,
getNumberFractionError,
getOptionsSignerError,
Expand Down
9 changes: 9 additions & 0 deletions src/validate/methods/getHomeDomainError.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const getHomeDomainError = (value: string) => {
const charLen = value.toString().length;

if (charLen > 32) {
return `Max length of home domain is 32 characters (got ${charLen}).`;
}

return false;
};

0 comments on commit c71b5ba

Please sign in to comment.