Skip to content

Commit aa00420

Browse files
Fix method names to mirror Rust bdk API (#185)
* Fix method names to mirror Rust bdk API * Fix method names to mirror Rust bdk API
1 parent eed5554 commit aa00420

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

CHANGELOG.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
- Breaking Changes
9+
- Rename `get_network()` method on `Wallet` interface to `network()` [#185]
10+
- Rename `get_transactions()` method on `Wallet` interface to `list_transactions()` [#185]
11+
- Remove `generate_extended_key`, returned ExtendedKeyInfo [#154]
12+
- Remove `restore_extended_key`, returned ExtendedKeyInfo [#154]
13+
- Remove dictionary `ExtendedKeyInfo {mnenonic, xprv, fingerprint}` [#154]
814
- APIs Added [#154]
915
- `generate_mnemonic()`, returns string mnemonic
1016
- `interface DescriptorSecretKey`
@@ -22,14 +28,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2228
- `DescriptorSecretKey`
2329
- `DescriptorPublicKey`
2430
- `DerivationPath`
25-
- Dictionary Removed [#154]
26-
- `ExtendedKeyInfo {mnenonic, xprv, fingerprint}`
27-
- APIs Removed [#154]
28-
- `generate_extended_key`, returned ExtendedKeyInfo
29-
- `restore_extended_key`, returned ExtendedKeyInfo
3031

3132
[#154]: https://github.com/bitcoindevkit/bdk-ffi/pull/154
3233
[#184]: https://github.com/bitcoindevkit/bdk-ffi/pull/184
34+
[#185]: https://github.com/bitcoindevkit/bdk-ffi/pull/185
3335

3436
## [v0.8.0]
3537
- Update BDK to version 0.20.0 [#169]

src/bdk.udl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ interface Wallet {
182182
boolean sign([ByRef] PartiallySignedBitcoinTransaction psbt);
183183

184184
[Throws=BdkError]
185-
sequence<Transaction> get_transactions();
185+
sequence<Transaction> list_transactions();
186186

187-
Network get_network();
187+
Network network();
188188

189189
[Throws=BdkError]
190190
void sync([ByRef] Blockchain blockchain, Progress? progress);

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ impl Wallet {
319319
self.wallet_mutex.lock().expect("wallet")
320320
}
321321

322-
fn get_network(&self) -> Network {
322+
fn network(&self) -> Network {
323323
self.get_wallet().network()
324324
}
325325

@@ -354,7 +354,7 @@ impl Wallet {
354354
self.get_wallet().sign(&mut psbt, SignOptions::default())
355355
}
356356

357-
fn get_transactions(&self) -> Result<Vec<Transaction>, Error> {
357+
fn list_transactions(&self) -> Result<Vec<Transaction>, Error> {
358358
let transactions = self.get_wallet().list_transactions(true)?;
359359
Ok(transactions.iter().map(Transaction::from).collect())
360360
}
@@ -363,7 +363,7 @@ impl Wallet {
363363
let unspents = self.get_wallet().list_unspent()?;
364364
Ok(unspents
365365
.iter()
366-
.map(|u| LocalUtxo::from_utxo(u, self.get_network()))
366+
.map(|u| LocalUtxo::from_utxo(u, self.network()))
367367
.collect())
368368
}
369369
}

0 commit comments

Comments
 (0)