Open
Description
opened on May 6, 2023
The docs located here: https://book.getfoundry.sh/cheatcodes/parse-json
are completely outdated. The example code
string memory root = vm.projectRoot();
string memory path = string.concat(root, "/src/test/fixtures/broadcast.log.json");
string memory json = vm.readFile(path);
bytes memory transactionDetails = json.parseRaw(".transactions[0].tx");
RawTx1559Detail memory rawTxDetail = abi.decode(transactionDetails, (RawTx1559Detail));
results in an error
error[9574]: TypeError: Type bytes memory is not implicitly convertible to expected type string memory.
error[8015]: TypeError: Invalid type for argument in the bytes.concat function call. bytes or fixed bytes type is required, but string provided.
Metadata
Assignees
Labels
No labels
Activity