-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: Allow passing multiple entities in the ApplySystem function #51
feat: Allow passing multiple entities in the ApplySystem function #51
Conversation
…github.com:magicblock-labs/bolt into vbrunet/2024_06_12-update-transaction-apply-system
); | ||
return { | ||
transaction: new Transaction().add(createEntityIx), | ||
entityPda, | ||
entityId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing this entityId
because this might not be correct if the user passed a seed as parameter. This should not be part of the public API imo.
authority: PublicKey; | ||
seeds?: string[]; | ||
systemId: PublicKey; | ||
entities: ApplySystemEntity[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the main change to the API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
# Summary `ApplySystem` typescript API has changed, we update the docs to match that. # Details `ApplySystem` can now take an array of entities instead of a single entity as parameter. Also removed the use of `entityId`. Also mention we can read the state from the `componentPda`. # Notes Matching PR for `bolt-sdk` change: magicblock-labs/bolt#51
Problem
It was previously impossible to pass components from multiple entities in the same system from the typescript SDK.
Solution
Changing the
ApplySystem
function to accommodate for multiple entities.Other changes (e.g. bug fixes, small refactors)
Refactored the integration tests to use the highest level API to increase testing surface.
Also improved some of the error tests:
Removed the unused
bolt.js
Notes
Matching PR for docs update: magicblock-labs/docs#6