Refactor: move spending conditions implementation to nut10 module#1714
Open
TheMhv wants to merge 9 commits intocashubtc:mainfrom
Open
Refactor: move spending conditions implementation to nut10 module#1714TheMhv wants to merge 9 commits intocashubtc:mainfrom
TheMhv wants to merge 9 commits intocashubtc:mainfrom
Conversation
83adf76 to
3bc4f98
Compare
Contributor
Author
|
I could further separate and modularize the Spending Conditions code, but that's not the purpose of this PR. What do you think about discussing this? |
KvngMikey
reviewed
Mar 9, 2026
KvngMikey
reviewed
Mar 9, 2026
3bc4f98 to
a2f73fc
Compare
KvngMikey
approved these changes
Mar 9, 2026
thesimplekid
requested changes
Mar 11, 2026
Collaborator
thesimplekid
left a comment
There was a problem hiding this comment.
This moves some this to a better place but leaves other fns not in the files of their nut.
977ee68 to
4c96fc0
Compare
4c96fc0 to
93d1086
Compare
afde93c to
7c5c8ea
Compare
Collaborator
thesimplekid
left a comment
There was a problem hiding this comment.
Looks good. I think we should reduce the visibility of some of the helper fns we have so they are not in the public api. What do you think @crodas
Collaborator
|
closes: #395 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR moves the spending conditions implementation to the module that corresponds to the correct NUT specification.
While reviewing the code, I noticed that the
SpendingConditionsimplementation is currently located innuts/nut11/mod.rs. However, spending conditions are defined in NUT-10, not NUT-11. Keeping this implementation undernut11can make the module structure slightly confusing for contributors trying to map code to the corresponding NUT specifications.This change relocates the relevant implementation to the
nut10module so the code structure better reflects the specification layout.Notes to the reviewers
nut10/for module of NUT-10nut11/mod.rstonut10/spending_conditions.rsnut10/error.rsnut10/secret.rsSpendingConditions::new_p2pk,extract_signatures_from_witnessandverify_sig_all_p2pkfunctions tonut11/mod.rsSpendingConditions::new_htlc,SpendingConditions::new_htlc_hash,verify_htlc_preimageandverify_sig_all_htlctonut14/mod.rsTagandTagKindtonut10/tag.rsSuggested CHANGELOG Updates
CHANGED
ADDED
REMOVED
FIXED
nut11instead of NUT-10 module #1705Checklist
just final-checkbefore committing