Skip to content

Commit b1ea5e0

Browse files
Merge pull request #165 from Virtual-Protocol/fix/unit-test-fixes
- fix unit tests - fixed acpClient.ts calling non-existing function from `acpClient.create` to `axios.create`
2 parents 0fdfd9f + 4fa91cb commit b1ea5e0

3 files changed

Lines changed: 148 additions & 89 deletions

File tree

src/acpClient.ts

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class AcpClient {
101101
},
102102
});
103103

104-
this.noAuthAcpClient = this.acpClient.create({
104+
this.noAuthAcpClient = axios.create({
105105
baseURL: `${this.acpUrl}/api`,
106106
});
107107

@@ -419,31 +419,27 @@ class AcpClient {
419419
name: agent.name,
420420
description: agent.description,
421421
jobOfferings: agent.jobs
422-
.filter((offering) =>
423-
offering.priceV2?.value != null ||
424-
offering.price != null
425-
)
426-
.map((offering) => {
427-
const price =
428-
offering.priceV2?.value ??
429-
offering.price!;
430-
431-
const priceType =
432-
offering.priceV2?.type ??
433-
PriceType.FIXED;
434-
435-
return new AcpJobOffering(
436-
this,
437-
acpContractClient,
438-
agent.walletAddress,
439-
offering.name,
440-
price,
441-
priceType,
442-
offering.requiredFunds,
443-
offering.requirement,
444-
offering.deliverable
445-
);
446-
}),
422+
.filter(
423+
(offering) =>
424+
offering.priceV2?.value != null || offering.price != null,
425+
)
426+
.map((offering) => {
427+
const price = offering.priceV2?.value ?? offering.price!;
428+
429+
const priceType = offering.priceV2?.type ?? PriceType.FIXED;
430+
431+
return new AcpJobOffering(
432+
this,
433+
acpContractClient,
434+
agent.walletAddress,
435+
offering.name,
436+
price,
437+
priceType,
438+
offering.requiredFunds,
439+
offering.requirement,
440+
offering.deliverable,
441+
);
442+
}),
447443
contractAddress: agent.contractAddress,
448444
twitterHandle: agent.twitterHandle,
449445
walletAddress: agent.walletAddress,

0 commit comments

Comments
 (0)