diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ba3b9154..f27a9be4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ changes. ### Added -- +- add support for CIP-129 governance identifiers [Issue 2183](https://github.com/IntersectMBO/govtool/issues/2183) ### Fixed diff --git a/govtool/frontend/src/components/molecules/GovernanceActionCard.tsx b/govtool/frontend/src/components/molecules/GovernanceActionCard.tsx index c70ede09a..c658b068f 100644 --- a/govtool/frontend/src/components/molecules/GovernanceActionCard.tsx +++ b/govtool/frontend/src/components/molecules/GovernanceActionCard.tsx @@ -11,6 +11,7 @@ import { import { useScreenDimension, useTranslation } from "@hooks"; import { + encodeCIP129Identifier, getFullGovActionId, getProposalTypeLabel, getProposalTypeNoEmptySpaces, @@ -53,6 +54,11 @@ export const GovernanceActionCard: FC = ({ ...props }) => { const { t } = useTranslation(); const govActionId = getFullGovActionId(txHash, index); + const cip129GovernanceActionId = encodeCIP129Identifier( + txHash, + index.toString(16).padStart(2, "0"), + "gov_action", + ); return ( = ({ ...props }) => { /> + diff --git a/govtool/frontend/src/components/molecules/GovernanceVotedOnCard.tsx b/govtool/frontend/src/components/molecules/GovernanceVotedOnCard.tsx index e47980920..cb5a4fd54 100644 --- a/govtool/frontend/src/components/molecules/GovernanceVotedOnCard.tsx +++ b/govtool/frontend/src/components/molecules/GovernanceVotedOnCard.tsx @@ -5,6 +5,7 @@ import { Button } from "@atoms"; import { PATHS } from "@consts"; import { useScreenDimension, useTranslation } from "@hooks"; import { + encodeCIP129Identifier, getFullGovActionId, getProposalTypeLabel, getProposalTypeNoEmptySpaces, @@ -43,6 +44,13 @@ export const GovernanceVotedOnCard = ({ votedProposal, inProgress }: Props) => { const { isMobile, screenWidth } = useScreenDimension(); const { t } = useTranslation(); + const govActionId = getFullGovActionId(txHash, index); + const cip129GovernanceActionId = encodeCIP129Identifier( + txHash, + index.toString(16).padStart(2, "0"), + "gov_action", + ); + return ( { /> + @@ -120,15 +135,12 @@ export const GovernanceVotedOnCard = ({ votedProposal, inProgress }: Props) => { >