mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
fixed error related to asset consuming #114
This commit is contained in:
parent
1ecbb69937
commit
83cf56b57e
@ -245,7 +245,7 @@ export default class Ocean {
|
||||
const event: ContractEvent = EventListener.subscribe(
|
||||
accessService.serviceAgreementContract.contractName,
|
||||
accessService.serviceAgreementContract.events[0].name, {
|
||||
serviceAgreementId,
|
||||
serviceAgreementId: `0x${serviceAgreementId}`,
|
||||
})
|
||||
|
||||
event.listenOnce(async (data) => {
|
||||
@ -296,7 +296,7 @@ export default class Ocean {
|
||||
const accessEvent: ContractEvent = EventListener.subscribe(
|
||||
accessService.conditions[1].contractName,
|
||||
accessService.conditions[1].events[1].name, {})
|
||||
|
||||
const files = new Promise(resolve => {
|
||||
accessEvent.listenOnce(async () => {
|
||||
Logger.log("Awesome; got a AccessGranted Event. Let's download the asset files.")
|
||||
const contentUrls = await SecretStoreProvider
|
||||
@ -314,6 +314,8 @@ export default class Ocean {
|
||||
}
|
||||
|
||||
cb(files)
|
||||
resolve(files)
|
||||
})
|
||||
})
|
||||
|
||||
await BrizoProvider
|
||||
@ -324,6 +326,8 @@ export default class Ocean {
|
||||
serviceDefinitionId,
|
||||
serviceAgreementSignature,
|
||||
consumer.getId())
|
||||
|
||||
await files
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user