Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions govtool/backend/sql/get-network-metrics.sql
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,10 @@ CommitteeThreshold AS (
SELECT
c.*
FROM committee c
LEFT JOIN LatestGovAction lga ON c.gov_action_proposal_id = lga.id
WHERE (c.gov_action_proposal_id IS NOT NULL AND lga.id IS NOT NULL)
OR (c.gov_action_proposal_id IS NULL)
where
( c.gov_action_proposal_id = (Select id from LatestGovAction))
OR ( c.gov_action_proposal_id IS NULL)
order by gov_action_proposal_id nulls last limit 1
)
SELECT
UniqueDelegators.count AS unique_delegators,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo, useState, useEffect } from "react";
import { Box, Tabs, Tab, styled, Skeleton } from "@mui/material";
import { Box, Tabs, Tab, styled, Skeleton, Link } from "@mui/material";
import { useLocation } from "react-router-dom";
import CheckCircleOutlineIcon from "@mui/icons-material/CheckCircleOutline";
import CancelOutlinedIcon from "@mui/icons-material/CancelOutlined";
Expand Down Expand Up @@ -29,9 +29,11 @@ import {
validateSignature,
} from "@utils";
import { MetadataValidationStatus, ProposalData } from "@models";
import { Trans } from "react-i18next";
import { errorRed, successGreen } from "@/consts";
import { GovernanceActionType } from "@/types/governanceAction";
import { useAppContext } from "@/context";
import { theme } from "@/theme";

type TabPanelProps = {
children?: React.ReactNode;
Expand Down Expand Up @@ -165,6 +167,11 @@ export const GovernanceActionDetailsCardData = ({
hash ?? ""
}`;

const isItMLabsWithdrawal =
type === GovernanceActionType.TreasuryWithdrawals &&
cip129GovernanceActionId ===
"gov_action18nefry4qacd80xzs2srjahxm2e4vz3c8wvrr03rrtk8mdqfuknysq66459t";

const tabs = useMemo(
() =>
[
Expand Down Expand Up @@ -390,6 +397,7 @@ export const GovernanceActionDetailsCardData = ({
publicKey={author.publicKey}
algorithm={author.witnessAlgorithm}
jsonContent={jsonContent}
forceValidStatus={isItMLabsWithdrawal}
/>
<span>{author.name}</span>
<Tooltip
Expand All @@ -409,6 +417,7 @@ export const GovernanceActionDetailsCardData = ({
</Tooltip>
</Box>
))}
{isItMLabsWithdrawal && authors && authors.length > 0 && <AuthorsVerificationInfoBox />}
</Box>
</GovernanceActionCardElement>

Expand Down Expand Up @@ -520,13 +529,16 @@ const AuthorSignatureStatus = ({
publicKey,
signature,
jsonContent,
forceValidStatus = false,
}: {
algorithm?: string;
publicKey?: string;
signature?: string;
jsonContent?: Record<string, unknown>;
forceValidStatus: boolean;
}) => {
const { t } = useTranslation();

const [isSignatureValid, setIsSignatureValid] = useState<boolean | null>(
null,
);
Expand All @@ -543,6 +555,9 @@ const AuthorSignatureStatus = ({
const result = await validateSignature(args);
if (!cancelled) setIsSignatureValid(result);
}
if (forceValidStatus) {
return setIsSignatureValid(true);
}
checkSignature();
return () => {
cancelled = true;
Expand Down Expand Up @@ -573,3 +588,46 @@ const AuthorSignatureStatus = ({
</Tooltip>
);
};

const AuthorsVerificationInfoBox = () => {
const { t } = useTranslation();
const {
palette: { lightBlue, secondaryBlue },
} = theme;

return (
<Box
sx={{
display: "flex",
gap: 1,
backgroundColor: lightBlue,
p: 2,
borderRadius: "5px",
}}
>
<InfoOutlinedIcon fontSize="small" style={{ color: secondaryBlue }} />
<Box sx={{ display: "flex", flexDirection: "column", gap: 2 }}>
<Typography variant="body2">
{t("govActions.safeModeInfoBox.title")}
</Typography>
<Typography variant="body2">
{t("govActions.safeModeInfoBox.line1")}
</Typography>
<Typography variant="body2">
<Trans
i18nKey="govActions.safeModeInfoBox.line2"
components={[<span style={{ fontWeight: 700 }} key="0" />]}
/>
</Typography>
<Link
href="https://docs.gov.tools/cardano-govtool/faqs/how-was-the-author-of-withdraw-ara45-217-for-mlabs-core...-ga-verified"
target="_blank"
rel="noopener noreferrer"
sx={{ fontSize: "14px" }}
>
{t("govActions.safeModeInfoBox.link")}
</Link>
</Box>
</Box>
);
};
6 changes: 6 additions & 0 deletions govtool/frontend/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,12 @@
"additionalInformationAboutYourVote": "Additional information about your vote",
"provideNewContextAboutYourVote": "Provide new context about your vote",
"rationale": "Rationale",
"safeModeInfoBox": {
"title": "How this Author got verified?",
"line1": "A metadata formatting issue caused only part of the data to be signed, preventing automatic verification — the signature is valid and can be manually confirmed.",
"line2": "<0>Govtool have manually verified the signature confirming this Treasury action is genuinely coming from Intersect</0> and has marked it accordingly to make it explicit to DReps.",
"link": "More details"
},
"seeExternalData": "See external data",
"selectDifferentOption": "Select a different option to change your vote",
"showVotes": "Show votes",
Expand Down
Loading