@@ -2,7 +2,6 @@ import { keccak256, toUtf8Bytes } from 'ethers'
2
2
import { task } from 'hardhat/config'
3
3
4
4
import { DisputeManager , SubgraphService } from '../../typechain-types'
5
- import { generateAllocationProof , HorizonStakingActions } from 'hardhat-graph-protocol/sdk'
6
5
import { IHorizonStaking } from '@graphprotocol/horizon'
7
6
8
7
import { indexers } from './fixtures/indexers'
@@ -11,9 +10,10 @@ task('test:post-upgrade', 'Test the post-upgrade state for integration tests')
11
10
. setAction ( async ( _ , hre ) => {
12
11
// Get contracts
13
12
const graph = hre . graph ( )
14
- const horizonStaking = graph . horizon ! . contracts . HorizonStaking as unknown as IHorizonStaking
15
- const subgraphService = graph . subgraphService ! . contracts . SubgraphService as unknown as SubgraphService
16
- const disputeManager = graph . subgraphService ! . contracts . DisputeManager as unknown as DisputeManager
13
+ const { generateAllocationProof } = graph . subgraphService . actions
14
+ const horizonStaking = graph . horizon . contracts . HorizonStaking as unknown as IHorizonStaking
15
+ const subgraphService = graph . subgraphService . contracts . SubgraphService as unknown as SubgraphService
16
+ const disputeManager = graph . subgraphService . contracts . DisputeManager as unknown as DisputeManager
17
17
18
18
// Get configs
19
19
const disputePeriod = await disputeManager . getDisputePeriod ( )
@@ -54,14 +54,7 @@ task('test:post-upgrade', 'Test the post-upgrade state for integration tests')
54
54
console . log ( `Creating subgraph service provision for indexer: ${ indexer . address } ` )
55
55
56
56
const indexerSigner = await hre . ethers . getSigner ( indexer . address )
57
- await HorizonStakingActions . createProvision ( {
58
- horizonStaking,
59
- serviceProvider : indexerSigner ,
60
- verifier : await subgraphService . getAddress ( ) ,
61
- tokens : indexer . provisionTokens ,
62
- maxVerifierCut : maxSlashingCut ,
63
- thawingPeriod : disputePeriod ,
64
- } )
57
+ await horizonStaking . connect ( indexerSigner ) . provision ( indexer . address , await subgraphService . getAddress ( ) , indexer . provisionTokens , maxSlashingCut , disputePeriod )
65
58
66
59
console . log ( `Provision created for indexer with ${ indexer . provisionTokens } tokens` )
67
60
@@ -94,7 +87,7 @@ task('test:post-upgrade', 'Test the post-upgrade state for integration tests')
94
87
console . log ( `Starting allocation: ${ allocation . allocationID } ` )
95
88
96
89
// Build allocation proof
97
- const signature = await generateAllocationProof ( subgraphService , indexer . address , allocation . allocationPrivateKey )
90
+ const signature = await generateAllocationProof ( allocation . allocationPrivateKey , [ indexer . address , allocation . allocationID ] )
98
91
const subgraphDeploymentId = allocation . subgraphDeploymentID
99
92
const allocationTokens = allocation . tokens
100
93
const allocationId = allocation . allocationID
0 commit comments