2020-06-30 19:38:02 +02:00
|
|
|
import React, { ReactElement } from 'react'
|
2020-07-14 13:01:24 +02:00
|
|
|
import libMock from './lib'
|
2020-06-30 19:38:02 +02:00
|
|
|
import web3ProviderMock from '../web3provider'
|
|
|
|
|
|
|
|
const reactMock = {
|
|
|
|
Web3Provider: function Component({
|
|
|
|
children
|
|
|
|
}: {
|
|
|
|
children: ReactElement
|
|
|
|
}): ReactElement {
|
|
|
|
return <div>{children}</div>
|
|
|
|
},
|
|
|
|
OceanProvider: function Component({
|
|
|
|
children
|
|
|
|
}: {
|
|
|
|
children: ReactElement
|
|
|
|
}): ReactElement {
|
|
|
|
return <div>{children}</div>
|
|
|
|
},
|
|
|
|
useOcean: () => {
|
|
|
|
return {
|
2020-07-14 13:01:24 +02:00
|
|
|
ocean: libMock.ocean
|
2020-06-30 19:38:02 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
useWeb3: () => {
|
|
|
|
return {
|
|
|
|
...web3ProviderMock,
|
|
|
|
account: '0x0000000011111111aaaaaaaabbbbbbbb22222222',
|
|
|
|
ethProviderStatus: 1
|
|
|
|
}
|
|
|
|
},
|
|
|
|
useConsume: () => {
|
|
|
|
return {
|
|
|
|
consume: () => null as any,
|
|
|
|
consumeStepText: '',
|
|
|
|
isLoading: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
useCompute: () => {
|
|
|
|
return {
|
|
|
|
compute: () => null as any,
|
|
|
|
isLoading: false,
|
|
|
|
computeStepText: 0,
|
|
|
|
computeError: ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
useMetadata: () => {
|
|
|
|
return {
|
|
|
|
getCuration: () => {
|
|
|
|
return Promise.resolve({ rating: 0, numVotes: 0 })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computeOptions: ['', '']
|
|
|
|
}
|
|
|
|
|
|
|
|
export default reactMock
|