Skip to content

Commit

Permalink
fix: starting point for tests that required stake deposit
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmardefago committed Mar 18, 2024
1 parent f177eb0 commit 34da68f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
5 changes: 4 additions & 1 deletion tests/curation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,15 @@ 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(() => {
// We need epoch length and delegation ratio to be nonzero for these tests
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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/gns.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 10 additions & 1 deletion tests/staking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 34da68f

Please sign in to comment.