Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
- name: Generate bindings and binaries
run: |
if [ "${{ matrix.os }}" = "macos-13" ]; then
bash ./scripts/generate_macos.sh
bash ./scripts/generate_macos.sh 1.85.0
else
bash ./scripts/generate_linux.sh
bash ./scripts/generate_linux.sh 1.85.0
fi

- name: Run tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: "Generate payjoin-ffi.py and binaries"
run: |
PYBIN=$(dirname $(which python))
PYBIN="$PYBIN" bash ./scripts/generate_linux.sh
PYBIN="$PYBIN" bash ./scripts/generate_linux.sh 1.85.0

- name: "Build wheel"
run: python setup.py bdist_wheel --verbose
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
uses: Swatinem/rust-cache@v2

- name: "Generate payjoin-ffi.py and binaries"
run: bash ./scripts/generate_macos.sh
run: bash ./scripts/generate_macos.sh 1.85.0

- name: "Build wheel"
run: python3 setup.py bdist_wheel --verbose
Expand Down
10 changes: 7 additions & 3 deletions payjoin-ffi/dart/scripts/generate_linux.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail

TOOLCHAIN=${1:-1.85.0}
echo "Using Rust toolchain: $TOOLCHAIN"

dart --version
dart pub get
LIBNAME=libpayjoin_ffi.so
Expand All @@ -8,13 +12,13 @@ LINUX_TARGET=x86_64-unknown-linux-gnu
echo "Generating payjoin_ffi.dart..."
cd ../
# This is a test script the actual release should not include the test utils feature
cargo build --profile release --features _test-utils
cargo run --profile release --features _test-utils --bin uniffi-bindgen -- --library target/release/$LIBNAME --language dart --out-dir dart/lib/
cargo +$TOOLCHAIN build --profile release --features _test-utils
cargo +$TOOLCHAIN run --profile release --features _test-utils --bin uniffi-bindgen -- --library target/release/$LIBNAME --language dart --out-dir dart/lib/

echo "Generating native binaries..."
rustup target add $LINUX_TARGET
# This is a test script the actual release should not include the test utils feature
cargo build --profile release-smaller --target $LINUX_TARGET --features _test-utils
cargo +$TOOLCHAIN build --profile release-smaller --target $LINUX_TARGET --features _test-utils

echo "Copying linux payjoin_ffi.so"
cp target/$LINUX_TARGET/release-smaller/$LIBNAME dart/$LIBNAME
Expand Down
12 changes: 8 additions & 4 deletions payjoin-ffi/dart/scripts/generate_macos.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
#!/usr/bin/env bash

set -euo pipefail

TOOLCHAIN=${1:-1.85.0}
echo "Using Rust toolchain: $TOOLCHAIN"

dart --version
dart pub get
LIBNAME=libpayjoin_ffi.dylib

echo "Generating payjoin_ffi.dart..."
cd ../
# This is a test script the actual release should not include the test utils feature
cargo build --features _test-utils --profile release
cargo run --features _test-utils --profile release --bin uniffi-bindgen -- --library target/release/$LIBNAME --language dart --out-dir dart/lib/
cargo +$TOOLCHAIN build --features _test-utils --profile release
cargo +$TOOLCHAIN run --features _test-utils --profile release --bin uniffi-bindgen -- --library target/release/$LIBNAME --language dart --out-dir dart/lib/

echo "Generating native binaries..."
rustup target add aarch64-apple-darwin x86_64-apple-darwin

# This is a test script the actual release should not include the test utils feature
cargo build --profile release-smaller --target aarch64-apple-darwin --features _test-utils
cargo +$TOOLCHAIN build --profile release-smaller --target aarch64-apple-darwin --features _test-utils
echo "Done building aarch64-apple-darwin"

# This is a test script the actual release should not include the test utils feature
cargo build --profile release-smaller --target x86_64-apple-darwin --features _test-utils
cargo +$TOOLCHAIN build --profile release-smaller --target x86_64-apple-darwin --features _test-utils
echo "Done building x86_64-apple-darwin"

echo "Building macos fat library"
Expand Down
10 changes: 7 additions & 3 deletions payjoin-ffi/python/scripts/generate_linux.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail

TOOLCHAIN=${1:-1.85.0}
echo "Using Rust toolchain: $TOOLCHAIN"

${PYBIN}/python --version
${PYBIN}/pip install -r requirements.txt -r requirements-dev.txt
LIBNAME=libpayjoin_ffi.so
Expand All @@ -8,13 +12,13 @@ LINUX_TARGET=x86_64-unknown-linux-gnu
echo "Generating payjoin_ffi.py..."
cd ../
# This is a test script the actual release should not include the test utils feature
cargo build --profile release --features _test-utils
cargo run --profile release --features _test-utils --bin uniffi-bindgen generate --library target/release/$LIBNAME --language python --out-dir python/src/payjoin/
cargo +$TOOLCHAIN build --profile release --features _test-utils
cargo +$TOOLCHAIN run --profile release --features _test-utils --bin uniffi-bindgen generate --library target/release/$LIBNAME --language python --out-dir python/src/payjoin/

echo "Generating native binaries..."
rustup target add $LINUX_TARGET
# This is a test script the actual release should not include the test utils feature
cargo build --profile release-smaller --target $LINUX_TARGET --features _test-utils
cargo +$TOOLCHAIN build --profile release-smaller --target $LINUX_TARGET --features _test-utils

echo "Copying linux payjoin_ffi.so"
cp target/$LINUX_TARGET/release-smaller/$LIBNAME python/src/payjoin/$LIBNAME
Expand Down
11 changes: 7 additions & 4 deletions payjoin-ffi/python/scripts/generate_macos.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

TOOLCHAIN=${1:-1.85.0}
echo "Using Rust toolchain: $TOOLCHAIN"

set -euo pipefail
python3 --version
pip install -r requirements.txt -r requirements-dev.txt
Expand All @@ -8,18 +11,18 @@ LIBNAME=libpayjoin_ffi.dylib
echo "Generating payjoin_ffi.py..."
cd ../
# This is a test script the actual release should not include the test utils feature
cargo build --features _test-utils --profile release
cargo run --features _test-utils --profile release --bin uniffi-bindgen generate --library target/release/$LIBNAME --language python --out-dir python/src/payjoin/
cargo +$TOOLCHAIN build --features _test-utils --profile release
cargo +$TOOLCHAIN run --features _test-utils --profile release --bin uniffi-bindgen generate --library target/release/$LIBNAME --language python --out-dir python/src/payjoin/

echo "Generating native binaries..."
rustup target add aarch64-apple-darwin x86_64-apple-darwin

# This is a test script the actual release should not include the test utils feature
cargo build --profile release-smaller --target aarch64-apple-darwin --features _test-utils
cargo +$TOOLCHAIN build --profile release-smaller --target aarch64-apple-darwin --features _test-utils
echo "Done building aarch64-apple-darwin"

# This is a test script the actual release should not include the test utils feature
cargo build --profile release-smaller --target x86_64-apple-darwin --features _test-utils
cargo +$TOOLCHAIN build --profile release-smaller --target x86_64-apple-darwin --features _test-utils
echo "Done building x86_64-apple-darwin"

echo "Building macos fat library"
Expand Down
2 changes: 1 addition & 1 deletion payjoin-ffi/python/test/test_payjoin_integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class CheckInputsNotSeenCallback(IsOutputKnown):
def __init__(self, connection: RpcClient):
self.connection = connection

def callback(self, _outpoint):
def callback(self):
return False

class ProcessPsbtCallback(ProcessPsbt):
Expand Down
Loading