Skip to content
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

Merged
merged 1 commit into from
Mar 1, 2018

Conversation

axic
Copy link
Member

@axic axic commented Feb 28, 2018

Depends on #3617 and ethereum/solc-js#201

@axic axic requested a review from chriseth February 28, 2018 21:38
@@ -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();
Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

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.

@axic axic changed the title Ensure that library addresses supplied are of correct length and hex prefixde Ensure that library addresses supplied are of correct length and hex prefixed Feb 28, 2018
{
char const* input = R"(
{
"language": "Solidity",
"settings": {
"libraries": {
"library.sol": {
"L": 42,
"L3": "42",
"L4": "0x42",
Copy link
Member Author

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.

Copy link
Contributor

@chriseth chriseth left a 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&

@axic axic force-pushed the jsonio-libraries-hex branch from 03f0246 to 8a86d20 Compare March 1, 2018 11:03
@axic axic force-pushed the jsonio-libraries-hex branch from 8a86d20 to b6dfd9e Compare March 1, 2018 11:04
@axic axic merged commit 2c82f74 into develop Mar 1, 2018
@axic axic deleted the jsonio-libraries-hex branch March 1, 2018 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants