-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Ensure that library addresses supplied are of correct length and hex prefixed #3624
Conversation
@@ -337,16 +339,30 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input) | |||
return formatFatalError("JSONError", "library entry is not a JSON object."); | |||
for (auto const& library: jsonSourceName.getMemberNames()) | |||
{ | |||
string const& address = jsonSourceName[library].asString(); |
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.
Need to double check asString
.
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.
does asString()
really return a reference?
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.
No, it actually creates a new instance in some cases.
{ | ||
char const* input = R"( | ||
{ | ||
"language": "Solidity", | ||
"settings": { | ||
"libraries": { | ||
"library.sol": { | ||
"L": 42, | ||
"L3": "42", | ||
"L4": "0x42", |
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.
Should leave this test too.
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.
Looks good apart from the const&
03f0246
to
8a86d20
Compare
…prefixed in JSONIO
8a86d20
to
b6dfd9e
Compare
Depends on #3617 and ethereum/solc-js#201