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

fix: dont show staking errors if the motion is completed #4248

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

bassgeta
Copy link
Contributor

@bassgeta bassgeta commented Feb 5, 2025

Description

This PR just cleans up the booleans a bit and makes sure that when a motion is completed, the errors don't show up.

Testing

  1. Run your dev env and the create-data script, install the voting reputation extension in planex
  2. Open up 2 more browsers (trust me, it's gonna be the fastest).
  3. Be logged in as leela in browser 1. In browser 2, go to http://localhost:9091/go/planex with Dev wallet 4. Name the user "has-nothing" or something
    image
  4. In browser 2, go to http://localhost:9091/go/planex with Dev wallet 5. Name the user "has-no-coins"
    image
  5. Run the following query and copy the invite code.
query MyQuery {
  getColony(id: "<planex_address>") {
    colonyMemberInviteCode
  }
}

image
6. Open up the URL http://localhost:9091/invite/planex/<that_code> as has-nothing and has-no-coins and join the colony
7. As leela give has-no-coins some reputation in General. Go to http://localhost:3001/reputation/monitor/toggle and run npm run forward-time 1 in the terminal
image
8. Create a mint tokens motion and fully stake it as leela. Don't finalize it!
image
9. As has-nothing open up the motion and verify that you get the no reputation error.
image
10. As has-no-coins open up the motion and verify that you get the not enough tokens error.
image
11. Finalize the motion and open it as has-nothing and has-no-coins and verify that there is no error
image
image

Diffs

Changes 🏗

  • Tidied up the boolean flags in StakingStep

Resolves #3909

@bassgeta bassgeta self-assigned this Feb 5, 2025
@bassgeta bassgeta requested a review from a team as a code owner February 5, 2025 13:38
Copy link
Contributor

@rumzledz rumzledz left a comment

Choose a reason for hiding this comment

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

You gotta love these motion quirks 😄

Created has-nothing & has-no-coins

Screenshot 2025-02-05 at 21 28 13 Screenshot 2025-02-05 at 21 28 49

Create and support Mint Motion as leela

Screenshot 2025-02-05 at 21 34 10

has-nothing error

Screenshot 2025-02-05 at 21 35 27

has-no-coins error

Screenshot 2025-02-05 at 21 35 38

Finalised motion as leela

Screenshot 2025-02-05 at 21 39 00

No more errors for has-nothing & has-no-coins

Screenshot 2025-02-05 at 21 36 22 Screenshot 2025-02-05 at 21 36 14

Copy link
Member

@rdig rdig left a comment

Choose a reason for hiding this comment

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

All good here

Copy link
Contributor

@mmioana mmioana left a comment

Choose a reason for hiding this comment

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

This is such a nice and straight-forward fix @bassgeta 🎉

Created the two users and joined planex
Screenshot 2025-02-06 at 09 16 52
Screenshot 2025-02-06 at 09 17 22
Screenshot 2025-02-06 at 09 17 48
Screenshot 2025-02-06 at 09 18 07
Screenshot 2025-02-06 at 09 18 24

Gave no-coins some reputation
Screenshot 2025-02-06 at 09 19 11
Screenshot 2025-02-06 at 09 20 06

Created a Mint tokens motion and went through the whole staking and voting process as leela
Screenshot 2025-02-06 at 09 22 56

The right errors showed up before the motion finalisation
Screenshot 2025-02-06 at 09 23 14
Screenshot 2025-02-06 at 09 23 28

And no longer showed up after the motion was finalised
Screenshot 2025-02-06 at 09 24 47
Screenshot 2025-02-06 at 09 24 54

And tested also for a motion going only through staking
Screenshot 2025-02-06 at 09 25 41
Screenshot 2025-02-06 at 09 27 41
Screenshot 2025-02-06 at 09 27 48

Nice job!!! 💯

@bassgeta bassgeta merged commit 9d6af14 into master Feb 6, 2025
2 checks passed
@bassgeta bassgeta deleted the fix/3909-completed-motion-stake-error branch February 6, 2025 08:43
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.

[PROD] Staking widget completed state incorrect error messages
4 participants