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: Staged payments with locked tokens #3931

Merged
merged 1 commit into from
Dec 16, 2024
Merged

Conversation

davecreaser
Copy link
Contributor

Description

  • Fix issues with making staged payment using tokens which are not native to your colony.
  • Four issues are fixed here:
    • You should not be able to make a staged payment milestone using a token which is locked
    • When using a token for a milestone which is not your colonies native token, it needs to be passed to the transaction for it to be claimed properly (previously only the colony native token was being sent)
    • If a milestone payment failed for whatever reason, the status pill should not show as 'passed'
    • Duplicate milestones were appearing in the sidebar (related to them silently failing)

Testing

  • Open Wayne Enterprises colony and check that the native token (GGG) is locked (this is the default state from the create-data script)
Screenshot 2024-12-12 at 16 35 12
  • Go to the Planet Express colony

  • Open the incoming funds table and claim all incoming funds (there should by default be some GGG in there)

Screenshot 2024-12-12 at 16 46 06
  • Install the staged payments extension

  • Make a staged payment, and for at least one of the milestones try to use GGG as the token. You should not be able to create the staged payment and a correct error should be shown.

Screenshot 2024-12-12 at 16 41 53
  • Go back to Wayne Enterprises and unlock the token using an unlock token action.
Screenshot 2024-12-12 at 16 44 48
  • Return to the Planet Express colony

  • Make another staged payment, and again for at least one of the milestones try to use GGG as the token. You should now be able to create the staged payment and no error should be shown.

Screenshot 2024-12-12 at 16 49 54
  • Go through all the steps in the sidebar of the completed action panel for this staged payment and release all of the milestones (either one by one, or all at once, it shouldn't matter). There should be no issues with this, and no duplicate milestones being shown in the sidebar.
Screenshot 2024-12-12 at 16 57 45

Diffs

Changes 🏗

  • Fixed form validation of staged payments
  • Fixed token addresses being passed in the payload to the staged payment saga
  • Fixed styling of failed milestone claims for staged payments

Resolves #3899

@davecreaser davecreaser requested a review from a team as a code owner December 12, 2024 17:00
Copy link
Collaborator

@jakubcolony jakubcolony left a comment

Choose a reason for hiding this comment

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

Nice work fixing this bunch of issues, everything working as described 👌

image image image image image image

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.

Really nice work on this issue @davecreaser 🙌

The token in wayne is locked
Screenshot 2024-12-13 at 11 22 22

Accepted all incoming funds in planex
Screenshot 2024-12-13 at 11 22 38
Screenshot 2024-12-13 at 11 22 52

Installed the Staged payments extension
Screenshot 2024-12-13 at 11 24 23

Tried creating a Staged payment with one milestone using the ƓƓƓ token and the error message was displayed
Screenshot 2024-12-13 at 11 25 38

Unlocked the ƓƓƓ token
Screenshot 2024-12-13 at 11 26 27

Now the error message was no longer shown
Screenshot 2024-12-13 at 11 26 33

Managed to create the Staged payment
Screenshot 2024-12-13 at 11 26 49

Released the 1st milestone with CREDS
Screenshot 2024-12-13 at 11 27 41

Released the 2nd milestone with ƓƓƓ
Screenshot 2024-12-13 at 11 27 56

And everything was completed without any issues ✨
Screenshot 2024-12-13 at 11 28 40

Nice job!!!

Copy link
Contributor

@iamsamgibbs iamsamgibbs left a comment

Choose a reason for hiding this comment

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

Great job fixing up the form Dave! Followed your testing steps without issue:

Screenshot 2024-12-13 at 14 07 53

Screenshot 2024-12-13 at 14 08 42

Screenshot 2024-12-13 at 14 10 30

Screenshot 2024-12-13 at 14 11 50

Screenshot 2024-12-13 at 14 12 01

@davecreaser davecreaser merged commit e323a02 into master Dec 16, 2024
2 checks passed
@davecreaser davecreaser deleted the fix/#3899-staged-payment branch December 16, 2024 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants