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

feat: Allow passing multiple entities in the ApplySystem function #51

Merged

Conversation

crypto-vincent
Copy link
Contributor

@crypto-vincent crypto-vincent commented Jun 13, 2024

Status Type ⚠️ Core Change Issue
Ready Feature/Refactor No --

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:

  • verifying that exactly what we want is failing by checking error messages
  • verify the actual content of the pdas after the calls

Removed the unused bolt.js

Notes

Matching PR for docs update: magicblock-labs/docs#6

@crypto-vincent crypto-vincent self-assigned this Jun 13, 2024
@crypto-vincent crypto-vincent marked this pull request as draft June 13, 2024 10:54
@crypto-vincent crypto-vincent marked this pull request as ready for review June 13, 2024 15:37
@crypto-vincent crypto-vincent changed the title [WIP] Update ApplySystem API feat: Allow passing multiple entities in the ApplySystem function Jun 13, 2024
);
return {
transaction: new Transaction().add(createEntityIx),
entityPda,
entityId,
Copy link
Contributor Author

@crypto-vincent crypto-vincent Jun 14, 2024

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[];
Copy link
Contributor Author

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

Copy link
Contributor

@GabrielePicco GabrielePicco left a comment

Choose a reason for hiding this comment

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

LGTM

@crypto-vincent crypto-vincent merged commit eef1e0e into main Jun 17, 2024
4 checks passed
@crypto-vincent crypto-vincent deleted the vbrunet/2024_06_12-update-transaction-apply-system branch June 17, 2024 13:24
crypto-vincent added a commit to magicblock-labs/docs that referenced this pull request Jun 17, 2024
# 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
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.

2 participants