1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

added the check for the status of the template that is used to sign the service agreement

This commit is contained in:
Sebastian Gerske 2018-12-14 16:11:26 +01:00
parent e1b1642907
commit 85496f7002

View File

@ -109,6 +109,12 @@ export default class ServiceAgreement extends OceanBase {
throw new Error(`TemplateId not found in service "${service.type}" ddo.`)
}
const templateActive = await serviceAgreement.getTemplateStatus(service.templateId)
if (!templateActive) {
throw new Error(`Template with id ${service.templateId} is not active.`)
}
const executeAgreementReceipt = await serviceAgreement
.executeAgreement(
service.templateId,