mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
6b061ba696
- Just extraction, with as few changes to the code as possible.
23 lines
744 B
Bash
Executable File
23 lines
744 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# shellcheck source=scripts/common.sh
|
|
source "${REPO_ROOT}/scripts/common.sh"
|
|
|
|
printTask "Testing linking itself..."
|
|
SOLTMPDIR=$(mktemp -d)
|
|
(
|
|
cd "$SOLTMPDIR"
|
|
echo 'library L { function f() public pure {} } contract C { function f() public pure { L.f(); } }' > x.sol
|
|
msg_on_error --no-stderr "$SOLC" --bin -o . x.sol
|
|
# 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
|
|
msg_on_error "$SOLC" --link --libraries x.sol:L=0x90f20564390eAe531E810af625A22f51385Cd222 C.bin
|
|
# Now the placeholder and explanation should be gone.
|
|
grep -q -v '[/_]' C.bin
|
|
)
|
|
rm -r "$SOLTMPDIR"
|