Update library to new bdk-ffi API version to 0.6.0
This commit is contained in:
parent
2ebd4979b0
commit
45216c7563
@ -20,13 +20,13 @@ python -m tox
|
||||
## Build the package
|
||||
```shell
|
||||
# Install dependecies
|
||||
pip install -r requirements.txt
|
||||
pip install --requirement requirements.txt
|
||||
|
||||
# Generate the bindings first
|
||||
bash generate.sh
|
||||
|
||||
# Build the wheel
|
||||
python3 setup.py -v bdist_wheel
|
||||
python3 setup.py --verbose bdist_wheel
|
||||
```
|
||||
<br/>
|
||||
|
||||
|
@ -6,4 +6,5 @@ SCRIPT_DIR=$(dirname "$(realpath $0)")
|
||||
PY_SRC="${SCRIPT_DIR}/src/bdkpython/"
|
||||
|
||||
echo "Generating bdk.py..."
|
||||
GENERATE_PYTHON_BINDINGS_OUT="$PY_SRC" GENERATE_PYTHON_BINDINGS_FIXUP_LIB_PATH=bdkffi cargo run --manifest-path ./bdk-ffi/Cargo.toml --release --bin generate --features generate-python
|
||||
# GENERATE_PYTHON_BINDINGS_OUT="$PY_SRC" GENERATE_PYTHON_BINDINGS_FIXUP_LIB_PATH=bdkffi cargo run --manifest-path ./bdk-ffi/Cargo.toml --release --bin generate --features generate-python
|
||||
BDKFFI_BINDGEN_PYTHON_FIXUP_PATH=bdkffi cargo run --manifest-path ./bdk-ffi/Cargo.toml --package bdk-ffi-bindgen -- --language python --udl-file ./bdk-ffi/src/bdk.udl --out-dir ./src/bdkpython/
|
||||
|
8
setup.py
8
setup.py
@ -60,16 +60,16 @@ rust_ext = RustExtension(
|
||||
)
|
||||
|
||||
setup(
|
||||
name = 'bdkpython',
|
||||
version = '0.0.5',
|
||||
name='bdkpython',
|
||||
version='0.0.6.dev0',
|
||||
description="The Python language bindings for the bitcoindevkit",
|
||||
long_description=LONG_DESCRIPTION,
|
||||
long_description_content_type='text/markdown',
|
||||
rust_extensions=[rust_ext],
|
||||
zip_safe=False,
|
||||
packages=['bdkpython'],
|
||||
package_dir={ 'bdkpython': './src/bdkpython' },
|
||||
url="https://github.com/thunderbiscuit/bdk-python",
|
||||
package_dir={'bdkpython': './src/bdkpython'},
|
||||
url="https://github.com/bitcoindevkit/bdk-python",
|
||||
author="Alekos Filini <alekos.filini@gmail.com>, Steve Myers <steve@notmandatory.org>",
|
||||
license="MIT or Apache 2.0",
|
||||
)
|
||||
|
@ -3,7 +3,7 @@ import bdkpython as bdk
|
||||
|
||||
# taken from bdk test suite @ https://github.com/bitcoindevkit/bdk/blob/master/src/descriptor/template.rs#L676
|
||||
descriptor = "wpkh(tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy/84h/0h/0h/0/*)"
|
||||
config = bdk.DatabaseConfig.MEMORY("")
|
||||
db_config = bdk.DatabaseConfig.MEMORY()
|
||||
client = bdk.BlockchainConfig.ELECTRUM(
|
||||
bdk.ElectrumConfig(
|
||||
"ssl://electrum.blockstream.info:60002",
|
||||
@ -15,11 +15,20 @@ client = bdk.BlockchainConfig.ELECTRUM(
|
||||
)
|
||||
|
||||
|
||||
def test_address_BIP84_testnet():
|
||||
wallet = bdk.OfflineWallet(descriptor, bdk.Network.TESTNET, config)
|
||||
def test_address_bip84_testnet():
|
||||
wallet = bdk.Wallet(
|
||||
descriptor=descriptor,
|
||||
change_descriptor=None,
|
||||
network=bdk.Network.TESTNET,
|
||||
database_config=db_config
|
||||
)
|
||||
address = wallet.get_new_address()
|
||||
print(f"New address is {address}")
|
||||
assert address == "tb1qkmvk2nadgplmd57ztld8nf8v2yxkzmdvvztyse"
|
||||
|
||||
|
||||
test_address_bip84_testnet()
|
||||
|
||||
# def test_wallet_balance():
|
||||
# wallet = bdk.OnlineWallet(
|
||||
# descriptor=descriptor,
|
||||
|
Loading…
x
Reference in New Issue
Block a user