Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Governance voting does not work for a Masternode with a changed owner address #132

Open
Kolibri1990 opened this issue Feb 25, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Kolibri1990
Copy link

Describe the bug
I wanted to vote with a masternode and it didn't work because the owner address is not the one with which the masternode was created.
It searches for the masternode with the masternodeId (update masternode tx) of the current owner address at "check_masternode".

In this case, however, it is the txid of the old owner address or the first owner address and not the txid of the input.
You even enter the correct masternodeId in the method.

I did a workaround and replaced all masternodeId parameter hardcoded to my correct one.

To Reproduce
Steps to reproduce the behavior:
Create a Masternode and update the owner address.

Then run the code:

ocean =  Ocean(network="mainnet")
mnemonic = ""
wallet = Wallet(DefichainMainnet)
wallet.from_mnemonic(mnemonic)
account = wallet.get_account(4)
builder = TxBuilder(wallet.from_path(path="m/1129/0/0/4").bech32_address(), account, ocean)
tx = builder.governance.vote('proposalId', 'masternodeId', 'yes')
txid = builder.send_tx(tx)

Expected behavior
Build should work with updated owner address.

Here is the error:
self.get_dataSource().check_masternode(input.get_txid()): self.ocean.masternodes.get(masternodeId)["data"]

Additional context
defichain.exceptions.http.NotFound.NotFound: NotFound(404): {'code': 404, 'type': 'NotFound', 'at': 1708887220659, 'message': 'Unable to find masternode', 'url': '/v0/mainnet/masternodes/txid_from_current_owneraddress'}

@Kolibri1990 Kolibri1990 added the bug Something isn't working label Feb 25, 2024
@eric-volz eric-volz self-assigned this Feb 26, 2024
@eric-volz
Copy link
Owner

Thanks @Kolibri1990, I will look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants