-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add tests for paymaster contracts using era-test-node-action #15
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: run | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
jobs: | ||
tests: | ||
name: unit-tests | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest] | ||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run Era Test Node | ||
uses: dutterbutter/era-test-node-action@latest | ||
|
||
- name: Install Dependencies | ||
run: yarn install | ||
|
||
- name: Run Tests | ||
run: | | ||
yarn ci:tests | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: We should consider always printing out the logs of
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think if a job fails it would be best the user updates the action to use logs:debug and then make use of the log file (either There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Up to you really, but I'd also prefer the CI showing test logs by default |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,37 +5,48 @@ import "@matterlabs/hardhat-zksync-solc"; | |
import "@matterlabs/hardhat-zksync-verify"; | ||
import "@nomiclabs/hardhat-etherscan"; | ||
|
||
// dynamically changes endpoints for local tests | ||
const zkSyncTestnet = | ||
process.env.NODE_ENV == "test" | ||
? { | ||
const getNetworkConfig = () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like this, we should use this in other examples too come to think of it |
||
const env = process.env.DEPLOY_ENV || "local"; | ||
switch (env) { | ||
case "local": | ||
return { | ||
url: "http://localhost:3050", | ||
ethNetwork: "http://localhost:8545", | ||
zksync: true, | ||
// Verification endpoint for Goerli | ||
verifyURL: | ||
"https://zksync2-testnet-explorer.zksync.dev/contract_verification", | ||
} | ||
: { | ||
}; | ||
case "ci": | ||
return { | ||
url: "http://127.0.0.1:8011", | ||
ethNetwork: "goerli", | ||
zksync: true, | ||
}; | ||
case "testnet": | ||
return { | ||
url: "https://zksync2-testnet.zksync.dev", | ||
ethNetwork: "goerli", | ||
zksync: true, | ||
// Verification endpoint for Goerli | ||
verifyURL: | ||
"https://zksync2-testnet-explorer.zksync.dev/contract_verification", | ||
}; | ||
default: | ||
throw new Error(`Unsupported DEPLOY_ENV: ${env}`); | ||
} | ||
}; | ||
|
||
const networkConfig = getNetworkConfig(); | ||
|
||
const config: HardhatUserConfig = { | ||
zksolc: { | ||
version: "latest", // can be defined like 1.3.x | ||
version: "latest", | ||
settings: {}, | ||
}, | ||
defaultNetwork: "zkSyncTestnet", | ||
networks: { | ||
hardhat: { | ||
zksync: false, | ||
}, | ||
zkSyncTestnet, | ||
zkSyncTestnet: networkConfig, | ||
}, | ||
solidity: { | ||
version: "0.8.17", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your steps have such nice capitalised titles and this one's just called "run" 😆