Skip to content

Commit

Permalink
[#280] Fix get drep voting power request
Browse files Browse the repository at this point in the history
  • Loading branch information
MSzalowski committed Feb 23, 2024
1 parent da200b0 commit 478fc0b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ changes.
- Fixed vote calculation problems related to NoConfidence DRep [Issue 59](https://github.com/IntersectMBO/govtool/issues/59)
- Fixed ada-holder/get-current-delegation error when delegated to NoConfidence or AlwaysAbstain dreps. [Issue 82](https://github.com/IntersectMBO/govtool/issues/82)
- Fixed deployment scripts to address [Issue 171](https://github.com/IntersectMBO/govtool/issues/171).
- Fixed get drep voting power incorrectly executed endpoint [Issue 280](https://github.com/IntersectMBO/govtool/issues/280)

### Changed
- Update Cardano-Serialization-Lib to 12.0.0-alpha.16 [Issue 156](https://github.com/IntersectMBO/govtool/issues/156)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ export const useDRepRegisterMutation = () => {

const { mutateAsync, isLoading } = useMutation(postDRepRegister, {
onSuccess: () => {
setDRep({ deposit: 100, isRegistered: true, wasRegistered: false });
setDRep({
deposit: 100,
isRegistered: true,
wasRegistered: false,
});
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ export const useDRepRetireMutation = () => {

const { mutateAsync } = useMutation(postDRepRetire, {
onSuccess: () => {
setDRep({ deposit: 100, wasRegistered: true, isRegistered: false });
setDRep({
deposit: 100,
wasRegistered: true,
isRegistered: false,
});
addSuccessAlert("DRep retired.");
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const useGetDRepVotingPowerQuery = () => {
queryFn: async () => {
return await getDRepVotingPower({ dRepID });
},
enabled: !!dRepID && dRep?.isRegistered,
enabled: !!dRepID && !!dRep?.isRegistered,
});

return { dRepVotingPower: data, isDRepVotingPowerLoading: isLoading };
Expand Down
4 changes: 3 additions & 1 deletion govtool/frontend/src/models/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export interface DRepInfo {
isRegistered: boolean;
isRegisteredAsSoleVoter: boolean;
wasRegistered: boolean;
deposit: number;
wasRegisteredAsSoleVoter: boolean;
deposit: number | null;
}

export interface DRepData {
Expand Down

0 comments on commit 478fc0b

Please sign in to comment.