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

Deposits on non-ETH gas token pools #1536

Merged
merged 1 commit into from
Nov 6, 2023
Merged

Conversation

abtestingalpha
Copy link
Collaborator

@abtestingalpha abtestingalpha commented Nov 6, 2023

null
c1314b8fa56b5de064b676049f1d0fa199626ea1: synapse-interface preview link
c7674e68aab0a5eccf7ee7498d1ff1c4e20c15ff: synapse-interface preview link
f13ff82d2e1e3ac294579892b65310356edbcddd: synapse-interface preview link

Summary by CodeRabbit

  • New Features
    • Enhanced the deposit functionality in the pool management section to support pools without the native token.
  • Bug Fixes
    • Fixed an issue where the balance was incorrectly fetched for tokens with a zero address.

Copy link
Contributor

coderabbitai bot commented Nov 6, 2023

Walkthrough

The changes primarily revolve around the enhancement of the Deposit.tsx file in the synapse-interface package. The modifications include the import of a new module, adjustments to function names and conditions, and the addition of a new prop to a component. The changes aim to improve the handling of token balances, particularly for the Ethereum network's native token.

Changes

File Change
.../pool/poolManagement/Deposit.tsx Introduced the import of zeroAddress from the viem module. Added the pool prop to the SerializedDepositInput component and used it as an argument in the getBalanceToken function. Renamed the correctToken function to getBalanceToken. Modified the getBalanceToken function to check if the pool does not include WETH before assigning ETH to balanceToken. Adjusted the serializeToken function to check if the balanceToken address is the zero address before fetching the balance.

Poem

🍂 As the leaves fall, code changes call, 🍁

In the world of tokens, where balances often fall. 📉

With a tweak and a twist, and a function renamed, 🔄

The handling of ETH is now well-tamed. 🎯

On this day in history, a rabbit hops with glee, 🐇

Celebrating the changes, as smooth as tea. ☕

So here's to the coders, working night and day, 🌙☀️

Making the blockchain world a better place to play. 🌐🎉


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Copy link

codecov bot commented Nov 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1d71e75) 51.23324% compared to head (b0546cb) 51.23324%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@              Coverage Diff              @@
##              master       #1536   +/-   ##
=============================================
  Coverage   51.23324%   51.23324%           
=============================================
  Files            362         362           
  Lines          24691       24691           
  Branches         283         283           
=============================================
  Hits           12650       12650           
  Misses         10813       10813           
  Partials        1228        1228           
Flag Coverage Δ
packages 91.00610% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

cloudflare-workers-and-pages bot commented Nov 6, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: b0546cb
Status: ✅  Deploy successful!
Preview URL: https://31e2dac5.sanguine.pages.dev
Branch Preview URL: https://fe-deposit-fix.sanguine.pages.dev

View logs

Copy link
Collaborator

@ChiTimesChi ChiTimesChi left a comment

Choose a reason for hiding this comment

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

LGTM, but should we also update the token naming from ETH to WETH on Metis for the sake of consistency?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 1d71e75 and b0546cb.
Files selected for processing (1)
  • packages/synapse-interface/pages/pool/poolManagement/Deposit.tsx (5 hunks)
Additional comments: 4
packages/synapse-interface/pages/pool/poolManagement/Deposit.tsx (4)
  • 40-40: Ensure that the zeroAddress imported from the viem module is the correct constant and is being used appropriately in the context of this file.

  • 209-215: The pool prop has been added to the SerializedDepositInput component. Make sure that this prop is being passed correctly wherever this component is used.

  • 287-294: The getBalanceToken function (previously correctToken) has been modified. It now checks if the pool does not include the native token WETH before assigning ETH to balanceToken. This change seems logical and should work as expected.

  • 304-310: The serializeToken function has been updated to check if the balanceToken address matches the zero address before fetching the balance. This is a good practice as it prevents unnecessary calls to fetch the balance for non-ETH gas token pools.

@abtestingalpha abtestingalpha merged commit 413a921 into master Nov 6, 2023
43 checks passed
@abtestingalpha abtestingalpha deleted the fe/deposit-fix branch November 6, 2023 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants