-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from vechain/prepare-npm-publish
Prepare npm publish
- Loading branch information
Showing
11 changed files
with
146 additions
and
5 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
# make sure gas reports are checked in with this commit | ||
# dump report diff | ||
# exit with "1" if there is a diff, zero if no diff | ||
|
||
folder=${1:-reports} | ||
git diff --color=always $folder | ||
git diff ${folder} | grep -q . | ||
|
||
if [ "$?" == 1 ]; then | ||
#diff with no error - ok | ||
exit | ||
else | ||
echo ERROR: found above unchecked reports. | ||
exit 1 | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# run "yarn gas-calc" using geth with docker. | ||
# (if you have geth running on localhost:8545, its faster with "HARDHAT_NETWORK=dev yarn gas-calc") | ||
docker-compose -f `dirname $0`/docker-gascalc.yml up --abort-on-container-exit | ||
docker-compose -f `dirname $0`/docker-gascalc.yml down | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: '2' | ||
|
||
services: | ||
test: | ||
image: node | ||
container_name: gascalc | ||
depends_on: | ||
- localgeth | ||
volumes: | ||
- ..:/app | ||
working_dir: /app | ||
restart: "no" | ||
environment: | ||
- HARDHAT_NETWORK=localgeth | ||
command: "yarn mocha-gascalc" | ||
|
||
#configuration is a copy of github/.workflows/build.xml | ||
localgeth: | ||
image: dtr22/geth-dev | ||
container_name: localgeth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# run gascalc, assuming "geth" is running on localhost, port 8545 | ||
cd `dirname $0`/.. | ||
function getClientVersion() { | ||
curl -m 1 -s -d '{"method":"web3_clientVersion","params":[],"id":1234,"jsonrpc":"2.0"}' -H content-type:application/json localhost:8545 | ||
} | ||
|
||
if [[ `getClientVersion` =~ "Geth" ]]; then | ||
echo Using GETH on localhost:8545 | ||
HARDHAT_NETWORK=dev yarn mocha-gascalc | ||
else | ||
echo No GETH running on localhost:8545. Using docker.. | ||
./scripts/docker-gascalc | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
export FORCE_COLOR=1 | ||
hardhat "$@" 2>&1 | `dirname $0`/solcErrors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash -xe | ||
#echo postpack for "contracts" package | ||
cd `dirname $0`/.. | ||
pwd | ||
rm -rf contracts/artifacts contracts/types contracts/dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash -xe | ||
#echo prepack for "contracts" package | ||
|
||
cd `dirname $0`/.. | ||
pwd | ||
if git status contracts | grep -v 'nothing to commit'|tee /dev/stderr |grep -q Untracked; then | ||
exit 1 | ||
fi | ||
|
||
yarn clean | ||
yarn compile | ||
cd contracts | ||
|
||
rm -rf artifacts types dist | ||
|
||
mkdir -p artifacts | ||
cp `find ../artifacts/contracts -type f | grep -v -E 'Test|dbg|gnosis|bls|IOracle'` artifacts/ | ||
npx typechain --target ethers-v5 --out-dir types artifacts/** | ||
npx tsc index.ts -d --outDir dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// We require the Hardhat Runtime Environment explicitly here. This is optional | ||
// but useful for running the script in a standalone fashion through `node <script>`. | ||
// | ||
// When running the script with `npx hardhat run <script>` you'll find the Hardhat | ||
// Runtime Environment's members available in the global scope. | ||
const hre = require('hardhat') | ||
|
||
async function main () { | ||
// Hardhat always runs the compile task when running scripts with its command | ||
// line interface. | ||
// | ||
// If this script is run directly using `node` you may want to call compile | ||
// manually to make sure everything is compiled | ||
// await hre.run('compile'); | ||
|
||
// We get the contract to deploy | ||
const Singleton = await hre.ethers.getContractFactory('Singleton') | ||
const singleton = await Singleton.deploy() | ||
|
||
await singleton.deployed() | ||
|
||
console.log('Singleton deployed to:', singleton.address) | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch((error) => { | ||
console.error(error) | ||
process.exit(1) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export LC_CTYPE= | ||
#solc error ( unrecognized by idea | ||
# --> contracts/UserOperation.sol:57:9: | ||
#js error (recognized) | ||
# at SimpleWallet._validateSignature (contracts/samples/SimpleWallet.sol:76) | ||
|
||
perl -pe 's/--> (\S+):(\d+):(\d+):/at ($1:$2)/;' \ | ||
-e "s/.*(Solidity 0.8.\d+ is not fully supported yet|Learn.more at.*solidity-support).*\s*//;" \ | ||
-e "s/^\s*$//;" \ | ||
-e "s/\s*at .*node_modules.*\s*//;" \ | ||
-e "s/.*HH600.*\s*//" | ||
|