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

✨ Variable components number #124

Merged
merged 6 commits into from
Jan 16, 2025
Merged

Conversation

notdanilo
Copy link
Contributor

@notdanilo notdanilo commented Jan 11, 2025

Status Type ⚠️ Core Change Issue
Hold Feature Yes #123

Problem

What problem are you trying to solve?

Max components is currently limited to 5.

Solution

Use the remaining accounts to flexibilize the number of components. It will get rid of the #[system_template(max_components = X)] macro which creates a burden for maintainability.

Greptile Summary

This PR removes the fixed maximum component limit (previously 5) in favor of a more flexible approach using remaining accounts for the Bolt framework.

  • Removes bolt-helpers crate and associated macros (#[system_template(max_components = X)]) to improve maintainability
  • Consolidates multiple apply functions into a single flexible implementation using remaining accounts
  • Modifies bolt-lang attributes to support variable component numbers through NumberOfComponents trait
  • Updates CPI context building and account validation to handle dynamic component arrays
  • Adds new InvalidSystemOutput error handling for the variable components approach

💡 (2/5) Greptile learns from your feedback when you react with 👍/👎!

@notdanilo notdanilo force-pushed the feature/variable-components-number branch 2 times, most recently from f11d548 to ebf4295 Compare January 16, 2025 13:02
@notdanilo notdanilo changed the title Feature/variable components number ✨ Variable components number Jan 16, 2025
@notdanilo notdanilo marked this pull request as ready for review January 16, 2025 13:09
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

22 file(s) reviewed, 19 comment(s)
Edit PR Review Bot Settings | Greptile

clients/bolt-sdk/src/generated/idl/world.json Outdated Show resolved Hide resolved
.github/workflows/publish-bolt-crates.yml Show resolved Hide resolved
crates/bolt-helpers/Cargo.toml Outdated Show resolved Hide resolved
clients/bolt-sdk/src/world/transactions.ts Show resolved Hide resolved
clients/bolt-sdk/src/world/transactions.ts Show resolved Hide resolved
crates/bolt-lang/attribute/system/src/lib.rs Show resolved Hide resolved
crates/programs/bolt-component/src/lib.rs Show resolved Hide resolved
crates/programs/world/src/error.rs Show resolved Hide resolved
crates/programs/world/src/lib.rs Show resolved Hide resolved
@notdanilo notdanilo self-assigned this Jan 16, 2025
@notdanilo notdanilo force-pushed the feature/variable-components-number branch from ebf4295 to 3dba024 Compare January 16, 2025 21:13
@notdanilo notdanilo force-pushed the feature/variable-components-number branch from 3dba024 to 972a8d8 Compare January 16, 2025 21:42
@notdanilo notdanilo merged commit ea1de62 into main Jan 16, 2025
5 checks passed
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.

1 participant