Skip to content

Commit 02c1681

Browse files
committed
tests: add additional test for GNS
1 parent d60e5a1 commit 02c1681

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/gns.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,23 @@ describe('GNS', () => {
10231023
await expect(tx).revertedWith('Caller must be Controller governor')
10241024
})
10251025

1026+
it('should revert if batching a call to initialize', async function () {
1027+
// Call a forbidden function
1028+
const tx1 = await gns.populateTransaction.initialize(me.address, me.address, me.address)
1029+
1030+
// Create a subgraph
1031+
const tx2 = await gns.populateTransaction.publishNewSubgraph(
1032+
me.address,
1033+
subgraph0.subgraphDeploymentID,
1034+
subgraph0.versionMetadata,
1035+
subgraph0.subgraphMetadata,
1036+
)
1037+
1038+
// Batch send transaction
1039+
const tx = gns.connect(me.signer).multicall([tx1.data, tx2.data])
1040+
await expect(tx).revertedWith('Caller must be the implementation')
1041+
})
1042+
10261043
it('should revert if trying to call a private function', async function () {
10271044
// Craft call a private function
10281045
const hash = ethers.utils.id('_setOwnerTaxPercentage(uint32)')

0 commit comments

Comments
 (0)