Skip to content

Commit

Permalink
chore: use infura provider
Browse files Browse the repository at this point in the history
  • Loading branch information
zixiang2018 committed Dec 27, 2023
1 parent fb5bae1 commit 9f26251
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/did/resolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ethers, providers } from "ethers";
import { INFURA_API_KEY } from "../config";
import { openAttestationDidIdentityProof } from "../verifiers/issuerIdentity/did/didIdentityProof";
import { verificationBuilder } from "../verifiers/verificationBuilder";
import { EthrResolverConfig, getProviderConfig, resolve } from "./resolver";
import { getProviderConfig, resolve } from "./resolver";
import { Resolver } from "did-resolver";
import { getResolver } from "ethr-did-resolver";

Expand Down Expand Up @@ -75,11 +75,7 @@ const v3DidSigned = {
},
} as v3.SignedWrappedDocument;

const customConfig: EthrResolverConfig = {
networks: [{ name: "sepolia", rpcUrl: `https://sepolia.infura.io/v3/${INFURA_API_KEY}` }],
};

const sepoliaCustomConfig = {
const sepoliaNetworkConfig = {
name: "sepolia",
chainId: 11155111,
provider: new providers.InfuraProvider("sepolia"),
Expand All @@ -92,7 +88,7 @@ describe("custom resolver", () => {
"did:ethr:sepolia:0x0cE1854a3836daF9130028Cf90D6d35B1Ae46457",
new Resolver(
getResolver({
networks: [sepoliaCustomConfig],
networks: [sepoliaNetworkConfig],
})
)
);
Expand All @@ -101,10 +97,10 @@ describe("custom resolver", () => {

it("should resolve did using verifier", async () => {
const verify = verificationBuilder([openAttestationDidIdentityProof], {
provider: new ethers.providers.JsonRpcProvider({ url: customConfig.networks[0].rpcUrl }),
provider: new ethers.providers.JsonRpcProvider({ url: `https://sepolia.infura.io/v3/${INFURA_API_KEY}` }),
resolver: new Resolver(
getResolver({
networks: [sepoliaCustomConfig],
networks: [sepoliaNetworkConfig],
})
),
});
Expand Down

0 comments on commit 9f26251

Please sign in to comment.