When I cast a vote on a referendum with a value as
let vote = {
Standard: {
vote: {
aye: true,
conviction: 'Locked4x',
},
balance: balance
}
};
let unsub = await api.tx.democracy.vote(i, vote).signAndSend(payoutKey, ...);
Through the event I have extracted the following data
[
AccountId32: 5HeM14aFJPKxi...vVyV7oX6rErJhN,
u32: 79,
{"_enum":{"Standard":"{"vote":"Vote","balance":"u128"}","Split":"{"aye":"u128","nay":"u128"}"}}: {"standard":{"vote":"0x01","balance":"0x0000000000000000c249fdd327780000"}}]
We realize that it does not contain the vote conviction.
I tried to look it up via api.query.democracy.votingOf(accountId)
But unfortunately, every vote returns the same value {conviction: "Locked1x", vote: "Nay"}
Even if the actual values are entirely different. Eg: conviction is Locked4x
and vote is Aye
The questions are:
- How to get the conviction value of a democratic vote?
- Why does
api.query.democracy.votingOf
always return the same value{conviction: "Locked1x", vote: "Nay"}