Migrate to Hardhat (#2397)
This commit is contained in:
@ -1,9 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
if [ "$SOLC_NIGHTLY" = true ]; then
|
||||
docker pull ethereum/solc:nightly
|
||||
fi
|
||||
|
||||
export OPENZEPPELIN_NON_INTERACTIVE=true
|
||||
|
||||
npx oz compile
|
||||
@ -1,25 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit -o pipefail
|
||||
set -euo pipefail
|
||||
|
||||
# Executes cleanup function at script exit.
|
||||
trap cleanup EXIT
|
||||
buidler coverage
|
||||
|
||||
cleanup() {
|
||||
# Delete the symlink created to the allFiredEvents file solidity-coverage creates
|
||||
rm -f allFiredEvents
|
||||
}
|
||||
|
||||
log() {
|
||||
echo "$*" >&2
|
||||
}
|
||||
|
||||
# The allFiredEvents file is created inside coverageEnv, but solidity-coverage
|
||||
# expects it to be at the top level. We create a symlink to fix this
|
||||
ln -s coverageEnv/allFiredEvents allFiredEvents
|
||||
|
||||
OZ_TEST_ENV_COVERAGE=true npx solidity-coverage || log "Test run failed"
|
||||
|
||||
if [ "$CI" = true ]; then
|
||||
if [ -n "$CI" ]; then
|
||||
curl -s https://codecov.io/bash | bash -s -- -C "$CIRCLE_SHA1"
|
||||
fi
|
||||
|
||||
10
scripts/prepack.sh
Executable file
10
scripts/prepack.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# cross platform `mkdir -p`
|
||||
node -e 'fs.mkdirSync("build/contracts", { recursive: true })'
|
||||
|
||||
cp artifacts/*.json build/contracts
|
||||
|
||||
node scripts/remove-ignored-artifacts.js
|
||||
0
scripts/prepare-contracts-package.sh
Normal file → Executable file
0
scripts/prepare-contracts-package.sh
Normal file → Executable file
@ -23,20 +23,19 @@ const ignorePatternsSubtrees = ignorePatterns
|
||||
.concat(ignorePatterns.map(pat => path.join(pat, '**/*')))
|
||||
.map(p => p.replace(/^\//, ''));
|
||||
|
||||
const solcOutput = readJSON('cache/solc-output.json');
|
||||
|
||||
const artifactsDir = 'build/contracts';
|
||||
|
||||
let n = 0;
|
||||
|
||||
for (const artifact of fs.readdirSync(artifactsDir)) {
|
||||
const fullArtifactPath = path.join(artifactsDir, artifact);
|
||||
const { sourcePath: fullSourcePath } = readJSON(fullArtifactPath);
|
||||
const sourcePath = path.relative('.', fullSourcePath);
|
||||
|
||||
for (const sourcePath in solcOutput.contracts) {
|
||||
const ignore = match.any(sourcePath, ignorePatternsSubtrees);
|
||||
|
||||
if (ignore) {
|
||||
fs.unlinkSync(fullArtifactPath);
|
||||
n += 1;
|
||||
for (const contract in solcOutput.contracts[sourcePath]) {
|
||||
fs.unlinkSync(path.join(artifactsDir, contract + '.json'));
|
||||
n += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user