diff options
author | chriseth <chris@ethereum.org> | 2018-10-12 21:53:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-12 21:53:45 +0800 |
commit | 94526b2d92e469fc8679be1f5a2b56c4c1ed25be (patch) | |
tree | a85bb55dbb29de2d3e271160af3e5afcc7d9c228 /test | |
parent | 1d312c8e4073e2e7ce9a23a721013942e1e5c727 (diff) | |
parent | 914668c622b60eab4129d0a6b3776c20d8e614bd (diff) | |
download | dexon-solidity-94526b2d92e469fc8679be1f5a2b56c4c1ed25be.tar.gz dexon-solidity-94526b2d92e469fc8679be1f5a2b56c4c1ed25be.tar.zst dexon-solidity-94526b2d92e469fc8679be1f5a2b56c4c1ed25be.zip |
Merge pull request #5145 from ethereum/hashLinker
Hash linker
Diffstat (limited to 'test')
-rwxr-xr-x | test/cmdlineTests.sh | 18 | ||||
-rw-r--r-- | test/libevmasm/Assembler.cpp | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh index 71866bce..20254ef4 100755 --- a/test/cmdlineTests.sh +++ b/test/cmdlineTests.sh @@ -233,6 +233,24 @@ echo '' | "$SOLC" - --link --libraries a:0x90f20564390eAe531E810af625A22f51385Cd printTask "Testing long library names..." echo '' | "$SOLC" - --link --libraries aveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerylonglibraryname:0x90f20564390eAe531E810af625A22f51385Cd222 >/dev/null +printTask "Testing linking itself..." +SOLTMPDIR=$(mktemp -d) +( + cd "$SOLTMPDIR" + set -e + echo 'library L { function f() public pure {} } contract C { function f() public pure { L.f(); } }' > x.sol + "$SOLC" --bin -o . x.sol 2>/dev/null + # Explanation and placeholder should be there + grep -q '//' C.bin && grep -q '__' C.bin + # But not in library file. + grep -q -v '[/_]' L.bin + # Now link + "$SOLC" --link --libraries x.sol:L:0x90f20564390eAe531E810af625A22f51385Cd222 C.bin + # Now the placeholder and explanation should be gone. + grep -q -v '[/_]' C.bin +) +rm -rf "$SOLTMPDIR" + printTask "Testing overwriting files..." SOLTMPDIR=$(mktemp -d) ( diff --git a/test/libevmasm/Assembler.cpp b/test/libevmasm/Assembler.cpp index bc652f56..1c041596 100644 --- a/test/libevmasm/Assembler.cpp +++ b/test/libevmasm/Assembler.cpp @@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE(all_assembly_items) BOOST_CHECK_EQUAL( _assembly.assemble().toHex(), - "5b6001600220606773__someLibrary___________________________" + "5b6001600220606773__$bf005014d9d0f534b8fcb268bd84c491a2$__" "6000567f556e75736564206665617475726520666f722070757368696e" "6720737472696e605f6001605e73000000000000000000000000000000000000000000fe" "fe010203044266eeaa" |