-
Notifications
You must be signed in to change notification settings - Fork 3
Add basic-operations examples (Anchor + Native) #16
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
pls add basic operations to ci |
8c12690 to
3da2b1f
Compare
Examples for compressed account operations in both Anchor and Native Rust. Structure: - basic-operations/anchor/ - Five standalone Anchor projects (create, update, close, reinit, burn) - basic-operations/native/ - Native Rust workspace with five programs Features: - Each Anchor project is independent with complete workspace configuration - SHA256 hashing for flat serialization - light-sdk 0.15.0+ compatibility - Rust and TypeScript tests for all operations - CI workflow integration for both Anchor and Native tests - confirmTransactionIndexed() for reliable test synchronization
3a938ad to
53f3805
Compare
…ually Each basic-operations/anchor subdirectory (burn, create, update, close, reinit) is a standalone Anchor project, not a workspace. This updates the CI matrix to list each project individually and dynamically extract the program name for the test validator.
- Add missing anchor feature to light-sdk-types in all basic-operations Anchor programs - Fix validator startup script to extract program name from Anchor.toml instead of using basename - Resolves prover health check failures and TypeScript connection errors
Split basic-operations/native workspace tests to run individual packages sequentially. This prevents multiple tests from starting prover instances simultaneously.
…s examples - Update light-sdk dependencies to latest versions across all examples - Optimize Cargo.lock files, reducing size significantly - Update Photon indexer revision in setup action - Fix import statements and update test files
- Fix anchor close test: use ProgramTestConfig with true for embedded prover - Remove unnecessary explicit lifetime parameters from LightAccount in native programs - Update Cargo.lock and dependencies
Comment on lines
117
to
124
| async fn get_message_account( | ||
| rpc: &mut LightProgramTest, | ||
| address: [u8; 32], | ||
| ) -> MyCompressedAccount { | ||
| let account = get_compressed_account(rpc, address).await; | ||
| let data = &account.data.as_ref().unwrap().data; | ||
| MyCompressedAccount::deserialize(&mut &data[..]).unwrap() | ||
| } |
Contributor
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.
propagate the error please
Co-authored-by: ananas-block <[email protected]>
Co-authored-by: ananas-block <[email protected]>
…ments This commit migrates all Anchor test files to use helper classes exported from @lightprotocol/[email protected] instead of local definitions: - Migrated to SDK exports: PackedAccounts, SystemAccountMetaConfig, confirmTx - Updated constructor patterns from static factory methods to standard ES6 constructors - Removed ~210 lines of duplicate helper class definitions per test file - Fixed close test to handle SDK behavior change where closed accounts return empty Buffer instead of throwing errors - Updated README.md with correct version requirements (Rust 1.90.0, Solana 2.3.11, Anchor 0.31.1) - Updated all package.json files to use @lightprotocol/[email protected] All tests verified working with local test validators.
Remove get_compressed_account and get_message_account helper functions from all test files as they obscure error origins with unnecessary unwraps. Replace with direct RPC calls in test functions for clearer error tracing. All tests continue to pass with simplified code.
ananas-block
approved these changes
Oct 30, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds examples for compressed account operations:
Structure:
Programs included:
Features: