Lunie: deposit count is incorrect

Created on 19 Dec 2019  路  6Comments  路  Source: luniehq/lunie

All 6 comments

server side problem it appears

Hey @jbibla both links are broken now. What's the problem?

Proposal 8 on the gaia testnet has 1 token deposited by me. But it shows 0. Even in the API response:

query proposal {
  proposal(networkId: "cosmos-hub-testnet", id: 8) {
    id
    type
    title
    description
    creationTime
    status
    statusBeginTime
    statusEndTime
    tally {
      yes
      no
      veto
      abstain
      total
      totalVotedPercentage
      __typename
    }
    deposit
    proposer
    validator {
      name
      __typename
    }
    __typename
  }
}

Proposal 8 on the gaia testnet has 1 token deposited by me. But it shows 0. Even in the API response:

query proposal {
  proposal(networkId: "cosmos-hub-testnet", id: 8) {
    id
    type
    title
    description
    creationTime
    status
    statusBeginTime
    statusEndTime
    tally {
      yes
      no
      veto
      abstain
      total
      totalVotedPercentage
      __typename
    }
    deposit
    proposer
    validator {
      name
      __typename
    }
    __typename
  }
}

Hey @faboweb, that's helpful thanks! leave it to me ;-)

The proposal returned by https://gaia-13007.lunie.io/gov/proposals

  {
    "content": {
      "type": "cosmos-sdk/TextProposal",
      "value": {
        "title": "Testing depositing",
        "description": "Hi from Lunie you wonderful community"
      }
    },
    "id": "8",
    "proposal_status": "VotingPeriod",
    "final_tally_result": {
      "yes": "0",
      "abstain": "0",
      "no": "0",
      "no_with_veto": "0"
    },
    "submit_time": "2020-01-10T18:41:20.16081563Z",
    "deposit_end_time": "2020-01-12T18:41:20.16081563Z",
    "total_deposit": [
      {
        "denom": "umuon",
        "amount": "1000000"
      }
    ],
    "voting_start_time": "2020-01-10T18:41:20.16081563Z",
    "voting_end_time": "2020-01-12T18:41:20.16081563Z"
  }

Problem is at proposalReducer:

deposit: getDeposit(proposal, 'uatom'), // TODO use denom lookup

Denom uatom is hardcoded, should be umuon in this case, causing getDeposit() function to return 0.

We can improve that as the comment suggest :-), we can just let getDeposit() return the denom (and not pass denom to it as parameter of course).

Was this page helpful?
0 / 5 - 0 ratings