Skip to content

ci: run e2e on local nitro node #711

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

Merged
merged 7 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,12 @@ jobs:
- name: Install packages
run: yarn install --non-interactive --frozen-lockfile
- name: Run e2e tests
run: ADDRESS_BOOK=addresses.json yarn test:e2e
run: |
git clone https://github.com/edgeandnode/nitro
pushd nitro
git checkout ci
git submodule update --init --recursive
./test-node.bash --init --no-blockscout --detach
popd
NETWORK=localnitrol1 ADDRESS_BOOK=addresses.json GRAPH_CONFIG=config/graph.localhost.yml yarn test:e2e
NETWORK=localnitrol2 ADDRESS_BOOK=addresses.json GRAPH_CONFIG=config/graph.arbitrum-localhost.yml yarn test:e2e
7 changes: 1 addition & 6 deletions e2e/deployment/config/graphToken.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { NamedAccounts } from '../../../gre/type-extensions'
describe('GraphToken configuration', () => {
const {
getNamedAccounts,
contracts: { GraphToken, RewardsManager },
contracts: { GraphToken },
getDeployer,
} = hre.graph()

Expand All @@ -25,9 +25,4 @@ describe('GraphToken configuration', () => {
const deployerIsMinter = await GraphToken.isMinter(deployer.address)
expect(deployerIsMinter).eq(false)
})

it('RewardsManager should be minter', async function () {
const deployerIsMinter = await GraphToken.isMinter(RewardsManager.address)
expect(deployerIsMinter).eq(true)
})
})
31 changes: 31 additions & 0 deletions e2e/deployment/config/l1/graphToken.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'
import { expect } from 'chai'
import hre from 'hardhat'
import GraphChain from '../../../../gre/helpers/network'

describe('[L1] GraphToken', () => {
const graph = hre.graph()
const { GraphToken, RewardsManager } = graph.contracts

let unauthorized: SignerWithAddress

before(async function () {
if (GraphChain.isL2(graph.chainId)) this.skip()
unauthorized = (await graph.getTestAccounts())[0]
})

describe('calls with unauthorized user', () => {
it('mint should revert', async function () {
const tx = GraphToken.connect(unauthorized).mint(
unauthorized.address,
'1000000000000000000000',
)
await expect(tx).revertedWith('Only minter can call')
})

it('RewardsManager should be minter', async function () {
const rewardsMgrIsMinter = await GraphToken.isMinter(RewardsManager.address)
expect(rewardsMgrIsMinter).eq(true)
})
})
})
7 changes: 6 additions & 1 deletion e2e/deployment/config/l2/l2GraphToken.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import GraphChain from '../../../../gre/helpers/network'

describe('[L2] L2GraphToken', () => {
const graph = hre.graph()
const { L2GraphToken } = graph.contracts
const { L2GraphToken, RewardsManager } = graph.contracts

let unauthorized: SignerWithAddress

Expand Down Expand Up @@ -35,5 +35,10 @@ describe('[L2] L2GraphToken', () => {
const tx = L2GraphToken.connect(unauthorized).setGateway(unauthorized.address)
await expect(tx).revertedWith('Only Governor can call')
})

it('RewardsManager should not be minter (for now)', async function () {
const rewardsMgrIsMinter = await L2GraphToken.isMinter(RewardsManager.address)
expect(rewardsMgrIsMinter).eq(false)
})
})
})