maintenance-pool::sweep has no test proving it requires the admin's authorization

Đang mở
#558 1 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 1 ngày

@urielit1313-creator đang làm issue này rồi.

Từ ngày 13/10/2026.

  • #580 của @urielit1313-creator — đang mở

Đá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
30/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
testing-qa

Hướng nghiên cứu

Start in contracts/maintenance-pool/src/test.rs and compare the targeted authorization mocks used for upgrade with the tests that call sweep under env.mock_all_auths(). Add positive coverage for admin authorization and negative coverage for another address, asserting the host auth error; the tests should fail if sweep does not require the admin's authorization. A linked open pull request (#580) indicates work may already be underway.

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

Mô tả

security testing

Problem

Every maintenance-pool test that calls sweep runs under env.mock_all_auths(), which authorises every address. No test uses targeted env.mock_auths(&[MockAuth { address: <admin>, invoke: … fn_name: "sweep" … }]) or checks that a call signed by a different address fails. (In contracts/maintenance-pool/src/test.rs, targeted mocks exist only for upgrade.) If the require_auth() call were deleted or pointed at the wrong address, the suite would still pass. sweep moves arbitrary 'surplus' to any recipient.

Suggested fix

Add a positive test that mocks only the admin's auth for sweep, and a negative test that mocks another address's auth and asserts the host auth error.

Related: #50

Ngôn ngữ chính
Rust
Star
1
Fork
102
Merge trung bình
4 giờ 12 phút
Pull request đã merge (30 ngày)
30

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

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

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 MergeFi/contracts

Tất cả issue của MergeFi/contracts

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.