Skip to content

Commit

Permalink
Fix method names to mirror Rust bdk API
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderbiscuit committed Aug 17, 2022
1 parent d387376 commit 765662e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/bdk.udl
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ interface Wallet {
boolean sign([ByRef] PartiallySignedBitcoinTransaction psbt);

[Throws=BdkError]
sequence<Transaction> get_transactions();
sequence<Transaction> list_transactions();

Network get_network();
Network network();

[Throws=BdkError]
void sync([ByRef] Blockchain blockchain, Progress? progress);
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ impl Wallet {
self.wallet_mutex.lock().expect("wallet")
}

fn get_network(&self) -> Network {
fn network(&self) -> Network {
self.get_wallet().network()
}

Expand Down Expand Up @@ -337,7 +337,7 @@ impl Wallet {
self.get_wallet().sign(&mut psbt, SignOptions::default())
}

fn get_transactions(&self) -> Result<Vec<Transaction>, Error> {
fn list_transactions(&self) -> Result<Vec<Transaction>, Error> {
let transactions = self.get_wallet().list_transactions(true)?;
Ok(transactions.iter().map(Transaction::from).collect())
}
Expand All @@ -346,7 +346,7 @@ impl Wallet {
let unspents = self.get_wallet().list_unspent()?;
Ok(unspents
.iter()
.map(|u| LocalUtxo::from_utxo(u, self.get_network()))
.map(|u| LocalUtxo::from_utxo(u, self.network()))
.collect())
}
}
Expand Down

0 comments on commit 765662e

Please sign in to comment.