feat(solana-wallet-snap): use shareable state management lib - #294
Conversation
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
| eventEmitter: EventEmitter, | ||
| state: Pick<IStateManager<UnencryptedStateValue>, 'deleteKey'>, | ||
| ): void => { | ||
| const migrateState = async (): Promise<void> => state.deleteKey('assets'); |
There was a problem hiding this comment.
I am not sure if my assumption is correct but with state.deleteKey - the assets field becomes undefined, but previous omit striped this field out from the object. Probably nothing wrong with this ?
There was a problem hiding this comment.
Should be good, using the newer shared deleteKey, this shared deleteKey strips the key like omit, it does not persist undefined.
The new deleteKey uses unset(state, key); which unset comes from lodash and that actually delete the property.



Explanation
Not client-breaking: JSON-RPC surface and persisted state format are unchanged. deleteKey now unsets the path (same as Tron/Stellar and Solana’s old test double) instead of writing serialized undefined.
References
Checklist