diff --git a/src/keeper/contracts/templates/AgreementTemplateBase.ts b/src/keeper/contracts/templates/AgreementTemplateBase.ts index 6203fe7..b8b2683 100644 --- a/src/keeper/contracts/templates/AgreementTemplateBase.ts +++ b/src/keeper/contracts/templates/AgreementTemplateBase.ts @@ -59,6 +59,7 @@ export class AgreementTemplateBase { this.conditions = conditions this.logger = LoggerInstance + this.templateName = 'invalid' } public async createAgreementFromDDO( @@ -90,8 +91,12 @@ export class AgreementTemplateBase { ) } + public getName() { + return this.templateName + } + public getId() { - return this.templateManager.generateId(this.templateName) + return this.templateManager.generateId(this.getName()) } /** @@ -144,7 +149,6 @@ export class AgreementTemplateBase { return null } - // getAgreementData /** * Conditions address list. * @return {Promise} Conditions address. diff --git a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts index 6acb7b5..bbcb6a5 100644 --- a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts +++ b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts @@ -1,8 +1,19 @@ -import { AgreementTemplateBase } from './AgreementTemplateBase' +import { AgreementTemplateBase, Conditions } from './AgreementTemplateBase' import { escrowAccessServiceAgreementTemplate } from './EscrowAccess.serviceAgreementTemplate' +import { AgreementStoreManager, TemplateStoreManager } from '../managers' +import DIDRegistry from '../DIDRegistry'; export class EscrowAccessSecretStoreTemplate extends AgreementTemplateBase { - public templateName: 'EscrowAccessSecretStoreTemplate' + + public constructor( + templateManager: TemplateStoreManager, + agreementStoreManager: AgreementStoreManager, + didRegistry: DIDRegistry, + conditions: Conditions + ) { + super(templateManager, agreementStoreManager, didRegistry, conditions) + this.templateName = 'EscrowAccessSecretStoreTemplate' + } public async getServiceAgreementTemplate() { return escrowAccessServiceAgreementTemplate diff --git a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts index 5a82ea4..ed2585a 100644 --- a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts +++ b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts @@ -1,8 +1,19 @@ -import { AgreementTemplateBase } from './AgreementTemplateBase' +import { AgreementTemplateBase, Conditions} from './AgreementTemplateBase' import { escrowComputeServiceAgreementTemplate } from './EscrowCompute.serviceAgreementTemplate' +import { AgreementStoreManager, TemplateStoreManager } from '../managers'; +import DIDRegistry from '../DIDRegistry'; export class EscrowComputeExecutionTemplate extends AgreementTemplateBase { - public templateName: 'EscrowComputeExecutionTemplate' + + public constructor( + templateManager: TemplateStoreManager, + agreementStoreManager: AgreementStoreManager, + didRegistry: DIDRegistry, + conditions: Conditions + ) { + super(templateManager, agreementStoreManager, didRegistry, conditions) + this.templateName = 'EscrowComputeExecutionTemplate' + } public async getServiceAgreementTemplate() { return escrowComputeServiceAgreementTemplate