From 5433d1e07f7f21b20ffd9525a136bc0f1e948dde Mon Sep 17 00:00:00 2001 From: Ahmed Ali Date: Fri, 26 Jun 2020 11:31:56 +0200 Subject: [PATCH] fix singature --- src/provider/Provider.ts | 9 +++------ test/integration/config.ts | 6 +++++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/provider/Provider.ts b/src/provider/Provider.ts index 96af5534..8a2e0864 100644 --- a/src/provider/Provider.ts +++ b/src/provider/Provider.ts @@ -3,7 +3,7 @@ import { noZeroX } from '../utils' import { Instantiable, InstantiableConfig } from '../Instantiable.abstract' import { File } from '../ddo/interfaces/File' -const apiPath = '/api/v1/provider/services' +const apiPath = '/api/v1/services' /** * Provides an interface for provider service. @@ -40,7 +40,7 @@ export class Provider extends Instantiable { } public async encrypt(did: string, document: any, account: Account): Promise { - const signature = this.ocean.utils.signature.signWithHash( + const signature = await this.ocean.utils.signature.signWithHash( did, account.getId(), account.getPassword() @@ -52,15 +52,12 @@ export class Provider extends Instantiable { document: JSON.stringify(document), publisherAddress: account.getId() } - + console.log(args) try { const response = await this.ocean.utils.fetch.post( this.getEncryptEndpoint(), decodeURI(JSON.stringify(args)) ) - if (!response.ok) { - throw new Error('HTTP request failed') - } return await response.text() } catch (e) { this.logger.error(e) diff --git a/test/integration/config.ts b/test/integration/config.ts index b4fc22ed..c8df3d09 100644 --- a/test/integration/config.ts +++ b/test/integration/config.ts @@ -7,7 +7,8 @@ const Web3 = require('web3') const web3 = new Web3('http://127.0.0.1:8545') export default { - metadataStoreUri: 'http://localhost:5000', + // metadataStoreUri: 'http://localhost:5000', + metadataStoreUri: 'https://aquarius.marketplace.dev-ocean.com', providerUri: 'http://localhost:8030', nodeUri: `http://localhost:${process.env.ETH_PORT || 8545}`, parityUri: 'http://localhost:9545', @@ -15,3 +16,6 @@ export default { verbose: LogLevel.Error, web3Provider: web3 } as Config + +// export PROVIDER_ADDRESS=0x94aeb88c9C7B933D131CAF4571eab7eE1Cb35e1D +// export PROVIDER_KEY=0x87e6661e4846e29dc478148f33899aea068e1da5996fe13e1dc64d675c06922f \ No newline at end of file