From 1ad80dde3ef6eb818ba40710511091e51081cc40 Mon Sep 17 00:00:00 2001 From: Sebastian Gerske Date: Mon, 5 Nov 2018 10:08:06 +0100 Subject: [PATCH] adapt examples, fix lint --- src/examples/GrantAccess.ts | 7 ++++--- src/examples/Purchase.ts | 7 ++++--- src/examples/Register.ts | 5 +++-- test/ocean/ServiceAgreement.test.ts | 4 ++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/examples/GrantAccess.ts b/src/examples/GrantAccess.ts index d6857f4..86bc709 100644 --- a/src/examples/GrantAccess.ts +++ b/src/examples/GrantAccess.ts @@ -1,3 +1,4 @@ +import DDO from "../ddo/DDO" import ServiceAgreement from "../ocean/ServiceAgreement" import {Account, Asset, Logger, Ocean} from "../squid" @@ -20,11 +21,11 @@ import {Account, Asset, Logger, Ocean} from "../squid" "nice data", 100, publisher) - const assetDid = await ocean.register(asset) - Logger.log("asset did:", assetDid) + const ddo: DDO = await ocean.register(asset) + Logger.log("asset did:", ddo.id) const serviceAgreement: ServiceAgreement = await asset.purchase(consumer) - Logger.log("service defintion id:", serviceAgreement.getId()) + Logger.log("service agreement id:", serviceAgreement.getId()) const accessGranted: boolean = await serviceAgreement.grantAccess(asset.getId(), "321721938712931283") diff --git a/src/examples/Purchase.ts b/src/examples/Purchase.ts index e81fc50..d2973b4 100644 --- a/src/examples/Purchase.ts +++ b/src/examples/Purchase.ts @@ -1,5 +1,6 @@ -import {Account, Asset, Logger, Ocean} from "../squid" +import DDO from "../ddo/DDO" import ServiceAgreement from "../ocean/ServiceAgreement" +import {Account, Asset, Logger, Ocean} from "../squid" (async () => { const ocean: Ocean = await Ocean.getInstance({ @@ -20,8 +21,8 @@ import ServiceAgreement from "../ocean/ServiceAgreement" "nice data", 100, publisher) - const assetDid = await ocean.register(asset) - Logger.log(assetDid) + const ddo: DDO = await ocean.register(asset) + Logger.log(ddo.id) const serviceAgreement: ServiceAgreement = await asset.purchase(consumer) Logger.log(serviceAgreement.getId()) diff --git a/src/examples/Register.ts b/src/examples/Register.ts index 6a255a9..1f0bc57 100644 --- a/src/examples/Register.ts +++ b/src/examples/Register.ts @@ -1,3 +1,4 @@ +import DDO from "../ddo/DDO" import {Account, Asset, Logger, Ocean} from "../squid" (async () => { @@ -16,7 +17,7 @@ import {Account, Asset, Logger, Ocean} from "../squid" "Fancy Car Data", "nice data", 100, publisher) - const assetDid = await ocean.register(asset) - Logger.log(assetDid) + const ddo: DDO = await ocean.register(asset) + Logger.log(ddo.id) })() diff --git a/test/ocean/ServiceAgreement.test.ts b/test/ocean/ServiceAgreement.test.ts index 51e6071..9811564 100644 --- a/test/ocean/ServiceAgreement.test.ts +++ b/test/ocean/ServiceAgreement.test.ts @@ -1,7 +1,9 @@ import {assert} from "chai" import AquariusConnectorProvider from "../../src/aquarius/AquariusConnectorProvider" import ConfigProvider from "../../src/ConfigProvider" +import Condition from "../../src/ddo/Condition" import DDO from "../../src/ddo/DDO" +import Service from "../../src/ddo/Service" import ContractHandler from "../../src/keeper/ContractHandler" import Account from "../../src/ocean/Account" import IdGenerator from "../../src/ocean/IdGenerator" @@ -10,8 +12,6 @@ import ServiceAgreement from "../../src/ocean/ServiceAgreement" import ServiceAgreementTemplate from "../../src/ocean/ServiceAgreementTemplate" import config from "../config" import AquariusConnectorMock from "../mocks/AquariusConnector.mock" -import Service from "../../src/ddo/Service" -import Condition from "../../src/ddo/Condition" let ocean: Ocean let accounts: Account[]