Skip to content

Commit

Permalink
Merge pull request #984 from privacy-scaling-explorations/deps/ceremo…
Browse files Browse the repository at this point in the history
…ny-deployment

chore(publish): fix publishing scripts to publish contracts with ceremony params
  • Loading branch information
0xmad authored Jan 10, 2024
2 parents a307e27 + f27af1c commit e45c136
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ jobs:
- name: Initialize Project
run: |
npm install
npx lerna bootstrap
npm run bootstrap
npm run build
env:
STATE_TREE_DEPTH: ${{ vars.STATE_TREE_DEPTH }}

- name: Compile Contracts
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/nightly-ceremony.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ jobs:
npm install
npm run bootstrap
npm run build
env:
STATE_TREE_DEPTH: 6

- name: Compile contracts with ceremony params and run hardhat fork
- name: Run hardhat fork
run: |
cd contracts
npm run compileSol 6
npm run hardhat &
- name: Download rapidsnark (1c137)
Expand All @@ -53,4 +54,5 @@ jobs:
run: ./.github/scripts/ceremony-param-tests-c-witness.sh

- name: Stop Hardhat
if: always()
run: kill $(lsof -t -i:8545)
1 change: 1 addition & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
run: npm run ${{ matrix.command }}

- name: Stop Hardhat
if: always()
run: kill $(lsof -t -i:8545)

unit:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ jobs:
run: |
git config --global url."https://github.com/".insteadOf git://github.com/
npm install
npx lerna bootstrap
npm run bootstrap
npm run build
env:
STATE_TREE_DEPTH: ${{ vars.STATE_TREE_DEPTH }}

- name: Publish NPM
run: |
Expand Down
2 changes: 1 addition & 1 deletion contracts/scripts/compileSol.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ echo 'Writing Merkle zeros contracts'
./scripts/writeMerkleZeroesContracts.sh

echo 'Writing empty ballot tree root contract'
./scripts/writeEmptyBallotRoots.sh $1
./scripts/writeEmptyBallotRoots.sh

echo 'Building contracts with Hardhat'
npx hardhat compile
Expand Down
3 changes: 1 addition & 2 deletions contracts/scripts/writeEmptyBallotRoots.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ set -e
cd "$(dirname "$0")"
cd ..

# take the stateTreeDepth as cli arg
npx ts-node ts/genEmptyBallotRootsContract.ts $1 > contracts/trees/EmptyBallotRoots.sol
npx ts-node ts/genEmptyBallotRootsContract.ts > contracts/trees/EmptyBallotRoots.sol
2 changes: 1 addition & 1 deletion contracts/ts/genEmptyBallotRootsContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const genEmptyBallotRootsContract = (): string => {
.toString();

// This hard-coded value should be consistent with the value of `stateTreeDepth` of MACI.sol
const stateTreeDepth = process.argv[2] ? Number.parseInt(process.argv[2], 10) : 10;
const stateTreeDepth = process.env.STATE_TREE_DEPTH ? Number.parseInt(process.env.STATE_TREE_DEPTH, 10) : 10;

let r = "";
for (let i = 1; i < 6; i += 1) {
Expand Down

0 comments on commit e45c136

Please sign in to comment.