From 575b45b68a4875f086b9fb836e378ca7d3bf2ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Guti=C3=A9rrez?= Date: Mon, 11 Feb 2019 15:10:11 +0100 Subject: [PATCH] using new Ocean API on buy asset test --- integration/ocean/BuyAsset.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/integration/ocean/BuyAsset.test.ts b/integration/ocean/BuyAsset.test.ts index db5191d..08b64fd 100644 --- a/integration/ocean/BuyAsset.test.ts +++ b/integration/ocean/BuyAsset.test.ts @@ -21,9 +21,9 @@ describe("Buy Asset", () => { ocean = await Ocean.getInstance(config) // Accounts - publisher = (await ocean.getAccounts())[0] + publisher = (await ocean.accounts.list())[0] publisher.setPassword(process.env.ACCOUNT_PASSWORD) - consumer = (await ocean.getAccounts())[1] + consumer = (await ocean.accounts.list())[1] // Data metadata = { @@ -64,7 +64,7 @@ describe("Buy Asset", () => { }) it("should regiester a asset", async () => { - ddo = await ocean.registerAsset(metadata as any, publisher) + ddo = await ocean.assets.create(metadata as any, publisher) did = DID.parse(ddo.id) assert.isDefined(ddo, "Register has not returned a DDO") @@ -83,7 +83,7 @@ describe("Buy Asset", () => { it("should sign the service agreement", async () => { const accessService = ddo.findServiceByType("Access") - serviceAgreementSignatureResult = await ocean.signServiceAgreement(ddo.id, accessService.serviceDefinitionId, consumer) + serviceAgreementSignatureResult = await ocean.assets.order(ddo.id, accessService.serviceDefinitionId, consumer) const {serviceAgreementId, serviceAgreementSignature} = serviceAgreementSignatureResult assert.match(serviceAgreementId, /^[a-f0-9]{64}$/, "Service agreement ID seems not valid") @@ -93,7 +93,7 @@ describe("Buy Asset", () => { it("should execute the service agreement", async () => { const accessService = ddo.findServiceByType("Access") - serviceAgreement = await ocean.executeServiceAgreement( + serviceAgreement = await ocean.agreements.create( ddo.id, accessService.serviceDefinitionId, serviceAgreementSignatureResult.serviceAgreementId,