Skip to content

Commit b60f396

Browse files
pcarranzavclaude
andcommitted
feat: complete DIPs integration with ethers v6 migration
- Updated all DIPs-related code to use ethers v6 API - Migrated from BigNumberish to bigint for all numeric operations - Fixed provider and signer initialization patterns - Updated test suite to use new ethers v6 patterns - Removed temporary migration documentation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 63204cb commit b60f396

File tree

6 files changed

+26
-262
lines changed

6 files changed

+26
-262
lines changed

REBASE_STRATEGY.md

Lines changed: 0 additions & 232 deletions
This file was deleted.

packages/indexer-common/src/indexer-management/monitor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,9 @@ export class NetworkMonitor {
684684
return {
685685
id: new SubgraphDeploymentID(ipfsHash),
686686
deniedAt: 1, // We assume the deployment won't be eligible for rewards if it's not found
687-
stakedTokens: BigNumber.from(0),
688-
signalledTokens: BigNumber.from(0),
689-
queryFeesAmount: BigNumber.from(0),
687+
stakedTokens: 0n,
688+
signalledTokens: 0n,
689+
queryFeesAmount: 0n,
690690
protocolNetwork: this.networkCAIPID,
691691
}
692692
}

packages/indexer-common/src/indexer-management/resolvers/allocations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ export default {
15411541
await allocationManager.dipsManager.tryUpdateAgreementAllocation(
15421542
deployment,
15431543
null,
1544-
toAddress(createAllocationEventLogs.allocationID),
1544+
toAddress(allocationId),
15451545
)
15461546
}
15471547

@@ -1852,7 +1852,7 @@ export default {
18521852
await allocationManager.dipsManager.tryUpdateAgreementAllocation(
18531853
allocationData.subgraphDeployment.id.toString(),
18541854
toAddress(allocation),
1855-
toAddress(createAllocationEventLogs.allocationID),
1855+
toAddress(newAllocationId),
18561856
)
18571857
}
18581858

packages/indexer-common/src/indexing-fees/__tests__/dips.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
} from '@graphprotocol/common-ts'
3030
import { Sequelize } from 'sequelize'
3131
import { testNetworkSpecification } from '../../indexer-management/__tests__/util'
32-
import { BigNumber } from 'ethers'
3332
import { CollectPaymentStatus } from '@graphprotocol/dips-proto/generated/gateway'
3433

3534
// Make global Jest variables available
@@ -65,9 +64,9 @@ const mockSubgraphDeployment = (id: string) => {
6564
id: new SubgraphDeploymentID(id),
6665
ipfsHash: id,
6766
deniedAt: null,
68-
stakedTokens: BigNumber.from('1000'),
69-
signalledTokens: BigNumber.from('1000'),
70-
queryFeesAmount: BigNumber.from('0'),
67+
stakedTokens: 1000n,
68+
signalledTokens: 1000n,
69+
queryFeesAmount: 0n,
7170
protocolNetwork: 'eip155:421614',
7271
}
7372
}

packages/indexer-common/src/indexing-fees/dips.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {
3434
} from '@graphprotocol/dips-proto/generated/gateway'
3535
import { IndexingAgreement } from '../indexer-management/models/indexing-agreement'
3636
import { NetworkSpecification } from '../network-specification'
37-
import { Wallet } from 'ethers'
37+
import { BaseWallet } from 'ethers'
3838

3939
const DIPS_COLLECTION_INTERVAL = 60_000
4040

@@ -364,7 +364,7 @@ export class DipsCollector {
364364
private queryFeeModels: QueryFeeModels,
365365
private specification: NetworkSpecification,
366366
private tapCollector: TapCollector,
367-
private wallet: Wallet,
367+
private wallet: BaseWallet,
368368
private graphNode: GraphNode,
369369
public escrowSenderGetter: GetEscrowSenderForSigner,
370370
) {
@@ -383,7 +383,7 @@ export class DipsCollector {
383383
queryFeeModels: QueryFeeModels,
384384
specification: NetworkSpecification,
385385
tapCollector: TapCollector,
386-
wallet: Wallet,
386+
wallet: BaseWallet,
387387
graphNode: GraphNode,
388388
escrowSenderGetter?: GetEscrowSenderForSigner,
389389
) {
@@ -467,7 +467,7 @@ export class DipsCollector {
467467
this.logger.info('Decoding TAP receipt for agreement')
468468
const tapReceipt = this.gatewayDipsServiceMessagesCodec.decodeTapReceipt(
469469
response.tapReceipt,
470-
this.tapCollector?.tapContracts.tapVerifier.address,
470+
this.tapCollector?.tapContracts.tapVerifier.target.toString(),
471471
)
472472
// Check that the signer of the TAP receipt is a signer
473473
// on the corresponding escrow account for the payer (sender) of the

0 commit comments

Comments
 (0)