1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00
This commit is contained in:
Sebastian Gerske 2018-11-01 09:28:17 +01:00
parent 076c2eb788
commit db910aaaa2

View File

@ -33,24 +33,14 @@ export default class ServiceAgreementTemplate extends OceanBase {
templateOwner)
}
/**
* gets the status of a service agreement template
*/
public async getStatus(): Promise<boolean> {
const serviceAgreement: ServiceAgreement = await ServiceAgreement.getInstance()
return serviceAgreement.getTemplateStatus(this.getId())
}
private static generateConditionsKeys(serviceAgreementTemplateId: string, methodReflections: MethodReflection[]):
string[] {
const conditions = []
for (let i = 0; i < methodReflections.length; i++) {
for (const methodReflection of methodReflections) {
const values = [
{type: "bytes32", value: serviceAgreementTemplateId},
{type: "address", value: methodReflections[i].address},
{type: "bytes4", value: methodReflections[i].signature},
{type: "address", value: methodReflection.address},
{type: "bytes4", value: methodReflection.signature},
]
conditions.push(Web3Provider.getWeb3().utils.soliditySha3(...values).toString("hex"))
}
@ -61,6 +51,16 @@ export default class ServiceAgreementTemplate extends OceanBase {
super(id)
}
/**
* gets the status of a service agreement template
*/
public async getStatus(): Promise<boolean> {
const serviceAgreement: ServiceAgreement = await ServiceAgreement.getInstance()
return serviceAgreement.getTemplateStatus(this.getId())
}
public getOwner(): Account {
return this.owner
}