Draft
Conversation
calldata
pushed a commit
that referenced
this pull request
Apr 10, 2026
- SvmBackend trait now uses AccountSharedData instead of Account, isolating the conversion to the LiteSVM impl only (ugly #1, #2) - Add to_pubkey/to_program_pubkey helpers in token_decode.rs, replacing 12+ verbose Pubkey::new_from_array(..to_bytes()) sites (ugly #3) - Deduplicate Pipeline constructors with private default_state() helper using struct update syntax (ugly #4) - Fill in missing error context pubkeys in ensure_same_program and resolve_lookup_indexes (ugly #5) - Introduce generic BundleResult<T> with skipped_count()/is_complete() so bundle callers can detect truncated execution (ugly #6)
calldata
added a commit
that referenced
this pull request
Apr 10, 2026
* refactor(sonar-sim): simplify public API with fluent Pipeline (#27) Replace ~40+ direct exports with a 11-item stable public API: - `Pipeline` — fluent API: `.parse()` → `.load_accounts()` → `.with_mutations()` → `.execute()` - `Mutations` / `MutationsBuilder` — consolidated mutation config - `SimulationResult` — auto-computed balance changes from pre/post snapshots - `SolBalanceChange` / `TokenBalanceChange` — balance change types - `AccountSource` / `FetchObserver` / `FetchEvent` — extension traits - `SonarSimError` / `Result<T>` — error types All internal types remain accessible via `sonar_sim::internals::*` for power users. No file moves — internals module re-exports from existing pub(crate) modules. Root sonar crate migrated to internals paths. BREAKING CHANGE: most types moved from top-level to `sonar_sim::internals::*` * docs(sonar-sim): add README with usage examples * refactor(sonar-sim): address architecture ugly points from review - SvmBackend trait now uses AccountSharedData instead of Account, isolating the conversion to the LiteSVM impl only (ugly #1, #2) - Add to_pubkey/to_program_pubkey helpers in token_decode.rs, replacing 12+ verbose Pubkey::new_from_array(..to_bytes()) sites (ugly #3) - Deduplicate Pipeline constructors with private default_state() helper using struct update syntax (ugly #4) - Fill in missing error context pubkeys in ensure_same_program and resolve_lookup_indexes (ugly #5) - Introduce generic BundleResult<T> with skipped_count()/is_complete() so bundle callers can detect truncated execution (ugly #6) * refactor(sonar-sim): encapsulate BundleResult fields and log skipped transactions - Make BundleResult fields private; add new(), executed(), into_executed(), total() accessors to prevent construction of invalid states - Log a warning in handle_bundle when transactions are skipped due to prior failure, surfacing the metadata BundleResult was designed to carry * refactor(sonar-sim): remove redundant traits.rs re-export module Re-export AccountSource, FetchEvent, FetchObserver directly from types in lib.rs, eliminating a pointless indirection hop.
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
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.
Summary
.github/workflows/ci.ymlwith four parallel jobs: format check, clippy lint, test, and release buildmainand on PRs targetingmaindtolnay/rust-toolchain@stableandSwatinem/rust-cache@v2for cachingTest plan