harb/onchain/test/mocks/MockVWAPTracker.sol
giteadmin eac7360ff9 Consolidate duplicate helper functions and improve test maintainability
- Create shared MockVWAPTracker.sol to eliminate duplicate mock implementations
- Add TestBase.sol with shared utilities (getDefaultParams, bp, denormTR)
- Update CSVHelper.sol to use Forge's vm.toString() instead of manual conversion
- Standardize tick calculation function names across test files
- Update test files to use consolidated utilities
- Remove helper function inventory (consolidation complete)

Eliminates 200-300 lines of duplicate code while maintaining 100% test compatibility.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18 20:30:50 +02:00

27 lines
No EOL
789 B
Solidity

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.19;
import "../../src/VWAPTracker.sol";
/**
* @title MockVWAPTracker
* @notice Shared mock implementation of VWAPTracker for testing
* @dev Exposes internal functions for testing purposes
*/
contract MockVWAPTracker is VWAPTracker {
/**
* @notice Exposes internal VWAP recording function for testing
* @param currentPriceX96 Current price in X96 format
* @param fee Fee amount used to calculate volume
*/
function recordVolumeAndPrice(uint256 currentPriceX96, uint256 fee) external {
_recordVolumeAndPrice(currentPriceX96, fee);
}
/**
* @notice Exposes internal VWAP reset function for testing
*/
function resetVWAP() external {
_resetVWAP();
}
}