build: pin demo toolchains
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { createRequire } from "node:module";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const expectedVersion = "1.46.0";
|
||||
const pluginSource = await readFile(
|
||||
new URL("../lib/openzeppelin-foundry-upgrades/src/internal/Versions.sol", import.meta.url),
|
||||
"utf8"
|
||||
);
|
||||
const lockfile = JSON.parse(
|
||||
await readFile(new URL("../package-lock.json", import.meta.url), "utf8")
|
||||
);
|
||||
const lockedVersion = lockfile.packages?.["node_modules/@openzeppelin/upgrades-core"]?.version;
|
||||
const installedVersion = require("@openzeppelin/upgrades-core/package.json").version;
|
||||
|
||||
if (!pluginSource.includes('UPGRADES_CORE = "^1.45.0"')) {
|
||||
throw new Error('Expected the vendored plugin to declare UPGRADES_CORE = "^1.45.0".');
|
||||
}
|
||||
|
||||
if (lockedVersion !== expectedVersion) {
|
||||
throw new Error(`Expected package-lock.json to resolve @openzeppelin/upgrades-core to ${expectedVersion}, found ${lockedVersion}.`);
|
||||
}
|
||||
|
||||
if (installedVersion !== expectedVersion) {
|
||||
throw new Error(`Expected installed @openzeppelin/upgrades-core to report ${expectedVersion}, found ${installedVersion}.`);
|
||||
}
|
||||
|
||||
console.log(`@openzeppelin/upgrades-core ${expectedVersion} is pinned and installed.`);
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
printf '%s\n' 'Expected: Foundry 1.7.1, Node 24.18.0, npm 11.17.0'
|
||||
|
||||
for tool in forge anvil node npm make; do
|
||||
if command -v "$tool" >/dev/null 2>&1; then
|
||||
printf '%s: ' "$tool"
|
||||
"$tool" --version | sed -n '1p'
|
||||
else
|
||||
printf '%s\n' "missing: $tool"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user