Skip to content

Commit

Permalink
fix: change from goerli to mainnet in resolver unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
MinHtet-O committed Apr 15, 2024
1 parent ea50f50 commit ba3ad7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/common/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { INFURA_API_KEY } from "../../src/config";
import { AllVerificationFragment } from "..";
import { InvalidVerificationFragment, ProviderDetails } from "../types/core";
import {
Expand Down Expand Up @@ -282,12 +281,12 @@ describe("generateProvider", () => {
const options = {
network: "sepolia",
providerType: "infura",
apiKey: INFURA_API_KEY,
apiKey: "bb46da3f80e040e8ab73c0a9ff365d18",
} as ProviderDetails;
const provider = generateProvider(options) as any;

expect(provider?._network?.name).toEqual("sepolia");
expect(provider?.apiKey).toEqual(INFURA_API_KEY);
expect(provider?.apiKey).toEqual("bb46da3f80e040e8ab73c0a9ff365d18");
expect(provider?.connection?.url).toMatch(/(infura)/i);
});

Expand Down Expand Up @@ -365,7 +364,7 @@ describe("generateProvider", () => {
expect(provider?._network?.name).toEqual("sepolia");
expect(provider?._network?.name).not.toEqual("mainnet");
expect(provider?.apiKey).toEqual("env123123");
expect(provider?.apiKey).not.toEqual(INFURA_API_KEY);
expect(provider?.apiKey).not.toEqual("bb46da3f80e040e8ab73c0a9ff365d18");
expect(provider?.connection?.url).toMatch(/(infura)/i);
});

Expand Down
4 changes: 2 additions & 2 deletions src/did/resolver.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { v3 } from "@tradetrust-tt/tradetrust";
import { ethers } from "ethers";
import { INFURA_API_KEY } from "../config";
import { openAttestationDidIdentityProof } from "../verifiers/issuerIdentity/did/didIdentityProof";
import { verificationBuilder } from "../verifiers/verificationBuilder";
import { createResolver, EthrResolverConfig, getProviderConfig, resolve } from "./resolver";
import { INFURA_API_KEY } from "../../src/config";

const didDoc = {
"@context": [
Expand Down Expand Up @@ -136,7 +136,7 @@ describe("getProviderConfig", () => {

it("should set default when provider type is jsonrpc", () => {
process.env.PROVIDER_ENDPOINT_TYPE = "jsonrpc";
process.env.PROVIDER_NETWORK = "goerli";
process.env.PROVIDER_NETWORK = "mainnet";

expect(getProviderConfig()).toEqual({
networks: [{ name: "mainnet", rpcUrl: `https://mainnet.infura.io/v3/${INFURA_API_KEY}` }],
Expand Down

0 comments on commit ba3ad7e

Please sign in to comment.