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

Đang mở
#559 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.

  • #579 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
25/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
authentication, testing

Hướng nghiên cứu

Start in contracts/maintenance-pool/src/test.rs and read the existing pause tests alongside the targeted upgrade auth mocks. Check how those tests assert host authorization errors; done means coverage verifies that admin authorization succeeds for pause and authorization from another address fails.

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 pause runs under env.mock_all_auths(), which authorises every address. No test uses targeted env.mock_auths(&[MockAuth { address: <admin>, invoke: … fn_name: "pause" … }]) 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.

Suggested fix

Add a positive test that mocks only the admin's auth for pause, 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.