fix: suppress compiler warnings in BacktestRunner (#316)
- Add `view` to _parseSqrtPriceFromFile and _resolveSqrtPrice - Remove unused IUniswapV3Pool import Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
96b06bd9fe
commit
70e49b2546
1 changed files with 2 additions and 3 deletions
|
|
@ -3,7 +3,6 @@ pragma solidity ^0.8.19;
|
|||
|
||||
import { Script } from "forge-std/Script.sol";
|
||||
import { console2 } from "forge-std/console2.sol";
|
||||
import { IUniswapV3Pool } from "@uniswap-v3-core/interfaces/IUniswapV3Pool.sol";
|
||||
import { MockToken } from "./MockToken.sol";
|
||||
import { ShadowPool, ShadowPoolDeployer } from "./ShadowPoolDeployer.sol";
|
||||
|
||||
|
|
@ -37,7 +36,7 @@ contract BacktestRunner is Script {
|
|||
* fetch-events.ts serialises BigInt values as decimal strings, so we use
|
||||
* parseJsonString then parseUint rather than parseJsonUint.
|
||||
*/
|
||||
function _parseSqrtPriceFromFile(string memory eventsFile) external returns (uint160) {
|
||||
function _parseSqrtPriceFromFile(string memory eventsFile) external view returns (uint160) {
|
||||
string memory line = vm.readLine(eventsFile);
|
||||
string memory sqrtStr = vm.parseJsonString(line, ".sqrtPriceX96");
|
||||
return uint160(vm.parseUint(sqrtStr));
|
||||
|
|
@ -48,7 +47,7 @@ contract BacktestRunner is Script {
|
|||
* @dev Call this BEFORE vm.startBroadcast() — the `this.` external call must not
|
||||
* be included in the broadcast.
|
||||
*/
|
||||
function _resolveSqrtPrice() internal returns (uint160) {
|
||||
function _resolveSqrtPrice() internal view returns (uint160) {
|
||||
// 1. Explicit env override.
|
||||
try vm.envUint("INITIAL_SQRT_PRICE_X96") returns (uint256 val) {
|
||||
if (val != 0) return uint160(val);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue