Skip to content

Support building a cdylib and skip libbitcoinconsensus in wasm32 #591

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

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 10 additions & 1 deletion lightning/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Does most of the hard work, without implying a specific runtime, requiring clien
Still missing tons of error-handling. See GitHub issues for suggested projects if you want to contribute. Don't have to bother telling you not to use this for anything serious, because you'd have to build a client around it to even try.
"""

[lib]
crate-type = ["cdylib", "rlib"]

[features]
# Supports tracking channels with a non-bitcoin chain hashes. Currently enables all kinds of fun DoS attacks.
non_bitcoin_chain_hash_routing = []
Expand All @@ -26,7 +29,13 @@ bitcoin = "0.21"
bitcoin_hashes = "0.7"
secp256k1 = "0.15"

[dev-dependencies.bitcoin]
# Building libbitcoinconsensus in wasm32 requires a stdlibc, which is...complicated
# Instead, just skip the script verification runs in wasm test runs.
# Note that due to a long-standing bug only recently fixed in an RFC on nightly, this
# workaround requires building with cargo nightly -Z features=itarget. See
# tracking issue https://github.com/rust-lang/cargo/issues/7914 and
# https://github.com/rust-lang/cargo/issues/1197.
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.bitcoin]
version = "0.21"
features = ["bitcoinconsensus"]

Expand Down
1 change: 1 addition & 0 deletions lightning/src/ln/functional_test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ pub fn create_announced_chan_between_nodes_with_value<'a, 'b, 'c, 'd>(nodes: &'a

macro_rules! check_spends {
($tx: expr, $($spends_txn: expr),*) => {
#[cfg(not(target_arch = "wasm32"))]
{
$tx.verify(|out_point| {
$(
Expand Down