diff --git a/govtool/backend/sql/get-network-metrics.sql b/govtool/backend/sql/get-network-metrics.sql index 73ddabc95..651f28a6d 100644 --- a/govtool/backend/sql/get-network-metrics.sql +++ b/govtool/backend/sql/get-network-metrics.sql @@ -22,21 +22,18 @@ CurrentEpoch AS ( SELECT MAX(no) AS no FROM epoch ), CommitteeMembers AS ( - SELECT DISTINCT ON (cm.committee_hash_id) - cr.id, - block.time, - encode(cold_key_hash.raw, 'hex') cold_key, - encode(hot_key_hash.raw, 'hex') hot_key - FROM committee_registration cr - JOIN tx ON tx.id = cr.tx_id - JOIN block ON block.id = tx.block_id - JOIN committee_hash cold_key_hash ON cr.cold_key_id = cold_key_hash.id - JOIN committee_hash hot_key_hash ON cr.hot_key_id = hot_key_hash.id - JOIN committee_member cm ON cm.committee_hash_id = cold_key_hash.id OR cm.committee_hash_id = hot_key_hash.id - LEFT JOIN committee_de_registration cdr ON cdr.cold_key_id = cold_key_hash.id - CROSS JOIN CurrentEpoch - WHERE - cdr.id IS NULL AND cm.expiration_epoch > CurrentEpoch.no + SELECT + DISTINCT cm.committee_hash_id AS committee_members + FROM committee_member cm + JOIN committee c ON c.id = cm.committee_id + LEFT JOIN gov_action_proposal gap ON gap.id = c.gov_action_proposal_id + CROSS JOIN CurrentEpoch ce + WHERE ( + (c.gov_action_proposal_id IS NULL) + OR + (gap.enacted_epoch IS NOT NULL AND gap.enacted_epoch <= ce.no) + ) + AND cm.expiration_epoch >= ce.no ), NoOfCommitteeMembers AS ( SELECT COUNT(*) total FROM CommitteeMembers diff --git a/govtool/frontend/package-lock.json b/govtool/frontend/package-lock.json index aa7470bca..4b6e6afcc 100644 --- a/govtool/frontend/package-lock.json +++ b/govtool/frontend/package-lock.json @@ -15,7 +15,7 @@ "@hookform/resolvers": "^3.3.1", "@intersect.mbo/govtool-outcomes-pillar-ui": "v1.5.9", "@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8", - "@intersect.mbo/pdf-ui": "1.0.14-beta", + "@intersect.mbo/pdf-ui": "1.0.15-beta", "@mui/icons-material": "^5.14.3", "@mui/material": "^5.14.4", "@noble/ed25519": "^2.3.0", @@ -3426,9 +3426,9 @@ "license": "ISC" }, "node_modules/@intersect.mbo/pdf-ui": { - "version": "1.0.14-beta", - "resolved": "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-1.0.14-beta.tgz", - "integrity": "sha512-d+soKsSE6xbNAmjqjZfs1HEsYLJeE9UTlM91kpMtujEeTTZDyg+EwbyjZ5a1ZpRZCD0D7j6tg69muSHxrz6BLg==", + "version": "1.0.15-beta", + "resolved": "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-1.0.15-beta.tgz", + "integrity": "sha512-Yzve799kMvCA5/9k3yyUmOyOAkpQuro9wo7PiF3Ham9QYjTuygb9QXEbeyCM0d5ofTePmnMKEqiFZ4x9AmTuIg==", "dependencies": { "@emurgo/cardano-serialization-lib-asmjs": "^12.0.0-beta.2", "@fontsource/poppins": "^5.0.14", diff --git a/govtool/frontend/package.json b/govtool/frontend/package.json index 578e6c801..a23ab3685 100644 --- a/govtool/frontend/package.json +++ b/govtool/frontend/package.json @@ -29,7 +29,7 @@ "@hookform/resolvers": "^3.3.1", "@intersect.mbo/govtool-outcomes-pillar-ui": "v1.5.9", "@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8", - "@intersect.mbo/pdf-ui": "1.0.14-beta", + "@intersect.mbo/pdf-ui": "1.0.15-beta", "@mui/icons-material": "^5.14.3", "@mui/material": "^5.14.4", "@noble/ed25519": "^2.3.0", diff --git a/govtool/frontend/src/components/molecules/DataActionsBar.tsx b/govtool/frontend/src/components/molecules/DataActionsBar.tsx index b6672a968..88790149d 100644 --- a/govtool/frontend/src/components/molecules/DataActionsBar.tsx +++ b/govtool/frontend/src/components/molecules/DataActionsBar.tsx @@ -74,14 +74,16 @@ export const DataActionsBar: FC = ({ setChosenFilters?.((prev) => (prev ?? []).filter((k) => k !== key)); return ( - + = ({ borderColor: "#6E87D9", borderRadius: 50, boxShadow: "2px 2px 20px 0 rgba(0,0,0,0.05)", - fontSize: 11, + fontSize: { xs: 16, sm: 11 }, fontWeight: 500, height: 48, padding: "16px 24px", @@ -133,6 +135,7 @@ export const DataActionsBar: FC = ({ flex: "0 0 auto", flexShrink: 0, mt: { xs: 1, sm: 0 }, + mr: { xs: 2, sm: 0 }, }} > = ({ const [inProgressDelegationDRepData, setInProgressDelegationDRepData] = useState(undefined); - // Set initial filters and sort useEffect(() => { if (!lastPath.includes("drep_directory")) { setChosenFilters([DRepStatus.Active]); @@ -104,7 +103,7 @@ export const DRepDirectoryContent: FC = ({ baselineTotalForStatus, } = useGetDRepListPaginatedQuery( { - page: page - 1, // convert 1-based UI -> 0-based API + page: page - 1, pageSize, searchPhrase: debouncedSearchText, sorting: chosenSorting as DRepListSort, @@ -152,8 +151,13 @@ export const DRepDirectoryContent: FC = ({ AutomatedVotingOptionCurrentDelegation.drep_always_no_confidence); return ( - - {/* My delegation */} + {myDrep && !inProgressDelegation && currentDelegation && @@ -162,61 +166,65 @@ export const DRepDirectoryContent: FC = ({ - + + + )} {inProgressDelegation && inProgressDelegation !== myDRepId && inProgressDelegationDRepData && ( - + + + )} - {/* Automated voting options */} {isConnected && (
{t("dRepDirectory.delegationOptions")} - + + +
)} - {/* DRep list */} <> {t("dRepDirectory.listTitle")} @@ -266,11 +274,31 @@ export const DRepDirectoryContent: FC = ({ opacity: isPrev ? 0.5 : 1, transition: "opacity 0.2s", flex: 1, + width: "100%", + maxWidth: "100%", + overflowX: "hidden", }} > {filteredDoNotListDReps?.length === 0 && } {filteredDoNotListDReps?.map((dRep) => ( - + = ({ ))} - { - setPageSize(n); - setPage(1); - }} - /> + + { + setPageSize(n); + setPage(1); + }} + /> + ); diff --git a/govtool/frontend/src/utils/validateSignature.ts b/govtool/frontend/src/utils/validateSignature.ts index b39d274ea..cd6e7d2a8 100644 --- a/govtool/frontend/src/utils/validateSignature.ts +++ b/govtool/frontend/src/utils/validateSignature.ts @@ -24,11 +24,11 @@ export const validateSignature = async ({ switch (algorithm) { case "ed25519": case "Ed25519": { - return verifyEd25519Signature(signature, messageHash, publicKey); + return await verifyEd25519Signature(signature, messageHash, publicKey); } case "CIP-8": case "CIP-0008": { - return verifyCIP8Signature(signature, messageHash, publicKey); + return await verifyCIP8Signature(signature, messageHash, publicKey); } default: console.error("Unsupported algorithm:", algorithm);