-
Notifications
You must be signed in to change notification settings - Fork 3
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
Order History Amount Fix and THEA package upgrade #1325
Conversation
WalkthroughThe recent changes in the Changes
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
✅ Deploy Preview for stupendous-valkyrie-505e4a ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (3)
apps/hestia/package.json
is excluded by!**/*.json
packages/core/package.json
is excluded by!**/*.json
yarn.lock
is excluded by!**/*.lock
,!**/*.lock
Files selected for processing (4)
- apps/hestia/src/components/thea/Form/index.tsx (1 hunks)
- apps/hestia/src/components/thea/selectAsset.tsx (1 hunks)
- apps/hestia/src/components/trading/Orders/OrderHistory/columns.tsx (4 hunks)
- apps/hestia/src/components/transactions/OrderHistory/columns.tsx (4 hunks)
Files skipped from review due to trivial changes (1)
- apps/hestia/src/components/thea/Form/index.tsx
Additional comments not posted (7)
apps/hestia/src/components/thea/selectAsset.tsx (1)
67-67
: Ensure strict equality check aligns with business requirements.Verification successful
The verification script results show that the codebase consistently uses strict equality checks (
===
and!==
) for comparingticker
values. This implies that the use of strict equality in the provided code snippet aligns with the existing codebase practices.
packages/core/src/providers/user/thea/index.tsx
apps/hestia/src/hooks/useTheaTransactions.ts
apps/hestia/src/hooks/useBridge.ts
apps/hestia/src/components/thea/selectAsset.tsx
apps/hestia/src/components/thea/Form/index.tsx
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify if strict equality check for asset selection is intended. # Test: Search for the previous loose equality check usage in the codebase to ensure consistency. rg --type typescript $'x.ticker.includes(e.ticker)'Length of output: 87
Script:
#!/bin/bash # Description: Verify if strict equality check for asset selection is intended. # Test: Search for the previous loose equality check usage in the codebase to ensure consistency. rg --type ts $'x.ticker.includes(e.ticker)'Length of output: 44
Script:
#!/bin/bash # Description: Verify if strict equality check for asset selection is intended. # Test: Search for any loose equality checks involving `ticker` in the codebase to ensure consistency. rg --type ts '\.ticker\s*==\s*' rg --type ts '\.ticker\s*!=\s*'Length of output: 1172
apps/hestia/src/components/trading/Orders/OrderHistory/columns.tsx (3)
1-1
: Ensure new import is used effectively across the module.
143-143
: Check consistency in the use ofparseScientific
across similar fields.Verification successful
The usage of
parseScientific
appears consistent across similar numerical fields in the file, as it is applied toquantity
,filledQuantity
, andfee
.
quantity
:{parseScientific((+quantity).toString())}{" "}
filledQuantity
:{parseScientific((+e.getValue().filledQuantity).toString())}{" "}
fee
:{parseScientific(e.getValue().fee.toString())} {ticker}
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Ensure consistent use of `parseScientific` for similar numerical fields. # Test: Search for usage of `parseScientific` in other numerical fields in the module. rg --type typescript $'parseScientific' apps/hestia/src/components/trading/Orders/OrderHistory/columns.tsxLength of output: 140
Script:
#!/bin/bash # Description: Ensure consistent use of `parseScientific` for similar numerical fields. # Test: Search for usage of `parseScientific` in other numerical fields in the module. rg 'parseScientific' apps/hestia/src/components/trading/Orders/OrderHistory/columns.tsxLength of output: 346
177-177
: Validate the correctness of fee calculations.Verification successful
The
parseScientific
function is implemented to handle scientific notation correctly and convert it to a standard string representation. This ensures that thefee
values are processed accurately when passed to this function.
parseScientific
is defined inpackages/core/src/helpers/Utils.ts
and is correctly imported and used inapps/hestia/src/components/trading/Orders/OrderHistory/columns.tsx
.Based on the gathered information, the fee calculations appear to be handled correctly within the context of the provided code.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Confirm that fee calculations are accurate and consistent. # Test: Search for other instances where fee is calculated differently. rg --type typescript $'fee' apps/hestia/src/components/trading/Orders/OrderHistory/columns.tsxLength of output: 128
Script:
#!/bin/bash # Description: Confirm that fee calculations are accurate and consistent. # Test: Search for other instances where fee is calculated differently. rg --type ts $'fee' apps/hestia/src/components/trading/Orders/OrderHistory/columns.tsxLength of output: 284
Script:
#!/bin/bash # Description: Locate the definition of the `Order` class or type and inspect the calculation or assignment of `fee`. # Find the definition of the `Order` class or type. rg 'type Order' --type ts # Search for `fee` within the `Order` type definition to understand its calculation or assignment. rg 'fee' --type tsLength of output: 13557
Script:
#!/bin/bash # Description: Locate the implementation of the `parseScientific` function and inspect its usage. # Find the implementation of the `parseScientific` function. rg 'function parseScientific' --type ts # Search for any import statements for `parseScientific`. rg 'parseScientific' --type tsLength of output: 3112
Script:
#!/bin/bash # Description: Extract the implementation of the `parseScientific` function from `packages/core/src/helpers/Utils.ts` and analyze it. # Display the implementation of the `parseScientific` function. rg 'export function parseScientific' --type ts --context 10 packages/core/src/helpers/Utils.tsLength of output: 957
apps/hestia/src/components/transactions/OrderHistory/columns.tsx (3)
1-1
: Good use ofparseScientific
to handle numerical data.
224-224
: Check for potential precision issues in fee calculations.
157-162
: Ensure numerical values are handled correctly in market buy conditions.Verification successful
The search results indicate several instances where 'market' is used in conjunction with numerical values. These instances include handling of 'quantity', 'price', and 'ticker'. Based on the provided context, it appears that numerical values are handled consistently across different market conditions, including market buy conditions.
- Line 157:
const { side, type, quantity, market } = e.getValue();
- Line 159:
const isMarketBuy = type === "MARKET" && side === "Bid";
- Line 161:
return ( <Typography.Text size="xs"> {parseScientific((+quantity).toString())} {isMarketBuy ? market.quoteAsset.ticker : market.baseAsset.ticker}
These lines indicate that the handling of numerical values, particularly 'quantity', involves parsing scientific notation and converting it to a string, which is then used to determine the appropriate ticker based on the market condition.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the handling of numerical values in market buy conditions. # Test: Check if the numerical handling differs in other market conditions. rg --type typescript $'market buy' apps/hestia/src/components/transactions/OrderHistory/columns.tsxLength of output: 135
Script:
#!/bin/bash # Description: Verify the handling of numerical values in market buy conditions. # Test: Check if the numerical handling differs in other market conditions. rg --type ts 'market buy' apps/hestia/src/components/transactions/OrderHistory/columns.tsxLength of output: 92
Script:
#!/bin/bash # Description: Verify the handling of numerical values in market conditions. # Test: Check if the numerical handling differs in various market conditions. rg --type ts 'market' apps/hestia/src/components/transactions/OrderHistory/columns.tsxLength of output: 635
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ap211unitech please hide the skeleton of available amount if the user hasn't connected their wallet
@ap211unitech please hide the skeleton of available amount if the user hasn't connected their wallet Fixed it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- apps/hestia/src/components/thea/Form/index.tsx (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- apps/hestia/src/components/thea/Form/index.tsx
Description
This PR includes -
Checklist