Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: vp from network economics #6165

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

mstrasinskis
Copy link
Contributor

Motivation

Changes

Tests

Todos

  • Add entry to changelog (if necessary).

<IconErrorOutline />
</BannerIcon>
</Banner>
{#if nonNullish($startReducingVotingPowerAfterSecondsStore)}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class="description"
class:negative={isLosingRewards || isLosingRewardsSoon}
data-tid="state-description"
{#if nonNullish($startReducingVotingPowerAfterSecondsStore) && nonNullish($clearFollowingAfterSecondsStore)}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


let isModalVisible = false;
</script>

<TestIdWrapper testId="losing-rewards-banner-component">
{#if nonNullish(mostInactiveNeuron)}
<Banner title={getTitle(mostInactiveNeuron)} {text}>
{#if nonNullish(mostInactiveNeuron) && nonNullish($startReducingVotingPowerAfterSecondsStore)}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (isNeuronLosingRewards(neuron)) {
// Skip the "missing rewards" tag when voting power economics not available
if (
nonNullish(startReducingVotingPowerAfterSeconds) &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}: {
neuron: NeuronInfo;
startReducingVotingPowerAfterSeconds: bigint | undefined;
clearFollowingAfterSeconds: bigint | undefined;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* e.g. "Neuron will start losing rewards in 30 days"
* If the voting power economics are not available,
* we assume that the neuron is not losing rewards. */
export const shouldDisplayRewardLossNotification = ({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

secondsUntilLosingRewards(neuron) <= 0;
/** If the voting power economics are not available,
* we assume that the neuron is not losing rewards. */
export const isNeuronLosingRewards = ({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant