diff --git a/payjoin-ffi/dart/CHANGELOG.md b/payjoin-ffi/dart/CHANGELOG.md index 41854b904..b00565815 100644 --- a/payjoin-ffi/dart/CHANGELOG.md +++ b/payjoin-ffi/dart/CHANGELOG.md @@ -1,3 +1,11 @@ +## [0.2.1+payjoin-1.0.0-rc.8] + +- Sender inputs must declare a sighash type that commits to all inputs and + outputs. Only ECDSA `SIGHASH_ALL`, taproot `SIGHASHDEFAULT`/`SIGHASH_ALL`, + and an unset type are accepted, both when building the sender context and + when validating the receiver's proposal +- Versions now carry the wrapped payjoin release as build metadata + ## [0.2.0] - Bindings for payjoin-1.0.0-rc.7 diff --git a/payjoin-ffi/dart/CONTRIBUTING.md b/payjoin-ffi/dart/CONTRIBUTING.md index 1ae6931d6..5c4790285 100644 --- a/payjoin-ffi/dart/CONTRIBUTING.md +++ b/payjoin-ffi/dart/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -Instructions for building and testing the Dart bindings locally. +Instructions for building, testing, and publishing the Dart bindings. ## Build Bindings @@ -24,3 +24,60 @@ bash ./scripts/generate_bindings.sh # Run all tests dart test ``` + +## Releasing + +Maintainer instructions for publishing to +[pub.dev](https://pub.dev/packages/payjoin). + +### Versioning + +Versions take the form `+payjoin-`, for +example `0.2.1+payjoin-1.0.0-rc.8`. The part before the `+` is the package's +own semantic version, and is what consumers write version constraints +against. The build metadata after it records which `payjoin` release the +bindings wrap, so the pub.dev listing names the supported protocol version +without a changelog lookup. + +Bump the package version for changes to the Dart API or to packaging. Update +the build metadata whenever the wrapped `payjoin` release changes, which is a +patch bump at minimum, since the same Dart API gets new behavior. + +### Publishing + +1. Point the `payjoin-ffi` dependency in `native/Cargo.toml` at the commit + tagged for the `payjoin` release being wrapped. Consumers build from that + revision. `.cargo/config.toml` redirects it to the local workspace for + development only, and `.pubignore` withholds that file from the archive. +2. Set the version in `pubspec.yaml` and describe the consumer-visible + changes under a matching heading in `CHANGELOG.md`. +3. Run the tests: `bash ./contrib/test.sh`. +4. Generate the bindings to be shipped and inspect the archive. + + ```shell + bash ./scripts/generate_bindings.sh + dart pub publish --dry-run + ``` + + `.pubignore` replaces `.gitignore` for publishing, so a gitignored file is + only kept out of the archive if `.pubignore` also lists it. Two build + artifacts decide the contents here: `lib/payjoin.dart` has to be present + and current, since it is the binding surface consumers import, and + `native/Cargo.lock` has to be absent, since publishing one resolved + against the `.cargo/config.toml` path overlay would hand consumers a + lockfile pinned to a dependency graph they cannot reproduce. Delete it + before publishing if a local build left one behind. + +5. Publish. + + ```shell + dart pub publish + ``` + +Known limitation: `scripts/generate_bindings.sh` always builds with +`_test-utils`, so the bindings it emits declare test-only APIs such as +`TestServices` and `BitcoindEnv`. Consumers build the native library without +that feature, which leaves those declarations backed by symbols that are +absent at runtime. Every release so far ships them. Giving the script a +production mode, as `payjoin-ffi/csharp` does with `PAYJOIN_FFI_FEATURES`, +remains to be done. diff --git a/payjoin-ffi/dart/native/Cargo.toml b/payjoin-ffi/dart/native/Cargo.toml index 02d63bfa9..ed0c76957 100644 --- a/payjoin-ffi/dart/native/Cargo.toml +++ b/payjoin-ffi/dart/native/Cargo.toml @@ -16,6 +16,6 @@ name = "payjoin_ffi_wrapper" crate-type = ["staticlib", "cdylib"] [dependencies] -payjoin-ffi = { git = "https://github.com/payjoin/rust-payjoin.git", rev = "a0eca7e054e035e2b350fd96e244d6b963def343", features = [ +payjoin-ffi = { git = "https://github.com/payjoin/rust-payjoin.git", rev = "e4f5a0b384462458b3d68aeec042c20ceffb8d80", features = [ "dart", ] } diff --git a/payjoin-ffi/dart/pubspec.yaml b/payjoin-ffi/dart/pubspec.yaml index f9bc4ff63..60a512b59 100644 --- a/payjoin-ffi/dart/pubspec.yaml +++ b/payjoin-ffi/dart/pubspec.yaml @@ -1,6 +1,6 @@ name: payjoin description: Dart bindings for payjoin (EXPERIMENTAL) -version: 0.2.0 +version: 0.2.1+payjoin-1.0.0-rc.8 homepage: https://github.com/payjoin/rust-payjoin repository: https://github.com/payjoin/rust-payjoin