Predictify-org/predictify-contracts

Add ReentrancyGuard::scope_stack debug introspection helper

クローズ

#666 opened on 2026/06/27

 (7 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (182 件のフォーク)auto 404
GRANTFOX OSSOFFICIAL CAMPAIGNStellar Wavegood first issuerustsmart-contractsorobantesting

Repository metrics

Stars
 (7 個のスター)
PR merge metrics
 (PR metrics pending)

説明

Description

reentrancy_guard.rs keeps a per-entrypoint scope but does not expose its current depth for tests. Add a #[cfg(test)] pub fn current_scope_stack() helper returning the active scope chain so integration tests can assert correct nesting and detect accidental cross-scope leakage.

Requirements and Context

  • Helper compiled only under #[cfg(test)]
  • Returns Vec<Symbol> of active scopes
  • Used by at least two existing tests
  • Must be secure, tested, and documented
  • Should be efficient and easy to review

Suggested Execution

  1. Fork the repo and create a branch
    git checkout -b task/reentrancy-scope-introspection
    
  2. Implement changes
    • contracts/predictify-hybrid/src/reentrancy_guard.rs
    • Update an existing test in tests/
  3. Test and commit
    • cargo test -p predictify-hybrid reentrancy
    • Cover edge cases
    • Include test output and notes in the PR

Example commit message

test: expose reentrancy guard scope stack for assertions

Acceptance Criteria

  • Helper is gated to cfg(test)
  • Two pre-existing tests adopt the helper
  • No public surface change for production builds

Guidelines

  • NatSpec-style /// doc comments where relevant
  • Clear documentation and inline comments
  • Timeframe: 96 hours

コントリビューターガイド