Closed Defi-Moses closed 2 months ago
The changes involve the introduction of a new constant, NativeTokenAddress
, in the bridgeable.ts
file, which is assigned a specific Ethereum address. This constant replaces instances of ZeroAddress
in the addresses
property of several BridgeableToken
exports, ensuring accurate token address assignments across multiple blockchain networks. Additionally, various test files were updated to utilize these constants instead of hardcoded values, enhancing the clarity and maintainability of the tests.
File Path | Change Summary |
---|---|
packages/rest-api/src/constants/bridgeable.ts | Added NativeTokenAddress constant; modified addresses for ETH , MOVR , AVAX , JEWEL , KLAY , MATIC , FTM to replace ZeroAddress with NativeTokenAddress . |
packages/rest-api/src/tests/destinationTokensRoute.test.ts | Updated fromToken parameter in tests to use constants instead of hardcoded addresses, including ZeroAddress . |
packages/rest-api/src/tests/bridgeRoute.test.ts | Modified token parameters in tests to utilize constants; added new test cases for ZeroAddress and NativeGasAddress . |
packages/rest-api/src/tests/bridgeTxInfoRoute.test.ts | Updated token addresses in tests to use constants instead of hardcoded values. |
packages/rest-api/src/tests/swapRoute.test.ts | Updated swap tests to use constants for token addresses; added tests for ZeroAddress and NativeGasAddress . |
packages/rest-api/src/tests/swapTxInfoRoute.test.ts | Replaced hardcoded token addresses with constants in multiple test cases. |
packages/rest-api/src/middleware/normalizeNativeTokenAddress.ts | Introduced normalizeNativeTokenAddress middleware to validate and normalize token addresses in requests. |
packages/rest-api/src/routes/*.ts | Added normalizeNativeTokenAddress middleware to various routes to process token address normalization. |
packages/rest-api/src/utils/tokenAddressToToken.ts | Simplified logic by removing checks for ZeroAddress and directly assigning chainData[tokenAddress] . |
NativeTokenAddress
introduced in the main PR.bridgeTxInfoController
and swapTxInfoController
to enhance token address handling, which aligns with the changes made in the main PR regarding the use of NativeTokenAddress
./destinationTokens
route involves query parameters that include fromToken
, which is relevant to the changes made in the main PR regarding token address handling./destinationTokens
endpoint, which is directly related to the changes in the main PR that enhance token address handling across multiple routes.size/m
, M-deps
In the meadow where tokens play,
A new address brightens the day.
No more placeholders, clear and true,
For bridges to cross, and dreams to pursue.
Hopping along, we celebrate this feat,
With every change, our code's more neat! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Latest commit: |
a415529
|
Status: | ✅ Deploy successful! |
Preview URL: | https://93fb17aa.sanguine-fe.pages.dev |
Branch Preview URL: | https://feat-rest-api-native-token.sanguine-fe.pages.dev |
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 37.95009%. Comparing base (
49cf94d
) to head (a415529
). Report is 12 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Changes the native gas token address from 0x00... to 0xEe
Summary by CodeRabbit
New Features
Improvements