Skip to content

Commit

Permalink
chore(gov)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hemanthghs committed Nov 25, 2023
1 parent c93a206 commit a455900
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions frontend/src/store/features/gov/govService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { convertPaginationToParams, cleanURL } from '../../../utils/util';
import { GetProposalsInVotingResponse, ProposalVote } from '@/types/gov';

const proposalsURL = '/cosmos/gov/v1beta1/proposals';
const proposalTallyURL = (id: string): string =>
const proposalTallyURL = (id: number): string =>
`/cosmos/gov/v1beta1/proposals/${id}/tally`;

const voterVoteURL = (id: string, voter: string): string =>
const voterVoteURL = (id: number, voter: string): string =>
`/cosmos/gov/v1beta1/proposals/${id}/votes/${voter}`;

const depositParamsURL = `/cosmos/gov/v1beta1/params/deposit`;
Expand All @@ -31,15 +31,15 @@ const fetchProposals = (

const fetchProposalTally = (
baseURL: string,
proposalId: string
proposalId: number
): Promise<AxiosResponse> => {
const uri = `${cleanURL(baseURL)}${proposalTallyURL(proposalId)}`;
return Axios.get(uri);
};

const fetchVoterVote = (
baseURL: string,
proposalId: string,
proposalId: number,
voter: string,
key: string | undefined,
limit: number | undefined
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/store/features/gov/govSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ export const getProposalsInVoting = createAsyncThunk(
dispatch(
getProposalTally({
baseURL: data.baseURL,
proposalId: proposals[i].proposal_id,
proposalId: Number(proposals[i].proposal_id),
chainID: data.chainID,
})
);

dispatch(
getVotes({
baseURL: data.baseURL,
proposalId: proposals[i].proposal_id,
proposalId: Number(proposals[i].proposal_id),
voter: data.voter,
chainID: data.chainID,
})
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/types/gov.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ interface VoteOption {
}

interface Vote {
proposal_id: string;
proposal_id: number;
voter: string;
option: string;
options: VoteOption[];
Expand Down Expand Up @@ -98,7 +98,7 @@ interface GetProposalsInVotingInputs {

interface GetVotesInputs {
baseURL: string;
proposalId: string;
proposalId: number;
voter: string;
chainID: string;
key?: string;
Expand All @@ -107,6 +107,6 @@ interface GetVotesInputs {

interface GetProposalTallyInputs {
baseURL: string;
proposalId: string;
proposalId: number;
chainID: string;
}

0 comments on commit a455900

Please sign in to comment.