Skip to content

Commit

Permalink
➕ Add Plume Main Network Configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
  • Loading branch information
pcaversaccio committed Dec 18, 2024
1 parent 53e48de commit 89791f5
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 60 deletions.
37 changes: 27 additions & 10 deletions .github/workflows/test-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,32 +132,49 @@ jobs:
with:
version: nightly

- name: Show the Foundry default config
run: forge config
env:
FOUNDRY_PROFILE: default
- name: Set up LCOV
uses: hrishikesh-kadam/setup-lcov@v1
with:
ref: v2.2

- name: Run coverage
run: NO_COLOR=1 forge coverage --report summary --report lcov >> $GITHUB_STEP_SUMMARY
run: NO_COLOR=1 forge coverage --report summary --report lcov --lcov-version 2.2 >> $GITHUB_STEP_SUMMARY
env:
FOUNDRY_PROFILE: default

- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1

# See https://github.com/ScopeLift/foundry-template/blob/fd3875d2e99a65dec19431723d6516b4ed76746e/.github/workflows/ci.yml#L49-L78.
- name: Remove unnecessary directories
run: lcov --remove lcov.info 'test/*' 'script/*' 'node_modules/*' --output-file lcov.info --rc lcov_branch_coverage=1
run: lcov --branch-coverage --remove lcov.info 'test/*' 'script/*' 'node_modules/*' --output-file lcov.info --ignore-errors unused,unused

- name: Post coverage report
if: ${{ (github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request') }}
uses: sunsergdev/lcov-reporter-action@v0.3.1-fork
uses: romeovs/lcov-reporter-action@v0.4.0
with:
title: "Test Coverage Report"
delete-old-comments: true
lcov-file: ./lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}

# The following steps act as a temporary workaround, as LCOV `2.2` is not yet supported
# in `zgosalvez/github-actions-report-lcov@v4`: https://github.com/zgosalvez/github-actions-report-lcov/issues/168.
- name: Set up LCOV `1.16`
run: |
wget https://github.com/linux-test-project/lcov/releases/download/v1.16/lcov-1.16.tar.gz
tar -xzf lcov-1.16.tar.gz
cd lcov-1.16
sudo make install
lcov --version
sudo rm -rf lcov-1.16.tar.gz lcov-1.16
- name: Run coverage using LCOV `1.16`
run: forge coverage --report lcov --lcov-version 1.16
env:
FOUNDRY_PROFILE: default

# See https://github.com/ScopeLift/foundry-template/blob/fd3875d2e99a65dec19431723d6516b4ed76746e/.github/workflows/ci.yml#L49-L78.
- name: Remove unnecessary `test` directory
run: lcov --remove lcov.info 'test/*' 'script/*' 'node_modules/*' --output-file lcov.info --rc lcov_branch_coverage=1

- name: Verify minimum coverage
uses: zgosalvez/github-actions-report-lcov@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion contracts/lib/forge-std
Submodule forge-std updated 2 files
+19 −0 src/Vm.sol
+1 −1 test/Vm.t.sol
17 changes: 16 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,12 @@ const config: HardhatUserConfig = {
accounts,
ledgerAccounts,
},
plumeMain: {
chainId: 98865,
url: vars.get("PLUME_MAINNET_URL", "https://rpc.plumenetwork.xyz"),
accounts,
ledgerAccounts,
},
unichainTestnet: {
chainId: 1301,
url: vars.get("UNICHAIN_TESTNET_URL", " https://sepolia.unichain.org"),
Expand Down Expand Up @@ -1196,7 +1202,8 @@ const config: HardhatUserConfig = {
// For World Chain testnet & mainnet
worldChain: vars.get("WORLD_CHAIN_API_KEY", ""),
worldChainTestnet: vars.get("WORLD_CHAIN_API_KEY", ""),
// For Plume testnet
// For Plume testnet & mainnet
plume: vars.get("PLUME_API_KEY", ""),
plumeTestnet: vars.get("PLUME_API_KEY", ""),
// For Unichain testnet
unichainTestnet: vars.get("UNICHAIN_API_KEY", ""),
Expand Down Expand Up @@ -1879,6 +1886,14 @@ const config: HardhatUserConfig = {
browserURL: "https://worldchain-sepolia.explorer.alchemy.com",
},
},
{
network: "plume",
chainId: 98865,
urls: {
apiURL: "https://explorer.plumenetwork.xyz/api",
browserURL: "https://explorer.plumenetwork.xyz",
},
},
{
network: "plumeTestnet",
chainId: 98864,
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"clean": "npx hardhat clean && forge clean",
"snapshot": "forge snapshot --out forge-artifacts",
"coverage:hh": "npx hardhat coverage",
"coverage:forge": "forge coverage --report summary",
"coverage:forge:report": "forge coverage --report lcov && lcov --remove lcov.info \"test/*\" \"script/*\" \"node_modules/*\" --output-file lcov.info --rc lcov_branch_coverage=1 && genhtml lcov.info --branch-coverage --output-dir coverage",
"coverage:forge": "forge coverage --report summary --out forge-artifacts --lcov-version 2.2",
"coverage:forge:report": "forge coverage --report lcov --out forge-artifacts --lcov-version 2.2 && lcov --branch-coverage --remove lcov.info \"test/*\" \"script/*\" \"node_modules/*\" --output-file lcov.info --ignore-errors unused,unused && genhtml lcov.info --branch-coverage --output-dir coverage",
"test:hh": "npx hardhat test",
"test:forge": "forge test -vvv --root . -C contracts/src --match-path \"contracts/test/*\" --out forge-artifacts",
"compile": "npx hardhat compile && forge build --root . -C contracts/src --optimize --out forge-artifacts",
Expand Down Expand Up @@ -183,12 +183,12 @@
"@nomicfoundation/hardhat-chai-matchers": "^2.0.8",
"@nomicfoundation/hardhat-ethers": "^3.0.8",
"@nomicfoundation/hardhat-foundry": "^1.1.3",
"@nomicfoundation/hardhat-ignition": "^0.15.8",
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.8",
"@nomicfoundation/hardhat-ignition": "^0.15.9",
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.9",
"@nomicfoundation/hardhat-ledger": "^1.0.3",
"@nomicfoundation/hardhat-network-helpers": "^1.0.12",
"@nomicfoundation/hardhat-verify": "^2.0.12",
"@nomicfoundation/ignition-core": "^0.15.8",
"@nomicfoundation/ignition-core": "^0.15.9",
"@openzeppelin/contracts": "^5.1.0",
"@tenderly/hardhat-tenderly": "^2.5.1",
"@truffle/dashboard-hardhat-plugin": "^0.2.15",
Expand Down
Loading

0 comments on commit 89791f5

Please sign in to comment.