Skip to content

Commit

Permalink
fix: sdk module resolution issues (#290)
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
  • Loading branch information
elribonazo authored Sep 17, 2024
1 parent 54ead35 commit f53d728
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
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

1 comment on commit f53d728

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines Statements Branches Functions
Coverage: 78%
78.35% (3424/4370) 67.51% (1505/2229) 82.06% (828/1009)

Please sign in to comment.