Skip to content

feat(wallet): list raw proofs#1026

Open
edgarmuyomba wants to merge 4 commits into
cashubtc:mainfrom
edgarmuyomba:feat/list-raw-proofs
Open

feat(wallet): list raw proofs#1026
edgarmuyomba wants to merge 4 commits into
cashubtc:mainfrom
edgarmuyomba:feat/list-raw-proofs

Conversation

@edgarmuyomba

Copy link
Copy Markdown
Contributor

Closes #710

Supercedes #785

Summary

This PR creates a new command for the wallet cli that allows a user to see the raw list of proofs in their wallet in a JSON structure.

Its built on top of work done in #785 performing a much needed rebase and adding an option for the user to sort the proofs in ascending or descending order as they might prefer.

Changes

  • Adds the proofs command to the cashu/wallet/cli/cli.py file
  • Adds the associated tests focusing on the same functionality.

Sample Output

cashu proofs
[
  {
    "id": "01884a74bb2fc5ee6e5f958f89f9e4e6cf79241fbc9fd1012d6811b054a78beffe",
    "amount": 16,
    "secret": "738fed97b84d87d34162e02484f6a7818824820ec6e4218eb74306b7387d1310",
    "C": "03bc6437b116ec0f55fae8af59ddea8f4bb67607a142c262783b55decc7e542227",
    "dleq": {
      "e": "321e8fb2faeba53437ed4bebd27818e7d1020aa190f49b404a378653ff41babf",
      "s": "8d1f6c8fd1630024716fa0039cc62637e3ff5491b5627d8fa958eb69d5cc940f",
      "r": "d2aefa0caaf353bcf5f0183034ec57138e65597421d56134dc98ca377e8a8758"
    }
  },
  {
    "id": "01884a74bb2fc5ee6e5f958f89f9e4e6cf79241fbc9fd1012d6811b054a78beffe",
    "amount": 1,
    "secret": "6261755b5ba4be93cce421235c9cb33964193e126d2b7b4685050065292c1ca6",
    "C": "02734be69059c04f0480c5c34e1e5f31b3ddfc0226e84aaa1ce4bcdbfdd6c33d96",
    "dleq": {
      "e": "9402f254d33d1cf22bc197e62f6141e69fc337bf5e9e1b80778722f2baaf1549",
      "s": "4799f5c58cd14096e09ec880f9e1e51c04d5c5443fe5a54a300ca12c7e2b8fd7",
      "r": "ce2dcfafedf2f1e87639c6e7a5a48eb15e58574d663afa4617e7003619b98eef"
    }
  },
  {
    "id": "01884a74bb2fc5ee6e5f958f89f9e4e6cf79241fbc9fd1012d6811b054a78beffe",
    "amount": 2,
    "secret": "73c2afdfd5117c5f105b3946344d29d6326111805d36caaebe2950098ceef31d",
    "C": "034e650966be852b5ce35baef8c5110cee84c9929b0f8071014a84497ed27d53cb",
    "dleq": {
      "e": "b02649668ed07632441652a30bb2e673c7c305aa115973486d09e4be4443d239",
      "s": "1fc468c58754514e996207f84ae99954064f0513472a0e39a99bd1b872fce61a",
      "r": "f90c860df9f3bbb74a2aa33e3dc3ecfdd57d71e912792caf7a35a3afce4bb333"
    }
  },
]

Comment thread cashu/wallet/cli/cli.py

if pr.m and wallet.url not in pr.m:
print(f"Error: Current mint {wallet.url} is not accepted by the receiver.")
print(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

unrelated change.

@KvngMikey

Copy link
Copy Markdown
Contributor

I think the PR has a number of unrelated changes.

@edgarmuyomba

Copy link
Copy Markdown
Contributor Author

I think the PR has a number of unrelated changes.

Hey @KvngMikey
Thanks for the review! Most of the diff is ruff reformatting the line wrapping — the actual logic changes are only in the proofs function.

@callebtc callebtc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.19%. Comparing base (620d629) to head (dec4050).
⚠️ Report is 26 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
cashu/wallet/cli/cli.py 76.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1026      +/-   ##
==========================================
- Coverage   75.03%   74.19%   -0.84%     
==========================================
  Files         111      111              
  Lines       12240    12279      +39     
==========================================
- Hits         9184     9111      -73     
- Misses       3056     3168     +112     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

List raw proofs

4 participants