Skip to content

refactor: use getTransferMode instead of isDepositMode #2186

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

Draft
wants to merge 34 commits into
base: master
Choose a base branch
from

Conversation

fionnachan
Copy link
Member

WIP
trying out inline union checks and getting rid of boolean helpers to see how it feels

@cla-bot cla-bot bot added the cla-signed label Jan 13, 2025
Copy link

vercel bot commented Jan 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
arbitrum-token-bridge ✅ Ready (Inspect) Visit Preview Mar 17, 2025 10:51am

@fionnachan fionnachan changed the base branch from make-isDepositMode-correct to master January 13, 2025 18:31
Comment on lines 17 to 19
if (!validDestinationChains.includes(destinationChainId)) {
throw new Error('Unsupported source and destination chain pair.')
}
Copy link
Member Author

Choose a reason for hiding this comment

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

remove throw and return false instead

import { isDepositMode } from './isDepositMode'
import { getDestinationChainIds } from './networks'

type TransferMode = 'deposit' | 'withdrawal' | 'teleport'
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
type TransferMode = 'deposit' | 'withdrawal' | 'teleport'
type TransferMode = 'deposit' | 'withdrawal' | 'teleport' | 'unsupported'

@fionnachan fionnachan marked this pull request as ready for review January 17, 2025 11:12
brtkx
brtkx previously approved these changes Jan 21, 2025
@spsjvc spsjvc self-requested a review January 21, 2025 13:22
chrstph-dvx
chrstph-dvx previously approved these changes Jan 21, 2025
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.

3 participants