[CLI] Allow "=" as separator between library name and address in --libraries commandline option.

This commit is contained in:
Hui Yu
2021-01-25 16:14:39 +08:00
parent a75b87c80e
commit c669ee251a
13 changed files with 55 additions and 29 deletions
+4 -4
View File
@@ -354,11 +354,11 @@ rm -rf "$SOLTMPDIR"
echo "Done."
printTask "Testing library checksum..."
echo '' | "$SOLC" - --link --libraries a:0x90f20564390eAe531E810af625A22f51385Cd222 >/dev/null
! echo '' | "$SOLC" - --link --libraries a:0x80f20564390eAe531E810af625A22f51385Cd222 &>/dev/null
echo '' | "$SOLC" - --link --libraries a=0x90f20564390eAe531E810af625A22f51385Cd222 >/dev/null
! echo '' | "$SOLC" - --link --libraries a=0x80f20564390eAe531E810af625A22f51385Cd222 &>/dev/null
printTask "Testing long library names..."
echo '' | "$SOLC" - --link --libraries aveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerylonglibraryname:0x90f20564390eAe531E810af625A22f51385Cd222 >/dev/null
echo '' | "$SOLC" - --link --libraries aveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerylonglibraryname=0x90f20564390eAe531E810af625A22f51385Cd222 >/dev/null
printTask "Testing linking itself..."
SOLTMPDIR=$(mktemp -d)
@@ -372,7 +372,7 @@ SOLTMPDIR=$(mktemp -d)
# But not in library file.
grep -q -v '[/_]' L.bin
# Now link
"$SOLC" --link --libraries x.sol:L:0x90f20564390eAe531E810af625A22f51385Cd222 C.bin
"$SOLC" --link --libraries x.sol:L=0x90f20564390eAe531E810af625A22f51385Cd222 C.bin
# Now the placeholder and explanation should be gone.
grep -q -v '[/_]' C.bin
)
+1 -1
View File
@@ -1 +1 @@
--bin --bin-runtime --libraries linking_solidity/input.sol:L:0x1234567890123456789012345678901234567890
--bin --bin-runtime --libraries linking_solidity/input.sol:L=0x1234567890123456789012345678901234567890
@@ -1 +1 @@
--bin --bin-runtime --libraries linking_solidity_unresolved_references/input.sol:L1:0x1234567890123456789012345678901234567890
--bin --bin-runtime --libraries linking_solidity_unresolved_references/input.sol:L1=0x1234567890123456789012345678901234567890
@@ -1 +1 @@
--strict-assembly --libraries contract/test.sol:L:0x1234567890123456789012345678901234567890
--strict-assembly --libraries contract/test.sol:L=0x1234567890123456789012345678901234567890
@@ -1 +1 @@
--strict-assembly --libraries library.sol:L:0x1234567890123456789012345678901234567890,library.sol:L:0x0987654321098765432109876543210987654321
--strict-assembly --libraries library.sol:L=0x1234567890123456789012345678901234567890,library.sol:L=0x0987654321098765432109876543210987654321
@@ -1 +1 @@
--strict-assembly --libraries L:0x1234567890123456789012345678901234567890
--strict-assembly --libraries L=0x1234567890123456789012345678901234567890
@@ -1 +1 @@
--strict-assembly --libraries library1.sol:L:0x1111111111111111111111111111111111111111,library2.sol:L:0x2222222222222222222222222222222222222222
--strict-assembly --libraries library1.sol:L=0x1111111111111111111111111111111111111111,library2.sol:L=0x2222222222222222222222222222222222222222
@@ -1 +1 @@
--strict-assembly --libraries library1.sol:L:0x1234567890123456789012345678901234567890
--strict-assembly --libraries library1.sol:L=0x1234567890123456789012345678901234567890
@@ -1 +1 @@
--strict-assembly --libraries contract/test.sol:L1:0x1234567890123456789012345678901234567890
--strict-assembly --libraries contract/test.sol:L1=0x1234567890123456789012345678901234567890