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

Provide snapshot tests for storage values in sequencer #1982

Closed
Fraser999 opened this issue Feb 19, 2025 · 0 comments · Fixed by #1985
Closed

Provide snapshot tests for storage values in sequencer #1982

Fraser999 opened this issue Feb 19, 2025 · 0 comments · Fixed by #1985
Assignees
Labels
code-quality sequencer pertaining to the astria-sequencer crate testing

Comments

@Fraser999
Copy link
Contributor

We need to ensure new variants of the many <component>::storage::ValueImpl enums are only ever appended to the existing ones. Providing snapshot tests for every variant will help ensure this (as well as helping ensure existing variants don't change).

We should also provide a snapshot test for each variant of the top-level StoredValue enum too, for the same reasons.

@Fraser999 Fraser999 added sequencer pertaining to the astria-sequencer crate code-quality testing labels Feb 19, 2025
github-merge-queue bot pushed a commit that referenced this issue Mar 7, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…te-breaking changes (#1985)

## Summary
Added snapshot tests for all storage values to ensure that future
changes do not break state.

## Background
The addition of the `BridgeTransfer` action revealed how inserting a
value into the storage `ValueImpl` is a breaking change, since
deserialization would then fail. New values, such as
`BridgeTransferFees` need to be appended instead of inserted. Adding
snapshots for each storage variant's discriminant ensures that there is
an extra level of protection against making a state breaking change.

## Changes
- Added snapshots for the borsch encoding of every `ValueImpl` variant
and every `StoredValue` variant.

## Testing
Manually reviewed every discriminant.

## Changelogs
No updates required.

## Related Issues
closes #1982

---------

Co-authored-by: Jordan Oroshiba <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-quality sequencer pertaining to the astria-sequencer crate testing
Projects
None yet
2 participants