Skip to content

test(receipts): keep generated keys inside the test's tmp_path - #5

Merged
itsmygithubacct merged 1 commit into
mainfrom
fix/hermetic-counterparty-tests
Aug 5, 2026
Merged

test(receipts): keep generated keys inside the test's tmp_path#5
itsmygithubacct merged 1 commit into
mainfrom
fix/hermetic-counterparty-tests

Conversation

@itsmygithubacct

Copy link
Copy Markdown
Owner

Caught on the first real run of #4: the waiver path generates at counterparty_key_default(), under $BONSAI_NOTARY_HOME — so exercising it minted a live secp256k1 key in the developer's own key directory.

Harmless once; wrong as a habit. A test that writes outside its tmp_path is also a test whose result depends on what is already there. An autouse fixture points BONSAI_NOTARY_HOME at tmp_path for the module.

21 passed, and the real key directory stays empty.

The waiver path generates at `counterparty_key_default()`, which resolves under
`$BONSAI_NOTARY_HOME` — so exercising it minted a live secp256k1 key in the developer's
own key directory. Harmless once, wrong as a habit, and it makes the test's result
depend on what happens to be there already.

The fixture points BONSAI_NOTARY_HOME at tmp_path for every test in the module.
@itsmygithubacct
itsmygithubacct merged commit 073d0a0 into main Aug 5, 2026
@itsmygithubacct
itsmygithubacct deleted the fix/hermetic-counterparty-tests branch August 5, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant