Skip to content

refactor: organize mint RPC server and CLI by service - #2545

Merged
thesimplekid merged 2 commits into
cashubtc:mainfrom
orangeshyguy21:mint-rpc-service-modules
Sep 22, 2026
Merged

thesimplekid merged 2 commits into
cashubtc:mainfrom
orangeshyguy21:mint-rpc-service-modules

Conversation

@orangeshyguy21

Copy link
Copy Markdown
Contributor

Description

Organizes the mint management RPC server and CLI into one module per service: info, keyset, payment method, quote, and wallet.

Splits proto/server.rs into service modules and groups CLI subcommands following the existing wallet module pattern. No behavior, API, or CLI command changes.

Completes the server modularization step in #2326, following the legacy RPC removal.


Notes to the reviewers

  • Two commits: server modularization, then CLI grouping.
  • Shared server setup and lifecycle code stay in server/mod.rs. Service-specific helpers and tests move alongside their implementations.
  • Live comparisons against the previous implementation matched across all 22 RPC methods and all CLI commands and aliases, including TLS and error paths.

Suggested CHANGELOG Updates

CHANGED

  • Organize mint management RPC server and CLI code by service.

ADDED

REMOVED

FIXED


Checklist

  • I followed the code style guidelines
  • I ran just quick-check before committing
  • If the Wallet API was modified (added/removed/changed), I have reflected those changes in the FFI bindings (crates/cdk-ffi)

@github-project-automation github-project-automation Bot moved this to Backlog in CDK Sep 14, 2026
@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.25913% with 380 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.05%. Comparing base (ca1dd83) to head (1df0979).

Files with missing lines Patch % Lines
.../cdk-mint-rpc/src/mint_rpc_cli/subcommands/info.rs 0.00% 134 Missing ⚠️
crates/cdk-mint-rpc/src/proto/server/mod.rs 57.03% 110 Missing ⚠️
...rpc/src/mint_rpc_cli/subcommands/payment_method.rs 0.00% 87 Missing ⚠️
...cdk-mint-rpc/src/mint_rpc_cli/subcommands/quote.rs 0.00% 27 Missing ⚠️
crates/cdk-mint-rpc/src/proto/server/info.rs 94.79% 14 Missing ⚠️
crates/cdk-mint-rpc/src/proto/server/wallet.rs 95.91% 4 Missing ⚠️
crates/cdk-mint-rpc/src/proto/server/quote.rs 99.37% 2 Missing ⚠️
crates/cdk-mint-rpc/src/proto/server/keyset.rs 97.67% 1 Missing ⚠️
...es/cdk-mint-rpc/src/proto/server/payment_method.rs 99.74% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2545      +/-   ##
==========================================
- Coverage   80.06%   80.05%   -0.01%     
==========================================
  Files         387      382       -5     
  Lines      107098   107098              
==========================================
- Hits        85744    85742       -2     
- Misses      21354    21356       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thesimplekid

Copy link
Copy Markdown
Collaborator

@cdk-bot review

@thesimplekid

Copy link
Copy Markdown
Collaborator

@cdk-bot

@orangeshyguy21
orangeshyguy21 force-pushed the mint-rpc-service-modules branch from 1df0979 to 716760d Compare September 16, 2026 19:46
@thesimplekid

Copy link
Copy Markdown
Collaborator

@cdk-bot

Move proto/server.rs into a server/ directory with one file per gRPC
service, mirroring the proto layout. mod.rs keeps the struct, builders,
mutation guard, and start/stop; each service file takes its trait impl
plus the helpers only it calls.

Pure move: no signature, behavior, or test-logic changes.
Collapse the flat subcommand files into one module per service, matching
the server split and the proto layout.

The re-exported symbol set is unchanged, so the CLI binary and its
command surface are untouched.
@thesimplekid
thesimplekid force-pushed the mint-rpc-service-modules branch from 716760d to 134535b Compare September 22, 2026 15:29
@thesimplekid
thesimplekid merged commit 134535b into cashubtc:main Sep 22, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in CDK Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants