Skip to content

Commit 55b7e8b

Browse files
Merge branch 'payjoin:master' into python-flake-dev-env
2 parents 9965c61 + 1771301 commit 55b7e8b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+6924
-5640
lines changed

.cargo/mutants.toml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,42 @@
11
additional_cargo_args = ["--all-features"]
2-
examine_globs = ["payjoin/src/core/uri/*.rs", "payjoin/src/core/receive/**/*.rs", "payjoin/src/core/send/**/*.rs"]
3-
exclude_globs = []
2+
gitignore = true
3+
examine_globs = [
4+
"payjoin/src/**/*.rs"
5+
]
6+
exclude_globs = [
7+
]
48
exclude_re = [
5-
"impl Debug",
6-
"impl Display",
9+
"impl (fmt::)?(Debug|Display)",
710
"deserialize",
811
"Iterator",
912
".*Error",
1013

1114
# ---------------------Crate-specific exculsions---------------------
12-
# Receive
13-
# src/receive/v1/mod.rs
15+
# Timeout loops
16+
# src/receive/v1/mod.rs
1417
"interleave_shuffle", # Replacing index += 1 with index *= 1 in a loop causes a timeout due to an infinite loop
18+
19+
# Trivial mutations
20+
# These exlusions are allowing code blocks to run with artithmetic involving zero and as a result are no-ops
21+
# payjoin/src/core/send/mod.rs
22+
"replace < with <= in PsbtContext::check_outputs",
23+
"replace > with >= in PsbtContext::check_fees",
24+
# payjoin/src/core/send/mod.rs
25+
"replace < with <= in PsbtContextBuilder::build_recommended", # clamping the fee contribution when the fee equals to the recommended fee does not do anything
26+
27+
# Async SystemTime comparison
28+
# checking if the system time is equal to the expiry is difficult to reasonably test
29+
# payjoin/src/core/receive/v2/mod.rs
30+
"replace < with <= in Receiver<Initialized>::apply_unchecked_from_payload",
31+
"replace > with >= in Receiver<Initialized>::create_poll_request",
32+
"replace > with >= in extract_err_req",
33+
# payjoin/src/core/send/v2/mod.rs
34+
"replace > with >= in Sender<WithReplyKey>::create_v2_post_request",
35+
36+
# TODO exclusions
37+
# payjoin/src/core/receive/v1/mod.rs
38+
"replace > with >= in WantsInputs::avoid_uih", # This mutation I am unsure about whether or not it is a trivial mutant and have not decided on how the best way to approach testing it is
39+
# payjoin/src/core/send/mod.rs
40+
"replace match guard proposed_txout.script_pubkey == original_output.script_pubkey with true in PsbtContext::check_outputs", # This non-deterministic mutation has a possible test to catch it
41+
"replace == with != in Receiver<Initialized>::unchecked_from_payload", #This mutant is something we intend to address in issue #948
1542
]
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Feature Request
2+
description: Suggest an idea for this project.
3+
labels: [Feature]
4+
body:
5+
- type: dropdown
6+
attributes:
7+
label: Which crate is this feature request for?
8+
multiple: true
9+
options:
10+
- payjoin
11+
- payjoin-cli
12+
- payjoin-directory
13+
- payjoin-test-utils
14+
- payjoin-ffi
15+
- type: textarea
16+
id: feature
17+
attributes:
18+
label: Please describe the feature you'd like to see added.
19+
description: Attach screenshots or logs if applicable.
20+
validations:
21+
required: true
22+
- type: textarea
23+
id: related-problem
24+
attributes:
25+
label: Is your feature related to a problem, if so please describe it.
26+
description: Attach screenshots or logs if applicable.
27+
validations:
28+
required: false
29+
- type: textarea
30+
id: solution
31+
attributes:
32+
label: Describe the solution you'd like
33+
validations:
34+
required: false
35+
- type: textarea
36+
id: alternatives
37+
attributes:
38+
label: Describe any alternatives you've considered
39+
validations:
40+
required: false
41+
- type: textarea
42+
id: additional-context
43+
attributes:
44+
label: Please leave any additional context
45+
validations:
46+
required: false

.github/ISSUE_TEMPLATE/general.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: General Question / Support
2+
description: A general question or support issue that isn't a bug or feature.
3+
body:
4+
- type: dropdown
5+
attributes:
6+
label: Which crate is this feature request for (if any)?
7+
multiple: true
8+
options:
9+
- payjoin
10+
- payjoin-cli
11+
- payjoin-directory
12+
- payjoin-test-utils
13+
- payjoin-ffi
14+
- type: textarea
15+
id: question
16+
attributes:
17+
label: Question
18+
description: Describe the issue
19+
validations:
20+
required: true
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Good First Issue
2+
description: (Regular devs only) Suggest a new good first issue
3+
labels: [good first issue]
4+
body:
5+
- type: dropdown
6+
attributes:
7+
label: Which crate is this issue for?
8+
multiple: true
9+
options:
10+
- payjoin
11+
- payjoin-cli
12+
- payjoin-directory
13+
- payjoin-test-utils
14+
- payjoin-ffi
15+
- type: markdown
16+
attributes:
17+
value: |
18+
Please add the label "good first issue" manually before or after opening
19+
20+
A good first issue is an uncontroversial issue, that has a relatively unique and obvious solution
21+
22+
Motivate the issue and explain the solution briefly
23+
- type: textarea
24+
id: motivation
25+
attributes:
26+
label: Motivation
27+
description: Motivate the issue
28+
validations:
29+
required: true
30+
- type: textarea
31+
id: solution
32+
attributes:
33+
label: Possible solution
34+
description: Describe a possible solution
35+
validations:
36+
required: false
37+
- type: textarea
38+
id: useful-skills
39+
attributes:
40+
label: Useful Skills
41+
description: For example, “Familiarity with BIP 77”.
42+
- type: textarea
43+
attributes:
44+
label: Guidance for new contributors
45+
description: Please leave this to automatically add the footer for new contributors
46+
value: |
47+
Want to work on this issue?
48+
49+
For guidance on contributing, please read [CONTRIBUTING.md](https://github.com/payjoin/rust-payjoin/blob/master/.github/CONTRIBUTING.md) before opening your pull request.

.github/pull_request_template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Pull Request Checklist
2+
3+
Please confirm the following before requesting review:
4+
5+
- [ ] A **human** has reviewed every single line of this code before opening the PR (no auto-generated, unreviewed LLM/robot submissions).
6+
- [ ] I have read [CONTRIBUTING.md](https://github.com/payjoin/rust-payjoin/blob/master/.github/CONTRIBUTING.md#commits) and **rebased my branch to produce [hygienic commits](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#committing-patches)**.
7+

.github/workflows/cron-weekly-mutants.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v4
1313
- uses: taiki-e/install-action@v2
1414
with:
15-
tool: cargo-mutants@25.0.1
15+
tool: cargo-mutants@25.2.2
1616
- run: cargo mutants --in-place --no-shuffle
1717
- uses: actions/upload-artifact@v4
1818
if: always()

.github/workflows/rust.yml

Lines changed: 59 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,23 @@ jobs:
99
fail-fast: false
1010
matrix:
1111
rust:
12-
- 1.63.0 # MSRV
12+
- 1.85.0 # MSRV
1313
- stable
1414
- nightly
15+
env:
16+
# Override the value from the rust-toolchain file
17+
# This is necessary because even though the correct toolchain
18+
# is explicitly specified for the rust-toolchain action,
19+
# rustup honors the rust-toolchain file over the default
20+
RUSTUP_TOOLCHAIN: ${{ matrix.rust }}
1521
steps:
1622
- name: "Checkout repo"
1723
uses: actions/checkout@v4
1824
- name: "Install ${{ matrix.rust }} toolchain"
19-
# https://github.com/dtolnay/rust-toolchain?tab=readme-ov-file#inputs
2025
uses: dtolnay/rust-toolchain@master
2126
with:
27+
# The toolchain must be specified manually, as this action ignores the rust-toolchain override
28+
# https://github.com/dtolnay/rust-toolchain?tab=readme-ov-file#inputs
2229
toolchain: ${{ matrix.rust }}
2330
- name: "Use cache"
2431
uses: Swatinem/rust-cache@v2
@@ -32,9 +39,10 @@ jobs:
3239
uses: actions/checkout@v4
3340
- name: "Install nightly toolchain"
3441
uses: dtolnay/rust-toolchain@nightly
42+
with:
43+
components: rustfmt
3544
- name: "Use cache"
3645
uses: Swatinem/rust-cache@v2
37-
- run: rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu
3846
- name: "Run formatting check"
3947
run: cargo fmt --all -- --check
4048

@@ -45,9 +53,10 @@ jobs:
4553
uses: actions/checkout@v4
4654
- name: "Install nightly toolchain"
4755
uses: dtolnay/rust-toolchain@nightly
56+
with:
57+
components: rustfmt
4858
- name: "Use cache"
4959
uses: Swatinem/rust-cache@v2
50-
- run: rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu
5160
- name: "Run formatting check"
5261
run: cd payjoin-ffi && cargo fmt --all -- --check
5362

@@ -58,9 +67,10 @@ jobs:
5867
uses: actions/checkout@v4
5968
- name: "Install nightly toolchain"
6069
uses: dtolnay/rust-toolchain@nightly
70+
with:
71+
components: clippy
6172
- name: "Use cache"
6273
uses: Swatinem/rust-cache@v2
63-
- run: rustup component add clippy --toolchain nightly-x86_64-unknown-linux-gnu
6474
- name: "Run linting check"
6575
run: cd payjoin-ffi && bash contrib/lint.sh
6676

@@ -71,10 +81,10 @@ jobs:
7181
uses: actions/checkout@v4
7282
- name: "Install nightly toolchain"
7383
uses: dtolnay/rust-toolchain@nightly
84+
with:
85+
components: clippy
7486
- name: "Use cache"
7587
uses: Swatinem/rust-cache@v2
76-
- name: "Install clippy"
77-
run: rustup component add clippy --toolchain nightly-x86_64-unknown-linux-gnu
7888
- name: "Run code linting"
7989
run: bash contrib/lint.sh
8090
- name: "Run documentation linting"
@@ -85,11 +95,17 @@ jobs:
8595
runs-on: ubuntu-latest
8696
strategy:
8797
fail-fast: false
98+
env:
99+
# Override the value from the rust-toolchain file
100+
# This is necessary because even though the correct toolchain
101+
# is explicitly specified for the rust-toolchain action,
102+
# rustup honors the rust-toolchain file over the default
103+
RUSTUP_TOOLCHAIN: stable
88104
steps:
89105
- name: "Checkout repo"
90106
uses: actions/checkout@v4
91107
- name: "Install toolchain"
92-
# https://github.com/dtolnay/rust-toolchain
108+
# rust-cache usage with stable Rust is most effective, as a cache is tied to the Rust version
93109
uses: dtolnay/rust-toolchain@stable
94110
- name: "Use cache"
95111
uses: Swatinem/rust-cache@v2
@@ -106,3 +122,38 @@ jobs:
106122
steps:
107123
- uses: actions/checkout@v4
108124
- uses: codespell-project/actions-codespell@v2
125+
126+
DiffMutants:
127+
name: Diff cargo-mutants
128+
runs-on: ubuntu-latest
129+
env:
130+
RUSTUP_TOOLCHAIN: stable
131+
steps:
132+
- name: "Checkout repo"
133+
uses: actions/checkout@v4
134+
with:
135+
fetch-depth: 0 # required for full diff context
136+
- name: Fetch base branch for diff
137+
run: git fetch origin ${{ github.base_ref }}
138+
- name: Relative diff
139+
run: |
140+
git branch -av
141+
git diff origin/${{ github.base_ref }}.. | tee git.diff
142+
- uses: taiki-e/install-action@v2
143+
with:
144+
tool: cargo-mutants@25.2.2
145+
- name: "Install toolchain"
146+
uses: dtolnay/rust-toolchain@stable
147+
- name: "Use cache"
148+
uses: Swatinem/rust-cache@v2
149+
- name: Run cargo-mutants on diff
150+
run: >
151+
cargo mutants --no-shuffle --in-diff git.diff
152+
--test-tool=cargo --timeout=500 --build-timeout=500
153+
- name: Upload mutants.out
154+
uses: actions/upload-artifact@v4
155+
if: always()
156+
with:
157+
name: mutants-incremental-cargo.out
158+
path: mutants.out
159+

0 commit comments

Comments
 (0)