Skip to content

Commit f7e65d0

Browse files
authored
Merge pull request #3479 from IntersectMBO/fix/metadata-validation-issues
fix: validating drep metadata
2 parents 701c166 + 933b943 commit f7e65d0

File tree

7 files changed

+35
-296
lines changed

7 files changed

+35
-296
lines changed

CHANGELOG.md

Lines changed: 11 additions & 269 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ changes.
1212

1313
### Added
1414

15+
### Fixed
16+
17+
### Changed
18+
19+
### Removed
20+
21+
## [v2.0.20](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.20) 2025-04-15
22+
23+
### Added
24+
1525
- Add Proposal discussion context that manages username [Issue 3341](https://github.com/IntersectMBO/govtool/issues/3341)
1626
- Add epochParams and ada holder balance to Proposal Discussion Pillar [Issue 2243](https://github.com/IntersectMBO/govtool/issues/2243)
1727
- Add skeleton element to the drep and governance action cards on validation [Issue 3247](https://github.com/IntersectMBO/govtool/issues/3247)
@@ -24,6 +34,7 @@ changes.
2434
- Fix scroll on a drawer on smaller resolution
2535
- Fix incorrect routing on connecting wallet on budget discussion page
2636
- Fix missing validation on failed image sha generation [Issue 3246](https://github.com/IntersectMBO/govtool/issues/3246)
37+
- Fix validating drep metadata
2738

2839
### Changed
2940

@@ -60,275 +71,6 @@ changes.
6071

6172
### Changed
6273

63-
- Bump CSL to v14 [Issue 3037](https://github.com/IntersectMBO/govtool/issues/3037)
64-
65-
### Removed
66-
67-
## [v2.0.17](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.17) 2025-03-18
68-
69-
### Added
70-
71-
### Fixed
72-
73-
- allow casting same vote with a different rationale [Issue 3191](https://github.com/IntersectMBO/govtool/issues/3191)
74-
75-
### Changed
76-
77-
### Removed
78-
79-
## [v2.0.16](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.16) 2025-03-17
80-
81-
### Added
82-
83-
- Add support for preprod in matomo analytics [Issue 3173](https://github.com/IntersectMBO/govtool/issues/3173)
84-
85-
### Fixed
86-
87-
- hotfix for ada handle and payment address validation order [Issue 3155](https://github.com/IntersectMBO/govtool/issues/3155)
88-
- fix proposal list performance by pre-filtering active proposals [Issue 3190](https://github.com/IntersectMBO/govtool/issues/3190)
89-
- Fix wrong prefix of script based dreps in CIP-129 standard [Issue 3203](https://github.com/IntersectMBO/govtool/issues/3203)
90-
91-
### Changed
92-
93-
- Exclude network total stake and info from network metrics [Issue 3189](https://github.com/IntersectMBO/govtool/issues/3189)
94-
- Change restriction level for re-voting on governance actions [Issue 3191](https://github.com/IntersectMBO/govtool/issues/3191)
95-
96-
### Removed
97-
98-
## [v2.0.15](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.15) 2025-03-11
99-
100-
### Added
101-
102-
- Add support for ada handle in drep payment address [Issue 3155](https://github.com/IntersectMBO/govtool/issues/3155)
103-
- Improve numerical data formatting in drep directory [Issue 3148](https://github.com/IntersectMBO/govtool/issues/3148)
104-
105-
### Fixed
106-
107-
### Changed
108-
109-
### Removed
110-
111-
## [v2.0.14](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.14) 2025-03-06
112-
113-
### Added
114-
115-
- Add image tag for DRep in GovTool metadata [Issue 3137](https://github.com/IntersectMBO/govtool/issues/3137)
116-
117-
### Fixed
118-
119-
- Fix calculating withdrawals when rewards records are empty for a given stake key [Issue 3134](https://github.com/IntersectMBO/govtool/issues/3134)
120-
121-
### Changed
122-
123-
### Removed
124-
125-
- Remove ratification threshold for Info Action for Consitutional Committee [Issue 3108](https://github.com/IntersectMBO/govtool/issues/3108)
126-
127-
## [v2.0.13](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.13) 2025-02-27
128-
129-
### Added
130-
131-
### Fixed
132-
133-
- Fix responsive error on menu [Issue 3055](https://github.com/IntersectMBO/govtool/issues/3055)
134-
- Fix wrong placement of nav items in disconnected menu [Issue 3057](https://github.com/IntersectMBO/govtool/issues/3057)
135-
- Fix missing subtraction withdrawals from ada holder balance [Issue 3061](https://github.com/IntersectMBO/govtool/issues/3061)
136-
- Fix displaying voting power on direct voter cards
137-
138-
### Changed
139-
140-
- Change drep details and governance action header components to follow accessibility standards [Issue 3065](https://github.com/IntersectMBO/govtool/issues/3065)
141-
142-
### Removed
143-
144-
## [v2.0.12](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.12) 2025-02-21
145-
146-
### Added
147-
148-
- Add metadata url and hash to drep details [Issue 2911](https://github.com/IntersectMBO/govtool/issues/2911)
149-
- Add CC votes percentages, not voted and Ratification threshold
150-
- Add support for submitting all 7 governance action types [Issue 2258](https://github.com/IntersectMBO/govtool/issues/2258)
151-
- Add workflow to automatically update any of the @intersect.mbo package [Issue 2968](https://github.com/IntersectMBO/govtool/issues/2968)
152-
- Add Propose Governance Action button in governance actions dashboard [Issue 1188](https://github.com/IntersectMBO/govtool/issues/1188)
153-
- Add click handlers to non-interactive elements [Issue 2929](https://github.com/IntersectMBO/govtool/issues/2929)
154-
- Allow searching for yourself in DRep Directory [Issue 2993](https://github.com/IntersectMBO/govtool/issues/2993)
155-
- Add mathematical styling for governance actions [Issue 2984](https://github.com/IntersectMBO/govtool/issues/2984)
156-
- Add script to update GovTool version
157-
- Add `isStakeKeyRegistered` for the usage by pillars [Issue 2384](https://github.com/IntersectMBO/govtool/issues/2384)
158-
- Add server side compression for large assets
159-
- Add outcomes
160-
161-
### Fixed
162-
163-
- Fix calculating votes counting for governance actions
164-
- Fix crashing backend on unhandled missing proposal from vote [Issue 2920](https://github.com/IntersectMBO/govtool/issues/2920)
165-
- Remove abstain votes (not auto abstain) from total DRep stake
166-
- Fix counting committee members [Issue 2948](https://github.com/IntersectMBO/govtool/issues/2948)
167-
- Fix refetching DRep list on every enter [Issue 2994](https://github.com/IntersectMBO/govtool/issues/2994)
168-
- Fix displaying helper buttons on governance action card details [Issue 3022](https://github.com/IntersectMBO/govtool/issues/3022)
169-
170-
### Changed
171-
172-
- Change threshold visual representation in governance action votes
173-
- Resize governance action details columns
174-
- Update @intersect.mbo/pdf-ui to v0.6.0
175-
- Bump actions/cache to v4 across workflows
176-
- Unify ADA Format across the application [Issue 3031](https://github.com/IntersectMBO/govtool/issues/3031)
177-
- Change default filtering for DRep directory to show the active DReps [Issue 3035](https://github.com/IntersectMBO/govtool/issues/3035)
178-
179-
### Removed
180-
181-
- Remove abstain from total DRep votes calculation
182-
183-
## [v2.0.11](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.11) 2025-02-04
184-
185-
### Added
186-
187-
-
188-
189-
### Fixed
190-
191-
- Fix displaying DRep with doNotList property as string
192-
- Handle exception when no index is provided to /proposal/get endpoint [Issue 1841](https://github.com/IntersectMBO/govtool/issues/1841)
193-
- Fix displaying vote pill on voted on cards
194-
- Fix incorrect link to learn more about direct voters [Issue 2647](https://github.com/IntersectMBO/govtool/issues/2647)
195-
- Fix missing No DRep found message on DRep Directory [Issue 2889](https://github.com/IntersectMBO/govtool/issues/2889)
196-
- Fix displaying givenName placeholder instead of actual value on DRep card [Issue 2888](https://github.com/IntersectMBO/govtool/issues/2888)
197-
- Fix executing insertBefore on undefined node [Issue 2878](https://github.com/IntersectMBO/govtool/issues/2878)
198-
199-
### Changed
200-
201-
- Change votes representation on Governance Actions [Issue 2880](https://github.com/IntersectMBO/govtool/issues/2880)
202-
- Change vote rationale character limit to 10000 [Issue 2891](https://github.com/IntersectMBO/govtool/issues/2891)
203-
- Move ratification threshold label below the voter type [Issue 2893](https://github.com/IntersectMBO/govtool/issues/2893)
204-
205-
### Removed
206-
207-
- Remove redundant sentry reports on handled wallet exceptions [Issue 2680](https://github.com/IntersectMBO/govtool/issues/2680)
208-
209-
## [v2.0.10](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.10) 2025-01-29
210-
211-
### Added
212-
213-
- Add exception handler on stake key voting power query execution [Issue 2757](https://github.com/IntersectMBO/govtool/issues/2757)
214-
- Add script hash to new consitution governance action [Issue 2745](https://github.com/IntersectMBO/govtool/issues/2745)
215-
216-
### Fixed
217-
218-
-
219-
220-
### Changed
221-
222-
- Bump @intersect.mbo/pdf-ui to v0.5.11
223-
224-
### Removed
225-
226-
-
227-
228-
## [v2.0.9](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.9) 2025-01-24
229-
230-
### Added
231-
232-
-
233-
234-
### Fixed
235-
236-
- Fix opening IPFS links [Issue 2711](https://github.com/IntersectMBO/govtool/issues/2711)
237-
238-
### Changed
239-
240-
- Change labelling of governance action metadata anchor
241-
- Change labelling and order of new constitution governance action details
242-
243-
### Removed
244-
245-
-
246-
247-
## [v2.0.8](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.8) 2025-01-23
248-
249-
### Added
250-
251-
- Add share DRep button to every DRep instead of only our own [Issue 2686](https://github.com/IntersectMBO/govtool/issues/2686)
252-
- Show metadata anchor in Governance Action Details [Issue 2178](https://github.com/IntersectMBO/govtool/issues/2178)
253-
- Handle unexpected drep info query result [Issue 2676](https://github.com/IntersectMBO/govtool/issues/2676)
254-
255-
### Fixed
256-
257-
- Fix usage of trim on missing label
258-
- Fix blank screen when registering as a DRep [Issue 2408](https://github.com/IntersectMBO/govtool/issues/2408)
259-
- Fix type mismatch between sql and haskell code for stake key address
260-
- Handle missing api key exception [Issue 2683](https://github.com/IntersectMBO/govtool/issues/2683)
261-
262-
### Changed
263-
264-
- Bump cardano-node to 10.1.4
265-
- Make CIP-129 governance identifiers the default ones
266-
267-
### Removed
268-
269-
- Remove logging to sentry for DRep registration transaction [Issue 2681](https://github.com/IntersectMBO/govtool/issues/2681)
270-
- Remove logging to sentry when delegation transaction fails [Issue 2682](https://github.com/IntersectMBO/govtool/issues/2682)
271-
272-
## [v2.0.7](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.7) 2025-01-20
273-
274-
### Added
275-
276-
-
277-
278-
### Fixed
279-
280-
- Fix calculating DRep activity
281-
- Fix fetching Governance Actions being navigated from dashboard
282-
283-
### Changed
284-
285-
- Bump @intersect.mbo/pdf-ui to v0.5.7
286-
287-
### Removed
288-
289-
-
290-
291-
## [v2.0.6](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.6) 2025-01-16
292-
293-
### Added
294-
295-
- Add support for base64 encoded images [Issue 2633](https://github.com/IntersectMBO/govtool/issues/2633)
296-
- Add searching for metadata [Issue 2634](https://github.com/IntersectMBO/govtool/issues/2634)
297-
- Allow delegation to inactive DRep [Issue 2589](https://github.com/IntersectMBO/govtool/issues/2589)
298-
299-
### Fixed
300-
301-
- Fix searching by full DRep IDs on wrong prefix cut [Issue 2639](https://github.com/IntersectMBO/govtool/issues/2639)
302-
- Trim whitespace from search bar input [Issue 2472](https://github.com/IntersectMBO/govtool/issues/2472)
303-
304-
### Changed
305-
306-
-
307-
308-
### Removed
309-
310-
-
311-
312-
## [v2.0.5](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.5) 2025-01-10
313-
314-
### Added
315-
316-
-
317-
318-
### Fixed
319-
320-
- Fix counting submitted votes [Issue 2609](https://github.com/IntersectMBO/govtool/issues/2609)
321-
- Fix opening relative paths in external links
322-
- Fix passing random sorting to governance actions on disconnected wallet
323-
324-
### Changed
325-
326-
- Bump @intersect.mbo/pdf-ui to v0.5.6
327-
328-
### Removed
329-
330-
-
331-
33274
## [v2.0.4](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.4) 2025-01-07
33375

33476
### Added

govtool/frontend/src/components/organisms/DRepCard.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,10 @@ export const DRepCard = ({
173173
/>
174174
) : (
175175
<Typography
176-
sx={{ ellipsisStyles, color: metadataStatus && "errorRed" }}
176+
sx={{
177+
ellipsisStyles,
178+
color: metadataStatus.current && "errorRed",
179+
}}
177180
>
178181
{metadataStatus.current
179182
? getMetadataDataMissingStatusTranslation(

govtool/frontend/src/components/organisms/DRepDetailsCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const DRepDetailsCard = ({
6060
setIsValidating(true);
6161

6262
const { status: metadataValidationStatus } = await validateMetadata({
63-
standard: MetadataStandard.CIP108,
63+
standard: MetadataStandard.CIP119,
6464
url: url ?? "",
6565
hash: metadataHash ?? "",
6666
});

govtool/frontend/src/components/organisms/DashboardCards/DelegateDashboardCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const DelegateDashboardCard = ({
5050
useEffect(() => {
5151
const validate = async () => {
5252
const { status } = await validateMetadata({
53-
standard: MetadataStandard.CIP108,
53+
standard: MetadataStandard.CIP119,
5454
url: myDRepDelegationData?.url ?? "",
5555
hash: myDRepDelegationData?.metadataHash ?? "",
5656
});

govtool/frontend/src/components/organisms/GovernanceActionsToVote.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ import { PATHS } from "@consts";
66
import { useCardano } from "@context";
77
import { useScreenDimension, useTranslation } from "@hooks";
88
import { ProposalData } from "@models";
9-
import { GovernanceActionCard } from "@molecules";
109
import { getProposalTypeTitle, getFullGovActionId } from "@utils";
11-
import { Slider } from "@organisms";
10+
import { Slider, ValidatedGovernanceActionCard } from "@organisms";
1211

1312
type GovernanceActionsToVoteProps = {
1413
filters: string[];
@@ -58,7 +57,7 @@ export const GovernanceActionsToVote = ({
5857
width: "auto",
5958
}}
6059
>
61-
<GovernanceActionCard
60+
<ValidatedGovernanceActionCard
6261
{...action}
6362
inProgress={
6463
onDashboard &&

govtool/frontend/src/hooks/mutations/metadataValidation/useValidateMutation.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
1-
import { useMutation } from "react-query";
1+
import { useMutation, useQueryClient } from "react-query";
22

33
import { postValidate } from "@services";
44
import { MUTATION_KEYS } from "@consts";
55
import { MetadataValidationDTO } from "@models";
66

77
export const useValidateMutation = <MetadataType>() => {
8-
const { data, isLoading, mutateAsync } = useMutation({
9-
mutationFn: (body: MetadataValidationDTO) => postValidate<MetadataType>(body),
8+
const queryClient = useQueryClient();
9+
10+
const { data, isLoading } = useMutation({
11+
mutationFn: (body: MetadataValidationDTO) =>
12+
postValidate<MetadataType>(body),
1013
mutationKey: [MUTATION_KEYS.postValidateKey],
1114
});
1215

16+
const validateMetadata = async (body: MetadataValidationDTO) =>
17+
queryClient.fetchQuery({
18+
queryKey: [MUTATION_KEYS.postValidateKey, body.hash, body.url],
19+
queryFn: () => postValidate<MetadataType>(body),
20+
cacheTime: 20 * 1000, // 20 seconds
21+
});
22+
1323
return {
14-
validateMetadata: mutateAsync,
24+
validateMetadata,
1525
validationStatus: data,
1626
isValidating: isLoading,
1727
};

0 commit comments

Comments
 (0)