mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
kick out squid-js, replace with lib
This commit is contained in:
parent
6d2ac9804a
commit
7b6cb91410
@ -174,9 +174,9 @@ vercel alias
|
|||||||
|
|
||||||
## 🏗 Ocean Protocol Infrastructure
|
## 🏗 Ocean Protocol Infrastructure
|
||||||
|
|
||||||
The following Aquarius & Brizo instances specifically for marketplace are deployed in Ocean Protocol's AWS K8:
|
The following Metadata Store & Provider instances specifically for marketplace are deployed in Ocean Protocol's AWS K8:
|
||||||
|
|
||||||
**Nile (Staging)**
|
**Rinkeby (Staging)**
|
||||||
|
|
||||||
- K8 namespace: `market-nile`
|
- K8 namespace: `market-nile`
|
||||||
- `aquarius.nile.market.dev-ocean.com`
|
- `aquarius.nile.market.dev-ocean.com`
|
||||||
@ -188,7 +188,7 @@ Edit command with `kubectl`, e.g.:
|
|||||||
kubectl edit deployment -n market-nile aquarius
|
kubectl edit deployment -n market-nile aquarius
|
||||||
```
|
```
|
||||||
|
|
||||||
**Pacific (Production)**
|
**Main (Production)**
|
||||||
|
|
||||||
- K8 namespace: `market-pacific`
|
- K8 namespace: `market-pacific`
|
||||||
- `aquarius.pacific.market.dev-ocean.com`
|
- `aquarius.pacific.market.dev-ocean.com`
|
||||||
|
22
package-lock.json
generated
22
package-lock.json
generated
@ -3971,6 +3971,23 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/keeper-contracts/-/keeper-contracts-0.13.2.tgz",
|
"resolved": "https://registry.npmjs.org/@oceanprotocol/keeper-contracts/-/keeper-contracts-0.13.2.tgz",
|
||||||
"integrity": "sha512-915dcnzCHEuvsmRKqVj0RxHT3T386lSJh8WREe4dsnrXHsi1ULNYxX0Ts/cvalv6bRL+aqyaZ6gN3l3nkfwEDg=="
|
"integrity": "sha512-915dcnzCHEuvsmRKqVj0RxHT3T386lSJh8WREe4dsnrXHsi1ULNYxX0Ts/cvalv6bRL+aqyaZ6gN3l3nkfwEDg=="
|
||||||
},
|
},
|
||||||
|
"@oceanprotocol/lib": {
|
||||||
|
"version": "0.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.1.1.tgz",
|
||||||
|
"integrity": "sha512-4lCF0jzBq735QzD7TSqyc7yMmcXL5eF0G1ZYx4bu4NS/vl2nzFVTa+QjqVbx31ZhHpFLgWr8d3QTsBGxTLXpmw==",
|
||||||
|
"requires": {
|
||||||
|
"@ethereum-navigator/navigator": "^0.5.0",
|
||||||
|
"bignumber.js": "^9.0.0",
|
||||||
|
"deprecated-decorator": "^0.1.6",
|
||||||
|
"fs": "0.0.1-security",
|
||||||
|
"node-fetch": "^2.6.0",
|
||||||
|
"save-file": "^2.3.1",
|
||||||
|
"uuid": "^8.2.0",
|
||||||
|
"web3": "^1.2.9",
|
||||||
|
"web3-eth-contract": "^1.2.9",
|
||||||
|
"whatwg-url": "^8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@oceanprotocol/react": {
|
"@oceanprotocol/react": {
|
||||||
"version": "0.0.11",
|
"version": "0.0.11",
|
||||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/react/-/react-0.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/@oceanprotocol/react/-/react-0.0.11.tgz",
|
||||||
@ -14920,6 +14937,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"fs": {
|
||||||
|
"version": "0.0.1-security",
|
||||||
|
"resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
|
||||||
|
"integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ="
|
||||||
|
},
|
||||||
"fs-constants": {
|
"fs-constants": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
"@loadable/component": "^5.13.1",
|
"@loadable/component": "^5.13.1",
|
||||||
"@now/node": "^1.7.2",
|
"@now/node": "^1.7.2",
|
||||||
"@oceanprotocol/art": "^3.0.0",
|
"@oceanprotocol/art": "^3.0.0",
|
||||||
"@oceanprotocol/react": "0.0.11",
|
"@oceanprotocol/lib": "^0.1.1",
|
||||||
"@oceanprotocol/squid": "^2.2.0",
|
"@oceanprotocol/react": "^0.0.11",
|
||||||
"@oceanprotocol/typographies": "^0.1.0",
|
"@oceanprotocol/typographies": "^0.1.0",
|
||||||
"@sindresorhus/slugify": "^1.0.0",
|
"@sindresorhus/slugify": "^1.0.0",
|
||||||
"@tippyjs/react": "^4.1.0",
|
"@tippyjs/react": "^4.1.0",
|
||||||
|
4
src/@types/MetaData.d.ts
vendored
4
src/@types/MetaData.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
import { File, MetaData, AdditionalInformation } from '@oceanprotocol/squid'
|
import { File, MetaData, AdditionalInformation } from '@oceanprotocol/lib'
|
||||||
import { ServiceMetadata } from '@oceanprotocol/squid/dist/node/ddo/Service'
|
import { ServiceMetadata } from '@oceanprotocol/lib/dist/node/ddo/Service'
|
||||||
|
|
||||||
export declare type AccessType = 'Download' | 'Compute'
|
export declare type AccessType = 'Download' | 'Compute'
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { ReactElement } from 'react'
|
import React, { ReactElement } from 'react'
|
||||||
import { File as FileMetaData } from '@oceanprotocol/squid'
|
import { File as FileMetaData } from '@oceanprotocol/lib'
|
||||||
import filesize from 'filesize'
|
import filesize from 'filesize'
|
||||||
import cleanupContentType from '../../utils/cleanupContentType'
|
import cleanupContentType from '../../utils/cleanupContentType'
|
||||||
import styles from './File.module.css'
|
import styles from './File.module.css'
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import ReactRating from 'react-rating'
|
import ReactRating from 'react-rating'
|
||||||
import Star from '../../images/star.svg'
|
import Star from '../../images/star.svg'
|
||||||
import { Curation } from '@oceanprotocol/squid'
|
import { Curation } from '@oceanprotocol/lib'
|
||||||
import styles from './Rating.module.css'
|
import styles from './Rating.module.css'
|
||||||
|
|
||||||
export default function Rating({
|
export default function Rating({
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import AssetTeaser from '../molecules/AssetTeaser'
|
import AssetTeaser from '../molecules/AssetTeaser'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { DDO } from '@oceanprotocol/squid'
|
import { DDO } from '@oceanprotocol/lib'
|
||||||
import ddo from '../../../tests/unit/__fixtures__/ddo'
|
import ddo from '../../../tests/unit/__fixtures__/ddo'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { useState, useEffect } from 'react'
|
import React, { useState, useEffect } from 'react'
|
||||||
import { useNavigate } from '@reach/router'
|
import { useNavigate } from '@reach/router'
|
||||||
import { DDO } from '@oceanprotocol/squid'
|
import { DDO } from '@oceanprotocol/lib'
|
||||||
import { redeploy } from '../../utils'
|
import { redeploy } from '../../utils'
|
||||||
import Button from '../atoms/Button'
|
import Button from '../atoms/Button'
|
||||||
import BaseDialog from '../atoms/BaseDialog'
|
import BaseDialog from '../atoms/BaseDialog'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { ReactElement } from 'react'
|
import React, { ReactElement } from 'react'
|
||||||
import { File } from '@oceanprotocol/squid'
|
import { File } from '@oceanprotocol/lib'
|
||||||
import { prettySize } from '../../../utils'
|
import { prettySize } from '../../../utils'
|
||||||
import cleanupContentType from '../../../utils/cleanupContentType'
|
import cleanupContentType from '../../../utils/cleanupContentType'
|
||||||
import styles from './Info.module.css'
|
import styles from './Info.module.css'
|
||||||
|
@ -2,7 +2,7 @@ import React, { ReactElement } from 'react'
|
|||||||
import Compute from './Compute'
|
import Compute from './Compute'
|
||||||
import ddo from '../../../../tests/unit/__fixtures__/ddo'
|
import ddo from '../../../../tests/unit/__fixtures__/ddo'
|
||||||
import web3Mock from '../../../../tests/unit/__mocks__/web3'
|
import web3Mock from '../../../../tests/unit/__mocks__/web3'
|
||||||
import squidMock from '../../../../tests/unit/__mocks__/@oceanprotocol/squid'
|
import squidMock from '../../../../tests/unit/__mocks__/@oceanprotocol/lib'
|
||||||
import { context } from '../../../../tests/unit/__mocks__/web3provider'
|
import { context } from '../../../../tests/unit/__mocks__/web3provider'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { useState, useEffect, ReactElement } from 'react'
|
import React, { useState, useEffect, ReactElement } from 'react'
|
||||||
import { Ocean } from '@oceanprotocol/squid'
|
import { Ocean } from '@oceanprotocol/lib'
|
||||||
import { fromWei } from 'web3-utils'
|
import { fromWei } from 'web3-utils'
|
||||||
import compareAsBN, { Comparisson } from '../../../utils/compareAsBN'
|
import compareAsBN, { Comparisson } from '../../../utils/compareAsBN'
|
||||||
import Loader from '../../atoms/Loader'
|
import Loader from '../../atoms/Loader'
|
||||||
|
@ -2,7 +2,7 @@ import React, { useState, useEffect, ReactElement } from 'react'
|
|||||||
import { toast } from 'react-toastify'
|
import { toast } from 'react-toastify'
|
||||||
import Rating from '../../atoms/Rating'
|
import Rating from '../../atoms/Rating'
|
||||||
import rateAsset from '../../../utils/rateAsset'
|
import rateAsset from '../../../utils/rateAsset'
|
||||||
import { DID } from '@oceanprotocol/squid'
|
import { DID } from '@oceanprotocol/lib'
|
||||||
import styles from './RatingAction.module.css'
|
import styles from './RatingAction.module.css'
|
||||||
import getAssetRating from '../../../utils/getAssetRating'
|
import getAssetRating from '../../../utils/getAssetRating'
|
||||||
import Loader from '../../atoms/Loader'
|
import Loader from '../../atoms/Loader'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { DDO } from '@oceanprotocol/squid'
|
import { DDO } from '@oceanprotocol/lib'
|
||||||
import AssetList from './AssetList'
|
import AssetList from './AssetList'
|
||||||
import asset from '../../../tests/unit/__fixtures__/ddo'
|
import asset from '../../../tests/unit/__fixtures__/ddo'
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import AssetTeaser from '../molecules/AssetTeaser'
|
import AssetTeaser from '../molecules/AssetTeaser'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { QueryResult } from '@oceanprotocol/squid/dist/node/aquarius/Aquarius'
|
import { QueryResult } from '@oceanprotocol/lib/dist/node/metadatastore/MetadataStore'
|
||||||
import shortid from 'shortid'
|
import shortid from 'shortid'
|
||||||
import Pagination from '../molecules/Pagination'
|
import Pagination from '../molecules/Pagination'
|
||||||
import { updateQueryStringParameter } from '../../utils'
|
import { updateQueryStringParameter } from '../../utils'
|
||||||
import styles from './AssetList.module.css'
|
import styles from './AssetList.module.css'
|
||||||
import { MetaDataMarket } from '../../@types/MetaData'
|
import { MetaDataMarket } from '../../@types/MetaData'
|
||||||
import { DDO } from '@oceanprotocol/squid'
|
import { DDO } from '@oceanprotocol/lib'
|
||||||
|
|
||||||
declare type AssetListProps = {
|
declare type AssetListProps = {
|
||||||
queryResult: QueryResult
|
queryResult: QueryResult
|
||||||
|
@ -10,7 +10,7 @@ import Price from '../atoms/Price'
|
|||||||
import { fromWei } from 'web3-utils'
|
import { fromWei } from 'web3-utils'
|
||||||
import DateCell from '../atoms/Table/DateCell'
|
import DateCell from '../atoms/Table/DateCell'
|
||||||
import DdoLinkCell from '../atoms/Table/DdoLinkCell'
|
import DdoLinkCell from '../atoms/Table/DdoLinkCell'
|
||||||
import { MetaDataMain } from '@oceanprotocol/squid'
|
import { MetaDataMain } from '@oceanprotocol/lib'
|
||||||
|
|
||||||
const consumedColumns = [
|
const consumedColumns = [
|
||||||
{
|
{
|
||||||
|
@ -11,7 +11,7 @@ import Price from '../atoms/Price'
|
|||||||
import { fromWei } from 'web3-utils'
|
import { fromWei } from 'web3-utils'
|
||||||
import Table from '../atoms/Table'
|
import Table from '../atoms/Table'
|
||||||
import Button from '../atoms/Button'
|
import Button from '../atoms/Button'
|
||||||
import { MetaDataMain, Logger } from '@oceanprotocol/squid'
|
import { MetaDataMain, Logger } from '@oceanprotocol/lib'
|
||||||
import DateCell from '../atoms/Table/DateCell'
|
import DateCell from '../atoms/Table/DateCell'
|
||||||
import DdoLinkCell from '../atoms/Table/DdoLinkCell'
|
import DdoLinkCell from '../atoms/Table/DdoLinkCell'
|
||||||
import shortid from 'shortid'
|
import shortid from 'shortid'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useState, ReactElement } from 'react'
|
import React, { useEffect, useState, ReactElement } from 'react'
|
||||||
import Loader from '../atoms/Loader'
|
import Loader from '../atoms/Loader'
|
||||||
import { MetaDataMain } from '@oceanprotocol/squid'
|
import { MetaDataMain } from '@oceanprotocol/lib'
|
||||||
import {
|
import {
|
||||||
useOcean,
|
useOcean,
|
||||||
OceanConnectionStatus,
|
OceanConnectionStatus,
|
||||||
|
@ -7,7 +7,7 @@ import { useOcean } from '@oceanprotocol/react'
|
|||||||
import {
|
import {
|
||||||
Service,
|
Service,
|
||||||
ServiceCompute
|
ServiceCompute
|
||||||
} from '@oceanprotocol/squid/dist/node/ddo/Service'
|
} from '@oceanprotocol/lib/dist/node/ddo/Service'
|
||||||
import { Formik, Form as FormFormik, Field } from 'formik'
|
import { Formik, Form as FormFormik, Field } from 'formik'
|
||||||
import Input from '../../atoms/Input'
|
import Input from '../../atoms/Input'
|
||||||
import Button from '../../atoms/Button'
|
import Button from '../../atoms/Button'
|
||||||
@ -15,7 +15,7 @@ import { transformPublishFormToMetadata } from './utils'
|
|||||||
import { FormContent, FormFieldProps } from '../../../@types/Form'
|
import { FormContent, FormFieldProps } from '../../../@types/Form'
|
||||||
import { MetaDataPublishForm } from '../../../@types/MetaData'
|
import { MetaDataPublishForm } from '../../../@types/MetaData'
|
||||||
import AssetModel from '../../../models/Asset'
|
import AssetModel from '../../../models/Asset'
|
||||||
import { File } from '@oceanprotocol/squid'
|
import { File } from '@oceanprotocol/lib'
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape<MetaDataPublishForm>({
|
const validationSchema = Yup.object().shape<MetaDataPublishForm>({
|
||||||
// ---- required fields ----
|
// ---- required fields ----
|
||||||
@ -81,7 +81,7 @@ export default function PublishForm({
|
|||||||
// account,
|
// account,
|
||||||
// metadata.main.price,
|
// metadata.main.price,
|
||||||
// // Note: a hack without consequences.
|
// // Note: a hack without consequences.
|
||||||
// // Will make metadata.main.datePublished (automatically created by Aquarius)
|
// // Will make metadata.main.datePublished (automatically created by MetadataStore)
|
||||||
// // go out of sync with this service.main.datePublished.
|
// // go out of sync with this service.main.datePublished.
|
||||||
// toStringNoMS(new Date(Date.now()))
|
// toStringNoMS(new Date(Date.now()))
|
||||||
// )
|
// )
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { ReactElement, useState, useEffect } from 'react'
|
import React, { ReactElement, useState, useEffect } from 'react'
|
||||||
import { QueryResult } from '@oceanprotocol/squid/dist/node/aquarius/Aquarius'
|
import { QueryResult } from '@oceanprotocol/lib/dist/node/metadatastore/MetadataStore'
|
||||||
import SearchBar from '../../molecules/SearchBar'
|
import SearchBar from '../../molecules/SearchBar'
|
||||||
import AssetList from '../../organisms/AssetList'
|
import AssetList from '../../organisms/AssetList'
|
||||||
import { SearchPriceFilter } from '../../molecules/SearchPriceFilter'
|
import { SearchPriceFilter } from '../../molecules/SearchPriceFilter'
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import {
|
import {
|
||||||
SearchQuery,
|
SearchQuery,
|
||||||
QueryResult
|
QueryResult
|
||||||
} from '@oceanprotocol/squid/dist/node/aquarius/Aquarius'
|
} from '@oceanprotocol/lib/dist/node/metadatastore/MetadataStore'
|
||||||
import { priceQueryParamToWei } from '../../../utils'
|
import { priceQueryParamToWei } from '../../../utils'
|
||||||
import { Aquarius, Logger } from '@oceanprotocol/squid'
|
import { MetadataStore, Logger } from '@oceanprotocol/lib'
|
||||||
import { oceanConfig } from '../../../../app.config'
|
import { oceanConfig } from '../../../../app.config'
|
||||||
|
|
||||||
export function getSearchQuery(
|
export function getSearchQuery(
|
||||||
@ -52,8 +52,8 @@ export async function getResults(params: any): Promise<QueryResult> {
|
|||||||
])
|
])
|
||||||
: undefined
|
: undefined
|
||||||
|
|
||||||
const aquarius = new Aquarius(oceanConfig.aquariusUri, Logger)
|
const metadataStore = new MetadataStore(oceanConfig.metadataStoreUri, Logger)
|
||||||
const queryResult = await aquarius.queryMetadata(
|
const queryResult = await metadataStore.queryMetadata(
|
||||||
getSearchQuery(page, offset, text, tag, priceQuery)
|
getSearchQuery(page, offset, text, tag, priceQuery)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import AssetContent from '../../components/organisms/AssetContent'
|
|||||||
import Layout from '../../components/Layout'
|
import Layout from '../../components/Layout'
|
||||||
import { PageProps } from 'gatsby'
|
import { PageProps } from 'gatsby'
|
||||||
import { MetaDataMarket, ServiceMetaDataMarket } from '../../@types/MetaData'
|
import { MetaDataMarket, ServiceMetaDataMarket } from '../../@types/MetaData'
|
||||||
import { Aquarius, Logger } from '@oceanprotocol/squid'
|
import { MetadataStore, Logger } from '@oceanprotocol/lib'
|
||||||
import { oceanConfig } from '../../../app.config'
|
import { oceanConfig } from '../../../app.config'
|
||||||
import Alert from '../../components/atoms/Alert'
|
import Alert from '../../components/atoms/Alert'
|
||||||
|
|
||||||
@ -18,12 +18,15 @@ export default function AssetRoute(props: PageProps): ReactElement {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function init() {
|
async function init() {
|
||||||
try {
|
try {
|
||||||
const aquarius = new Aquarius(oceanConfig.aquariusUri, Logger)
|
const metadataStore = new MetadataStore(
|
||||||
const ddo = await aquarius.retrieveDDO(did)
|
oceanConfig.metadataStoreUri,
|
||||||
|
Logger
|
||||||
|
)
|
||||||
|
const ddo = await metadataStore.retrieveDDO(did)
|
||||||
|
|
||||||
if (!ddo) {
|
if (!ddo) {
|
||||||
setTitle('Could not retrieve asset')
|
setTitle('Could not retrieve asset')
|
||||||
setError('The DDO was not found in Aquarius.')
|
setError('The DDO was not found in MetadataStore.')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { DID } from '@oceanprotocol/squid'
|
import { DID } from '@oceanprotocol/lib'
|
||||||
import { oceanConfig } from '../../app.config'
|
import { oceanConfig } from '../../app.config'
|
||||||
|
|
||||||
export declare type GetRatingResponse = {
|
export declare type GetRatingResponse = {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import axios, { AxiosResponse } from 'axios'
|
import axios, { AxiosResponse } from 'axios'
|
||||||
import { toast } from 'react-toastify'
|
import { toast } from 'react-toastify'
|
||||||
import { File } from '@oceanprotocol/squid'
|
import { File } from '@oceanprotocol/lib'
|
||||||
import numeral from 'numeral'
|
import numeral from 'numeral'
|
||||||
import web3Utils from 'web3-utils'
|
import web3Utils from 'web3-utils'
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import axios, { AxiosResponse } from 'axios'
|
import axios, { AxiosResponse } from 'axios'
|
||||||
import Web3 from 'web3'
|
import Web3 from 'web3'
|
||||||
import { DID } from '@oceanprotocol/squid'
|
import { DID } from '@oceanprotocol/lib'
|
||||||
import { oceanConfig } from '../../app.config'
|
import { oceanConfig } from '../../app.config'
|
||||||
|
|
||||||
export declare type RatingResponse = [string, number]
|
export declare type RatingResponse = [string, number]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { DDO } from '@oceanprotocol/squid'
|
import { DDO } from '@oceanprotocol/lib'
|
||||||
import { MetaDataMarket } from '../../../src/@types/MetaData'
|
import { MetaDataMarket } from '../../../src/@types/MetaData'
|
||||||
|
|
||||||
const ddo: Partial<DDO> = {
|
const ddo: Partial<DDO> = {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ComputeJob } from '@oceanprotocol/squid'
|
import { ComputeJob } from '@oceanprotocol/lib'
|
||||||
|
|
||||||
// ComputeJob need to be updated in squid
|
// ComputeJob need to be updated in squid
|
||||||
const job: Partial<ComputeJob> = {
|
const job: Partial<ComputeJob> = {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import ddo from '../../__fixtures__/ddo'
|
import ddo from '../../__fixtures__/ddo'
|
||||||
import job from '../../__fixtures__/job'
|
import job from '../../__fixtures__/job'
|
||||||
|
|
||||||
const aquarius = {
|
const metadataStore = {
|
||||||
queryMetadata: () => {
|
queryMetadata: () => {
|
||||||
return {
|
return {
|
||||||
results: [] as any[],
|
results: [] as any[],
|
||||||
@ -12,13 +12,13 @@ const aquarius = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const squidMock = {
|
const squidMock = {
|
||||||
Aquarius: () => aquarius,
|
MetadataStore: () => metadataStore,
|
||||||
DDO: () => ddo,
|
DDO: () => ddo,
|
||||||
ocean: {
|
ocean: {
|
||||||
accounts: {
|
accounts: {
|
||||||
list: () => ['xxx', 'xxx']
|
list: () => ['xxx', 'xxx']
|
||||||
},
|
},
|
||||||
aquarius,
|
metadataStore,
|
||||||
compute: {
|
compute: {
|
||||||
status: (account: string) => {
|
status: (account: string) => {
|
||||||
return [job]
|
return [job]
|
||||||
@ -69,13 +69,13 @@ const squidMock = {
|
|||||||
name: 'Squid-js',
|
name: 'Squid-js',
|
||||||
status: 'Working'
|
status: 'Working'
|
||||||
},
|
},
|
||||||
aquarius: {
|
metadataStore: {
|
||||||
name: 'Aquarius',
|
name: 'MetadataStore',
|
||||||
status: 'Working'
|
status: 'Working'
|
||||||
},
|
},
|
||||||
brizo: {
|
provider: {
|
||||||
name: 'Brizo',
|
name: 'Provider',
|
||||||
network: 'Nile',
|
network: 'Rinkeby',
|
||||||
status: 'Working',
|
status: 'Working',
|
||||||
contracts: {
|
contracts: {
|
||||||
hello: 'hello',
|
hello: 'hello',
|
@ -1,5 +1,5 @@
|
|||||||
import React, { ReactElement } from 'react'
|
import React, { ReactElement } from 'react'
|
||||||
import squidMock from './squid'
|
import libMock from './lib'
|
||||||
import web3ProviderMock from '../web3provider'
|
import web3ProviderMock from '../web3provider'
|
||||||
|
|
||||||
const reactMock = {
|
const reactMock = {
|
||||||
@ -19,7 +19,7 @@ const reactMock = {
|
|||||||
},
|
},
|
||||||
useOcean: () => {
|
useOcean: () => {
|
||||||
return {
|
return {
|
||||||
ocean: squidMock.ocean
|
ocean: libMock.ocean
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
useWeb3: () => {
|
useWeb3: () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user