-
Notifications
You must be signed in to change notification settings - Fork 433
feat: add parseJson helper functions #138
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
Conversation
|
Now that |
b3664ce to
9e5b97c
Compare
|
|
All issues fixed and |
|
The ci fail is propably because they fix PR that was just merged has not be yet propagated |
|
If I rebase locally against main all tests pass, seems this branch is missing the |
mds1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking awesome, thanks a lot for all the work!
|
I addressed all your comments, except for the library. The parser needs the state to have a nicer UX. It also needs console2, vm, so the imports would get a bit funky. What I can't reason about is the |
Makes sense.
But what's this? Duplicate functionality as an abstract contract instead of a library? |
No, we are going to move the problematic std-cheats there and remove the current content. |
|
@ZeroEkkusu to be very clear. We can compile with the experimental pragma. The issue we seem to be hitting on some solc is decoding |
|
Ok, I think I follow: // Library
function parseRaw(string memory json, string memory key)
function readUint(string memory json, string memory key)
function readUintArray(string memory json, string memory key)
function readInt(string memory json, string memory key)
function readIntArray(string memory json, string memory key)
function readBytes32(string memory json, string memory key)
function readBytes32Array(string memory json, string memory key)
function readString(string memory json, string memory key)
function readStringArray(string memory json, string memory key)
function readAddress(string memory json, string memory key)
function readAddressArray(string memory json, string memory key)
function readBool(string memory json, string memory key)
function readBoolArray(string memory json, string memory key)
function readBytes(string memory json, string memory key)
function readBytesArray(string memory json, string memory key)
// StdCheatsJson
// --- snip: all the custom structs ---
function readEIP1559ScriptArtifact(string memory path)
function rawToConvertedEIPTx1559s(RawTx1559[] memory rawTxs)
function rawToConvertedEIPTx1559(RawTx1559 memory rawTx)
function rawToConvertedEIP1559Detail(RawTx1559Detail memory rawDetail)
function readTx1559s(string memory path)
function readTx1559(string memory path, uint256 index)
function readReceipts(string memory path)
function readReceipt(string memory path, uint index)
function rawToConvertedReceipts(RawReceipt[] memory rawReceipts)
function rawToConvertedReceipt(RawReceipt memory rawReceipt)
function rawToConvertedReceiptLogs(RawReceiptLog[] memory rawLogs)
function bytesToUint(bytes memory b) internal pure returns (uint256){
This is the part I was missing, I didn't realize we still had this requirement |
|
I think with |
|
@mds1 even with the flag, we seem not being able to compile for 0.7.6 due to the types I mentioned above. Didn't go into why. |
|
Lemme check. |
|
Ahh I thought it was a test/runtime error, not a compilation error |
|
So, it works with |
|
My solc failed to compile. What the actual F |
|
I was experimenting manually. Going to check out the PR now and compile it myself. |
|
Try to build from 7daae38 |
|
Ok, I see with |
|
@odyslam It's because it missing |
|
So, let's:
|
0af5bc2 to
ea7d0cf
Compare
|
@ZeroEkkusu I can't merge |
|
Thanks so much @odyslam for getting this done, thanks @ZeroEkkusu for your help with review. @ZeroEkkusu this LGTM, feel free to squash merge if you wanted to do a final check |
|
Next steps:
|
Co-authored-by: Zero Ekkusu <[email protected]>
|
The reason CI didn't fail was because it is configured to use Great work, team! |

Helper functions that leverage the new
parseJsoncheat code and enable the user to easily parseforge scriptartifacts.The Structs will probably change a bit, due to the artifacts requiring some changes to avoid
Solidity keywordkeys and make the artifacts be consistent (produce keys with null values instead of omitting them)