-
Notifications
You must be signed in to change notification settings - Fork 985
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
Pass the source account into the host and allow calling into the token wrapper host functions #3553
Conversation
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.
LGTM, modulo a couple nitpicks
// verify contract code is correct | ||
LedgerTxn ltx2(app.getLedgerTxnRoot()); | ||
auto ltxe2 = loadContractData(ltx2, contractID, wasmKey); | ||
REQUIRE((bool)ltxe2 == expectEntry); |
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: Please use static_cast
- c-style casts should normally be avoided in c++.
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
{ | ||
case HostFunction::HOST_FN_CREATE_CONTRACT_WITH_ED25519: | ||
{ | ||
// uint256 salt = sha256("salt"); |
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.
Please remove this.
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
Marked as draft so we can get #3547 in as well. |
host.invoke_function(hf, args)?; | ||
} | ||
HostFunction::CreateContract => { |
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.
Not important to do now but the only thing differing between these arms is what gets logged, and these enum values all have debug representations -- you can just print that into the log and use a single branch here, don't need to switch on the value.
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.
Good point. Fixed.
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.
One nit I notice, everything else looks reasonable from what I understand about the goal here. I haven't been following the development of these APIs very closely though, so might want second eyes if you're looking for design feedback!
r+ 060a6bb |
Description
Resolves #3546 and #3547.
Checklist
clang-format
v8.0.0 (viamake format
or the Visual Studio extension)