mirror of
https://github.com/tornadocash/tornado-classic-ui
synced 2024-02-02 15:04:09 +01:00
feat: propose by delegator
This commit is contained in:
parent
a1c3acb1fc
commit
b1fe50b7d4
@ -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)
|
||||
|
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user