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

Feat/#2200 allow modifying stake fraction #2386

Merged

Conversation

davecreaser
Copy link
Contributor

@davecreaser davecreaser commented May 16, 2024

Description

  • Create saga to allow modification of stake fraction.
  • UI to follow in another PR.

Block ingestor PR here: JoinColony/block-ingestor#223

Ticket here: #2200

Testing

Create a fake UI to trigger the saga, and trigger it. The stake fraction for the staked expenditure extension should be updated in the db.

Diffs

New stuff

  • New saga 'setStakeFraction'

Contributes to #2200

@davecreaser davecreaser marked this pull request as ready for review May 16, 2024 16:28
@davecreaser davecreaser requested a review from a team as a code owner May 16, 2024 16:28
@davecreaser davecreaser requested review from a team May 16, 2024 19:43
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.

Nice work on this Dave! All working as expected 👍

Screenshot 2024-05-17 at 16 12 33

Just looks like a couple of unrelated commits got accidentally mixed into this, once those are resolved should be good to go!

@iamsamgibbs
Copy link
Contributor

iamsamgibbs commented May 17, 2024

Some code snippets to add to TmpAdvancedPayments.tsx for the sake of anyone else who wants to test:

import { type SetStakeFractionPayload } from '~redux/sagas/expenditures/setStakeFraction.ts';
  const setStakeFraction = useAsyncFunction({
    submit: ActionTypes.SET_STAKE_FRACTION,
    error: ActionTypes.SET_STAKE_FRACTION_ERROR,
    success: ActionTypes.SET_STAKE_FRACTION_SUCCESS,
  });

  const handleModifyStakeFraction = async () => {
    const payload: SetStakeFractionPayload = {
      colonyAddress: colony.colonyAddress,
      stakeFraction: '50',
    };

    await setStakeFraction(payload);
  };
<Button onClick={handleModifyStakeFraction}>Modify stake fraction</Button>

@davecreaser davecreaser force-pushed the feat/#2200-allow-modifying-stake-fraction branch from 9d79c45 to 7e12e5d Compare May 17, 2024 15:32
@davecreaser
Copy link
Contributor Author

Nice work on this Dave! All working as expected 👍

Screenshot 2024-05-17 at 16 12 33 Just looks like a couple of unrelated commits got accidentally mixed into this, once those are resolved should be good to go!

Cheers Sam! And thanks for catching those commits, I've rebased and removed them :)

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.

Nicely done!

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.

Changes look and work great, nice job @davecreaser 👍

Considering it's resolving the first part of the issue, would you mind opening another one for the other subtask?

Comment on lines +429 to +430
"transaction.ColonyClient.installExtension.title": "Install extension",
"transaction.ColonyClient.installExtension.description": "Install extension",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice catch!

@davecreaser
Copy link
Contributor Author

Changes look and work great, nice job @davecreaser 👍

Considering it's resolving the first part of the issue, would you mind opening another one for the other subtask?

@jakubcolony No problem. You mean opening another issue or another PR?

@davecreaser davecreaser merged commit c638429 into feat/advanced-payments-2 May 21, 2024
3 of 5 checks passed
@davecreaser davecreaser deleted the feat/#2200-allow-modifying-stake-fraction branch May 21, 2024 10:21
jakubcolony pushed a commit that referenced this pull request May 21, 2024
…take-fraction

Feat/#2200 allow modifying stake fraction
jakubcolony pushed a commit that referenced this pull request May 22, 2024
…take-fraction

Feat/#2200 allow modifying stake fraction
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.

4 participants