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
8 changes: 8 additions & 0 deletions payjoin-ffi/dart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
59 changes: 58 additions & 1 deletion payjoin-ffi/dart/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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 `<package version>+payjoin-<crate version>`, 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.
2 changes: 1 addition & 1 deletion payjoin-ffi/dart/native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
] }
2 changes: 1 addition & 1 deletion payjoin-ffi/dart/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Loading