Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Sworzen1 committed Mar 22, 2024
1 parent 3807f65 commit 0913549
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ export const useCreateGovernanceActionForm = (
const generateMetadata = useCallback(async () => {
const data = getValues();

if (!govActionType)
if (!govActionType) {
throw new Error("Governance action type is not defined");
}

const acceptedKeys = ["title", "motivation", "abstract", "rationale"];

Expand All @@ -104,10 +105,10 @@ export const useCreateGovernanceActionForm = (
const jsonld = await generateJsonld(body, GOVERNANCE_ACTION_CONTEXT);

const canonizedJson = await canonizeJSON(jsonld);
const hash = blake2bHex(canonizedJson, undefined, 32);
const canonizedJsonHash = blake2bHex(canonizedJson, undefined, 32);

// That allows to validate metadata hash
setHash(hash);
setHash(canonizedJsonHash);
setJson(jsonld);

return jsonld;
Expand Down

0 comments on commit 0913549

Please sign in to comment.