mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
merge fixes
This commit is contained in:
parent
e31aa81dcc
commit
c8ea5f77c2
@ -292,7 +292,7 @@ export class OceanAssets extends Instantiable {
|
||||
public order(
|
||||
did: string,
|
||||
index: number,
|
||||
consumerAccount: Account
|
||||
consumerAccount: Account,
|
||||
provider?: string
|
||||
): SubscribablePromise<OrderProgressStep, string> {
|
||||
return new SubscribablePromise(async observer => {
|
||||
|
@ -44,7 +44,8 @@ export class OceanCompute extends Instantiable {
|
||||
*/
|
||||
public order(
|
||||
consumerAccount: Account,
|
||||
datasetDid: string
|
||||
datasetDid: string,
|
||||
provider?: string
|
||||
): SubscribablePromise<OrderProgressStep, string> {
|
||||
return new SubscribablePromise(async observer => {
|
||||
const { keeper, assets, agreements } = this.ocean
|
||||
@ -95,12 +96,23 @@ export class OceanCompute extends Instantiable {
|
||||
|
||||
observer.next(OrderProgressStep.CreatingAgreement)
|
||||
this.logger.log('Creating agreement')
|
||||
|
||||
// Get provider from didRegistry if not given in arguments
|
||||
let _provider = provider
|
||||
if (!provider) {
|
||||
const providers = await keeper.didRegistry.getDIDProviders(ddo.shortId())
|
||||
if (providers) {
|
||||
_provider = providers[0]
|
||||
}
|
||||
}
|
||||
|
||||
await agreements.create(
|
||||
datasetDid,
|
||||
agreementId,
|
||||
index,
|
||||
undefined,
|
||||
consumerAccount,
|
||||
_provider,
|
||||
consumerAccount
|
||||
)
|
||||
this.logger.log('Agreement created')
|
||||
|
Loading…
Reference in New Issue
Block a user