-
Notifications
You must be signed in to change notification settings - Fork 312
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
Add --create option to evmc run
#566
Conversation
chfast
commented
Nov 5, 2020
•
edited
Loading
edited
b7d820a
to
ecf6ae1
Compare
590721d
to
8a61e92
Compare
tools/commands/run.cpp
Outdated
|
||
const auto deploy_result = vm.execute(host, rev, deploy_msg, code.data(), code.size()); | ||
if (deploy_result.status_code != EVMC_SUCCESS) | ||
return 1; |
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.
Perhaps output a message in this case.
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.
Done.
Codecov Report
@@ Coverage Diff @@
## master #566 +/- ##
==========================================
+ Coverage 93.54% 93.82% +0.28%
==========================================
Files 23 23
Lines 3422 3497 +75
==========================================
+ Hits 3201 3281 +80
+ Misses 221 216 -5 |
tools/commands/run.cpp
Outdated
@@ -11,24 +11,62 @@ namespace evmc | |||
{ | |||
namespace cmd | |||
{ | |||
namespace | |||
{ | |||
constexpr auto deploy_address = 0x000000000000000000000000000000000c9ea7ed_address; |
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.
Why does this address has so many leading zeroes?
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.
Changed.
tools/commands/run.cpp
Outdated
return 1; | ||
|
||
auto& deployed_account = host.accounts[deploy_address]; | ||
deployed_account.code = bytes(deploy_result.output_data, deploy_result.output_size); |
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.
Why isn't this done in MockedHost?
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.
MockedHost does not have any call/create logic, it just records the passed message.
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.
Okay for me, but left some questions.
2eac3cd
to
f8a39a1
Compare
auto vm = evmc::VM{evmc_create_example_vm()}; | ||
std::ostringstream out; | ||
|
||
const auto exit_code = cmd::run(vm, EVMC_PETERSBURG, 0, "FE", "", true, out); |
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.
Nit: other hex strings are lowercase in this file.
const auto exit_code = cmd::run(vm, EVMC_PETERSBURG, 0, "FE", "", true, out); | |
const auto exit_code = cmd::run(vm, EVMC_PETERSBURG, 0, "fe", "", true, out); |
f8a39a1
to
ed4dddf
Compare
ed4dddf
to
c8c90e0
Compare
c8c90e0
to
6330289
Compare