diff --git a/zk-tests/src/MissingLibraries.sol b/zk-tests/src/MissingLibraries.sol index 88c1a6b66..3314d9288 100644 --- a/zk-tests/src/MissingLibraries.sol +++ b/zk-tests/src/MissingLibraries.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.13; import {Maths} from "./Maths.sol"; -import 'forge-std/Test.sol'; +import 'forge-std/Script.sol'; contract Mathematician { uint256 public number; @@ -16,10 +16,10 @@ contract Mathematician { } } -contract MathematicianTest is Test { - function testLibraries() external { +contract MathematicianScript is Script { + function run() external { Mathematician maths = new Mathematician(2); - assertEq(maths.square(), 4); + assert(maths.square() == 4); } } diff --git a/zk-tests/src/NestedMissingLibraries.sol b/zk-tests/src/NestedMissingLibraries.sol index 705d13226..6b1b9050c 100644 --- a/zk-tests/src/NestedMissingLibraries.sol +++ b/zk-tests/src/NestedMissingLibraries.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.13; import {NestedMaths} from "./NestedMaths.sol"; -import 'forge-std/Test.sol'; +import 'forge-std/Script.sol'; contract NestedMathematician { uint256 public number; @@ -16,10 +16,10 @@ contract NestedMathematician { } } -contract NestedMathematicianTest is Test { - function testNestedLibraries() external { +contract NestedMathematicianScript is Script { + function run() external { NestedMathematician maths = new NestedMathematician(2); - assertEq(maths.square(), 4); + assert(maths.square() == 4); } } diff --git a/zk-tests/test.sh b/zk-tests/test.sh index d1f556d3d..2966beebf 100755 --- a/zk-tests/test.sh +++ b/zk-tests/test.sh @@ -132,6 +132,8 @@ output=$(RUST_LOG=warn "${FORGE}" build --zksync 2>&1 || true) if echo "$output" | grep -q "Missing libraries detected"; then RUST_LOG=warn "${FORGE}" create --deploy-missing-libraries --rpc-url $RPC_URL --private-key $PRIVATE_KEY --zksync + RUST_LOG=warn "${FORGE}" script ./src/MissingLibraries.sol:MathematicianScript --rpc-url $RPC_URL --private-key $PRIVATE_KEY --zksync --chain 260 --use "./${SOLC}" -vvv || fail "forge script with libs failed" + RUST_LOG=warn "${FORGE}" script ./src/NestedMissingLibraries.sol:NestedMathematicianScript --rpc-url $RPC_URL --private-key $PRIVATE_KEY --zksync --chain 260 --use "./${SOLC}" -vvv || fail "forge script with nested libs failed" else echo "No missing libraries detected." fi