Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: PosixPath #458

Open
x1250 opened this issue Jan 6, 2024 · 1 comment
Open

KeyError: PosixPath #458

x1250 opened this issue Jan 6, 2024 · 1 comment

Comments

@x1250
Copy link

x1250 commented Jan 6, 2024

Hello. I'm getting this error after a function is proposed and I answer "Y":

...function
to,
block.timestamp + 1
);
address pairAddress = factory.getPair(address(tokenA), address(WETH));
assertTrue(pairAddress != address(0), "Pair address should not be zero");
(uint256 reserveA, uint256 reserveETH, ) = ZuniswapV2Pair(pairAddress).getReserves();
assertEq(reserveA, amountTokenDesired, "Reserve A should match desired token amount");
assertEq(reserveETH, amountETHMin, "Reserve ETH should match desired ETH amount");
uint256 liquidityBalance = ZuniswapV2Pair(pairAddress).balanceOf(to);
assertTrue(liquidityBalance > 0, "Liquidity balance should be greater than zero");
}

Speed: 21.59 tkns/s | Cost: $0.13
Apply these changes? 'Y/n/i' or provide feedback.

Y
Unhandled Exception: Traceback (most recent call last):
File "/home/daniel/ZuniswapV2/.venv/lib/python3.10/site-packages/mentat/session.py", line 219, in run_main
await self._main()
File "/home/daniel/ZuniswapV2/.venv/lib/python3.10/site-packages/mentat/session.py", line 170, in _main
applied_edits = await code_file_manager.write_changes_to_files(
File "/home/daniel/ZuniswapV2/.venv/lib/python3.10/site-packages/mentat/code_file_manager.py", line 105, in write_changes_to_files
stored_lines = self.file_lines[file_edit.file_path]
KeyError: PosixPath('/home/daniel/ZuniswapV2/src/../test/ZuniswapV2Router.t.sol')

@granawkins
Copy link
Member

Hmm.. were you using auto-context? If so, try including ZuniswapV2Router.t.sol manually mentat path/to/Zuniswap ... and see if it works?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants