-
Notifications
You must be signed in to change notification settings - Fork 0
Spike: Referendum-Relayer: Display veto percentage #17
base: develop
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
const totalStaked = ( | ||
(await cennzApi.query.staking.erasTotalStake(stakingEra)) as u128 | ||
).toNumber(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Promise.all
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cennzApi.query.staking.erasTotalStake
relies on the result from the first promise
@@ -19,4 +19,11 @@ export interface ReferendumMessageBody { | |||
proposal: ProposalInterface; | |||
referendum?: ReferendumInterface; | |||
vetoSum: number; | |||
vetoThreshold?: number; | |||
vetoPercentage?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should vetoPercentage
be number
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a string as I'm using toFixed()
, I was tossing up between using 0 and 2 decimal places, what do you think?
Why
What is changing
fetchVetoPercentage
utilnew
, fetch and display veto thresholdupdate
, fetch and display veto percentageScreenshot