Skip to content

Commit

Permalink
temp 6
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderbiscuit committed Jul 17, 2024
1 parent 14b0a46 commit a09b220
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
16 changes: 10 additions & 6 deletions bdk-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ mod electrum;
mod error;
mod esplora;
mod keys;
mod kyoto;
mod store;
mod types;
mod wallet;
mod kyoto;

use crate::bitcoin::Address;
use crate::bitcoin::Amount;
Expand Down Expand Up @@ -48,6 +48,12 @@ use crate::keys::DerivationPath;
use crate::keys::DescriptorPublicKey;
use crate::keys::DescriptorSecretKey;
use crate::keys::Mnemonic;
use crate::kyoto::build_light_client;
use crate::kyoto::run_node;
use crate::kyoto::LightClient;
use crate::kyoto::LightNode;
use crate::kyoto::NodePair;
use crate::kyoto::Peer;
use crate::store::SqliteStore;
use crate::types::AddressInfo;
use crate::types::Balance;
Expand All @@ -65,15 +71,13 @@ use crate::wallet::SentAndReceivedValues;
use crate::wallet::TxBuilder;
use crate::wallet::Update;
use crate::wallet::Wallet;
use crate::kyoto::KyotoClient;
use crate::kyoto::KyotoNode;
use crate::kyoto::KyotoResult;
use crate::kyoto::build_kyoto_client;
use crate::kyoto::run_node;

use bdk_wallet::bitcoin::Network;
use bdk_wallet::keys::bip39::WordCount;
use bdk_wallet::wallet::tx_builder::ChangeSpendPolicy;
use bdk_wallet::KeychainKind;

use bdk_kyoto::logger::NodeMessageHandler;
use bdk_kyoto::logger::NodeState;

uniffi::include_scaffolding!("bdk");
6 changes: 1 addition & 5 deletions bdk-ffi/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,9 @@ impl Wallet {
}

pub(crate) fn get_wallet(&self) -> MutexGuard<BdkWallet> {
self.inner_mutex.lock().expect("wallet")
self.inner_mutex.lock().unwrap()
}

// pub(crate) fn get_clone(&self) -> BdkWallet {
// *self.inner_mutex.lock().expect("wallet")
// }

pub fn reveal_next_address(&self, keychain_kind: KeychainKind) -> AddressInfo {
self.get_wallet().reveal_next_address(keychain_kind).into()
}
Expand Down
15 changes: 9 additions & 6 deletions bdk-python/scripts/generate-linux.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#!/usr/bin/env bash

set -euo pipefail
${PYBIN}/python --version
${PYBIN}/pip install -r requirements.txt

cd ../bdk-ffi/
rustup default 1.77.1

echo "Generating native binaries..."
cargo build --profile release-smaller
Expand All @@ -16,4 +11,12 @@ cargo run --bin uniffi-bindgen generate --library ./target/release-smaller/libbd
echo "Copying linux libbdkffi.so..."
cp ./target/release-smaller/libbdkffi.so ../bdk-python/src/bdkpython/libbdkffi.so

echo "All done!"
cd ../bdk-python

echo "Building wheel"

python3 setup.py --verbose bdist_wheel

echo "Installing BDK Python"

pip3 install ./dist/bdkpython-1.0.0a12.dev0-cp310-cp310-linux_x86_64.whl --force-reinstall

0 comments on commit a09b220

Please sign in to comment.