-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix colorscheme fix banner aztec logo prettier working? add api endpoint switch to cjs file parse contract functions, but no working form delete unneeded text comments slightly cleaner form slightly better css fix: Remove automatic update to `AztecProtocol/dev-bb.js` (#1712) Related to #1711 Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge. - [ ] If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag. - [ ] I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code. - [ ] Every change is related to the PR description. - [ ] I have [linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) this pull request to relevant issues (if any exist). git subrepo push --branch=master circuits/cpp/barretenberg subrepo: subdir: "circuits/cpp/barretenberg" merged: "d883900f9" upstream: origin: "https://github.com/AztecProtocol/barretenberg" branch: "master" commit: "d883900f9" git-subrepo: version: "0.4.6" origin: "???" commit: "???" chore: sync bb master (#1713) Ran: ``` ./scripts/git_subrepo.sh pull circuits/cpp/barretenberg git checkout origin/master -- .gitmodules ``` Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge. - [ ] If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag. - [ ] I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code. - [ ] Every change is related to the PR description. - [ ] I have [linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) this pull request to relevant issues (if any exist). copy the contract ABI into the new subdirectory fix output json name
- Loading branch information
Showing
27 changed files
with
502 additions
and
211 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -73,24 +73,6 @@ jobs: | |
cd ts | ||
yarn install && yarn && yarn build | ||
- name: Checkout destination repository | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: AztecProtocol/dev-bb.js | ||
path: ./dev-bb.js | ||
token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} | ||
|
||
- name: Push to destination repository | ||
run: | | ||
cd ./dev-bb.js | ||
cp -R ../ts/dest/* . | ||
git config --global user.name AztecBot | ||
git config --global user.email [email protected] | ||
git checkout -b dev || git checkout dev | ||
git add . | ||
git commit -m "Tracking changes" | ||
git push origin dev | ||
- name: Tar and GZip barretenberg.wasm | ||
run: tar -cvzf barretenberg.wasm.tar.gz cpp/build-wasm/bin/barretenberg.wasm | ||
|
||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
{".":"0.4.1","ts":"0.4.1"} | ||
{".":"0.4.2","ts":"0.4.2"} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
v0.4.1 x-release-please-version | ||
v0.4.2 x-release-please-version |
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
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
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 |
---|---|---|
@@ -1,91 +1,92 @@ | ||
// heavily inspired by https://github.com/trufflesuite/truffle/blob/develop/packages/box/lib/utils/unbox.ts | ||
import fetch from 'node-fetch'; | ||
import JSZip from 'jszip'; | ||
import { promises as fs } from 'fs'; | ||
import JSZip from 'jszip'; | ||
import fetch from 'node-fetch'; | ||
|
||
const GITHUB_OWNER = 'AztecProtocol'; | ||
const GITHUB_REPO = 'aztec-packages'; | ||
const NOIR_CONTRACTS_PATH = 'yarn-project/noir-contracts/src/contracts' | ||
const STARTER_KIT_PATH = 'yarn-project/starter-kit' | ||
const NOIR_CONTRACTS_PATH = 'yarn-project/noir-contracts/src/contracts'; | ||
const STARTER_KIT_PATH = 'yarn-project/starter-kit'; | ||
|
||
/** | ||
* Converts a contract name in "upper camel case" to a folder name in snake case. | ||
* @param contractName - The contract name. | ||
* @returns The folder name. | ||
* */ | ||
function contractNameToFolder(contractName: string): string { | ||
|
||
return contractName | ||
.replace(/[\w]([A-Z])/g, (m) => m[0] + "_" + m[1]) | ||
.toLowerCase(); | ||
export function contractNameToFolder(contractName: string): string { | ||
return contractName.replace(/[\w]([A-Z])/g, m => m[0] + '_' + m[1]).toLowerCase(); | ||
} | ||
|
||
/** | ||
* | ||
* | ||
* @param contractName - The contract name, in upper camel case. | ||
* @param outputPath - The output path, by default this is the current working directory | ||
* @returns The path to the downloaded contract. | ||
*/ | ||
export async function downloadContractFromGithub( | ||
contractName: string='PrivateToken', | ||
outputPath: string | ||
contractName: string = 'PrivateToken', | ||
outputPath: string, | ||
): Promise<void> { | ||
// small string conversion, in the ABI the contract name looks like PrivateToken | ||
// but in the repostory it looks like private_token | ||
const contractFolder = `${NOIR_CONTRACTS_PATH}/${contractNameToFolder(contractName)}_contract`; | ||
await _downloadNoirFilesFromGithub(contractFolder, outputPath); | ||
} | ||
// small string conversion, in the ABI the contract name looks like PrivateToken | ||
// but in the repostory it looks like private_token | ||
const contractFolder = `${NOIR_CONTRACTS_PATH}/${contractNameToFolder(contractName)}_contract`; | ||
await _downloadNoirFilesFromGithub(contractFolder, outputPath); | ||
} | ||
|
||
/** | ||
* Not flexible at at all, but quick fix to download a noir smart contract from our | ||
* monorepo on github. this will copy over the `yarn-projects/starter-kit` folder in its entirey | ||
* as well as the specfieid directoryPath, which should point to a single noir contract in | ||
* as well as the specfieid directoryPath, which should point to a single noir contract in | ||
* `yarn-projects/noir-contracts/src/contracts/...` | ||
* @param directoryPath - path to the directory in the github repo | ||
* @param outputPath - local path that we will copy the noir contracts and web3 starter kit to | ||
* @returns | ||
* @returns | ||
*/ | ||
async function _downloadNoirFilesFromGithub( | ||
directoryPath: string, | ||
outputPath: string, | ||
outputPrefix: string = 'starter-kit' | ||
directoryPath: string, | ||
outputPath: string, | ||
outputPrefix: string = 'starter-kit', | ||
): Promise<string> { | ||
const owner = GITHUB_OWNER; | ||
const repo = GITHUB_REPO; | ||
// Step 1: Fetch the ZIP from GitHub, hardcoded to the master branch | ||
const url = `https://github.com/${owner}/${repo}/archive/refs/heads/master.zip`; | ||
const response = await fetch(url); | ||
const buffer = await response.arrayBuffer(); | ||
const owner = GITHUB_OWNER; | ||
const repo = GITHUB_REPO; | ||
// Step 1: Fetch the ZIP from GitHub, hardcoded to the master branch | ||
const url = `https://github.com/${owner}/${repo}/archive/refs/heads/master.zip`; | ||
const response = await fetch(url); | ||
const buffer = await response.arrayBuffer(); | ||
|
||
// Step 2: Use JSZip to read the ZIP contents | ||
const zip = new JSZip(); | ||
const data = await zip.loadAsync(buffer); | ||
|
||
// Step 2: Use JSZip to read the ZIP contents | ||
const zip = new JSZip(); | ||
const data = await zip.loadAsync(buffer); | ||
// Step 3: Extract the specific directory from the ZIP | ||
const repoDirectoryPrefix = `${repo}-master/`; | ||
const fullDirectoryPath = `${repoDirectoryPrefix}${directoryPath}/`; | ||
const starterKitPath = `${repoDirectoryPrefix}${STARTER_KIT_PATH}/`; | ||
|
||
// Step 3: Extract the specific directory from the ZIP | ||
const repoDirectoryPrefix = `${repo}-master/`; | ||
const fullDirectoryPath = `${repoDirectoryPrefix}${directoryPath}/`; | ||
const starterKitPath = `${repoDirectoryPrefix}${STARTER_KIT_PATH}/`; | ||
const contractFiles = Object.values(data.files).filter(file => { | ||
return file.dir && (file.name.startsWith(fullDirectoryPath) || file.name.startsWith(starterKitPath)); | ||
}); | ||
|
||
const contractFiles = Object.values(data.files).filter(file => { | ||
return file.dir && (file.name.startsWith(fullDirectoryPath) || file.name.startsWith(starterKitPath)); | ||
}); | ||
|
||
for (const file of contractFiles) { | ||
// note that we strip out the entire "directoryPath"! | ||
const relativePath = file.name.replace(fullDirectoryPath, `${outputPrefix}/noir-contracts/`).replace(starterKitPath, `${outputPrefix}/`); | ||
const targetPath = `${outputPath}/${relativePath}`; | ||
await fs.mkdir(targetPath, { recursive: true }); | ||
} | ||
for (const file of contractFiles) { | ||
// note that we strip out the entire "directoryPath"! | ||
const relativePath = file.name | ||
.replace(fullDirectoryPath, `${outputPrefix}/noir-contracts/`) | ||
.replace(starterKitPath, `${outputPrefix}/`); | ||
const targetPath = `${outputPath}/${relativePath}`; | ||
await fs.mkdir(targetPath, { recursive: true }); | ||
} | ||
|
||
const directoryFiles = Object.values(data.files).filter(file => { | ||
return !file.dir && (file.name.startsWith(fullDirectoryPath) || file.name.startsWith(starterKitPath)); | ||
}); | ||
const directoryFiles = Object.values(data.files).filter(file => { | ||
return !file.dir && (file.name.startsWith(fullDirectoryPath) || file.name.startsWith(starterKitPath)); | ||
}); | ||
|
||
for (const file of directoryFiles) { | ||
const relativePath = file.name.replace(fullDirectoryPath, `${outputPrefix}/noir-contracts/`).replace(starterKitPath, `${outputPrefix}/`); | ||
const targetPath = `${outputPath}/${relativePath}`; | ||
const content = await file.async("nodebuffer"); | ||
await fs.writeFile(targetPath, content); | ||
} | ||
return Promise.resolve(`${outputPath}/${outputPrefix}`); | ||
for (const file of directoryFiles) { | ||
const relativePath = file.name | ||
.replace(fullDirectoryPath, `${outputPrefix}/noir-contracts/`) | ||
.replace(starterKitPath, `${outputPrefix}/`); | ||
const targetPath = `${outputPath}/${relativePath}`; | ||
const content = await file.async('nodebuffer'); | ||
await fs.writeFile(targetPath, content); | ||
} | ||
return Promise.resolve(`${outputPath}/${outputPrefix}`); | ||
} |
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 @@ | ||
module.exports = require('@aztec/foundation/eslint'); |
File renamed without changes.
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 |
---|---|---|
@@ -1,25 +1,46 @@ | ||
{ | ||
"name": "starter-kit", | ||
"version": "0.1.0", | ||
"private": true, | ||
"packageManager": "[email protected]", | ||
"type": "module", | ||
"exports": { | ||
"./prettier": "./.prettierrc.json" | ||
}, | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"build:dev": "tsc -b --watch", | ||
"start": "next start", | ||
"lint": "next lint" | ||
"clean": "rm -rf ./dest .tsbuildinfo", | ||
"prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", | ||
"prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", | ||
"prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write", | ||
"formatting": "run -T prettier --check ./src && run -T eslint ./src", | ||
"formatting:fix": "run -T prettier -w ./src" | ||
}, | ||
"inherits": [ | ||
"../package.common.json", | ||
"./package.local.json" | ||
], | ||
"dependencies": { | ||
"@aztec/aztec.js": "0.1.0", | ||
"@aztec/foundation": "0.1.0", | ||
"@types/node": "20.5.1", | ||
"@types/react": "18.2.20", | ||
"@types/react-dom": "18.2.7", | ||
"autoprefixer": "10.4.15", | ||
"eslint": "8.47.0", | ||
"eslint-config-next": "13.4.19", | ||
"formik": "^2.4.3", | ||
"next": "13.4.19", | ||
"postcss": "8.4.28", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"tailwindcss": "3.3.3", | ||
"typescript": "5.1.6" | ||
"typescript": "5.1.6", | ||
"yup": "^1.2.0" | ||
}, | ||
"engines": { | ||
"node": ">=18" | ||
} | ||
} |
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.