Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

wallet sign command returns generic error for decoding failures

Đang mở Phù hợp với người mới
#357 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu từ luồng giải mã PSBT của lệnh bdk-cli wallet sign và theo dõi cách các lỗi giải mã trở thành giá trị BDKCliError. Issue chỉ ra các biến thể hiện có PsbtParseError và DecodeError; hãy kiểm tra ánh xạ lỗi và chạy các bài kiểm thử CLI liên quan. Công việc hoàn tất khi đầu vào PSBT sai định dạng báo lỗi giải mã Base64 mô tả rõ nguyên nhân thay vì lỗi chung chung.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Describe the bug

When the bdk-cli wallet sign command is given a PSBT that cannot be decoded (e.g. malformed base64, truncated bytes, or invalid PSBT structure), the CLI returns a generic error instead of a descriptive one. The underlying BDKCliError already has a dedicated PsbtError and DecodeError variant, but the CLI appears to collapse decoding failures into Error::Generic, which makes it impossible for users to tell whether the problem is their PSBT, their wallet, or the signing step itself.

To Reproduce

  1. Build bdk-cli with any wallet backend.
  2. Create a wallet and obtain a valid PSBT (or use an existing one).
  3. Corrupt the PSBT string or send a invalid one:
   bdk-cli wallet -w test_user1 sign --psbt "cHNidP8BAKkBAAAAAsoKb5SPcP0PpTjvnGo3b4ANmCiirV/br9mIOgkb6DqyAAAAAAD9////"
  1. Observe the error output.

Expected behavior

The CLI should return a specific, actionable error that identifies the failure as a Base64 decoding problem.for example:

Error: Base64 decode error: Invalid padding

rather than:

Error: Generic error: Invalid padding

Build environment

· BDK-CLI tag/commit: main
· OS+version: macOS 12.7.6 (Monterey)
· Rust/Cargo version: rustc --version output
· Rust/Cargo target: x86_64-apple-darwin

Additional context

The BDKCliError enum already includes a PsbtParseError and DecodeErrorvariant so the fix is simple. I'll like to work on it myself.

Ngôn ngữ chính
Rust
Star
142
Fork
103
Merge trung bình
4 ngày 8 giờ
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của bitcoindevkit/bdk-cli

Tất cả issue của bitcoindevkit/bdk-cli

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.