Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
osx-wheels:
strategy:
matrix:
os: ["macos-13", "macos-14"] # 13 -> x86_64, 14 -> arm64 # https://github.com/actions/runner-images?tab=readme-ov-file#available-images
os: ["macos-14"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ variables:
DOCKER_TLS_CERTDIR: ""

.base:
image: xenoky/lwk-builder@sha256:688515310b737b51a672d49fbdce1dc7c98d3c1f8a7a62c20ec62df01bef87b7
image: xenoky/lwk-builder@sha256:d6bed899f62f5d9e935c43627f431b5098815211a9f9ad3db4198cf6ecc8a31d
tags:
- cloud
retry:
Expand Down
8 changes: 5 additions & 3 deletions context/download_bins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ set -e
mkdir -p bin
cd bin || exit 1

# electrs
FNAME=electrs_linux_esplora_a33e97e1a1fc63fa9c20a116bb92579bbf43b254_liquid && \
curl -Ls https://github.com/RCasatta/electrsd/releases/download/electrs_releases/${FNAME}.gz | gunzip > ${FNAME} && \
FNAME=electrs_linux_esplora_027e38d3ebc2f85b28ae76f8f3448438ee4fc7b1_liquid && \
wget https://github.com/RCasatta/electrsd/releases/download/electrs_releases/${FNAME}.zip && \
unzip ${FNAME}.zip && \
rm ${FNAME}.zip && \
mv electrs $FNAME && \
chmod +x $FNAME

# waterfalls
Expand Down
2 changes: 1 addition & 1 deletion context/env.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
export ELECTRS_LIQUID_EXEC="$PWD/bin/electrs_linux_esplora_a33e97e1a1fc63fa9c20a116bb92579bbf43b254_liquid"
export ELECTRS_LIQUID_EXEC="$PWD/bin/electrs_linux_esplora_027e38d3ebc2f85b28ae76f8f3448438ee4fc7b1_liquid"
export ELEMENTSD_EXEC="$PWD/bin/elements-23.2.4/bin/elementsd"
export BITCOIND_EXEC="$PWD/bin/bitcoin-26.0/bin/bitcoind"
export WATERFALLS_EXEC="$PWD/bin/waterfalls_b8818e1"
Expand Down
5 changes: 5 additions & 0 deletions lwk_wollet/src/clients/asyncr/esplora.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,11 @@ impl EsploraClient {
}

batch_count += 1;

if !descriptor.descriptor.has_wildcard() {
// No wildcard, 1 loop is enough
return Ok(data);
}
}
}
Ok(data)
Expand Down
39 changes: 39 additions & 0 deletions lwk_wollet/tests/tr.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::test_wollet::*;
use lwk_common::Signer;
use lwk_test_util::*;
use lwk_wollet::{ElementsNetwork, WolletBuilder, WolletDescriptor};

#[test]
fn test_single_address_tr() {
Expand Down Expand Up @@ -40,3 +41,41 @@ fn test_single_address_tr() {
let sigs_added = signer.sign(&mut pset).unwrap();
assert_eq!(sigs_added, 0);
}

#[tokio::test(flavor = "multi_thread")]
async fn test_single_address_tr_async() {
let env = TestEnvBuilder::from_env().with_esplora().build();

let view_key = generate_view_key();
let pk = "0202020202020202020202020202020202020202020202020202020202020202";

let desc = format!("ct({view_key},eltr({pk}))");
let mut client = lwk_wollet::asyncr::EsploraClient::new(
ElementsNetwork::default_regtest(),
&env.esplora_url(),
);
let network = ElementsNetwork::default_regtest();
let descriptor: WolletDescriptor = desc.parse().unwrap();
let mut wollet = WolletBuilder::new(network, descriptor).build().unwrap();

let addr = wollet.address(None).unwrap();

let _txid = env.elementsd_sendtoaddress(addr.address(), 2_000_011, None);

// TODO: wait_update_with_txs is not working correctly in this case. It seems
// it returns even if the tx is not yet in the wallet, fix it and remove this unconditional wait
tokio::time::sleep(std::time::Duration::from_secs(5)).await;

let update = client.full_scan(&wollet).await.unwrap().unwrap();

wollet.apply_update(update).unwrap();

let balance = *wollet
.balance()
.unwrap()
.get(&regtest_policy_asset())
.unwrap();
assert!(balance > 0);
let utxos = wollet.utxos().unwrap();
assert_eq!(utxos.len(), 1);
}
Loading