maintenance-pool::deposit has no test proving it requires the sponsor's authorization

オープン
#560 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@urielit1313-creator がすでに取り組んでいます。

2026年10月13日 から。

  • #578 @urielit1313-creator による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
rust

調査の方向性

Read contracts/maintenance-pool/src/test.rs, especially the existing targeted authorization mocks for upgrade and the tests that call deposit. Add coverage for sponsor-only authorization succeeding and another address's authorization failing with the host auth error; run the maintenance-pool tests and confirm both cases are covered. A linked pull request is already open, so check its status before starting.

索引モデルが issue の本文から書いたものです。

説明

security testing

Problem

Every maintenance-pool test that calls deposit runs under env.mock_all_auths(), which authorises every address. No test uses targeted env.mock_auths(&[MockAuth { address: <sponsor>, invoke: … fn_name: "deposit" … }]) 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 sponsor's auth for deposit, and a negative test that mocks another address's auth and asserts the host auth error.

Related: #50

主要言語
Rust
スター
1
フォーク
102
平均マージ
4時間 12分
マージ済み PR(30日)
30

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

MergeFi/contracts のほかの issue

MergeFi/contracts の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。