changeTreeHeight script
This commit is contained in:
parent
0cabd318cd
commit
bf5581f764
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
@ -15,8 +15,9 @@ jobs:
|
|||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12
|
node-version: 12
|
||||||
- run: yarn install
|
|
||||||
- run: cargo install zkutil
|
- run: cargo install zkutil
|
||||||
|
- run: yarn install
|
||||||
|
- run: yarn changeTreeHeight 2
|
||||||
- run: yarn circuit
|
- run: yarn circuit
|
||||||
- run: yarn test
|
- run: yarn test
|
||||||
- run: yarn lint
|
- run: yarn lint
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
pragma solidity ^0.6.0;
|
pragma solidity ^0.6.0;
|
||||||
|
|
||||||
contract Pack {
|
contract Pack {
|
||||||
uint256 public constant CHUNK_TREE_HEIGHT = 7;
|
uint256 public constant CHUNK_TREE_HEIGHT = 8;
|
||||||
uint256 public constant CHUNK_SIZE = 2**CHUNK_TREE_HEIGHT;
|
uint256 public constant CHUNK_SIZE = 2**CHUNK_TREE_HEIGHT;
|
||||||
uint256 public constant ITEM_SIZE = 32 + 20 + 4;
|
uint256 public constant ITEM_SIZE = 32 + 20 + 4;
|
||||||
uint256 public constant BYTES_SIZE = CHUNK_SIZE * ITEM_SIZE;
|
uint256 public constant BYTES_SIZE = CHUNK_SIZE * ITEM_SIZE;
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"prettier:check": "prettier --check . --config .prettierrc",
|
"prettier:check": "prettier --check . --config .prettierrc",
|
||||||
"prettier:fix": "prettier --write . --config .prettierrc",
|
"prettier:fix": "prettier --write . --config .prettierrc",
|
||||||
"lint": "yarn eslint && yarn prettier:check",
|
"lint": "yarn eslint && yarn prettier:check",
|
||||||
|
"changeTreeHeight": "scripts/changeTreeHeight.sh",
|
||||||
"circuit:batchTreeUpdate": "scripts/buildCircuit.sh BatchTreeUpdate",
|
"circuit:batchTreeUpdate": "scripts/buildCircuit.sh BatchTreeUpdate",
|
||||||
"circuit:batchTreeUpdateLarge": "scripts/buildCircuit.sh BatchTreeUpdate large",
|
"circuit:batchTreeUpdateLarge": "scripts/buildCircuit.sh BatchTreeUpdate large",
|
||||||
"circuit:batchTreeUpdateWitness": "scripts/buildWitness.sh BatchTreeUpdate",
|
"circuit:batchTreeUpdateWitness": "scripts/buildWitness.sh BatchTreeUpdate",
|
||||||
|
7
scripts/changeTreeHeight.sh
Executable file
7
scripts/changeTreeHeight.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
case $(sed --help 2>&1) in
|
||||||
|
*GNU*) sed_i () { xargs sed -i "$@"; };;
|
||||||
|
*) sed_i () { xargs sed -i '' "$@"; };;
|
||||||
|
esac
|
||||||
|
|
||||||
|
grep -l --exclude-dir={.git,node_modules,artifacts} -r "CHUNK_TREE_HEIGHT = [0-9]" . | sed_i "s/CHUNK_TREE_HEIGHT = [0-9]/CHUNK_TREE_HEIGHT = ${1}/g"
|
@ -13,7 +13,7 @@ const hashes = [
|
|||||||
'0x57f7b90a3cb4ea6860e6dd5fa44ac4f53ebe6ae3948af577a01ef51738313246',
|
'0x57f7b90a3cb4ea6860e6dd5fa44ac4f53ebe6ae3948af577a01ef51738313246',
|
||||||
]
|
]
|
||||||
|
|
||||||
const CHUNK_TREE_HEIGHT = 7
|
const CHUNK_TREE_HEIGHT = 8
|
||||||
describe.skip('Pack', () => {
|
describe.skip('Pack', () => {
|
||||||
it('should work', async () => {
|
it('should work', async () => {
|
||||||
const Pack = await ethers.getContractFactory('Pack')
|
const Pack = await ethers.getContractFactory('Pack')
|
||||||
|
Loading…
Reference in New Issue
Block a user