diff --git a/components/governance/ProposalsList.vue b/components/governance/ProposalsList.vue index 1cadbbb..d3ccd92 100644 --- a/components/governance/ProposalsList.vue +++ b/components/governance/ProposalsList.vue @@ -59,7 +59,7 @@ export default { } }, computed: { - ...mapState('governance/gov', ['lockedBalance', 'proposals']), + ...mapState('governance/gov', ['votingPower', 'proposals']), ...mapGetters('governance/gov', ['isFetchingProposals', 'constants', 'isFetchingBalances']), ...mapGetters('token', ['toDecimals']), filteredProposals() { @@ -74,7 +74,7 @@ export default { }, hasProposalThreshold() { const PROPOSAL_THRESHOLD = toBN(this.constants.PROPOSAL_THRESHOLD) - return toBN(this.lockedBalance).gte(PROPOSAL_THRESHOLD) + return toBN(this.votingPower || 0).gte(PROPOSAL_THRESHOLD) }, proposalThreshold() { return this.toDecimals(this.constants.PROPOSAL_THRESHOLD, 18) diff --git a/store/governance/gov.js b/store/governance/gov.js index 1237f50..5382cb4 100644 --- a/store/governance/gov.js +++ b/store/governance/gov.js @@ -165,10 +165,13 @@ const actions = { const govInstance = getters.govContract({ netId }) const json = JSON.stringify({ title, description }) - const data = await govInstance.methods.propose(proposalAddress, json).encodeABI() + + const [delegator] = state.delegators + + const data = await govInstance.methods.proposeByDelegate(delegator, proposalAddress, json).encodeABI() const gas = await govInstance.methods - .propose(proposalAddress, json) + .proposeByDelegate(delegator, proposalAddress, json) .estimateGas({ from: ethAccount, value: 0 }) const callParams = {