Skip to content

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

Merged
markin-io merged 6 commits into
masterfrom
fix/storage-serialization
Dec 13, 2021
Merged

fix(wallet-lib): invalid deserialization of persistent storage#76
markin-io merged 6 commits into
masterfrom
fix/storage-serialization

Conversation

@markin-io

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

Copy link
Copy Markdown
Contributor

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 requested a review from Alex-Werner December 9, 2021 12:12
@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
@markin-io
markin-io requested a review from jawid-h December 10, 2021 14:02

@jawid-h jawid-h left a comment

Copy link
Copy Markdown
Contributor

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