diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 00795a80..0bd751a5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,8 +21,8 @@ repos: hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.6.0 - hooks: - - id: mypy - args: [--ignore-missing] + # - repo: https://github.com/pre-commit/mirrors-mypy + # rev: v1.6.0 + # hooks: + # - id: mypy + # args: [--ignore-missing] diff --git a/cashu/mint/ledger.py b/cashu/mint/ledger.py index a00d8259..179baad9 100644 --- a/cashu/mint/ledger.py +++ b/cashu/mint/ledger.py @@ -457,8 +457,8 @@ async def melt( f" {total_provided}, needed: {invoice_amount + fees_sat}" ) - # verify spending inputs, outputs, and spending conditions - await self.verify_inputs_and_outputs(proofs, outputs) + # verify spending inputs and their spending conditions + await self.verify_inputs_and_outputs(proofs) if settings.lightning: logger.trace(f"paying lightning invoice {invoice}") diff --git a/cashu/mint/verification.py b/cashu/mint/verification.py index 434dca78..a50ba5ee 100644 --- a/cashu/mint/verification.py +++ b/cashu/mint/verification.py @@ -139,10 +139,8 @@ def _verify_no_duplicate_outputs(self, outputs: List[BlindedMessage]) -> bool: return True def _verify_amount(self, amount: int) -> int: - """Any amount used should be a positive integer not larger than 2^MAX_ORDER.""" - valid = ( - isinstance(amount, int) and amount > 0 and amount < 2**settings.max_order - ) + """Any amount used should be positive and not larger than 2^MAX_ORDER.""" + valid = amount > 0 and amount < 2**settings.max_order logger.trace(f"Verifying amount {amount} is valid: {valid}") if not valid: raise NotAllowedError("invalid amount: " + str(amount)) diff --git a/cashu/wallet/wallet.py b/cashu/wallet/wallet.py index f6c7b178..3c3f7ba8 100644 --- a/cashu/wallet/wallet.py +++ b/cashu/wallet/wallet.py @@ -797,7 +797,7 @@ async def pay_lightning( # amount of fees we overpaid. n_return_outputs = calculate_number_of_blank_outputs(fee_reserve_sat) secrets, rs, derivation_paths = await self.generate_n_secrets(n_return_outputs) - outputs, rs = self._construct_outputs(n_return_outputs * [1], secrets, rs) + outputs, rs = self._construct_outputs(n_return_outputs * [0], secrets, rs) status = await super().pay_lightning(proofs, invoice, outputs)