Skip to content

Commit

Permalink
Add approval (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
smitch88 authored Aug 9, 2023
1 parent e7f7b32 commit d420f0f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions client/components/proposal/ProposalDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import { useStore } from "utils/store";
import { toast } from "react-toastify";
import useShowDelegationModalOption from "utils/useShowDelegationModalOption";
import { EnsureDelegationModal } from "components/proposal/EnsureDelegationModal";
import { PageTitle } from "components/PageTitle";
import { getCleanProposalContent } from "utils/index";
import { Address } from "components/Address";
import { SupportTable } from "./SupportTable";
import { StateTag } from "./StateTag";
import { ProposalHistory } from "./ProposalHistory";
import moment from "moment";
import RegisterToVote from "components/proposal/RegisterToVote";
import { useAccount, useSigner } from "wagmi";

export const ProposalDetail = ({
id,
Expand All @@ -35,7 +35,9 @@ export const ProposalDetail = ({
voters: Array<object>;
transactions: Array<object>;
}) => {
const { address, contracts, pendingTransactions, rpcProvider } = useStore();
const { address } = useAccount();
const { data: signer } = useSigner();
const { contracts, pendingTransactions, rpcProvider } = useStore();
const [proposalActions, setProposalActions] = useState(null);
const { showModalIfApplicable } = useShowDelegationModalOption();
const [proposal, setProposal] = useState(null);
Expand Down Expand Up @@ -139,7 +141,10 @@ export const ProposalDetail = ({
return;
}

const transaction = await Governance.castVote(proposalId, support);
const transaction = await Governance.connect(signer).castVote(
proposalId,
support
);

useStore.setState({
pendingTransactions: [
Expand Down

0 comments on commit d420f0f

Please sign in to comment.