Skip to content

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Dec 18, 2024

This adds support for the state methods introduced in #2916 to snaps-simulation (and snaps-jest), and updates the example to test these methods as well.

Breaking changes

  • The middleware hooks in snaps-simulation were separated into two separate types, PermittedMiddlewareHooks and RestrictedMiddlewareHooks.
  • The MiddlewareHooks type was removed.

@Mrtenz Mrtenz marked this pull request as ready for review December 18, 2024 09:23
@Mrtenz Mrtenz requested a review from a team as a code owner December 18, 2024 09:23
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.59%. Comparing base (1e16931) to head (ce25973).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2966      +/-   ##
==========================================
+ Coverage   94.57%   94.59%   +0.01%     
==========================================
  Files         492      493       +1     
  Lines       10625    10654      +29     
  Branches     1635     1635              
==========================================
+ Hits        10049    10078      +29     
  Misses        576      576              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

* @returns The state of the Snap.
* @yields Selects the state from the store.
*/
function* getSnapStateImplementation(encrypted: boolean): SagaIterator<string> {
Copy link
Member

Choose a reason for hiding this comment

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

IIRC we already have a function for this, can we dedupe?

Copy link
Member Author

Choose a reason for hiding this comment

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

This hook doesn't expect an origin as first parameter, so it's slightly different.

@Mrtenz Mrtenz changed the title Add support for new state methods to snaps-simulation BREAKING: Add support for new state methods to snaps-simulation Dec 18, 2024
Base automatically changed from mrtenz/state-methods to main December 18, 2024 18:25
@Mrtenz Mrtenz force-pushed the mrtenz/state-methods-snaps-jest branch from 6cc7dad to ce25973 Compare December 19, 2024 09:48
@Mrtenz Mrtenz merged commit 336b83f into main Dec 19, 2024
166 checks passed
@Mrtenz Mrtenz deleted the mrtenz/state-methods-snaps-jest branch December 19, 2024 10:04
PatrykLucka pushed a commit that referenced this pull request Jan 13, 2025
)

This adds support for the state methods introduced in #2916 to
`snaps-simulation` (and `snaps-jest`), and updates the example to test
these methods as well.

## Breaking changes

- The middleware hooks in `snaps-simulation` were separated into two
separate types, `PermittedMiddlewareHooks` and
`RestrictedMiddlewareHooks`.
- The `MiddlewareHooks` type was removed.
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