Getting "Invalid data" with the getCode
cheatcode
#647
Answered
by
ZeroEkkusu
ZeroEkkusu
asked this question in
Q&A
-
Gm, sers, I can't get the // SPDX-License-Identifier: Unlicense
pragma solidity 0.8.10;
import "ds-test/test.sol";
import "./ICheatCodes.sol";
contract MyContractTest is DSTest {
CheatCodes cheats = CheatCodes(HEVM_ADDRESS);
function setUp() public {}
function testExample() public {
bytes memory code = cheats.getCode("MyContract.sol:MyContract");
}
} Here's the output:
I also tried using |
Beta Was this translation helpful? Give feedback.
Answered by
ZeroEkkusu
Feb 1, 2022
Replies: 1 comment 2 replies
-
LG! I've figured it out! For some reason, doing cargo install --git https://github.com/gakonst/foundry --bins --locked I tried testing again, and it works! |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
ZeroEkkusu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
LG! I've figured it out!
For some reason, doing
foundryup
does not actually update Foundry for me 🤔.So I built it from source with:
I tried testing again, and it works!