bdk-ffi icon indicating copy to clipboard operation
bdk-ffi copied to clipboard

(draft)deps(experimental): uniffi 0.30.0

Open reez opened this issue 3 months ago • 1 comments

Description

Testing uniffi 0.30.0

Two changes:

  1. export Ord trait so swift and kotlin now treat them as comparable value types
  2. ~(breaking! but potentially awesome) convert HashableOutPoint from an object to a record "Enums and Records can have methods"~ compiles but exporting our own methods on a record fails in bindgen step

Notes to the reviewers

Changelog notice

Checklists

All Submissions:

  • [x] I've signed all my commits
  • [x] I followed the contribution guidelines
  • [ ] I ran cargo fmt and cargo clippy before committing

New Features:

  • [ ] I've added tests for the new feature
  • [ ] I've added docs for the new feature

Bugfixes:

  • [ ] This pull request breaks the existing API
  • [ ] I've added tests to reproduce the issue which are now passing
  • [ ] I'm linking the issue being fixed by this PR

reez avatar Oct 14 '25 15:10 reez

@thunderbiscuit + @ItoroD this is just a draft/experiment on 2 new things in uniffi 0.30.0

reez avatar Oct 14 '25 20:10 reez

We can probably do this bump to 0.30.0 now that 2.2.0 is released. It just needs a rebase and a clear vision for the Ord + Hashable stuff.

We can then figure out if the new Display on the Errors is a breaking change (I don't actually think it is?), but that can come in a separate PR.

thunderbiscuit avatar Nov 12 '25 14:11 thunderbiscuit

We can probably do this bump to 0.30.0 now that 2.2.0 is released. It just needs a rebase and a clear vision for the Ord + Hashable stuff.

We can then figure out if the new Display on the Errors is a breaking change (I don't actually think it is?), but that can come in a separate PR.

ok so 2 commits now, one just bumping to 0.30.0, and the other (which we can keep in this pr or spin out into another pr, whatever is cool w me) is relating to the ord+hashable stuff.

in that second commit 9fa0fa0f7de34378623e24284cae85e6c77a5946 I'm applying it for BlockHash, Txid, Wtxid, DescriptorId, and TxMerkleNode

Before this BDK iOS app would have had to compare txids indirectly lhs.outpoint.txid.description < rhs.outpoint.txid.description or doing a manual Comparable extension, (id assume Kotilin is somewhat "comparable" to swift).

But after this change the generated Swift bindings now declare those types as Comparable, so i can sort UTXOs directly with lhs.outpoint.txid < rhs.outpoint.txid https://github.com/bitcoindevkit/BDKSwiftExampleWallet/pull/334/files#diff-53a4180956cd49d7d1972a362feac43ba63abe4268a7d5aa6d99456554c64662 (I used locally generated swift bindings form this branch to test) without the string/hex workaround which tidy's up the code.

reez avatar Nov 12 '25 19:11 reez