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

SHARD-2019 - Prettier distributor #43

Merged
merged 2 commits into from
Mar 20, 2025

Conversation

mhanson-github
Copy link

@mhanson-github mhanson-github commented Mar 18, 2025

PR Type

enhancement, formatting


Description

  • Refactor code for improved readability and consistency.

  • Update Prettier configuration for wider print width.

  • Simplify logging and error handling statements.

  • Adjust ESLint and TSLint configurations for better code quality.


Changes walkthrough 📝

Relevant files
Enhancement
10 files
api.ts
Simplify error handling in route registration                       
+1/-3     
index.ts
Refactor server factory and logging                                           
+2/-6     
accounts.ts
Simplify logging in account operations                                     
+3/-13   
cycles.ts
Simplify function signature formatting                                     
+1/-3     
originalTxsData.ts
Simplify error handling in transaction data operations     
+2/-6     
receipts.ts
Simplify logging in receipt operations                                     
+2/-10   
transactions.ts
Simplify logging and data deserialization                               
+5/-17   
distributor.ts
Simplify console logging for memory usage                               
+1/-3     
rmq_data_publisher.ts
Simplify checkpoint update and error logging                         
+4/-16   
index.ts
Simplify logger initialization                                                     
+1/-3     
Formatting
3 files
Crypto.ts
Remove unnecessary whitespace                                                       
+0/-1     
rmq_data_publisher.test.ts
Remove unnecessary whitespace in tests                                     
+1/-2     
distributor-log.json
Simplify JSON formatting for log configuration                     
+4/-11   
Configuration changes
3 files
prettier.config.js
Update print width in Prettier configuration                         
+1/-1     
.eslintrc.json
Simplify ignore patterns in ESLint configuration                 
+1/-3     
tslint.json
Simplify exclude patterns in TSLint configuration               
+1/-3     

Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🏅 Score: 92
    🧪 PR contains tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Logging Consistency

    Ensure that the logging statements are consistent and provide meaningful information. The added log messages should be checked for clarity and relevance.

    Logger.mainLogger.error(`Exceed maximum limit of ${MAX_CYCLES_PER_REQUEST} cycles`)
    reply.send(Crypto.sign({ success: false, error: `Exceed maximum limit of ${MAX_CYCLES_PER_REQUEST} cycles` }))
    Error Handling Improvement

    The error handling in the insertAccount function has been updated. Verify that the new error message provides sufficient context and is logged appropriately.

    Logger.mainLogger.error(e)
    Logger.mainLogger.error('Unable to insert Account or it is already stored in to database', account.accountId)

    Copy link

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @mhanson-github mhanson-github merged commit 40a0e99 into mainnet-launch Mar 20, 2025
    5 checks passed
    @mhanson-github mhanson-github deleted the SHARD-2019-prettier branch March 20, 2025 01:55
    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