diff --git a/guardian-service/src/api/contract.service.ts b/guardian-service/src/api/contract.service.ts index 8107e32115..2276a31abe 100644 --- a/guardian-service/src/api/contract.service.ts +++ b/guardian-service/src/api/contract.service.ts @@ -3102,10 +3102,14 @@ export async function contractAPI( owner.creator ); - const contract = await contractRepository.findOne({ - contractId: request.contractId, - owner - }) + const contract: { version: string } = await contractRepository.findOne({ + contractId: request.contractId + }, { field: ['version'] }); + + const error = await checkContractsCompatibility(workers, contractRepository, contract, request.tokens); + if (error) { + throw new Error(error); + } let result; if (contract.version === '1.0.0') {