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(
|
public order(
|
||||||
did: string,
|
did: string,
|
||||||
index: number,
|
index: number,
|
||||||
consumerAccount: Account
|
consumerAccount: Account,
|
||||||
provider?: string
|
provider?: string
|
||||||
): SubscribablePromise<OrderProgressStep, string> {
|
): SubscribablePromise<OrderProgressStep, string> {
|
||||||
return new SubscribablePromise(async observer => {
|
return new SubscribablePromise(async observer => {
|
||||||
|
@ -44,7 +44,8 @@ export class OceanCompute extends Instantiable {
|
|||||||
*/
|
*/
|
||||||
public order(
|
public order(
|
||||||
consumerAccount: Account,
|
consumerAccount: Account,
|
||||||
datasetDid: string
|
datasetDid: string,
|
||||||
|
provider?: string
|
||||||
): SubscribablePromise<OrderProgressStep, string> {
|
): SubscribablePromise<OrderProgressStep, string> {
|
||||||
return new SubscribablePromise(async observer => {
|
return new SubscribablePromise(async observer => {
|
||||||
const { keeper, assets, agreements } = this.ocean
|
const { keeper, assets, agreements } = this.ocean
|
||||||
@ -95,12 +96,23 @@ export class OceanCompute extends Instantiable {
|
|||||||
|
|
||||||
observer.next(OrderProgressStep.CreatingAgreement)
|
observer.next(OrderProgressStep.CreatingAgreement)
|
||||||
this.logger.log('Creating agreement')
|
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(
|
await agreements.create(
|
||||||
datasetDid,
|
datasetDid,
|
||||||
agreementId,
|
agreementId,
|
||||||
index,
|
index,
|
||||||
undefined,
|
undefined,
|
||||||
consumerAccount,
|
consumerAccount,
|
||||||
|
_provider,
|
||||||
consumerAccount
|
consumerAccount
|
||||||
)
|
)
|
||||||
this.logger.log('Agreement created')
|
this.logger.log('Agreement created')
|
||||||
|
Loading…
Reference in New Issue
Block a user