Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: verification of melt quote with empty outputs #655

Merged
merged 1 commit into from
Mar 13, 2025

Conversation

thesimplekid
Copy link
Collaborator

@thesimplekid thesimplekid commented Mar 13, 2025

Description


@davidcaseria this should fix the ci issue on #596

Notes to the reviewers


Suggested CHANGELOG Updates

CHANGED

ADDED

REMOVED

FIXED


Checklist

Copy link
Contributor

@ok300 ok300 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When can a mint operation have no outputs?

@thesimplekid
Copy link
Collaborator Author

thesimplekid commented Mar 13, 2025

When can a mint operation have no outputs?

It can't that would fail the unbalanced check.

// We check the total value of blinded messages == mint quote
if amount != mint_quote.amount {
return Err(Error::TransactionUnbalanced(
mint_quote.amount.into(),
mint_request.total_amount()?.into(),
0,
));
}

and for swap

if output_verification.amount
!= input_verification
.amount
.checked_sub(fees)
.ok_or(Error::AmountOverflow)?
{

Copy link
Contributor

@ok300 ok300 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, melt can have no outputs, not mint.

@thesimplekid thesimplekid merged commit 60367cd into cashubtc:main Mar 13, 2025
81 checks passed
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.

2 participants