Skip to content

Commit

Permalink
Correct StatusList2021Credential usage
Browse files Browse the repository at this point in the history
  • Loading branch information
olegnn committed Nov 28, 2024
1 parent 3ce4e9d commit 0df5d91
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import {
import { DockDid } from "@docknetwork/credential-sdk/types";
import { registerNewDIDUsingPair } from "./helpers";
import { getKeyDoc } from "@docknetwork/credential-sdk/vc/helpers";
import { StatusList2021Credential } from "@docknetwork/credential-sdk/types/status-list-credential";
import { DockStatusList2021Credential } from "@docknetwork/credential-sdk/types/status-list-credential";

const expectEqualCreds = (cred1, cred2) => {
expect(cred1.eq(cred2)).toBe(true);
expect(cred1.toJSON()).toEqual(cred2.toJSON());
expect(StatusList2021Credential.fromJSON(cred1.toJSON())).toEqual(
StatusList2021Credential.fromJSON(cred2.toJSON())
expect(DockStatusList2021Credential.fromJSON(cred1.toJSON())).toEqual(
DockStatusList2021Credential.fromJSON(cred2.toJSON())
);
};

Expand Down Expand Up @@ -74,7 +74,7 @@ describe("StatusListCredential Module", () => {
}, 10000);

test("Can create a status list with a OneOf policy", async () => {
const cred = await StatusList2021Credential.create(
const cred = await DockStatusList2021Credential.create(
ownerKey,
statusListCredId
);
Expand Down Expand Up @@ -134,7 +134,7 @@ describe("StatusListCredential Module", () => {
}, 40000);

test("Can unsuspend from a status list credential", async () => {
const credential = await StatusList2021Credential.create(
const credential = await DockStatusList2021Credential.create(
ownerKey,
statusListCredId,
{ statusPurpose: "suspension", revokeIndices: revokeIds }
Expand Down Expand Up @@ -178,7 +178,7 @@ describe("StatusListCredential Module", () => {
}, 40000);

test("Can create a status list with multiple owners", async () => {
const cred = await StatusList2021Credential.create(
const cred = await DockStatusList2021Credential.create(
ownerKey,
multipleControllerstatusListCredID,
{ statusPurpose: "suspension" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { DockCoreModules } from "../../src";
import { getUnsignedCred, registerNewDIDUsingPair } from "./helpers";
import { getKeyDoc } from "@docknetwork/credential-sdk/vc/helpers";
import { DockDid } from "@docknetwork/credential-sdk/types";
import { StatusList2021Credential } from "@docknetwork/credential-sdk/types";
import { DockStatusList2021Credential } from "@docknetwork/credential-sdk/types";
import { addStatusList21EntryToCredential } from "@docknetwork/credential-sdk/vc/credentials";
import {
Ed25519Keypair,
Expand All @@ -30,7 +30,7 @@ import {

const credId = "A large credential id with size > 32 bytes";

describe("StatusList2021Credential", () => {
describe("DockStatusList2021Credential", () => {
const dockAPI = new DockAPI();
const modules = new DockCoreModules(dockAPI);
const resolver = new CoreResolver(modules);
Expand Down Expand Up @@ -82,7 +82,7 @@ describe("StatusList2021Credential", () => {
"Ed25519VerificationKey2018"
);

const statusListCred = await StatusList2021Credential.create(
const statusListCred = await DockStatusList2021Credential.create(
issuerKey,
statusListCredentialId,
{ statusPurpose: "suspension" }
Expand Down

0 comments on commit 0df5d91

Please sign in to comment.