Cosmos-SDK simple governance application

Hi guys! I need your help!

I’m following the docs to build a simple governance application (https://cosmos.network/docs/sdk/sdk-by-examples/simple-governance/simple-gov-module.html)

I know that the docs are a little out of date and Cosmos SDK API has changed a little, but I almost made it work by looking at a more fresh example at https://github.com/cosmos/sdk-application-tutorial.

When I try to cast a vote I get an error: “Delegator does not contain this delegation”. The error occurs at the following line:

Could anybody explain to me what’s going on here and how to fix it, please?

Prove me wrong. If I get it correctly I need to somehow let my application know about a validator in order to make it work. If so, how can I do it on my local machine?

Hey @happygopher! The simple_goverance application is pretty out of date. We are, however, maintaining the sdk-application-tutorial does that one work for you?

Yeah, I know :slight_smile: As I mentioned it in my message, I’m trying to build the simple governance application using the sdk-application-tutorial as a skeleton. I hacked it a little and almost made it work, the only thing I’m struggling is that I don’t know how to make delegations work :slight_smile: The thing is that the delegation part is not covered by sdk-application-tutorial :slight_smile:

Btw, I’ve committed everything I’ve done so far in my own repo. So to be more precise, I don’t know how to prevent the error at the following line from happening:

It would be great if someone could help me with it :slight_smile: What I basically need is to learn more about stake module and how to tell my application to get the delegations :slight_smile:

I’ve finally made it work :slight_smile: All really needed is to create a validator. I’ve committed the changes and updated the docs. Current version is available on GitHub screwyprof/testgov (the forum doesn’t allow posting a link for some reason)

1 Like

link to repo mentioned above