Skip to content

Refactoring and removing dead code#476

Closed
dastansam wants to merge 1 commit intographite-base/476from
04-17-refactoring_and_removing_dead_code
Closed

Refactoring and removing dead code#476
dastansam wants to merge 1 commit intographite-base/476from
04-17-refactoring_and_removing_dead_code

Conversation

@dastansam
Copy link
Copy Markdown
Contributor

@dastansam dastansam commented Apr 17, 2025

What?

General refactoring:

  • redundant config types
  • unused code
  • repeating code generalized

Why?

How?

Testing?

Screenshots (optional)

Anything Else?

Copy link
Copy Markdown
Contributor Author

dastansam commented Apr 17, 2025

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.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@dastansam dastansam marked this pull request as ready for review April 17, 2025 13:17
@graphite-app
Copy link
Copy Markdown

graphite-app bot commented Apr 17, 2025

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.

@dastansam dastansam marked this pull request as draft April 17, 2025 13:20
@lrazovic lrazovic requested a review from Copilot April 22, 2025 12:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lrazovic lrazovic changed the base branch from 03-21-vesting_pallet_block_number_provider_migration to graphite-base/476 April 25, 2025 10:47
@lrazovic lrazovic mentioned this pull request Apr 25, 2025
@dastansam dastansam marked this pull request as ready for review April 30, 2025 07:58
@dastansam dastansam marked this pull request as draft April 30, 2025 11:39
@lrazovic lrazovic closed this May 1, 2025
@lrazovic lrazovic deleted the 04-17-refactoring_and_removing_dead_code branch May 1, 2025 14:22
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