Skip to content

Commit

Permalink
Merge pull request #30 from deltaDAO/fix/ctd-env
Browse files Browse the repository at this point in the history
fix: check for multi chain provider
  • Loading branch information
moritzkirstein authored Oct 20, 2023
2 parents ec21e6d + 439773b commit 92dc45b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/modules/ocean/compute-to-data/C2D.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ export class C2D {

// get compute environments and choose the first one
const computeEnvs = await ProviderInstance.getComputeEnvironments(this.providerUrl);
if (computeEnvs.length === 0) throw new Error('No compute environment');
this.computeEnv = computeEnvs[0];
const computeEnv = Array.isArray(computeEnvs) ? computeEnvs[0] : computeEnvs[this.config.chainId][0];

if (!computeEnv) throw new Error('No compute environment');

this.computeEnv = computeEnv;
console.log('compute env:', this.computeEnv);

const validUntil = getValidUntilTime(
Expand Down

0 comments on commit 92dc45b

Please sign in to comment.