Refactoring and removing dead code#476
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Graphite Automations"Auto-assign PRs to author" took an action on this PR • (04/17/25)1 assignee was added to this PR based on Juan Ignacio Rios's automation. |
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the codebase by removing dead code and unifying balance types across pallets, transitioning from a hard-coded u128 Balance alias to a generic BalanceOf type. Key changes include updating type signatures and trait bounds in multiple modules and improving type consistency throughout funding, instantiation, and migration code.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pallets/linear-release/src/lib.rs | Refactored imports and type aliases; updated documentation. |
| pallets/funding/src/types.rs | Updated generic types in storage and configuration structs. |
| pallets/funding/src/traits.rs | Changed function signatures to use BalanceOf instead of Balance. |
| pallets/funding/src/mock.rs | Updated constants and helper functions to use BalanceOf. |
| pallets/funding/src/migrations/storage_migrations.rs | Adjusted migration types; explicitly sets Balance as u128 locally. |
| pallets/funding/src/lib.rs | Revised type definitions and Config trait bounds for consistency. |
| pallets/funding/src/instantiator/* | Updated conversions and arithmetic functions with BalanceOf. |
| pallets/funding/src/functions/* | Updated function parameters and return types to BalanceOf. |
| pallets/funding/Cargo.toml | Adjusted workspace dependencies accordingly. |
Comments suppressed due to low confidence (2)
pallets/funding/src/migrations/storage_migrations.rs:33
- This explicit type alias 'type Balance = u128;' differs from the updated generic 'BalanceOf' usage elsewhere. Please ensure that this inconsistency is intentional and that any necessary conversions between u128 and BalanceOf are properly handled.
type Balance = u128;
pallets/linear-release/src/lib.rs:246
- The added term 'permissionlessly' in this function's documentation implies a change in access control. Please verify that the implementation enforces the intended security guarantees and consider adding clarification if needed.
/// Unlock any vested funds of a `target` account, for the given `reason` permissionlessly.

What?
General refactoring:
Why?
How?
Testing?
Screenshots (optional)
Anything Else?