Skip to content

Add abitrary persistence to Wallet #757

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rustaceanrob
Copy link
Collaborator

Description

Notes to the reviewers

Changelog notice

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

Types like "Txid", "BlockHash", "DescriptorId" are all just 32 byte
arrays that represent hashes with different meanings. Currently they
are represented as strings at the FFI layer, but they are also
meaningful arrays of bytes. Particularly if a user wants to implement
persistence over the FFI layer, they would want to efficiently
serialize these types.

Here I am introducing a new group of types that all implement display,
allow serialization to bytes, and may be constructed from an array of
bytes. I went with a "rule of 3s" here, and also introduced a macro to
do these implementations because there was a lot of boilerplate
involved.

Note that all of these are included in the wallet changeset, which is
required to represent in-full for FFI-layer custom persistence.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant