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: sdk module resolution issues #290

Merged
merged 1 commit into from
Sep 17, 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
4 changes: 2 additions & 2 deletions integration-tests/e2e-tests/src/abilities/WalletSdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { CloudAgentConfiguration } from "../configuration/CloudAgentConfiguratio
import InMemoryStore from "../configuration/inmemory"
import { randomUUID, UUID } from "crypto"

const { Agent, Apollo, Domain, ListenerKey, } = SDK

// fallback in any case of dangling sdk agents
export const agentList: Map<string, WalletSdk> = new Map()
Expand All @@ -15,7 +14,7 @@ export class WalletSdk extends Ability implements Initialisable, Discardable {
store: SDK.Store
messages: MessageQueue = new MessageQueue()
id: UUID = randomUUID()

static async withANewInstance(): Promise<Ability> {
return new WalletSdk()
}
Expand Down Expand Up @@ -85,6 +84,7 @@ export class WalletSdk extends Ability implements Initialisable, Discardable {
}

async createSdk(seed: SDK.Domain.Seed = undefined) {
const { Agent, Apollo, Domain, ListenerKey, } = SDK
const apollo = new Apollo()
this.store = new SDK.Store({
name: [...Array(30)].map(() => Math.random().toString(36)[2]).join(""),
Expand Down
11 changes: 10 additions & 1 deletion integration-tests/e2e-tests/src/workflow/EdgeAgentWorkflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { randomUUID } from "crypto"
import _ from "lodash"
import { assert } from "chai"

const { IssueCredential, OfferCredential, RequestPresentation, Presentation } = SDK

export class EdgeAgentWorkflow {

Expand Down Expand Up @@ -40,6 +39,7 @@ export class EdgeAgentWorkflow {
}

static async processIssuedCredential(edgeAgent: Actor, recordId: string) {
const { IssueCredential } = SDK;
await edgeAgent.attemptsTo(
WalletSdk.execute(async (sdk, messages) => {
const issuedCredential = messages.issuedCredentialStack.shift()!
Expand All @@ -51,6 +51,8 @@ export class EdgeAgentWorkflow {
}

static async acceptCredential(edgeAgent: Actor) {
const { OfferCredential } = SDK

await edgeAgent.attemptsTo(
WalletSdk.execute(async (sdk, messages) => {
const message = OfferCredential.fromMessage(messages.credentialOfferStack.shift()!)
Expand All @@ -75,6 +77,8 @@ export class EdgeAgentWorkflow {
}

static async presentVerificationRequest(edgeAgent: Actor) {
const { RequestPresentation } = SDK

await edgeAgent.attemptsTo(
WalletSdk.execute(async (sdk, messages) => {
const credentials = await sdk.verifiableCredentials()
Expand All @@ -96,6 +100,8 @@ export class EdgeAgentWorkflow {
}

static async verifyPresentation(edgeAgent: Actor, expected: boolean = true) {
const { Presentation } = SDK

await edgeAgent.attemptsTo(
WalletSdk.execute(async (sdk, messages) => {
const presentation = messages.presentationMessagesStack.shift()!
Expand All @@ -117,6 +123,7 @@ export class EdgeAgentWorkflow {
}

static async tryToPresentVerificationRequestWithWrongAnoncred(edgeAgent: Actor) {
const { RequestPresentation } = SDK
await edgeAgent.attemptsTo(
WalletSdk.execute(async (sdk, messages) => {
const credentials = await sdk.verifiableCredentials()
Expand All @@ -135,6 +142,8 @@ export class EdgeAgentWorkflow {
}

static async presentProof(edgeAgent: Actor) {
const { RequestPresentation } = SDK

await edgeAgent.attemptsTo(
WalletSdk.execute(async (sdk, messages) => {
const credentials = await sdk.verifiableCredentials()
Expand Down
Loading