Skip to content

Add isolated RGB stock snapshots - #19

Draft
Jainakin wants to merge 1 commit into
rgb-protocol:masterfrom
Jainakin:hardik/rgb-stock-snapshot
Draft

Add isolated RGB stock snapshots#19
Jainakin wants to merge 1 commit into
rgb-protocol:masterfrom
Jainakin:hardik/rgb-stock-snapshot

Conversation

@Jainakin

Copy link
Copy Markdown
Contributor

Summary

  • add an explicit Stock::snapshot() API backed by clone_no_persistence()
  • guarantee that staged stock mutations cannot modify the source persistence providers
  • cover source/snapshot isolation with a focused unit test

Motivation

Transactional RGB acceptance needs to validate and stage state changes without publishing partial stock state. This small primitive makes that ownership boundary explicit and testable.

Validation

  • cargo +nightly fmt --all -- --check
  • cargo test --workspace --all-features
  • Result: 39 passed, 0 failed

Dependency

This PR is independent at the source level. It is consumed by the transactional acceptance work in rgb-lib.

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@St333p

St333p commented Aug 11, 2026

Copy link
Copy Markdown
Member

Thanks for this PR!
However, a rather large change is underway to move RGB internal storage to a sqlite DB, and this PR might become unnecessary after that change. We expect to publish it in the next couple of weeks

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