Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ jobs:
uses: ./.github/workflows/reusable_native_tests.yaml
with:
vapp_name: "vnd-bitcoin"
test_dirs_json: '["apps/bitcoin/common","apps/bitcoin/app"]'
test_dirs_json: '["apps/bitcoin/bip388","apps/bitcoin/common","apps/bitcoin/app"]'

vnd_bitcoin_integration_tests:
needs: [build_vanadium_app, build_vnd_bitcoin_autoapprove]
Expand Down
30 changes: 30 additions & 0 deletions apps/bitcoin/bip388/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[package]
name = "bip388"
version = "0.1.0"
edition = "2021"

[features]
default = []
cleartext-decode = []

[dependencies]
bitcoin = { version = "0.32.0", features = ["serde"], default-features = false }
hex = { version = "0.4.3", default-features = false, features = ["alloc"] }

[dev-dependencies]
toml = { version = "0.8", default-features = false, features = ["parse"] }
serde = { version = "1.0", features = ["derive"] }

[build-dependencies]
toml = { version = "0.8", default-features = false, features = ["parse"] }
serde = { version = "1.0", features = ["derive"] }
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "2.0", features = ["full"] }
prettyplease = "0.2"

[profile.release]
opt-level = 3
lto = true

[workspace]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Build script: generates the cleartext support files from `cleartext.spec.toml`.
//! Build script: generates the cleartext support files from `src/cleartext/specs/cleartext.toml`.
//!
//! Emits two files into `OUT_DIR`:
//!
Expand Down Expand Up @@ -1399,7 +1399,7 @@ fn pretty_file(file: TokenStream) -> String {
let parsed = syn::parse_file(&file.to_string()).expect("generated code is valid Rust");
let body = prettyplease::unparse(&parsed);
format!(
"// AUTO-GENERATED by build.rs from cleartext.spec.toml. Do not edit.\n\
"// AUTO-GENERATED by build.rs from src/cleartext/specs/cleartext.toml. Do not edit.\n\
// To regenerate: edit the spec and rebuild.\n\n{body}"
)
}
Expand Down Expand Up @@ -1466,7 +1466,8 @@ fn emit_decode(top_level: &[ProcessedEntry], tapleaf: &[ProcessedEntry]) -> Stri

fn main() -> Result<(), Box<dyn Error>> {
let manifest_dir = env::var("CARGO_MANIFEST_DIR")?;
let spec_path = PathBuf::from(&manifest_dir).join("src/bip388/cleartext.spec.toml");
let spec_path =
PathBuf::from(&manifest_dir).join("src/cleartext/specs/cleartext.toml");
println!("cargo:rerun-if-changed={}", spec_path.display());
println!("cargo:rerun-if-changed=build.rs");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub enum CleartextDecodeError {

// `DescriptorClass::from_cleartext_pattern`, `TapleafClass::from_cleartext_pattern`,
// `top_level_variants`, and `tapleaf_to_descriptors` are generated from
// `cleartext.spec.toml` by `build.rs` (see `emit_decode` there).
// `specs/cleartext.toml` by `build.rs` (see `emit_decode` there).
include!(concat!(env!("OUT_DIR"), "/cleartext_decode_generated.rs"));

fn parse_key_index(s: &str) -> Option<KeyPlaceholder> {
Expand Down
Loading
Loading