0stake after undelegating from validator
This is kind of 2 bugs
The first bug is that validators are still displayed as staked to even though they don't have any stake assigned
As a result of not having anything staked..
When you withdrawal rewards from all current validators you see:
Seems solvable client-side with a simple .filter statement where we ignore delegations of amount 0
This will only solve this issue for our first party client, any other client (explorers will also see this issue, See here: https://nibiru.explorers.guru/account/nibi1ytf8uvxjx0guxcj7mxs9x8xw5suters539dxp5#:~:text=Time-,Delegations,-Delegations)
Rewards have a non-zero amount from the built-in cosmos tx, and it's impossible to make this zero even after claiming
import { setupDistributionExtension, } from "@cosmjs/stargate"
`this.nibiruExtensions = StargateQueryClient.withExtensions(
tmClient,
setupDistributionExtension,
setupGovExtension,
setupStakingExtension,
setupIbcExtension,
setupWasmExtension,
setupAuthExtension,
setupNibiruExtension
)`
const resp = await signingClient.nibiruExtensions.distribution.delegationTotalRewards(address)
For my account it's the Nodes.Guru validator "nibivaloper1hvt68he6uvadnk73rjy6hg7a4u2myud5yhj3ae"
Client-side fix here: https://github.com/NibiruChain/web-app/pull/1251
Also related, calling reward withdrawal when most are minimal non-zero numbers
Raw log: (Note, all validators are returning 0stake here, not 0unibi)
"[{\"msg_index\":0,\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward\"},{\"key\":\"sender\",\"value\":\"nibi1ytf8uvxjx0guxcj7mxs9x8xw5suters539dxp5\"},{\"key\":\"module\",\"value\":\"distribution\"}]},{\"type\":\"withdraw_rewards\",\"attributes\":[{\"key\":\"amount\",\"value\":\"0stake\"},{\"key\":\"validator\",\"value\":\"nibivaloper1xwh38k5kulrfglt34qqmnsrrjg788d4azq6e5u\"},{\"key\":\"delegator\",\"value\":\"nibi1ytf8uvxjx0guxcj7mxs9x8xw5suters539dxp5\"}]}]},{\"msg_index\":1,\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward\"},{\"key\":\"sender\",\"value\":\"nibi1ytf8uvxjx0guxcj7mxs9x8xw5suters539dxp5\"},{\"key\":\"module\",\"value\":\"distribution\"}]},{\"type\":\"withdraw_rewards\",\"attributes\":[{\"key\":\"amount\",\"value\":\"0stake\"},{\"key\":\"validator\",\"value\":\"nibivaloper140l6y2gp3gxvay6qtn70re7z2s0gn57zj8exm0\"},{\"key\":\"delegator\",\"value\":\"nibi1ytf8uvxjx0guxcj7mxs9x8xw5suters539dxp5\"}]}]},{\"msg_index\":2,\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward\"},{\"key\":\"sender\",\"value\":\"nibi1ytf8uvxjx0guxcj7mxs9x8xw5suters539dxp5\"},{\"key\":\"module\",\"value\":\"distribution\"}]},{\"type\":\"withdraw_rewards\",\"attributes\":[{\"key\":\"amount\",\"value\":\"0stake\"},{\"key\":\"validator\",\"value\":\"nibivaloper1hvt68he6uvadnk73rjy6hg7a4u2myud5yhj3ae\"},{\"key\":\"delegator\",\"value\":\"nibi1ytf8uvxjx0guxcj7mxs9x8xw5suters539dxp5\"}]}]}]"
Investigate import { setupDistributionExtension, } from "@cosmjs/stargate"
"/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest"
Initial review by Kevin found partial share amount