question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

api.derive.democracy.referendumVotes is not a function

See original GitHub issue

Hello,

I face a problem with fetching votes for selected referendum from api. According to implementation I need to just call api.derive.democracy.referendumVotes(index) unfortunately this method doesn’t work on api@1.8.1

If I want to use old approach with api.derive.democracy.referendumVotesFor(index) I got another error:

DRR: TypeError: "api.query.democracy.votersFor is not a function"

Used chain: Kusama CC3

Thanks 🚀

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jacogrcommented, Mar 24, 2020

Make the queries directly via api.query.* as per the chain you are connecting to. Each chain exposes the info and exposes queries via metadata, albeit in different places, there is no real magic behind derives.

All derives do is to grab info from multiple sources, supporting all available query types and construct it into a usable format - these undocumented for a reason, since they can change at will, and certainly after massive breaking democracy changes, they are changing very rapidly for the sake of efficiency.

1reaction
jacogrcommented, Mar 24, 2020

If you want to use the derives for this, you are better suited with the 1.9-beta versions which has full support for the new democracy in all derives.

And yes, as expected with the upgraded democarcy, the old endpoints are not decorated - https://polkadot.js.org/api/start/basics.html#metadata

The API can only make available what is exposed by metadata, after 1055 on Kusama those old query endpoints don’t exist.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Initiative and Referendum Overview and Resources
Citizen Initiative Overview ... In political terminology, the initiative is a process that enables citizens to bypass their state legislature by ...
Read more >
Arizona Proposition 132, 60% Vote Requirement for Ballot ...
The measure was approved. A "yes" vote supported this constitutional amendment to require a 60% vote for voters to pass ballot measures to...
Read more >
Disinformation and propaganda – impact on the functioning of ...
This study, commissioned by the European Parliament's Policy Department for Citizens'. Rights and Constitutional Affairs and requested by ...
Read more >
Code of Good Practice on Referendums - Venice Commission
In response to a request from the Parliamentary Assembly, the Council for Democratic. Elections and subsequently the Venice Commission adopted ...
Read more >
Voter turnout - Wikipedia
In political science, voter turnout is the participation rate of a given election. This can be the percentage of registered voters, eligible voters, ......
Read more >

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found