Skip to content

Add abitrary persistence to Wallet#757

Closed
rustaceanrob wants to merge 4 commits intobitcoindevkit:masterfrom
rustaceanrob:persistence-5-8
Closed

Add abitrary persistence to Wallet#757
rustaceanrob wants to merge 4 commits intobitcoindevkit:masterfrom
rustaceanrob:persistence-5-8

Conversation

@rustaceanrob
Copy link
Copy Markdown
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