Skip to content

Commit

Permalink
Merge pull request #691 from eco-stake/evmos-update-fixes
Browse files Browse the repository at this point in the history
Evmos update fixes
  • Loading branch information
tombeynon authored Jan 6, 2023
2 parents 90fd955 + 33a1668 commit f1a8423
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"txTimeout": 120000,
"ownerAddress": "evmosvaloper1umk407eed7af6anvut6llg2zevnf0dn0feqqny",
"maxPerDay": 1,
"ledgerSupport": false
"authzAminoSupport": false
},
{
"name": "sifchain",
Expand Down
14 changes: 12 additions & 2 deletions src/utils/Vote.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { equal } from 'mathjs'

export const VOTE_CHOICES = {
'VOTE_OPTION_YES': 'Yes',
'VOTE_OPTION_NO': 'No',
Expand All @@ -14,11 +16,19 @@ export const VOTE_VALUES = {

const Vote = (data) => {

const optionHuman = VOTE_CHOICES[data.option]
const optionValue = VOTE_VALUES[data.option]
let option = data.option
let optionHuman = VOTE_CHOICES[data.option]
let optionValue = VOTE_VALUES[data.option]

if(!optionValue && data.options?.length){
option = data.options.find(el => equal(el.weight, 1))?.option
optionHuman = option ? VOTE_CHOICES[option] : 'Multiple'
optionValue = option ? VOTE_VALUES[option] : null // doesn't support multiple right now
}

return {
...data,
option,
optionHuman,
optionValue
}
Expand Down

0 comments on commit f1a8423

Please sign in to comment.