Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

refactor: Refactor and optimize governance.ts for better maintainability#25

Open
tiendn wants to merge 1 commit intoberachain:mainL2from
tiendn:refactor/goveranance
Open

refactor: Refactor and optimize governance.ts for better maintainability#25
tiendn wants to merge 1 commit intoberachain:mainL2from
tiendn:refactor/goveranance

Conversation

@tiendn
Copy link
Copy Markdown

@tiendn tiendn commented Jun 11, 2024

Enhancements in governance.ts for Improved Code Quality

This PR introduces several improvements to the governance.ts module to enhance readability, maintainability, and performance. Key changes include:

  1. Code Deduplication:
    Refactored opsResolution and treasuryResolution to use a shared helper function resolutionHelper, reducing code duplication and improving maintainability.
  2. Early Error Handling:
    Modified timelockDelaySet to check delay constraints at the beginning of the function. This change ensures that the function fails fast before performing any operations if the delay exceeds the allowed maximum.
  3. Consistency in Async Operations:
    Updated asynchronous operations to consistently use async/await syntax, ensuring that all asynchronous code is easy to read and error handling is straightforward.

These changes aim to streamline the codebase and improve the overall quality of the governance module.
Files Modified: misc/libs/governance.ts

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants