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

fix(wallet-lib): invalid deserialization of persistent storage #76

Merged
merged 6 commits into from
Dec 13, 2021

Conversation

markin-io
Copy link
Contributor

@markin-io markin-io commented Dec 9, 2021

Issue being fixed or feature implemented

The fix ensures proper data types casting for serialized items in the persistent storage at the moment of wallet initialization:

  • Read data from persistent storage
  • Deserialize to JSON objects
  • Cast certain objects to correct data types (Transaction, BlockHeader, InstantLock, Output, UnspentOutput)

What was done?

Described storage types schema and wrote a function to validate storage against the schema and cast to correct types

How Has This Been Tested?

  • Created relevant unit test
  • Tested manually by starting wallet from persistent storage and broadcasting a transaction

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@markin-io markin-io added the bug Something isn't working label Dec 9, 2021
@markin-io markin-io added this to the v0.22.0 milestone Dec 9, 2021
@markin-io markin-io changed the title fix(wallet-lib): invalid deserialization of persistence storage fix(wallet-lib): invalid deserialization of persistent storage Dec 10, 2021
Copy link
Collaborator

@jawid-h jawid-h left a comment

Choose a reason for hiding this comment

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

Looks legit to me.

@markin-io markin-io merged commit 1fff5e1 into master Dec 13, 2021
@markin-io markin-io deleted the fix/storage-serialization branch December 13, 2021 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants