1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

adapt examples, fix lint

This commit is contained in:
Sebastian Gerske 2018-11-05 10:08:06 +01:00
parent 6e2b270a1f
commit 1ad80dde3e
4 changed files with 13 additions and 10 deletions

View File

@ -1,3 +1,4 @@
import DDO from "../ddo/DDO"
import ServiceAgreement from "../ocean/ServiceAgreement" import ServiceAgreement from "../ocean/ServiceAgreement"
import {Account, Asset, Logger, Ocean} from "../squid" import {Account, Asset, Logger, Ocean} from "../squid"
@ -20,11 +21,11 @@ import {Account, Asset, Logger, Ocean} from "../squid"
"nice data", "nice data",
100, publisher) 100, publisher)
const assetDid = await ocean.register(asset) const ddo: DDO = await ocean.register(asset)
Logger.log("asset did:", assetDid) Logger.log("asset did:", ddo.id)
const serviceAgreement: ServiceAgreement = await asset.purchase(consumer) const serviceAgreement: ServiceAgreement = await asset.purchase(consumer)
Logger.log("service defintion id:", serviceAgreement.getId()) Logger.log("service agreement id:", serviceAgreement.getId())
const accessGranted: boolean = const accessGranted: boolean =
await serviceAgreement.grantAccess(asset.getId(), "321721938712931283") await serviceAgreement.grantAccess(asset.getId(), "321721938712931283")

View File

@ -1,5 +1,6 @@
import {Account, Asset, Logger, Ocean} from "../squid" import DDO from "../ddo/DDO"
import ServiceAgreement from "../ocean/ServiceAgreement" import ServiceAgreement from "../ocean/ServiceAgreement"
import {Account, Asset, Logger, Ocean} from "../squid"
(async () => { (async () => {
const ocean: Ocean = await Ocean.getInstance({ const ocean: Ocean = await Ocean.getInstance({
@ -20,8 +21,8 @@ import ServiceAgreement from "../ocean/ServiceAgreement"
"nice data", "nice data",
100, publisher) 100, publisher)
const assetDid = await ocean.register(asset) const ddo: DDO = await ocean.register(asset)
Logger.log(assetDid) Logger.log(ddo.id)
const serviceAgreement: ServiceAgreement = await asset.purchase(consumer) const serviceAgreement: ServiceAgreement = await asset.purchase(consumer)
Logger.log(serviceAgreement.getId()) Logger.log(serviceAgreement.getId())

View File

@ -1,3 +1,4 @@
import DDO from "../ddo/DDO"
import {Account, Asset, Logger, Ocean} from "../squid" import {Account, Asset, Logger, Ocean} from "../squid"
(async () => { (async () => {
@ -16,7 +17,7 @@ import {Account, Asset, Logger, Ocean} from "../squid"
"Fancy Car Data", "Fancy Car Data",
"nice data", 100, "nice data", 100,
publisher) publisher)
const assetDid = await ocean.register(asset)
Logger.log(assetDid) const ddo: DDO = await ocean.register(asset)
Logger.log(ddo.id)
})() })()

View File

@ -1,7 +1,9 @@
import {assert} from "chai" import {assert} from "chai"
import AquariusConnectorProvider from "../../src/aquarius/AquariusConnectorProvider" import AquariusConnectorProvider from "../../src/aquarius/AquariusConnectorProvider"
import ConfigProvider from "../../src/ConfigProvider" import ConfigProvider from "../../src/ConfigProvider"
import Condition from "../../src/ddo/Condition"
import DDO from "../../src/ddo/DDO" import DDO from "../../src/ddo/DDO"
import Service from "../../src/ddo/Service"
import ContractHandler from "../../src/keeper/ContractHandler" import ContractHandler from "../../src/keeper/ContractHandler"
import Account from "../../src/ocean/Account" import Account from "../../src/ocean/Account"
import IdGenerator from "../../src/ocean/IdGenerator" import IdGenerator from "../../src/ocean/IdGenerator"
@ -10,8 +12,6 @@ import ServiceAgreement from "../../src/ocean/ServiceAgreement"
import ServiceAgreementTemplate from "../../src/ocean/ServiceAgreementTemplate" import ServiceAgreementTemplate from "../../src/ocean/ServiceAgreementTemplate"
import config from "../config" import config from "../config"
import AquariusConnectorMock from "../mocks/AquariusConnector.mock" import AquariusConnectorMock from "../mocks/AquariusConnector.mock"
import Service from "../../src/ddo/Service"
import Condition from "../../src/ddo/Condition"
let ocean: Ocean let ocean: Ocean
let accounts: Account[] let accounts: Account[]