feat(cast): run arbitrary bytecode#1020
Closed
refcell wants to merge 5 commits intofoundry-rs:revmfrom
refcell:ab/cast_run
Closed
feat(cast): run arbitrary bytecode#1020refcell wants to merge 5 commits intofoundry-rs:revmfrom refcell:ab/cast_run
refcell wants to merge 5 commits intofoundry-rs:revmfrom
refcell:ab/cast_run
Conversation
gakonst
reviewed
Mar 22, 2022
3 tasks
mattsse
reviewed
Mar 22, 2022
cli/src/cmd/cast/run.rs
Outdated
Comment on lines
+56
to
+57
| let bytecode_vec = self.bytecode.strip_prefix("0x").unwrap_or(&self.bytecode); | ||
| let parsed_bytecode = Bytes::from(hex::decode(bytecode_vec)?); |
Member
There was a problem hiding this comment.
I think this should work as well
Suggested change
| let bytecode_vec = self.bytecode.strip_prefix("0x").unwrap_or(&self.bytecode); | |
| let parsed_bytecode = Bytes::from(hex::decode(bytecode_vec)?); | |
| let bytecode_vec:Bytes = self.bytecode.parse()?; |
Comment on lines
+49
to
+60
| macro_rules! casttest { | ||
| ($test:ident, $fun:expr) => { | ||
| $crate::casttest!($test, $crate::ethers_solc::PathStyle::Dapptools, $fun); | ||
| }; | ||
| ($test:ident, $style:expr, $fun:expr) => { | ||
| #[test] | ||
| fn $test() { | ||
| let (prj, cmd) = $crate::util::setup_cast(stringify!($test), $style); | ||
| $fun(prj, cmd); | ||
| } | ||
| }; | ||
| } |
Contributor
Author
|
Right now, Open Questionscc: @gakonst @onbjerg @mattsse Currently, there is a stark difference between the outputs of `cast run` and `hevm exec` as shown below:  |
Member
|
I think this was auto-closed - rebase on top of master (which now includes revm changes) and re-open 😄 |
Member
|
oops my bad - sorry @abigger87 |
Contributor
Author
|
haha no worries! |
Contributor
|
Any plans to reopen this one? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Overview
This PR finishes the work in #945
Motivation & Solution
This PR introduces a new subcommand for cast:
runthat executes arbitrary bytecode similar tohevm exec.Checklist