Skip to content

Commit

Permalink
[#210] 'UserInfo' changed to 'VoterInfo'
Browse files Browse the repository at this point in the history
  • Loading branch information
JanJaroszczak committed Feb 26, 2024
1 parent 47cb366 commit d6c5514
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions govtool/frontend/src/context/wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import { Trans } from "react-i18next";
import { useModal, useSnackbar } from ".";

import { PATHS } from "@consts";
import { CardanoApiWallet, userInfo, Protocol } from "@models";
import { CardanoApiWallet, VoterInfo, Protocol } from "@models";
import type { StatusModalState } from "@organisms";
import {
getPubDRepID,
Expand Down Expand Up @@ -99,14 +99,14 @@ interface CardanoContext {
disconnectWallet: () => Promise<void>;
enable: (walletName: string) => Promise<EnableResponse>;
error?: string;
voter: userInfo | undefined;
voter: VoterInfo | undefined;
isEnabled: boolean;
pubDRepKey: string;
dRepID: string;
dRepIDBech32: string;
isMainnet: boolean;
stakeKey?: string;
setVoter: (key: undefined | userInfo) => void;
setVoter: (key: undefined | VoterInfo) => void;
setStakeKey: (key: string) => void;
stakeKeys: string[];
walletApi?: CardanoApiWallet;
Expand Down Expand Up @@ -169,7 +169,7 @@ CardanoContext.displayName = "CardanoContext";

function CardanoProvider(props: Props) {
const [isEnabled, setIsEnabled] = useState(false);
const [voter, setVoter] = useState<userInfo | undefined>(undefined);
const [voter, setVoter] = useState<VoterInfo | undefined>(undefined);
const [walletApi, setWalletApi] = useState<CardanoApiWallet | undefined>(
undefined
);
Expand Down
4 changes: 2 additions & 2 deletions govtool/frontend/src/context/walletUtils.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { getAdaHolderCurrentDelegation, getDRepInfo } from "@services";
import { DRepActionType } from "./wallet";
import { userInfo } from "@models";
import { VoterInfo } from "@models";

export const setLimitedRegistrationInterval = (
intervalTime: number,
attemptsNumber: number,
dRepID: string,
transactionType: DRepActionType | Omit<DRepActionType, "update">,
setVoter: (key: undefined | userInfo) => void
setVoter: (key: undefined | VoterInfo) => void
): Promise<boolean> => {
return new Promise(async (resolve) => {
const desiredResult = transactionType === "registration" ? true : false;
Expand Down
2 changes: 1 addition & 1 deletion govtool/frontend/src/models/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface userInfo {
export interface VoterInfo {
isRegisteredAsDRep: boolean;
wasRegisteredAsDRep: boolean;
isRegisteredAsSoleVoter: boolean;
Expand Down
4 changes: 2 additions & 2 deletions govtool/frontend/src/services/requests/getDRepInfo.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { API } from "../API";

import type { userInfo } from "@models";
import type { VoterInfo } from "@models";

export const getDRepInfo = async (dRepID: string) => {
const response = await API.get<userInfo>(`/drep/info/${dRepID}`);
const response = await API.get<VoterInfo>(`/drep/info/${dRepID}`);

return response.data;
};

0 comments on commit d6c5514

Please sign in to comment.