Skip to content

Commit

Permalink
abstracting networks away
Browse files Browse the repository at this point in the history
  • Loading branch information
signorecello committed Feb 19, 2024
1 parent 9755d0a commit fab501a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 26 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/vite_hardhat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,5 @@ jobs:
run: yarn --immutable
shell: bash

- name: 'Create env file'
run: |
touch .env
echo SEPOLIA_ALCHEMY_KEY="${{ secrets.SEPOLIA_ALCHEMY_KEY }}" >> .env
echo SEPOLIA_DEPLOYER_PRIVATE_KEY="${{ secrets.SEPOLIA_DEPLOYER_PRIVATE_KEY }}" >> .env
echo MUMBAI_ALCHEMY_KEY"=${{ secrets.MUMBAI_ALCHEMY_KEY }}" >> .env
echo MUMBAI_DEPLOYER_PRIVATE_KEY="${{ secrets.MUMBAI_DEPLOYER_PRIVATE_KEY }}" >> .env
- name: Run test
run: yarn test
12 changes: 1 addition & 11 deletions .github/workflows/vite_hardhat_nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,8 @@ jobs:
@noir-lang/noir_wasm@${{ matrix.version }} \
@noir-lang/types@${{ matrix.version }}
- name: 'Create env file'
run: |
touch .env
echo SEPOLIA_ALCHEMY_KEY="${{ secrets.SEPOLIA_ALCHEMY_KEY }}" >> .env
echo SEPOLIA_DEPLOYER_PRIVATE_KEY="${{ secrets.SEPOLIA_DEPLOYER_PRIVATE_KEY }}" >> .env
echo MUMBAI_ALCHEMY_KEY"=${{ secrets.MUMBAI_ALCHEMY_KEY }}" >> .env
echo MUMBAI_DEPLOYER_PRIVATE_KEY="${{ secrets.MUMBAI_DEPLOYER_PRIVATE_KEY }}" >> .env
- name: Generate verifier contract
run: |
nargo codegen-verifier
working-directory: vite-hardhat/circuits
run: yarn prep

- name: Run test
run: yarn test
Expand Down
20 changes: 14 additions & 6 deletions vite-hardhat/hardhat.config.cts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,24 @@ const config: HardhatUserConfig = {
localhost: {
url: 'http://127.0.0.1:8545',
},
hardhat: {
mining: {
auto: true,
interval: 1000,
},
},
},
paths: {
sources: './circuit',
},
};

if (process.env.MUMBAI_ALCHEMY_KEY && config.networks) {
config.networks.mumbai = {
url: `https://polygon-mumbai.g.alchemy.com/v2/${process.env.MUMBAI_ALCHEMY_KEY}`,
accounts: [process.env.MUMBAI_DEPLOYER_PRIVATE_KEY as string],
};
}

if (process.env.SEPOLIA_ALCHEMY_KEY && config.networks) {
config.networks.sepolia = {
url: `https://eth-sepolia.g.alchemy.com/v2/${process.env.SEPOLIA_ALCHEMY_KEY}`,
accounts: [process.env.SEPOLIA_DEPLOYER_PRIVATE_KEY as string],
};
}

export default config;
2 changes: 1 addition & 1 deletion vite-hardhat/utils/addresses.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"chainId":31337,"verifier":"0x7a2088a1bfc9d81c55368ae168c2c02570cb814f"}
{"chainId":31337,"verifier":"0x9fe46736679d2d9a65f0992f2272de9f3c7fa6e0"}

0 comments on commit fab501a

Please sign in to comment.