From 82b6b927bd1f8c8ab08d4d6db272d9a41201dd48 Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 09:03:18 +0200 Subject: [PATCH 01/18] Move NFTFactory interface types to \@types --- src/@types/NFTFactory.ts | 23 +++++++++++++++++++++++ src/@types/index.ts | 1 + src/contracts/factories/NFTFactory.ts | 27 +++------------------------ 3 files changed, 27 insertions(+), 24 deletions(-) create mode 100644 src/@types/NFTFactory.ts diff --git a/src/@types/NFTFactory.ts b/src/@types/NFTFactory.ts new file mode 100644 index 00000000..874a326d --- /dev/null +++ b/src/@types/NFTFactory.ts @@ -0,0 +1,23 @@ +import { ConsumeMarketFee, ProviderFees } from '.' + +export interface Template { + templateAddress: string + isActive: boolean +} + +export interface TokenOrder { + tokenAddress: string + consumer: string + serviceIndex: number + _providerFee: ProviderFees + _consumeMarketFee: ConsumeMarketFee +} + +export interface NftCreateData { + name: string + symbol: string + templateIndex: number + tokenURI: string + transferable: boolean + owner: string +} \ No newline at end of file diff --git a/src/@types/index.ts b/src/@types/index.ts index dbadc5be..7ff08ef4 100644 --- a/src/@types/index.ts +++ b/src/@types/index.ts @@ -11,6 +11,7 @@ export * from './Erc20' export * from './Erc721' export * from './FileMetadata' export * from './FixedPrice' +export * from './NFTFactory' export * from './Pool' export * from './Provider' export * from './Router' diff --git a/src/contracts/factories/NFTFactory.ts b/src/contracts/factories/NFTFactory.ts index cca80872..f4e0ef69 100644 --- a/src/contracts/factories/NFTFactory.ts +++ b/src/contracts/factories/NFTFactory.ts @@ -16,36 +16,15 @@ import { } from '../../utils' import { Config, ConfigHelper } from '../../config' import { - ProviderFees, FreCreationParams, Erc20CreateParams, PoolCreationParams, DispenserCreationParams, - ConsumeMarketFee + NftCreateData, + Template, + TokenOrder } from '../../@types' -interface Template { - templateAddress: string - isActive: boolean -} - -export interface TokenOrder { - tokenAddress: string - consumer: string - serviceIndex: number - _providerFee: ProviderFees - _consumeMarketFee: ConsumeMarketFee -} - -export interface NftCreateData { - name: string - symbol: string - templateIndex: number - tokenURI: string - transferable: boolean - owner: string -} - /** * Provides an interface for NFT Factory contract */ From f96f8fb59ba3476d5a842944eff32422dfef2e07 Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 09:05:35 +0200 Subject: [PATCH 02/18] Move Dispenser interface types to @types --- src/@types/Dispenser.ts | 10 ++++++++++ src/contracts/pools/Dispenser.ts | 11 +---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/@types/Dispenser.ts b/src/@types/Dispenser.ts index 6919ef22..417ecc48 100644 --- a/src/@types/Dispenser.ts +++ b/src/@types/Dispenser.ts @@ -5,3 +5,13 @@ export interface DispenserCreationParams { withMint?: boolean // true if we want to allow the dispenser to be a minter allowedSwapper?: string // only account that can ask tokens. set address(0) if not required } + +export interface DispenserToken { + active: boolean + owner: string + maxTokens: string + maxBalance: string + balance: string + isMinter: boolean + allowedSwapper: string +} \ No newline at end of file diff --git a/src/contracts/pools/Dispenser.ts b/src/contracts/pools/Dispenser.ts index d50a0668..61797fa5 100644 --- a/src/contracts/pools/Dispenser.ts +++ b/src/contracts/pools/Dispenser.ts @@ -12,16 +12,7 @@ import { } from '../../utils/' import { Datatoken } from '..' import { Config, ConfigHelper } from '../../config' - -export interface DispenserToken { - active: boolean - owner: string - maxTokens: string - maxBalance: string - balance: string - isMinter: boolean - allowedSwapper: string -} +import { DispenserToken } from '../../@types' export class Dispenser { public web3: Web3 = null From c7bb0452641c4dba024f7092526376aa5b523afd Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 09:06:20 +0200 Subject: [PATCH 03/18] fix lint problems --- src/@types/Dispenser.ts | 2 +- src/@types/NFTFactory.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/@types/Dispenser.ts b/src/@types/Dispenser.ts index 417ecc48..02749dfb 100644 --- a/src/@types/Dispenser.ts +++ b/src/@types/Dispenser.ts @@ -14,4 +14,4 @@ export interface DispenserToken { balance: string isMinter: boolean allowedSwapper: string -} \ No newline at end of file +} diff --git a/src/@types/NFTFactory.ts b/src/@types/NFTFactory.ts index 874a326d..5e20ac9d 100644 --- a/src/@types/NFTFactory.ts +++ b/src/@types/NFTFactory.ts @@ -20,4 +20,4 @@ export interface NftCreateData { tokenURI: string transferable: boolean owner: string -} \ No newline at end of file +} From 970c2011ef150a113f3508bcdaba1881acea8bae Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 09:08:23 +0200 Subject: [PATCH 04/18] Move FixedRateExchange interface types to @types --- src/@types/FixedPrice.ts | 26 +++++++++++++++ src/contracts/pools/FixedRateExchange.ts | 41 +----------------------- 2 files changed, 27 insertions(+), 40 deletions(-) diff --git a/src/@types/FixedPrice.ts b/src/@types/FixedPrice.ts index 3fe6ea43..8527a7f0 100644 --- a/src/@types/FixedPrice.ts +++ b/src/@types/FixedPrice.ts @@ -25,3 +25,29 @@ export interface PriceAndFees { marketFeeAmount: string consumeMarketFeeAmount: string } + +export interface FixedPriceExchange { + active: boolean + exchangeOwner: string + datatoken: string + baseToken: string + fixedRate: string + dtDecimals: string + btDecimals: string + dtBalance: string + btBalance: string + dtSupply: string + btSupply: string + withMint: boolean + allowedSwapper: string + exchangeId?: string +} + +export interface FeesInfo { + opcFee: string + marketFee: string + marketFeeCollector: string + marketFeeAvailable: string + oceanFeeAvailable: string + exchangeId: string +} diff --git a/src/contracts/pools/FixedRateExchange.ts b/src/contracts/pools/FixedRateExchange.ts index 88fc921b..c5d28c41 100644 --- a/src/contracts/pools/FixedRateExchange.ts +++ b/src/contracts/pools/FixedRateExchange.ts @@ -13,46 +13,7 @@ import { ZERO_ADDRESS } from '../../utils' import { Config, ConfigHelper } from '../../config' -import { PriceAndFees } from '../../@types' - -export interface FixedPriceExchange { - active: boolean - exchangeOwner: string - datatoken: string - baseToken: string - fixedRate: string - dtDecimals: string - btDecimals: string - dtBalance: string - btBalance: string - dtSupply: string - btSupply: string - withMint: boolean - allowedSwapper: string - exchangeId?: string -} - -export interface FeesInfo { - opcFee: string - marketFee: string - marketFeeCollector: string - marketFeeAvailable: string - oceanFeeAvailable: string - exchangeId: string -} -export interface FixedPriceSwap { - exchangeId: string - caller: string - baseTokenAmount: string - datatokenAmount: string -} - -/* eslint-disable no-unused-vars */ -export enum FixedRateCreateProgressStep { - CreatingExchange, - ApprovingDatatoken -} -/* eslint-enable no-unused-vars */ +import { PriceAndFees, FeesInfo, FixedPriceExchange } from '../../@types' export class FixedRateExchange { /** Ocean related functions */ From 38895fcf621c3fd6ce8dc8081800aef8f48af89d Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 09:09:55 +0200 Subject: [PATCH 05/18] Move MAX_UINT_256 constant to Constants file --- src/contracts/pools/Pool.ts | 14 ++++++-------- src/utils/Constants.ts | 2 ++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/contracts/pools/Pool.ts b/src/contracts/pools/Pool.ts index 5f5dd1ee..381912fd 100644 --- a/src/contracts/pools/Pool.ts +++ b/src/contracts/pools/Pool.ts @@ -16,7 +16,8 @@ import { getMaxAddLiquidity, getMaxRemoveLiquidity, getMaxSwapExactIn, - getMaxSwapExactOut + getMaxSwapExactOut, + MAX_UINT_256 } from '../../utils' import { CurrentFees, @@ -27,9 +28,6 @@ import { } from '../../@types' import { Config, ConfigHelper } from '../../config' -const MaxUint256 = - '115792089237316195423570985008687907853269984665640564039457584007913129639934' - /** * Provides an interface to Ocean friendly fork from Balancer BPool */ @@ -803,7 +801,7 @@ export class Pool { await this.getBaseToken(poolAddress), amountsInOutMaxFee.maxPrice ) - : MaxUint256 + : MAX_UINT_256 return estimateGas( address, @@ -868,7 +866,7 @@ export class Pool { await this.getBaseToken(poolAddress), amountsInOutMaxFee.maxPrice ) - : MaxUint256 + : MAX_UINT_256 const estGas = await estimateGas( address, @@ -954,7 +952,7 @@ export class Pool { await this.getBaseToken(poolAddress), amountsInOutMaxFee.maxPrice ) - : MaxUint256 + : MAX_UINT_256 return estimateGas( address, @@ -1015,7 +1013,7 @@ export class Pool { await this.getBaseToken(poolAddress), amountsInOutMaxFee.maxPrice ) - : MaxUint256 + : MAX_UINT_256 const estGas = await estimateGas( account, diff --git a/src/utils/Constants.ts b/src/utils/Constants.ts index 7295e074..2b97edbf 100644 --- a/src/utils/Constants.ts +++ b/src/utils/Constants.ts @@ -1,2 +1,4 @@ export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' export const GASLIMIT_DEFAULT = 1000000 +export const MAX_UINT_256 = + '115792089237316195423570985008687907853269984665640564039457584007913129639934' From ff3e50994451da2033ee4583bcdb30983dd31c05 Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 09:11:25 +0200 Subject: [PATCH 06/18] Move Provider interface types to @types --- src/@types/Provider.ts | 9 +++++++++ src/services/Provider.ts | 17 +++-------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/@types/Provider.ts b/src/@types/Provider.ts index a8be432c..1b2e64c6 100644 --- a/src/@types/Provider.ts +++ b/src/@types/Provider.ts @@ -26,3 +26,12 @@ export interface ProviderComputeInitializeResults { algorithm?: ProviderComputeInitialize datasets?: ProviderComputeInitialize[] } + +export interface ServiceEndpoint { + serviceName: string + method: string + urlPath: string +} +export interface UserCustomParameters { + [key: string]: any +} diff --git a/src/services/Provider.ts b/src/services/Provider.ts index 602d95c3..412a8469 100644 --- a/src/services/Provider.ts +++ b/src/services/Provider.ts @@ -9,22 +9,11 @@ import { ComputeAsset, ComputeEnvironment, ProviderInitialize, - ProviderComputeInitializeResults + ProviderComputeInitializeResults, + ServiceEndpoint, + UserCustomParameters } from '../@types' -export interface HttpCallback { - (httpMethod: string, url: string, body: string, header: any): Promise -} - -export interface ServiceEndpoint { - serviceName: string - method: string - urlPath: string -} -export interface UserCustomParameters { - [key: string]: any -} - export class Provider { /** * Returns the provider endpoints From 433878c54c248f977d8bbb34cc172c26c610d1a5 Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 09:58:11 +0200 Subject: [PATCH 07/18] Move Datatoken interface types to @types --- src/@types/Erc20.ts | 21 +++++++++++++++++++++ src/contracts/tokens/Datatoken.ts | 27 ++++----------------------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/@types/Erc20.ts b/src/@types/Erc20.ts index 19643b47..15715c98 100644 --- a/src/@types/Erc20.ts +++ b/src/@types/Erc20.ts @@ -1,3 +1,5 @@ +import { ProviderFees } from '.' + export interface Erc20CreateParams { templateIndex: number minter: string @@ -21,3 +23,22 @@ export interface PublishingMarketFee { publishMarketFeeToken: string publishMarketFeeAmount: string } + +export interface Roles { + minter: boolean + paymentManager: boolean +} + +export interface OrderParams { + consumer: string + serviceIndex: number + _providerFee: ProviderFees + _consumeMarketFee: ConsumeMarketFee +} + +export interface DispenserParams { + maxTokens: string + maxBalance: string + withMint?: boolean // true if we want to allow the dispenser to be a minter + allowedSwapper?: string // only account that can ask tokens. set address(0) if not required +} diff --git a/src/contracts/tokens/Datatoken.ts b/src/contracts/tokens/Datatoken.ts index 21912fb5..53779474 100644 --- a/src/contracts/tokens/Datatoken.ts +++ b/src/contracts/tokens/Datatoken.ts @@ -18,33 +18,14 @@ import { FreOrderParams, FreCreationParams, ProviderFees, - PublishingMarketFee + PublishingMarketFee, + DispenserParams, + OrderParams, + Roles } from '../../@types' import { Nft } from './NFT' import { Config, ConfigHelper } from '../../config' -/** - * ERC20 ROLES - */ -interface Roles { - minter: boolean - paymentManager: boolean -} - -export interface OrderParams { - consumer: string - serviceIndex: number - _providerFee: ProviderFees - _consumeMarketFee: ConsumeMarketFee -} - -export interface DispenserParams { - maxTokens: string - maxBalance: string - withMint?: boolean // true if we want to allow the dispenser to be a minter - allowedSwapper?: string // only account that can ask tokens. set address(0) if not required -} - export class Datatoken { public factoryAddress: string public factoryABI: AbiItem | AbiItem[] From 19b9ced779a20d14d625fb361182de9b2257cba4 Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 09:59:31 +0200 Subject: [PATCH 08/18] rename Roles to DatatokenRoles --- src/@types/Erc20.ts | 2 +- src/contracts/tokens/Datatoken.ts | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/@types/Erc20.ts b/src/@types/Erc20.ts index 15715c98..96cdb2bb 100644 --- a/src/@types/Erc20.ts +++ b/src/@types/Erc20.ts @@ -24,7 +24,7 @@ export interface PublishingMarketFee { publishMarketFeeAmount: string } -export interface Roles { +export interface DatatokenRoles { minter: boolean paymentManager: boolean } diff --git a/src/contracts/tokens/Datatoken.ts b/src/contracts/tokens/Datatoken.ts index 53779474..962937b4 100644 --- a/src/contracts/tokens/Datatoken.ts +++ b/src/contracts/tokens/Datatoken.ts @@ -21,7 +21,7 @@ import { PublishingMarketFee, DispenserParams, OrderParams, - Roles + DatatokenRoles } from '../../@types' import { Nft } from './NFT' import { Config, ConfigHelper } from '../../config' @@ -1215,9 +1215,12 @@ export class Datatoken { /** Returns ERC20 user's permissions for a datatoken * @param {String} dtAddress Datatoken adress * @param {String} address user adress - * @return {Promise} + * @return {Promise} */ - public async getDTPermissions(dtAddress: string, address: string): Promise { + public async getDTPermissions( + dtAddress: string, + address: string + ): Promise { const dtContract = setContractDefaults( new this.web3.eth.Contract(this.datatokensAbi, dtAddress), this.config From 2c2fccdfb0e3a5ebb481f5768a72be41053cc1c3 Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 10:01:19 +0200 Subject: [PATCH 09/18] Move NFT interface types to @types --- src/@types/Erc721.ts | 7 +++++++ src/contracts/tokens/NFT.ts | 18 ++++-------------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/@types/Erc721.ts b/src/@types/Erc721.ts index 5b2289e3..4ba47066 100644 --- a/src/@types/Erc721.ts +++ b/src/@types/Erc721.ts @@ -11,3 +11,10 @@ export interface MetadataAndTokenURI { tokenURI: string metadataProofs?: MetadataProof[] } + +export interface NftRoles { + manager: boolean + deployERC20: boolean + updateMetadata: boolean + store: boolean +} diff --git a/src/contracts/tokens/NFT.ts b/src/contracts/tokens/NFT.ts index 202d9f51..e926eaf2 100644 --- a/src/contracts/tokens/NFT.ts +++ b/src/contracts/tokens/NFT.ts @@ -10,19 +10,9 @@ import { estimateGas } from '../../utils' import { Contract } from 'web3-eth-contract' -import { MetadataProof, MetadataAndTokenURI } from '../../@types' +import { MetadataProof, MetadataAndTokenURI, NftRoles } from '../../@types' import { Config, ConfigHelper } from '../../config' -/** - * ERC721 ROLES - */ -interface Roles { - manager: boolean - deployERC20: boolean - updateMetadata: boolean - store: boolean -} - export class Nft { public factory721Address: string public factory721Abi: AbiItem | AbiItem[] @@ -1173,9 +1163,9 @@ export class Nft { /** Get users NFT Permissions * @param {String} nftAddress erc721 contract adress * @param {String} address user adress - * @return {Promise} + * @return {Promise} */ - public async getNftPermissions(nftAddress: string, address: string): Promise { + public async getNftPermissions(nftAddress: string, address: string): Promise { const nftContract = setContractDefaults( new this.web3.eth.Contract(this.nftAbi, nftAddress), this.config @@ -1199,7 +1189,7 @@ export class Nft { /** Get users ERC20Deployer role * @param {String} nftAddress erc721 contract adress * @param {String} address user adress - * @return {Promise} + * @return {Promise} */ public async isErc20Deployer(nftAddress: string, address: string): Promise { const nftContract = setContractDefaults( From 3f71d957668c123c883811f9a2da3bc95930dbd3 Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 10:02:00 +0200 Subject: [PATCH 10/18] remove unused factory721Abi property --- src/contracts/tokens/NFT.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/contracts/tokens/NFT.ts b/src/contracts/tokens/NFT.ts index e926eaf2..4cc19f25 100644 --- a/src/contracts/tokens/NFT.ts +++ b/src/contracts/tokens/NFT.ts @@ -15,7 +15,6 @@ import { Config, ConfigHelper } from '../../config' export class Nft { public factory721Address: string - public factory721Abi: AbiItem | AbiItem[] public nftAbi: AbiItem | AbiItem[] public web3: Web3 public startBlock: number From 4dcb8a72efbd58a05ef8c1524ef3624d98152c94 Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 10:03:18 +0200 Subject: [PATCH 11/18] remove unused oceanAddress parameter --- src/contracts/pools/FixedRateExchange.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/contracts/pools/FixedRateExchange.ts b/src/contracts/pools/FixedRateExchange.ts index c5d28c41..ef1217b7 100644 --- a/src/contracts/pools/FixedRateExchange.ts +++ b/src/contracts/pools/FixedRateExchange.ts @@ -17,7 +17,6 @@ import { PriceAndFees, FeesInfo, FixedPriceExchange } from '../../@types' export class FixedRateExchange { /** Ocean related functions */ - public oceanAddress: string = null public fixedRateAddress: string public fixedRateExchangeAbi: AbiItem | AbiItem[] public web3: Web3 @@ -36,14 +35,12 @@ export class FixedRateExchange { fixedRateAddress: string, network?: string | number, fixedRateExchangeAbi: AbiItem | AbiItem[] = null, - oceanAddress: string = null, config?: Config ) { this.web3 = web3 this.config = config || new ConfigHelper().getConfig(network || 'unknown') this.fixedRateExchangeAbi = fixedRateExchangeAbi || (defaultFixedRateExchangeAbi.abi as AbiItem[]) - this.oceanAddress = oceanAddress this.fixedRateAddress = fixedRateAddress this.fixedRateContract = setContractDefaults( new this.web3.eth.Contract(this.fixedRateExchangeAbi, this.fixedRateAddress), From d23c1d1b05081105e8fb41e5333a30075185029e Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 10:04:39 +0200 Subject: [PATCH 12/18] remove unused oceanAddress parameter --- src/contracts/tokens/Datatoken.ts | 1 - .../pools/fixedRate/FixedRateExchange.test.ts | 16 ++-------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/contracts/tokens/Datatoken.ts b/src/contracts/tokens/Datatoken.ts index 962937b4..26d8b9f3 100644 --- a/src/contracts/tokens/Datatoken.ts +++ b/src/contracts/tokens/Datatoken.ts @@ -28,7 +28,6 @@ import { Config, ConfigHelper } from '../../config' export class Datatoken { public factoryAddress: string - public factoryABI: AbiItem | AbiItem[] public datatokensAbi: AbiItem | AbiItem[] public datatokensEnterpriseAbi: AbiItem | AbiItem[] public web3: Web3 diff --git a/test/unit/pools/fixedRate/FixedRateExchange.test.ts b/test/unit/pools/fixedRate/FixedRateExchange.test.ts index dba2b639..6d09be46 100644 --- a/test/unit/pools/fixedRate/FixedRateExchange.test.ts +++ b/test/unit/pools/fixedRate/FixedRateExchange.test.ts @@ -100,13 +100,7 @@ describe('Fixed Rate unit test', () => { // user1 has no dt1 expect(await balance(web3, dtAddress, user1)).to.equal('0') - fixedRate = new FixedRateExchange( - web3, - contracts.fixedRateAddress, - 8996, - null, - contracts.oceanAddress - ) + fixedRate = new FixedRateExchange(web3, contracts.fixedRateAddress, 8996) assert(fixedRate != null) }) @@ -415,13 +409,7 @@ describe('Fixed Rate unit test', () => { // user1 has no dt1 expect(await balance(web3, dtAddress, user1)).to.equal('0') - fixedRate = new FixedRateExchange( - web3, - contracts.fixedRateAddress, - 8996, - null, - contracts.oceanAddress - ) + fixedRate = new FixedRateExchange(web3, contracts.fixedRateAddress, 8996) assert(fixedRate != null) }) From 1d92f06108d5c4ff57d0c9b4b49bf41bce92a16b Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 14:49:46 +0200 Subject: [PATCH 13/18] console log to find issue --- test/integration/ComputeFlow.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/integration/ComputeFlow.test.ts b/test/integration/ComputeFlow.test.ts index aa494b08..f7e7814f 100644 --- a/test/integration/ComputeFlow.test.ts +++ b/test/integration/ComputeFlow.test.ts @@ -428,6 +428,12 @@ describe('Simple compute tests', async () => { serviceId: resolvedAlgoDdoWith1mTimeout.services[0].id } + console.log('assets', assets) + console.log('algo', algo) + console.log('computeEnv', computeEnv) + console.log('computeValidUntil', computeValidUntil) + console.log('providerUrl', providerUrl) + console.log('consumerAccount', consumerAccount) providerInitializeComputeResults = await ProviderInstance.initializeCompute( assets, algo, @@ -436,6 +442,7 @@ describe('Simple compute tests', async () => { providerUrl, consumerAccount ) + console.log(providerInitializeComputeResults) assert( !('error' in providerInitializeComputeResults.algorithm), 'Cannot order algorithm' From d065a778f4be704f018b835294a39008e4bc4b86 Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 15:05:01 +0200 Subject: [PATCH 14/18] console log to find issue --- test/integration/ComputeFlow.test.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/integration/ComputeFlow.test.ts b/test/integration/ComputeFlow.test.ts index f7e7814f..6a801b90 100644 --- a/test/integration/ComputeFlow.test.ts +++ b/test/integration/ComputeFlow.test.ts @@ -447,6 +447,16 @@ describe('Simple compute tests', async () => { !('error' in providerInitializeComputeResults.algorithm), 'Cannot order algorithm' ) + console.log( + 'providerInitializeComputeResults.algorithm', + providerInitializeComputeResults.algorithm + ) + console.log( + 'resolvedAlgoDdoWith1mTimeout.services[0].datatokenAddress', + resolvedAlgoDdoWith1mTimeout.services[0].datatokenAddress + ) + console.log('consumerAccount', consumerAccount) + console.log('computeConsumerAddress', computeConsumerAddress) algo.transferTxId = await handleOrder( providerInitializeComputeResults.algorithm, resolvedAlgoDdoWith1mTimeout.services[0].datatokenAddress, @@ -463,6 +473,12 @@ describe('Simple compute tests', async () => { 0 ) } + console.log('algo.transferTxId', algo.transferTxId) + console.log('providerUrl', providerUrl) + console.log('consumerAccount', consumerAccount) + console.log('computeEnv', computeEnv) + console.log('assets[0]', assets[0]) + console.log('algo', algo) const computeJobs = await ProviderInstance.computeStart( providerUrl, web3, @@ -471,6 +487,7 @@ describe('Simple compute tests', async () => { assets[0], algo ) + console.log('computeJobs', computeJobs) assert(computeJobs, 'Cannot start compute job') computeJobId = computeJobs[0].jobId }) From 8f3635ee6101b99d66b0723d8e1a67c638c1b092 Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 16:23:01 +0200 Subject: [PATCH 15/18] revert console log to find issue --- test/integration/ComputeFlow.test.ts | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/test/integration/ComputeFlow.test.ts b/test/integration/ComputeFlow.test.ts index 6a801b90..aa494b08 100644 --- a/test/integration/ComputeFlow.test.ts +++ b/test/integration/ComputeFlow.test.ts @@ -428,12 +428,6 @@ describe('Simple compute tests', async () => { serviceId: resolvedAlgoDdoWith1mTimeout.services[0].id } - console.log('assets', assets) - console.log('algo', algo) - console.log('computeEnv', computeEnv) - console.log('computeValidUntil', computeValidUntil) - console.log('providerUrl', providerUrl) - console.log('consumerAccount', consumerAccount) providerInitializeComputeResults = await ProviderInstance.initializeCompute( assets, algo, @@ -442,21 +436,10 @@ describe('Simple compute tests', async () => { providerUrl, consumerAccount ) - console.log(providerInitializeComputeResults) assert( !('error' in providerInitializeComputeResults.algorithm), 'Cannot order algorithm' ) - console.log( - 'providerInitializeComputeResults.algorithm', - providerInitializeComputeResults.algorithm - ) - console.log( - 'resolvedAlgoDdoWith1mTimeout.services[0].datatokenAddress', - resolvedAlgoDdoWith1mTimeout.services[0].datatokenAddress - ) - console.log('consumerAccount', consumerAccount) - console.log('computeConsumerAddress', computeConsumerAddress) algo.transferTxId = await handleOrder( providerInitializeComputeResults.algorithm, resolvedAlgoDdoWith1mTimeout.services[0].datatokenAddress, @@ -473,12 +456,6 @@ describe('Simple compute tests', async () => { 0 ) } - console.log('algo.transferTxId', algo.transferTxId) - console.log('providerUrl', providerUrl) - console.log('consumerAccount', consumerAccount) - console.log('computeEnv', computeEnv) - console.log('assets[0]', assets[0]) - console.log('algo', algo) const computeJobs = await ProviderInstance.computeStart( providerUrl, web3, @@ -487,7 +464,6 @@ describe('Simple compute tests', async () => { assets[0], algo ) - console.log('computeJobs', computeJobs) assert(computeJobs, 'Cannot start compute job') computeJobId = computeJobs[0].jobId }) From 13e66b1fae9b03cc5f3a123b93d8d2b3eba0f4e2 Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 17:02:04 +0200 Subject: [PATCH 16/18] console log to find issue --- test/integration/ComputeFlow.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/integration/ComputeFlow.test.ts b/test/integration/ComputeFlow.test.ts index aa494b08..f7e7814f 100644 --- a/test/integration/ComputeFlow.test.ts +++ b/test/integration/ComputeFlow.test.ts @@ -428,6 +428,12 @@ describe('Simple compute tests', async () => { serviceId: resolvedAlgoDdoWith1mTimeout.services[0].id } + console.log('assets', assets) + console.log('algo', algo) + console.log('computeEnv', computeEnv) + console.log('computeValidUntil', computeValidUntil) + console.log('providerUrl', providerUrl) + console.log('consumerAccount', consumerAccount) providerInitializeComputeResults = await ProviderInstance.initializeCompute( assets, algo, @@ -436,6 +442,7 @@ describe('Simple compute tests', async () => { providerUrl, consumerAccount ) + console.log(providerInitializeComputeResults) assert( !('error' in providerInitializeComputeResults.algorithm), 'Cannot order algorithm' From 7d21fc195bd18404d695c5c16c1b7a8a3b7fe362 Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 17:16:30 +0200 Subject: [PATCH 17/18] console log to find issue --- test/integration/ComputeFlow.test.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/integration/ComputeFlow.test.ts b/test/integration/ComputeFlow.test.ts index f7e7814f..6a801b90 100644 --- a/test/integration/ComputeFlow.test.ts +++ b/test/integration/ComputeFlow.test.ts @@ -447,6 +447,16 @@ describe('Simple compute tests', async () => { !('error' in providerInitializeComputeResults.algorithm), 'Cannot order algorithm' ) + console.log( + 'providerInitializeComputeResults.algorithm', + providerInitializeComputeResults.algorithm + ) + console.log( + 'resolvedAlgoDdoWith1mTimeout.services[0].datatokenAddress', + resolvedAlgoDdoWith1mTimeout.services[0].datatokenAddress + ) + console.log('consumerAccount', consumerAccount) + console.log('computeConsumerAddress', computeConsumerAddress) algo.transferTxId = await handleOrder( providerInitializeComputeResults.algorithm, resolvedAlgoDdoWith1mTimeout.services[0].datatokenAddress, @@ -463,6 +473,12 @@ describe('Simple compute tests', async () => { 0 ) } + console.log('algo.transferTxId', algo.transferTxId) + console.log('providerUrl', providerUrl) + console.log('consumerAccount', consumerAccount) + console.log('computeEnv', computeEnv) + console.log('assets[0]', assets[0]) + console.log('algo', algo) const computeJobs = await ProviderInstance.computeStart( providerUrl, web3, @@ -471,6 +487,7 @@ describe('Simple compute tests', async () => { assets[0], algo ) + console.log('computeJobs', computeJobs) assert(computeJobs, 'Cannot start compute job') computeJobId = computeJobs[0].jobId }) From ada16aaca2ee5afd578e6e870825d3a2ccb3998a Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Mon, 6 Jun 2022 17:29:46 +0200 Subject: [PATCH 18/18] revert console log to find issue --- test/integration/ComputeFlow.test.ts | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/test/integration/ComputeFlow.test.ts b/test/integration/ComputeFlow.test.ts index 6a801b90..aa494b08 100644 --- a/test/integration/ComputeFlow.test.ts +++ b/test/integration/ComputeFlow.test.ts @@ -428,12 +428,6 @@ describe('Simple compute tests', async () => { serviceId: resolvedAlgoDdoWith1mTimeout.services[0].id } - console.log('assets', assets) - console.log('algo', algo) - console.log('computeEnv', computeEnv) - console.log('computeValidUntil', computeValidUntil) - console.log('providerUrl', providerUrl) - console.log('consumerAccount', consumerAccount) providerInitializeComputeResults = await ProviderInstance.initializeCompute( assets, algo, @@ -442,21 +436,10 @@ describe('Simple compute tests', async () => { providerUrl, consumerAccount ) - console.log(providerInitializeComputeResults) assert( !('error' in providerInitializeComputeResults.algorithm), 'Cannot order algorithm' ) - console.log( - 'providerInitializeComputeResults.algorithm', - providerInitializeComputeResults.algorithm - ) - console.log( - 'resolvedAlgoDdoWith1mTimeout.services[0].datatokenAddress', - resolvedAlgoDdoWith1mTimeout.services[0].datatokenAddress - ) - console.log('consumerAccount', consumerAccount) - console.log('computeConsumerAddress', computeConsumerAddress) algo.transferTxId = await handleOrder( providerInitializeComputeResults.algorithm, resolvedAlgoDdoWith1mTimeout.services[0].datatokenAddress, @@ -473,12 +456,6 @@ describe('Simple compute tests', async () => { 0 ) } - console.log('algo.transferTxId', algo.transferTxId) - console.log('providerUrl', providerUrl) - console.log('consumerAccount', consumerAccount) - console.log('computeEnv', computeEnv) - console.log('assets[0]', assets[0]) - console.log('algo', algo) const computeJobs = await ProviderInstance.computeStart( providerUrl, web3, @@ -487,7 +464,6 @@ describe('Simple compute tests', async () => { assets[0], algo ) - console.log('computeJobs', computeJobs) assert(computeJobs, 'Cannot start compute job') computeJobId = computeJobs[0].jobId })