@@ -3,7 +3,7 @@ import { expect } from 'chai'
3
3
import { HDNodeWallet } from 'ethers'
4
4
import hre from 'hardhat'
5
5
6
- import { encodeCollectData , encodeStartServiceData , generatePOI , getSignedRAVCalldata , getSignerProof , PaymentTypes } from '@graphprotocol/toolshed'
6
+ import { encodeCollectData , encodeStartServiceData , generateAllocationProof , generatePOI , getSignedRAVCalldata , getSignerProof , PaymentTypes } from '@graphprotocol/toolshed'
7
7
import { GraphPayments , GraphTallyCollector , HorizonStaking } from '@graphprotocol/horizon'
8
8
import { IGraphToken , IPaymentsEscrow , SubgraphService } from '../../../../typechain-types'
9
9
import { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers'
@@ -29,7 +29,7 @@ describe('Indexer', () => {
29
29
let subgraphServiceAddress : string
30
30
31
31
const graph = hre . graph ( )
32
- const { collect, generateAllocationProof } = graph . subgraphService . actions
32
+ const { collect } = graph . subgraphService . actions
33
33
34
34
before ( async ( ) => {
35
35
// Get contracts
@@ -110,7 +110,7 @@ describe('Indexer', () => {
110
110
const beforeLockedTokens = await subgraphService . allocationProvisionTracker ( indexer . address )
111
111
112
112
// Build allocation proof
113
- const signature = await generateAllocationProof ( allocationPrivateKey , [ indexer . address , allocationId ] )
113
+ const signature = await generateAllocationProof ( indexer . address , allocationPrivateKey , subgraphServiceAddress , chainId )
114
114
115
115
// Attempt to create an allocation with the same ID
116
116
const data = encodeStartServiceData ( subgraphDeploymentId , allocationTokens , allocationId , signature )
@@ -134,7 +134,7 @@ describe('Indexer', () => {
134
134
135
135
it ( 'should be able to start an allocation with zero tokens' , async ( ) => {
136
136
// Build allocation proof
137
- const signature = await generateAllocationProof ( allocationPrivateKey , [ indexer . address , allocationId ] )
137
+ const signature = await generateAllocationProof ( indexer . address , allocationPrivateKey , subgraphServiceAddress , chainId )
138
138
139
139
// Attempt to create an allocation with the same ID
140
140
const data = encodeStartServiceData ( subgraphDeploymentId , 0n , allocationId , signature )
@@ -154,7 +154,7 @@ describe('Indexer', () => {
154
154
155
155
it ( 'should not start an allocation without enough tokens' , async ( ) => {
156
156
// Build allocation proof
157
- const signature = await generateAllocationProof ( allocationPrivateKey , [ indexer . address , allocationId ] )
157
+ const signature = await generateAllocationProof ( indexer . address , allocationPrivateKey , subgraphServiceAddress , chainId )
158
158
159
159
// Build allocation data
160
160
const allocationTokens = provisionTokens + ethers . parseEther ( '10000000' )
@@ -384,7 +384,7 @@ describe('Indexer', () => {
384
384
allocationPrivateKey = wallet . privateKey
385
385
subgraphDeploymentId = indexers [ 0 ] . allocations [ 0 ] . subgraphDeploymentID
386
386
const allocationTokens = availableTokens - lockedTokens
387
- const signature = await generateAllocationProof ( allocationPrivateKey , [ indexer . address , allocationId ] )
387
+ const signature = await generateAllocationProof ( indexer . address , allocationPrivateKey , subgraphServiceAddress , chainId )
388
388
const data = encodeStartServiceData ( subgraphDeploymentId , allocationTokens , allocationId , signature )
389
389
await subgraphService . connect ( indexer ) . startService (
390
390
indexer . address ,
0 commit comments