Skip to content

Commit 13ac3a1

Browse files
committed
fix: debug
1 parent f67ff16 commit 13ac3a1

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ const setup = async () => {
119119

120120
const operator = new Operator(logger, indexerManagementClient, networkSpecWithDips)
121121
await operator.ensureGlobalIndexingRule()
122+
logger.debug('Ensured global indexing rule')
123+
logger.debug(JSON.stringify(network.specification, null, 2))
122124
}
123125

124126
const setupEach = async () => {
@@ -468,17 +470,19 @@ describe('DipsCollector', () => {
468470
status: CollectPaymentStatus.ACCEPT,
469471
tapReceipt: Buffer.from('1234', 'hex'),
470472
})
471-
;(decodeTapReceipt as jest.Mock).mockReturnValue({
472-
allocation_id: toAddress(testAllocationId),
473-
signer_address: toAddress('0xabcd56df41234949a75a6693c77834c00b8abbbb'),
474-
signature: Buffer.from('1234', 'hex'),
475-
timestamp_ns: 1234567890,
476-
nonce: 1,
477-
value: '1000',
473+
;(decodeTapReceipt as jest.Mock).mockImplementation(() => {
474+
return {
475+
allocation_id: toAddress(testAllocationId),
476+
signer_address: toAddress('0xabcd56df41234949a75a6693c77834c00b8abbbb'),
477+
signature: Buffer.from('1234', 'hex'),
478+
timestamp_ns: 1234567890,
479+
nonce: 1,
480+
value: '1000',
481+
}
482+
})
483+
;(getEscrowSenderForSigner as jest.Mock).mockImplementation(() => {
484+
return toAddress('0x123456df40c29949a75a6693c77834c00b8a5678')
478485
})
479-
;(getEscrowSenderForSigner as jest.Mock).mockResolvedValue(
480-
toAddress('0x123456df40c29949a75a6693c77834c00b8a5678'),
481-
)
482486

483487
await dipsCollector.tryCollectPayment(agreement)
484488

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ export class DipsCollector {
257257
this.wallet,
258258
)
259259
try {
260+
this.logger.debug(`Collecting payment for agreement ${agreement.id}`)
260261
const response = await this.gatewayDipsServiceClient.CollectPayment({
261262
version: 1,
262263
signedCollection: collection,
@@ -266,6 +267,7 @@ export class DipsCollector {
266267
throw new Error('TapCollector not initialized')
267268
}
268269
// Store the tap receipt in the database
270+
this.logger.debug(`Decoding TAP receipt for agreement`)
269271
const tapReceipt = decodeTapReceipt(
270272
response.tapReceipt,
271273
this.tapCollector?.tapContracts.tapVerifier.address,

0 commit comments

Comments
 (0)