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/add params smart route #325

Merged
merged 7 commits into from
Aug 29, 2024
Merged

Feat/add params smart route #325

merged 7 commits into from
Aug 29, 2024

Conversation

haunv3
Copy link
Contributor

@haunv3 haunv3 commented Aug 29, 2024

Summary by CodeRabbit

  • New Features

    • Updated version numbers for @oraichain/oraidex-common and @oraichain/oraidex-universal-swap packages.
    • Enhanced UniversalSwapHandler with a new method for converting tokens and improved token retrieval with optional decimal precision.
    • Introduced RouterConfigSmartRoute interface for better routing configuration.
    • Added methods to UniversalSwapHelper for improved smart routing functionality.
  • Bug Fixes

    • Improved error handling in token swap processes for clearer debugging.
  • Documentation

    • Updated routing logic and parameters in the alpha-smart-router to reflect new transaction volumes and protocols.
  • Tests

    • Enhanced test suite for the universal swap handler, improving modularity and clarity.

Copy link

coderabbitai bot commented Aug 29, 2024

Walkthrough

The updates include version increments for two packages, @oraichain/oraidex-common and @oraichain/oraidex-universal-swap. Key modifications in the code involve enhancements to the UniversalSwapHandler class, including method updates and the introduction of new methods for improved token handling. The UniversalSwapHelper class has also been restructured to support new routing configurations. Additionally, the routing logic in alpha-smart-router.ts has been significantly adjusted for better transaction parameters.

Changes

File Path Change Summary
packages/oraidex-common/package.json Updated version from 1.1.3 to 1.1.6.
packages/oraidex-common/src/network.ts Modified chainInfos array structure for OsmoToken integration, enhancing clarity and functionality.
packages/universal-swap/package.json Updated version from 1.1.1 to 1.1.3.
packages/universal-swap/src/handler.ts Updated getTokenOnOraichain method to accept an optional decimals parameter. Introduced generateMsgsConvertSmartRouterSwap method. Removed flattenSmartRouters method, replaced with UniversalSwapHelper.flattenSmartRouters. Enhanced error handling in generateMsgsSwap.
packages/universal-swap/src/helper.ts Updated routerConfig to use RouterConfigSmartRoute type. Added generateMsgsSmartRouterV2withV3 and flattenSmartRouters static methods.
packages/universal-swap/src/types.ts Introduced new interface RouterConfigSmartRoute with properties for routing configurations.
packages/universal-swap/src/universal-demos/alpha-smart-router.ts Updated routing logic with new swapAmount and returnAmount values for multiple routes. Modified alphaSwapToOraichain function parameters and adjusted userSlippage and relayerFee structures.
packages/universal-swap/tests/index.spec.ts Updated test handling for config parameter and removed instantiation of FakeUniversalSwapHandler. Streamlined test cases for clarity and modularity.

Poem

🐰 In the garden of code, changes bloom bright,
New tokens and swaps dance in the light.
With helpers and routers, we leap and we bound,
Through logic and flows, new paths to be found.
Hooray for the updates, let’s hop with delight,
For every small change makes our futures so bright! 🌼✨


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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 an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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.

Actionable comments posted: 4

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 303fe90 and cdfa6c5.

Files selected for processing (8)
  • packages/oraidex-common/package.json (1 hunks)
  • packages/oraidex-common/src/network.ts (1 hunks)
  • packages/universal-swap/package.json (1 hunks)
  • packages/universal-swap/src/handler.ts (16 hunks)
  • packages/universal-swap/src/helper.ts (7 hunks)
  • packages/universal-swap/src/types.ts (1 hunks)
  • packages/universal-swap/src/universal-demos/alpha-smart-router.ts (3 hunks)
  • packages/universal-swap/tests/index.spec.ts (4 hunks)
Files skipped from review due to trivial changes (3)
  • packages/oraidex-common/package.json
  • packages/oraidex-common/src/network.ts
  • packages/universal-swap/package.json
Additional context used
Gitleaks
packages/universal-swap/src/universal-demos/alpha-smart-router.ts

484-484: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


493-493: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


498-498: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


514-514: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


523-523: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


528-528: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


533-533: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

Additional comments not posted (19)
packages/universal-swap/src/types.ts (1)

270-275: LGTM! But verify the usage of the new interface.

The new interface RouterConfigSmartRoute is well-defined. Ensure that the optional properties are correctly handled in the codebase.

The code changes are approved.

Run the following script to verify the usage of the new interface:

Verification successful

Verification Successful: Optional Properties Handled Correctly

The RouterConfigSmartRoute interface is used in the codebase with consideration for its optional properties, as indicated by the usage of the ? operator. This confirms that the optional properties are being handled correctly. No further action is required.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the new interface `RouterConfigSmartRoute`.

# Test: Search for the interface usage. Expect: Correct handling of optional properties.
rg --type typescript -A 5 $'RouterConfigSmartRoute'

Length of output: 85


Script:

#!/bin/bash
# Find all TypeScript files and search for the usage of the `RouterConfigSmartRoute` interface.
fd --extension ts --exec rg 'RouterConfigSmartRoute' {}

Length of output: 297

packages/universal-swap/src/universal-demos/alpha-smart-router.ts (3)

473-535: LGTM! But verify the updated values and address potential security issues.

The updated swapAmount and returnAmount values should be verified for correctness. Additionally, the flagged potential issues with generic API keys need to be addressed.

The code changes are approved.

Run the following script to verify the updated values:

Address the flagged potential issues with generic API keys:

- tokenIn: "orai12hzjxfh77wl572gdzct2fxv2arxcwh6gykc7qh",
- tokenOut: "orai12hzjxfh77wl572gdzct2fxv2arxcwh6gykc7qh",
- poolId: "orai-orai12hzjxfh77wl572gdzct2fxv2arxcwh6gykc7qh-3000000000-100",
- tokenIn: "orai12hzjxfh77wl572gdzct2fxv2arxcwh6gykc7qh",
- tokenOut: "orai12hzjxfh77wl572gdzct2fxv2arxcwh6gykc7qh",
- poolId: "orai-orai15un8msx3n5zf9ahlxmfeqd2kwa5wm0nrpxer304m9nd5q6qq0g6sku5pdd-3000000000-100",
- tokenOut: "orai15un8msx3n5zf9ahlxmfeqd2kwa5wm0nrpxer304m9nd5q6qq0g6sku5pdd",
- poolId: "orai12hzjxfh77wl572gdzct2fxv2arxcwh6gykc7qh-orai15un8msx3n5zf9ahlxmfeqd2kwa5wm0nrpxer304m9nd5q6qq0g6sku5pdd-500000000-10",
- tokenOut: "orai12hzjxfh77wl572gdzct2fxv2arxcwh6gykc7qh"
Verification successful

Verification Successful: Updated Values Confirmed

The swapAmount and returnAmount values have been successfully verified in the alpha-smart-router.ts file. The changes align with the expected updates, and no discrepancies were found.

  • swapAmount: "88000000"
  • returnAmount: "521900530"
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the updated `swapAmount` and `returnAmount` values.

# Test: Search for the updated values. Expect: Correct values in the codebase.
rg --type typescript -A 5 $'swapAmount: "88000000"'

Length of output: 87


Script:

#!/bin/bash
# Description: Verify the updated `swapAmount` and `returnAmount` values in .ts files.

# Test: Search for the updated values in .ts files. Expect: Correct values in the codebase.
rg --glob '*.ts' -A 5 'swapAmount: "88000000"'

Length of output: 580

Tools
Gitleaks

484-484: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


493-493: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


498-498: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


514-514: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


523-523: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


528-528: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


533-533: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


575-575: LGTM! But verify the updated value.

The updated isIbcWasm option should be verified for correctness.

The code changes are approved.

Run the following script to verify the updated value:


Line range hint 547-571: LGTM! But verify the updated values and test the changes.

The updated values should be verified for correctness. Additionally, the changes should be tested to ensure they do not introduce any issues.

The code changes are approved.

Run the following script to verify the updated values:

Do you want me to generate the unit testing code or open a GitHub issue to track this task?

Verification successful

Verification Successful: Updated Values Confirmed

The updates to originalToToken and userSlippage in the alpha-smart-router.ts file have been verified and are consistent with the intended changes. The modifications are correctly implemented.

  • originalToToken is set to find a token with coinGeckoId as "tether" and chainId as "0x38".
  • userSlippage is correctly set to 1.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the updated values in the `alphaSwapToOraichain` function.

# Test: Search for the updated values. Expect: Correct values in the codebase.
rg --type typescript -A 5 $'fromAmount: 210'

Length of output: 80


Script:

#!/bin/bash
# Description: Verify the updated values in the `alphaSwapToOraichain` function.

# Test: Search for the updated values. Expect: Correct values in the codebase.
rg --type ts -A 5 $'fromAmount: 210'

Length of output: 37


Script:

#!/bin/bash
# Description: Verify the updated values in the `alphaSwapToOraichain` function by searching for related changes.

# Test: Search for related updated values. Expect: Correct values in the codebase.
rg --type ts -A 5 $'originalToToken: flattenTokens.find((t) => t.coinGeckoId === "tether" && t.chainId === "0x38")'
rg --type ts -A 5 $'userSlippage: 1'

Length of output: 2105


Script:

#!/bin/bash
# Description: Verify the presence of the `originalToToken` update in the `alphaSwapToOraichain` function.

# Test: Search for a broader pattern related to `originalToToken`.
rg --type ts -A 5 $'originalToToken'

Length of output: 41989

packages/universal-swap/src/helper.ts (7)

56-59: LGTM!

The new imports are necessary for the new functionality introduced in the file.

The code changes are approved.


Line range hint 534-545: LGTM!

The changes ensure that the new configuration option dontAllowSwapAfter is utilized in the routing logic.

The code changes are approved.


564-568: LGTM!

The changes ensure that the new configuration option dontAllowSwapAfter is utilized in the routing logic.

The code changes are approved.


625-625: LGTM!

The changes ensure that the new configuration option RouterConfigSmartRoute is utilized in the routing logic.

The code changes are approved.


716-716: LGTM!

The changes ensure that the new configuration option RouterConfigSmartRoute is utilized in the routing logic.

The code changes are approved.


1137-1137: LGTM!

The changes ensure type safety and improve code readability.

The code changes are approved.


1181-1232: LGTM!

The changes ensure type safety and improve code readability.

The code changes are approved.

packages/universal-swap/src/handler.ts (6)

74-75: LGTM!

The function correctly handles the optional decimals parameter and throws an error if the token is not found.

The code changes are approved.


619-635: LGTM!

The function correctly constructs a message for converting tokens in the smart router context.

The code changes are approved.


Line range hint 1232-1254: LGTM!

The function correctly handles the logic for building swap messages from the smart route.

The code changes are approved.


1198-1198: Improve error handling.

The function correctly handles the logic for calculating the minimum receive amount. However, the error handling can be improved by providing more context.

Provide more context in the error message:

- if (!this.swapData.originalFromToken.feeCurrencies)
-   throw generateError(
-     `This token ${JSON.stringify(
-       this.swapData.originalFromToken
-     )} does not have fee currencies. getGasPriceFromToken is not called correctly`
-   );
+ if (!this.swapData.originalFromToken.feeCurrencies)
+   throw generateError(
+     `This token ${JSON.stringify(
+       this.swapData.originalFromToken
+     )} does not have fee currencies. Ensure the token has fee currencies before calling getGasPriceFromToken.`
+   );

Likely invalid or redundant comment.


1429-1429: Improve error handling.

The function correctly handles the logic for generating messages to transfer tokens using IBC Wasm contract. However, the error handling can be improved by providing more context.

Provide more context in the error message:

- if (!ibcWasmContractAddress)
-   throw generateError("IBC Wasm source port is invalid. Cannot transfer to the destination chain");
+ if (!ibcWasmContractAddress)
+   throw generateError("IBC Wasm source port is invalid. Ensure the source port is correctly defined to transfer to the destination chain.");

Likely invalid or redundant comment.


1270-1271: Improve error handling.

The function correctly handles the logic for generating swap messages. However, the error handling can be improved by providing more context.

Provide more context in the error message:

- if (!routes?.length) throw "Route not found";
+ if (!routes?.length) throw generateError("Route not found. Ensure the routes are correctly defined.");

Likely invalid or redundant comment.

packages/universal-swap/tests/index.spec.ts (2)

326-326: LGTM!

The constructor update enhances the flexibility of the configuration object by allowing additional properties to be included without losing the default wallet settings.

The code changes are approved.


1178-1178: LGTM!

The test now directly calls UniversalSwapHelper.flattenSmartRouters, indicating a shift towards a more modular design.

The code changes are approved.

packages/universal-swap/src/handler.ts Show resolved Hide resolved
packages/universal-swap/src/handler.ts Show resolved Hide resolved
packages/universal-swap/src/handler.ts Show resolved Hide resolved
packages/universal-swap/src/handler.ts Show resolved Hide resolved
Copy link

badge

Code Coverage Summary

Filename                                                                      Stmts    Miss  Cover    Missing
--------------------------------------------------------------------------  -------  ------  -------  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
docs/assets/main.js                                                              58      58  0.00%    1-58
docs/assets/search.js                                                             1       1  0.00%    1
packages/ibc-routing/hardhat.config.ts                                           59      59  0.00%    1-75
packages/ibc-routing/src/db.ts                                                  158     158  0.00%    1-263
packages/ibc-routing/src/event.ts                                                85      85  0.00%    1-122
packages/ibc-routing/src/index.ts                                                31      31  0.00%    1-56
packages/ibc-routing/src/machine.ts                                              30      30  0.00%    1-34
packages/ibc-routing/test/mock-eth-ws.ts                                         52      52  0.00%    1-55
packages/ibc-routing/test/mock-tendermint-ws.spec.ts                             25      17  32.00%   7-24
packages/oraidex-common/src/alpha-network.ts                                     61       0  100.00%
packages/oraidex-common/src/axios-request.ts                                     11      11  0.00%    1-20
packages/oraidex-common/src/bigdecimal.ts                                       139      50  64.02%   23-24, 30-33, 40-41, 45-54, 63-65, 71-73, 120-124, 127-146, 149-150, 153-154, 180-181, 184-185
packages/oraidex-common/src/constant.ts                                         161       0  100.00%
packages/oraidex-common/src/helper.ts                                           464     139  70.04%   141-142, 145-156, 159-169, 276-283, 286-299, 309-315, 325-340, 343-350, 353-383, 386-394, 397-399, 402-404, 408-417, 426-440, 446-448, 533-534, 559-562
packages/oraidex-common/src/ibc-info.ts                                         183     183  0.00%    1-215
packages/oraidex-common/src/index.ts                                             13      13  0.00%    1-13
packages/oraidex-common/src/network.ts                                          968       0  100.00%
packages/oraidex-common/src/pairs.ts                                            154       4  97.40%   151-152, 157-158
packages/oraidex-common/src/token.ts                                             71       0  100.00%
packages/oraidex-common/src/wallet.ts                                           146     146  0.00%    1-236
packages/oraidex-common/src/config/chainInfosWithIcon.ts                        196     196  0.00%    1-210
packages/oraidex-common/src/interface/index.ts                                    1       1  0.00%    1
packages/oraidex-common/src/interface/wallet.ts                                  19      19  0.00%    1-20
packages/oraidex-common/tests/bigdecimal.spec.ts                                220       0  100.00%
packages/oraidex-common/tests/helper.spec.ts                                    560       8  98.57%   97-98, 337-338, 628-629, 659-660
packages/oraidex-common/tests/pairs.spec.ts                                      24       0  100.00%
packages/oraiswap-v3/src/const.ts                                                11       0  100.00%
packages/oraiswap-v3/src/handler.ts                                             266       6  97.74%   60-61, 97-98, 213-214
packages/oraiswap-v3/src/helpers.ts                                             212      10  95.28%   96-97, 107-108, 133-134, 162-163, 173-174
packages/oraiswap-v3/src/index.ts                                                 5       0  100.00%
packages/oraiswap-v3/src/types.ts                                                 0       0  100.00%
packages/oraiswap-v3/src/wasm/oraiswap_v3_wasm.d.ts                              32      32  0.00%    469-500
packages/oraiswap-v3/src/wasm/oraiswap_v3_wasm.js                              1543     710  53.98%   32-34, 92-94, 100-101, 103-108, 113-120, 136-145, 160-223, 233-255, 264-284, 293-313, 322-342, 351-371, 380-400, 409-429, 463-464, 480-502, 508-511, 518-530, 536-548, 555-558, 565-579, 587-590, 595-598, 611-614, 620-623, 636-639, 660-663, 668-671, 688-729, 736-754, 762-776, 783-786, 793-807, 817-838, 848-869, 884-885, 910-911, 929-953, 958-961, 966-969, 976-979, 984-987, 992-995, 1002-1005, 1010-1013, 1028-1031, 1036-1039, 1044-1047, 1062-1065, 1080-1083, 1088-1091, 1096-1099, 1106-1109, 1114-1117, 1122-1125, 1132-1135, 1149-1150, 1161-1164, 1170-1173, 1179-1182, 1188-1191, 1196-1199, 1204-1207, 1214-1217, 1219-1225, 1300-1301, 1329-1330, 1333-1335, 1356-1361, 1364-1365, 1368-1372, 1386-1387, 1390-1391, 1394-1395, 1398-1399, 1402-1403, 1406-1407, 1410-1413, 1416-1417, 1420-1421, 1424-1425, 1428-1431, 1434-1437, 1444, 1447-1448, 1451-1458, 1465-1466, 1469-1470, 1473-1474, 1477, 1480-1481, 1484-1491, 1500-1504, 1507, 1510-1511
packages/oraiswap-v3/tests/handler.spec.ts                                      277       0  100.00%
packages/oraiswap-v3/tests/helpers.spec.ts                                      577       0  100.00%
packages/oraiswap-v3/tests/test-common.ts                                        32       0  100.00%
packages/universal-swap/src/handler.ts                                         1199     607  49.37%   81-82, 103-104, 119-121, 127-130, 141-143, 155-160, 181-203, 282-312, 369-374, 425-445, 496-501, 548-559, 583, 585-589, 602-613, 620-635, 638-684, 695-705, 708-718, 725-732, 746-823, 827-858, 862-881, 884-901, 905-956, 961-1043, 1049-1134, 1144-1149, 1179-1181, 1183-1184, 1190, 1204-1218, 1246-1249, 1282-1285, 1292-1302, 1307-1320, 1361-1362, 1403-1414, 1481-1482
packages/universal-swap/src/helper.ts                                           915     329  64.04%   86-88, 224-225, 271-276, 304-305, 339-351, 365-419, 460-462, 484-490, 514-516, 520-522, 529-556, 616-617, 650-657, 664-705, 717-785, 824-825, 840, 868, 875-896, 898-899, 932-933, 936-939, 949-991, 999-1015, 1074-1084, 1095-1100, 1119, 1145-1157
packages/universal-swap/src/index.ts                                              6       6  0.00%    1-6
packages/universal-swap/src/swap-filter.ts                                       40       0  100.00%
packages/universal-swap/src/types.ts                                             10       0  100.00%
packages/universal-swap/src/wrapper.ts                                           79      79  0.00%    1-117
packages/universal-swap/src/proto/index.ts                                        1       1  0.00%    1
packages/universal-swap/src/proto/universal-swap-memo-proto-handler.ts           66      60  9.09%    21-46, 50-91
packages/universal-swap/src/proto/universal_swap_memo.ts                        911     818  10.20%   110-112, 116-132, 135-183, 186-193, 196-213, 216-217, 219-230, 233-235, 239-243, 246-266, 269-274, 277-282, 285-286, 288-291, 294-296, 300-304, 307-327, 330-333, 336-341, 344-345, 347-350, 353-355, 359-366, 369-396, 399-405, 408-416, 419-420, 422-426, 429-431, 435-445, 448-482, 485-490, 493-504, 507-508, 510-515, 518-520, 524-534, 537-571, 574-583, 586-597, 600-601, 603-613, 616-618, 622-635, 638-679, 682-690, 693-707, 710-711, 713-727, 730-732, 736-752, 755-803, 806-813, 816-833, 836-837, 839-846, 849-851, 855-871, 874-922, 925-932, 935-952, 955-956, 958-965, 968-970, 974-981, 984-1011, 1014-1018, 1021-1029, 1032-1033, 1035-1039, 1042-1044, 1048-1052, 1055-1075, 1078-1079, 1082-1087, 1090-1091, 1093-1096, 1111-1119, 1122-1128
packages/universal-swap/src/universal-demos/alpha-smart-router.ts               114     114  0.00%    1-589
packages/universal-swap/src/universal-demos/evm-to-evm.ts                        52      52  0.00%    1-68
packages/universal-swap/src/universal-demos/from-cosmos-to-evm.ts                41      41  0.00%    1-53
packages/universal-swap/src/universal-demos/from-oraichain-to-oraichain.ts       49      49  0.00%    1-66
packages/universal-swap/src/universal-demos/handle-simulate-swap.ts              32      32  0.00%    1-36
packages/universal-swap/src/universal-demos/ibc-hooks-demo.ts                    40      40  0.00%    1-55
packages/universal-swap/src/universal-demos/neutaro-ibc-demo.ts                  40      40  0.00%    1-47
packages/universal-swap/src/universal-demos/noble-ibc-demo.ts                    41      41  0.00%    1-45
packages/universal-swap/src/universal-demos/offline-wallet.ts                    19      19  0.00%    1-21
packages/universal-swap/tests/helper.spec.ts                                    697      24  96.55%   378, 947-969
packages/universal-swap/tests/index.spec.ts                                    1735      32  98.15%   240-243, 271-272, 283-284, 289-290, 292-293, 295-296, 1130-1149
packages/universal-swap/tests/smart-router-common.ts                            864       0  100.00%
packages/universal-swap/tests/test-common.ts                                     56       0  100.00%
TOTAL                                                                         13852    4403  68.21%

Diff against main

Filename                                                             Stmts    Miss  Cover
-----------------------------------------------------------------  -------  ------  --------
packages/universal-swap/src/handler.ts                                 -76      +4  -3.33%
packages/universal-swap/src/helper.ts                                  +82     +13  +1.98%
packages/universal-swap/src/universal-demos/alpha-smart-router.ts      +19     +19  +100.00%
packages/universal-swap/tests/index.spec.ts                            -10      +2  -0.13%
TOTAL                                                                  +15     +38  -0.24%

Results for commit: 181b5a4

Minimum allowed coverage is 0%

♻️ This comment has been updated with latest results

@haunv3 haunv3 merged commit e40cbf0 into main Aug 29, 2024
4 checks passed
@trung2891 trung2891 deleted the feat/add-params-smart-route branch October 6, 2024 10:46
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.

3 participants