proto-kit / framework

Apache License 2.0
28 stars 10 forks source link

State API should enforce from state transitions at all times #20

Closed maht0rz closed 1 year ago

maht0rz commented 1 year ago

Is your feature request related to a problem? Please describe. As of now, when an optional value is retrieved via .get() a corresponding state transition is emitted. Problem is that this state transition respects the isSome of the value retrieved, so when the value is none then the state transition from is also none. This is a problem since the state transition prover then ignores the from of the state transition.

Describe the solution you'd like The correct way to issue state transitions anchored to the previous state, is to mark the from as some instead of none. This applies to all cases including .get() and .set() state transitions

Additional context This issue was discovered during the PR review of #7