Skip to content

feat: propose by delegator #7

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/governance/ProposalsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions store/governance/gov.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down