Modularize cleartext specifications for the bitcoin app#267
Merged
Conversation
…ectors as a toml file
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extracts the BIP388 cleartext display/specification logic from the Bitcoin common crate into a new standalone apps/bitcoin/bip388 crate, and migrates the cleartext specification + test vectors into TOML files to be consumed by codegen and tests.
Changes:
- Introduces a new
bip388crate containing the BIP388 parsing/types plus cleartext encode/decode support and code generation viabuild.rs. - Moves the cleartext specification and test vectors into
src/cleartext/specs/*.tomland updates the codegen/test harness to consume them. - Updates the Bitcoin common crate to depend on and re-export the new
bip388crate; updates CI and workspace configuration to include the new crate.
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| vanadium.code-workspace | Adds the new apps/bitcoin/bip388 folder to the workspace config. |
| apps/bitcoin/common/src/lib.rs | Switches from an internal bip388 module to re-exporting the external bip388 crate. |
| apps/bitcoin/common/src/bip388/cleartext/mod.rs | Removes the old in-crate cleartext implementation (moved to the new crate). |
| apps/bitcoin/common/Cargo.toml | Drops cleartext codegen build deps and adds a path dependency on ../bip388. |
| apps/bitcoin/bip388/Cargo.toml | Adds the new bip388 crate manifest, features, and build/dev dependencies. |
| apps/bitcoin/bip388/build.rs | Implements cleartext code generation from src/cleartext/specs/cleartext.toml. |
| apps/bitcoin/bip388/src/lib.rs | Defines the new crate root, wiring in cleartext/time and re-exporting cleartext API. |
| apps/bitcoin/bip388/src/time.rs | Adds time/date formatting + parsing helpers used by cleartext. |
| apps/bitcoin/bip388/src/cleartext/mod.rs | Adds the cleartext encode/decode + confusion score logic and TOML-driven test harness. |
| apps/bitcoin/bip388/src/cleartext/decode.rs | Updates decode module comment to reference the new spec path. |
| apps/bitcoin/bip388/src/cleartext/specs/cleartext.toml | Adds the TOML “single source of truth” cleartext spec consumed by codegen. |
| apps/bitcoin/bip388/src/cleartext/specs/test_vectors.toml | Adds shared TOML test vectors for encoder/decoder behavior. |
| .github/workflows/ci.yaml | Ensures native tests run in the new apps/bitcoin/bip388 directory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move bip388/cleartext into standalone crate.
Move both the specs and the test vectors in a a folder containing toml files.