harb/onchain/test/mocks/MockVWAPTracker.sol

28 lines
790 B
Solidity
Raw Normal View History

// 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();
}
}