-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from ethereum/develop
version 0.1.1 development
- Loading branch information
Showing
152 changed files
with
4,207 additions
and
1,486 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include "Compiler.h" | ||
#include "TestHelper.h" | ||
#include <libdevcore/CommonIO.h> | ||
using namespace dev; | ||
using namespace test; | ||
using namespace dataobject; | ||
|
||
|
||
namespace test | ||
{ | ||
namespace compiler | ||
{ | ||
string compileYul(string const& _code) | ||
{ | ||
#if defined(_WIN32) | ||
BOOST_ERROR("Yul compilation only supported on posix systems."); | ||
return ""; | ||
#else | ||
fs::path const path(fs::temp_directory_path() / fs::unique_path()); | ||
|
||
string const cmd = string("solc --assemble ") + path.string(); | ||
writeFile(path.string(), _code); | ||
string result = executeCmd(cmd); | ||
string c_findString = "Binary representation:"; | ||
size_t codePos = result.find(c_findString); | ||
if (codePos != string::npos) | ||
{ | ||
size_t codeStartPos = codePos + c_findString.size() + 1; | ||
size_t codeEndPos = result.find('\n', codeStartPos + 1); | ||
if (codeEndPos == string::npos) | ||
ETH_FAIL_MESSAGE("YUL compile error!"); | ||
|
||
string const yulCode = result.substr(codeStartPos, codeEndPos - codeStartPos); | ||
return "0x" + yulCode; | ||
} | ||
else | ||
ETH_FAIL_MESSAGE("Error compiling YUL!"); | ||
return ""; | ||
#endif | ||
} | ||
} // namespace compiler | ||
} // namespace test |
This file contains 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
Oops, something went wrong.