Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use tapSubgraph to ignore connection with tapContracts #952

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/indexer-common/src/allocations/query-fees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class AllocationReceiptCollector implements ReceiptCollector {
declare models: QueryFeeModels
declare transactionManager: TransactionManager
declare allocationExchange: Contract
declare tapContracts?: TapContracts
declare tapContracts: TapContracts | undefined
declare allocations: Eventual<Allocation[]>
declare collectEndpoint: URL
declare partialVoucherEndpoint: URL
Expand Down
28 changes: 16 additions & 12 deletions packages/indexer-common/src/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import {
AddressBook,
toAddress,
} from '@graphprotocol/common-ts'
import { connectContracts as connectTapContracts } from '@semiotic-labs/tap-contracts-bindings'
import {
connectContracts as connectTapContracts,
NetworkContracts as TapContracts,
} from '@semiotic-labs/tap-contracts-bindings'
import {
INDEXER_ERROR_MESSAGES,
indexerError,
Expand Down Expand Up @@ -238,18 +241,19 @@ export class Network {
// * Escrow contract
// --------------------------------------------------------------------------------
const networkIdentifier = await networkProvider.getNetwork()
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let tapContracts: any
try {
tapContracts = await connectTapContracts(
wallet,
networkIdentifier.chainId,
specification.tapAddressBook,
)
} catch (err) {
logger.error(`Failed to connect to tap contract bindings:`, { err })
let tapContracts: TapContracts | undefined = undefined
if (tapSubgraph) {
try {
tapContracts = await connectTapContracts(
wallet,
networkIdentifier.chainId,
specification.tapAddressBook,
)
} catch (err) {
logger.error(`Failed to connect to tap contract bindings:`, { err })
fordN marked this conversation as resolved.
Show resolved Hide resolved
throw err
}
}

// --------------------------------------------------------------------------------
// * Allocation and allocation signers
// --------------------------------------------------------------------------------
Expand Down
Loading