Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
with:
toolchain: 1.92.0
- uses: Swatinem/rust-cache@v2
- run: cargo build --workspace --all-targets
- run: cargo test --workspace

clippy:
Expand Down
16 changes: 14 additions & 2 deletions core/src/jets/custom_jet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,25 @@ mod test {
use super::*;

// --- DLLs for tests ---
// Use the cargo-built output from target/debug/ with the platform-appropriate extension
// (dylib on macOS, so on Linux) instead of pre-built platform-specific binaries.
static ELEMENTS_TEST_DLL: LazyLock<Option<Container<CustomJetApi>>> =
LazyLock::new(|| unsafe {
Container::<CustomJetApi>::load("../cli/assets/custom_jet_dlls/libelements.so").ok()
let path = format!(
"{}/../target/debug/libelements.{}",
env!("CARGO_MANIFEST_DIR"),
std::env::consts::DLL_EXTENSION
);
Container::<CustomJetApi>::load(&path).ok()
});

static CORE_TEST_DLL: LazyLock<Option<Container<CustomJetApi>>> = LazyLock::new(|| unsafe {
Container::<CustomJetApi>::load("../cli/assets/custom_jet_dlls/libbitcoin.so").ok()
let path = format!(
"{}/../target/debug/libbitcoin.{}",
env!("CARGO_MANIFEST_DIR"),
std::env::consts::DLL_EXTENSION
);
Container::<CustomJetApi>::load(&path).ok()
});

struct ElementsTestApi;
Expand Down
10 changes: 6 additions & 4 deletions core/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,12 @@ mod tests {
use hal_simplicity::simplicity::elements::pset::PartiallySignedTransaction;

static TEST_DLL: LazyLock<Option<Container<CustomJetApi>>> = LazyLock::new(|| unsafe {
Container::<CustomJetApi>::load(
"../cli/assets/custom_jet_dlls/libopcode_pubkey_elements.so",
)
.ok()
let path = format!(
"{}/../target/debug/libopcode_pubkey_elements.{}",
env!("CARGO_MANIFEST_DIR"),
std::env::consts::DLL_EXTENSION
);
Container::<CustomJetApi>::load(&path).ok()
});

struct TestApi;
Expand Down
Loading