From 34da68fb3b5179c2e433e4f6ce740abfee346259 Mon Sep 17 00:00:00 2001 From: juanmardefago Date: Fri, 15 Mar 2024 02:54:14 -0300 Subject: [PATCH] fix: starting point for tests that required stake deposit --- tests/curation.test.ts | 5 ++++- tests/gns.test.ts | 2 +- tests/staking.test.ts | 11 ++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/curation.test.ts b/tests/curation.test.ts index 51564ff..8e7729f 100644 --- a/tests/curation.test.ts +++ b/tests/curation.test.ts @@ -70,7 +70,7 @@ createMockedFunction(controllerAddress, 'getGovernor', 'getGovernor():(address)' // L2 graph network init EpochManager call createMockedFunction(graphAddress, 'blockNum', 'blockNum():(uint256)') .withArgs([]) - .returns([ethereum.Value.fromI32(1)]) + .returns([ethereum.Value.fromI32(5)]) describe('Signalled', () => { beforeAll(() => { @@ -78,6 +78,7 @@ describe('Signalled', () => { let graphNetwork = createOrLoadGraphNetwork(blockNumber, controllerAddress) graphNetwork.delegationRatio = delegationRatio graphNetwork.epochLength = epochLength + graphNetwork.lastLengthUpdateBlock = 1 graphNetwork.save() // When _stake is successfully run, before any event we are considering here can be emitted @@ -202,6 +203,7 @@ describe('Burned', () => { let graphNetwork = createOrLoadGraphNetwork(blockNumber, controllerAddress) graphNetwork.delegationRatio = delegationRatio graphNetwork.epochLength = epochLength + graphNetwork.lastLengthUpdateBlock = 1 graphNetwork.save() // When _stake is successfully run, before any event we are considering here can be emitted @@ -313,6 +315,7 @@ describe('ParameterUpdated', () => { let graphNetwork = createOrLoadGraphNetwork(blockNumber, controllerAddress) graphNetwork.delegationRatio = delegationRatio graphNetwork.epochLength = epochLength + graphNetwork.lastLengthUpdateBlock = 1 graphNetwork.save() // When _stake is successfully run, before any event we are considering here can be emitted diff --git a/tests/gns.test.ts b/tests/gns.test.ts index 0844534..05765bb 100644 --- a/tests/gns.test.ts +++ b/tests/gns.test.ts @@ -23,7 +23,7 @@ createMockedFunction(controllerAddress, 'getGovernor', 'getGovernor():(address)' // L2 graph network init EpochManager call createMockedFunction(graphAddress, 'blockNum', 'blockNum():(uint256)') .withArgs([]) - .returns([ethereum.Value.fromI32(1)]) + .returns([ethereum.Value.fromI32(5)]) // CONSTANTS const blockNumber = BigInt.fromI32(1) diff --git a/tests/staking.test.ts b/tests/staking.test.ts index df1e05b..3f34527 100644 --- a/tests/staking.test.ts +++ b/tests/staking.test.ts @@ -109,7 +109,7 @@ createMockedFunction(controllerAddress, 'getGovernor', 'getGovernor():(address)' // L2 graph network init EpochManager call createMockedFunction(graphAddress, 'blockNum', 'blockNum():(uint256)') .withArgs([]) - .returns([ethereum.Value.fromI32(1)]) + .returns([ethereum.Value.fromI32(5)]) // INDEXER STAKE RELATED TESTS describe('INDEXER STAKE', () => { @@ -180,6 +180,7 @@ describe('INDEXER STAKE', () => { let graphNetwork = createOrLoadGraphNetwork(blockNumber, controllerAddress) graphNetwork.delegationRatio = delegationRatio graphNetwork.epochLength = epochLength + graphNetwork.lastLengthUpdateBlock = 1 graphNetwork.save() // When _stake is successfully run, before any event we are considering here can be emitted @@ -233,6 +234,7 @@ describe('INDEXER STAKE', () => { let graphNetwork = createOrLoadGraphNetwork(blockNumber, controllerAddress) graphNetwork.delegationRatio = delegationRatio graphNetwork.epochLength = epochLength + graphNetwork.lastLengthUpdateBlock = 1 graphNetwork.save() // When _stake is successfully run, before any event we are considering here can be emitted @@ -282,6 +284,7 @@ describe('INDEXER STAKE', () => { let graphNetwork = createOrLoadGraphNetwork(blockNumber, controllerAddress) graphNetwork.delegationRatio = delegationRatio graphNetwork.epochLength = epochLength + graphNetwork.lastLengthUpdateBlock = 1 graphNetwork.save() // When _stake is successfully run, before any event we are considering here can be emitted @@ -342,6 +345,7 @@ describe('INDEXER STAKE', () => { let graphNetwork = createOrLoadGraphNetwork(blockNumber, controllerAddress) graphNetwork.delegationRatio = delegationRatio graphNetwork.epochLength = epochLength + graphNetwork.lastLengthUpdateBlock = 1 graphNetwork.save() // When _stake is successfully run, before any event we are considering here can be emitted @@ -382,6 +386,7 @@ describe('DELEGATOR STAKE', () => { let graphNetwork = createOrLoadGraphNetwork(blockNumber, controllerAddress) graphNetwork.delegationRatio = delegationRatio graphNetwork.epochLength = epochLength + graphNetwork.lastLengthUpdateBlock = 1 graphNetwork.save() // When _stake is successfully run, before any event we are considering here can be emitted @@ -453,6 +458,7 @@ describe('DELEGATOR STAKE', () => { let graphNetwork = createOrLoadGraphNetwork(blockNumber, controllerAddress) graphNetwork.delegationRatio = delegationRatio graphNetwork.epochLength = epochLength + graphNetwork.lastLengthUpdateBlock = 1 graphNetwork.save() // When _stake is successfully run, before any event we are considering here can be emitted @@ -543,6 +549,7 @@ describe('DELEGATOR STAKE', () => { let graphNetwork = createOrLoadGraphNetwork(blockNumber, controllerAddress) graphNetwork.delegationRatio = delegationRatio graphNetwork.epochLength = epochLength + graphNetwork.lastLengthUpdateBlock = 1 graphNetwork.save() // When _stake is successfully run, before any event we are considering here can be emitted @@ -600,6 +607,7 @@ describe('ALLOCATION LIFE CYCLE', () => { let graphNetwork = createOrLoadGraphNetwork(blockNumber, controllerAddress) graphNetwork.delegationRatio = delegationRatio graphNetwork.epochLength = epochLength + graphNetwork.lastLengthUpdateBlock = 1 graphNetwork.save() // When _stake is successfully run, before any event we are considering here can be emitted @@ -670,6 +678,7 @@ describe('ALLOCATION LIFE CYCLE', () => { let graphNetwork = createOrLoadGraphNetwork(blockNumber, controllerAddress) graphNetwork.delegationRatio = delegationRatio graphNetwork.epochLength = epochLength + graphNetwork.lastLengthUpdateBlock = 1 graphNetwork.save() // When _stake is successfully run, before any event we are considering here can be emitted