feat(web-client): expose storage-map deltas and slot names on AccountStorageDelta - #298
Open
WiktorStarczewski wants to merge 2 commits into
Open
feat(web-client): expose storage-map deltas and slot names on AccountStorageDelta#298WiktorStarczewski wants to merge 2 commits into
WiktorStarczewski wants to merge 2 commits into
Conversation
…StorageDelta
Add AccountStorageDelta.valueDeltas() (each { slotName, value }) and
maps() (each { slotName, entries() } of { key, value } Words), so a
consumer can read storage-map changes (e.g. multisig signer sets,
per-procedure thresholds) and label value-slot changes from a
TransactionSummary.accountDelta().storage(). The existing values()
(bare Word[]) is unchanged. Purely a JS-binding addition; the native
miden-protocol data was already present.
Bumps @miden-sdk/miden-sdk to 0.15.10.
3 tasks
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.
What
Adds two accessors to
AccountStorageDeltaso a JS consumer can read storage-map deltas and the slot names of value-slot changes from aTransactionSummary:valueDeltas(): StorageValueDelta[]— each{ slotName, value }(the existingvalues(): Word[]is unchanged).maps(): StorageMapSlotDelta[]— each{ slotName, entries() }, where an entry isStorageMapDeltaEntry { key, value }(bothWord).Why
AccountStorageDelta.values()returned a bareWord[]with the slot name dropped, and storage-map deltas weren't exposed at all. A consumer that needs to verify what a transaction changed — e.g. the OpenZeppelin guardian multisig client checking that a proposal's metadata matches the signedTransactionSummaryin a block-independent way — must read map-slot changes (signer sets, per-procedure thresholds) and know which value slot changed. Those live in storage maps / named value slots that the JS binding was discarding.How
Pure JS-binding addition, mirroring the existing
FungibleAssetDeltaItempattern invault.rs. The nativemiden-protocolAccountStorageDeltaalready exposesvalues()(with slot name) andmaps(); this surfaces them. Slot names come through as plain strings (StorageSlotName::as_str()), so consumers match by name directly. No upstreammiden-protocol/miden-clientchange — the data was already present, just dropped at the boundary.values()is left intact (additive, non-breaking).Tests
Extended the
transactions.preview returns a TransactionSummarymock test to exercisestorage().valueDeltas()/maps()on a real faucet-mint summary (accessors present, arrays returned,valueDeltas()aligned withvalues(), value-slot shape checked).Notes
@miden-sdk/miden-sdkto0.15.10; CHANGELOG entry under## 0.15.10 (TBD).StorageMapEntryalready existed (full-storage{root,key,value}strings), so the delta entry type is namedStorageMapDeltaEntry.