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: rfox refactor #7079

Merged
merged 59 commits into from
Jun 11, 2024
Merged

feat: rfox refactor #7079

merged 59 commits into from
Jun 11, 2024

Conversation

gomesalexandre
Copy link
Contributor

@gomesalexandre gomesalexandre commented Jun 6, 2024

Description

a.k.a originally RFOX bridge refactor to hide logic away into hooks, effectively the same for stake and unstake, react-query type-safety, and much more, see below.

  • Extracts all the boilerplaty bits of Stake, Unstake and Bridge to useRfoxBridge and useRfoxApproval queries to keep things clean
  • extracts wagmi consumptions (balanceOf and stakingInfo) into reusable hooks, leveraging @wagmi/core's internal to get their skipToken type-safe variant and keeping things DRY
  • bumps react-query to latest and leverages skipToken type safety (see ff065af)
  • bumps query-key-factory to latest

Pull Request Type

  • 🐛 Bug fix (Non-breaking Change: Fixes an issue)
  • 🛠️ Chore (Non-breaking Change: Doc updates, pkg upgrades, typos, etc..)
  • 💅 New Feature (Breaking/Non-breaking Change)

Issue (if applicable)

Risk

High Risk PRs Require 2 approvals

Low - moved code, and retested E2E - ensure RFOX as a feature, with particular focus on RFOX bridge still works as it did in the PR under

What protocols, transaction types or contract interactions might be affected by this PR?

Testing

  • RFOX as a feature is still happy
  • RFOX bridge in particular is still happy

Engineering

  • ☝🏽

Operations

  • ☝🏽

Screenshots (if applicable)

@gomesalexandre gomesalexandre requested a review from a team as a code owner June 6, 2024 17:26
@gomesalexandre gomesalexandre marked this pull request as draft June 6, 2024 17:27
@gomesalexandre gomesalexandre changed the title [skip ci] wip: rfox bridge refactor PoC Feat: rfox bridge refactor PoC Jun 6, 2024
@gomesalexandre gomesalexandre changed the title Feat: rfox bridge refactor PoC feat: rfox bridge refactor PoC Jun 6, 2024
@gomesalexandre gomesalexandre requested a review from NeOMakinG June 6, 2024 18:56
@gomesalexandre gomesalexandre marked this pull request as ready for review June 6, 2024 18:58
Copy link
Member

@woodenfurniture woodenfurniture left a comment

Choose a reason for hiding this comment

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

So we dont let the resolutions in #7020 regarding non-null assertions, marking this as requested changes until we address that feedback as its relevent here too.
#7020 (review)

@gomesalexandre gomesalexandre force-pushed the feat_rfox_bridge_refactor_poc branch 4 times, most recently from 0e6df8c to c32b72b Compare June 7, 2024 09:23
@gomesalexandre gomesalexandre force-pushed the feat_rfox_bridge_refactor_poc branch 4 times, most recently from cddf7cb to b16682b Compare June 7, 2024 10:08
@gomesalexandre gomesalexandre force-pushed the feat_rfox_bridge_refactor_poc branch from b950ec5 to ff065af Compare June 7, 2024 16:41
@gomesalexandre gomesalexandre changed the title feat: rfox bridge refactor PoC feat: rfox refactor Jun 7, 2024
src/lib/utils/evm.ts Outdated Show resolved Hide resolved
@gomesalexandre gomesalexandre force-pushed the feat_rfox_bridge_refactor_poc branch from 49d4a3f to dbc5531 Compare June 10, 2024 22:28
Copy link
Member

@woodenfurniture woodenfurniture left a comment

Choose a reason for hiding this comment

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

Absolutely tasty PR ser, just minor non-blocking feedback regarding memoization for perf and some non-blocking stylistic querstions/comments.

src/react-queries/queries/mutations.ts Show resolved Hide resolved
src/react-queries/queries/common.ts Show resolved Hide resolved
src/pages/RFOX/hooks/useStakingInfoQuery.ts Outdated Show resolved Hide resolved
src/pages/RFOX/hooks/useStakingInfoQuery.ts Outdated Show resolved Hide resolved
src/lib/utils/evm.ts Show resolved Hide resolved
src/hooks/queries/useEvmFees.ts Outdated Show resolved Hide resolved
src/hooks/queries/useEvmFees.ts Outdated Show resolved Hide resolved
Base automatically changed from feat_rfox_bridge_p2 to develop June 11, 2024 05:03
@gomesalexandre
Copy link
Contributor Author

Type errors after develop merge fixed in #7094

Copy link
Collaborator

@NeOMakinG NeOMakinG left a comment

Choose a reason for hiding this comment

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

I didn't test it yet but love the code for now! Well done

src/hooks/queries/useEvmFees.ts Show resolved Hide resolved
src/lib/utils/evm.ts Show resolved Hide resolved
Copy link
Collaborator

@NeOMakinG NeOMakinG left a comment

Choose a reason for hiding this comment

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

Staking preview

image

Lock up warning

image

Confirm

image

Confirm and stake, loading and success states

image

Looks super sane, appreciate the effort on taking care of the status like I did on LP deposits

Unstake 50%

image

Everything looks smooth on my side

Very nitpick but this shouldn't be a button when hovering but an underlined link without the background color
image

And the claim loader could be a bit sexier, to be tackled in an UI refining PR I guess

image

Claim list

image

Cooldown period looks fine, available claim too

🚫 Claim

image

I'm not able to claim at all

Change address

Both custom address and put current wallet address back are happy
image

LGTM except for the claim part which doesn't look happy for now

Copy link
Collaborator

@NeOMakinG NeOMakinG left a comment

Choose a reason for hiding this comment

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

Finally I managed to claim

image
image

Should be good now!

@NeOMakinG NeOMakinG enabled auto-merge (squash) June 11, 2024 09:21
@NeOMakinG NeOMakinG merged commit 1eb71c3 into develop Jun 11, 2024
3 checks passed
@NeOMakinG NeOMakinG deleted the feat_rfox_bridge_refactor_poc branch June 11, 2024 09:24
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.

rFOX cleanup Abstract and refactor rfox confirm component
4 participants