diff --git a/src/keeper/contracts/conditions/PaymentConditions.ts b/src/keeper/contracts/conditions/PaymentConditions.ts index 40656cc..7cc045a 100644 --- a/src/keeper/contracts/conditions/PaymentConditions.ts +++ b/src/keeper/contracts/conditions/PaymentConditions.ts @@ -12,7 +12,7 @@ export default class PaymentConditions extends ContractBase { public async lockPayment(serviceAgreementId: string, assetId: string, price: number, consumerAddress: string) : Promise { return this.send("lockPayment", consumerAddress, [ - serviceAgreementId, "0x" + assetId, price, + serviceAgreementId, assetId, price, ]) } } diff --git a/src/ocean/Ocean.ts b/src/ocean/Ocean.ts index 23ee5be..b432ac6 100644 --- a/src/ocean/Ocean.ts +++ b/src/ocean/Ocean.ts @@ -67,7 +67,7 @@ export default class Ocean { const aquarius = AquariusProvider.getAquarius() const brizo = BrizoProvider.getBrizo() - const assetId: string = IdGenerator.generateId() + const assetId: string = IdGenerator.generatePrefixedId() const did: string = `did:op:${assetId}` const accessServiceDefinitionId: string = "0" const computeServiceDefintionId: string = "1" @@ -183,7 +183,8 @@ export default class Ocean { event.listenOnce(async (data) => { const sa: ServiceAgreement = new ServiceAgreement(data.returnValues.serviceAgreementId) - await sa.payAsset(id, + await sa.payAsset( + id, metadataService.metadata.base.price, consumer, ) diff --git a/src/ocean/ServiceAgreements/ServiceAgreementTemplate.ts b/src/ocean/ServiceAgreements/ServiceAgreementTemplate.ts index a78241c..ae6423d 100644 --- a/src/ocean/ServiceAgreements/ServiceAgreementTemplate.ts +++ b/src/ocean/ServiceAgreements/ServiceAgreementTemplate.ts @@ -111,9 +111,9 @@ export default class ServiceAgreementTemplate extends OceanBase { case "price": return metadata.base.price case "assetId": - return "0x" + assetId + return assetId case "documentKeyId": - return "0x" + assetId + return assetId } return null diff --git a/test/aquarius/Aquarius.test.ts b/test/aquarius/Aquarius.test.ts index 8b8a031..cb8d8b8 100644 --- a/test/aquarius/Aquarius.test.ts +++ b/test/aquarius/Aquarius.test.ts @@ -85,7 +85,7 @@ describe("Aquarius", () => { it("should store a ddo", async () => { - const did: string = `did:op:${IdGenerator.generateId()}` + const did: string = `did:op:${IdGenerator.generatePrefixedId()}` const ddo: DDO = new DDO({ id: did, }) @@ -103,7 +103,7 @@ describe("Aquarius", () => { it("should store a ddo", async () => { - const did: string = `did:op:${IdGenerator.generateId()}` + const did: string = `did:op:${IdGenerator.generatePrefixedId()}` const ddo: DDO = new DDO({ id: did, }) diff --git a/test/ocean/ServiceAgreement.test.ts b/test/ocean/ServiceAgreement.test.ts index a3aef06..c68ba7e 100644 --- a/test/ocean/ServiceAgreement.test.ts +++ b/test/ocean/ServiceAgreement.test.ts @@ -44,7 +44,7 @@ describe("ServiceAgreement", () => { accessService = { type: "Access", - serviceDefinitionId: IdGenerator.generateId(), + serviceDefinitionId: "0", templateId: serviceAgreementTemplate.getId(), conditions, } as Service diff --git a/test/ocean/ServiceAgreementTemplate.test.ts b/test/ocean/ServiceAgreementTemplate.test.ts index 8ea80f3..f351f50 100644 --- a/test/ocean/ServiceAgreementTemplate.test.ts +++ b/test/ocean/ServiceAgreementTemplate.test.ts @@ -49,7 +49,7 @@ describe("ServiceAgreementTemplate", () => { new ServiceAgreementTemplate(access) assert(serviceAgreementTemplate) - const conds = await serviceAgreementTemplate.getConditions(new MetaData(), IdGenerator.generateId()) + const conds = await serviceAgreementTemplate.getConditions(new MetaData(), IdGenerator.generatePrefixedId()) assert(conds) }) })