Skip to content

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

@Kolibri1990

Description

@Kolibri1990

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'}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions