Closed alexdonh closed 2 years ago
Then you would have to manually change the following line to the denom you want:
We had a similar case with likcoin where the default denom was nanolike
with 9
exponent places but the voting power was actually 6
decimal places. What I ended up doing was creating a ulike
with 6
decimal places in the config and instead of relying on stakingParams.bondDenom
I manually replaced it with ulike
and here is the config file: https://github.com/forbole/big-dipper-2.0-cosmos/blob/chains/likecoin/src/configs/chain_config.mainnet.json
As these cases do not happen often I think a manual change is quite alright for the time being
Thanks @ryuash but still i don't get the part dividing voting power by total bonded tokens. those 2 are basically different units. I will do a workaround as your suggestion for now.
A chain's bonded tokens represent the number of active voting power present.
Example 1:
1 VP
in Cosmos Hub can be represented by 1 ATOM
but since I am referencing bonded tokens, 1 ATOM
will be represented as 1000000uatom
hence the formatting in the code (converting uatom -> atom)
Example 2:
1 VP
in Likecoin is 0.001000000LIKE
so instead of formatting the bonded tokens by the default 9 decimal places
i formatted it by 6
(nanolike -> ulike) for the purposes of calculating the voting power
Closing. Feel free to open back up if there's more questions regarding this issue
Hello folks,
Can someone help explain the logic of voting power % calculation below:
https://github.com/forbole/big-dipper-2.0-cosmos/blob/dd2523bc256a15f1af014d9af3350052c81108e3/src/screens/validator_details/components/voting_power/index.tsx#L24
in short:
where
self
is:https://github.com/forbole/big-dipper-2.0-cosmos/blob/dd2523bc256a15f1af014d9af3350052c81108e3/src/screens/validator_details/hooks.ts#L283
(= the validator's voting power)
and
overall
is:https://github.com/forbole/big-dipper-2.0-cosmos/blob/dd2523bc256a15f1af014d9af3350052c81108e3/src/screens/validator_details/hooks.ts#L303
(= total bonded tokens)
I understand that the
formatToken
will divide this total bonded tokens bybondDenom
's exponent which is normally6
but what if you have a different exponent set?