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

Merge pull request #94 from oceanprotocol/feature/executeagreementtest

added test for failed service agreements
This commit is contained in:
Dimitri De Jonghe 2019-01-02 14:05:07 +01:00 committed by GitHub
commit 391e44aaab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,6 +96,21 @@ describe("ServiceAgreement", () => {
assert(serviceDefinitionId) assert(serviceDefinitionId)
assert(serviceDefinitionId !== did.getId()) assert(serviceDefinitionId !== did.getId())
}) })
it("should throw on invalid sig", (done) => {
const ddo = new DDO({id: did.getDid(), service: [accessService]})
const serviceAgreementId: string = IdGenerator.generateId()
// @ts-ignore
WebServiceConnectorProvider.setConnector(new WebServiceConnectorMock(ddo))
ServiceAgreement.executeServiceAgreement(did, ddo, accessService.serviceDefinitionId,
serviceAgreementId, "0x00", consumerAccount, publisherAccount)
.catch((err) => {
done()
})
})
}) })
describe("#getStatus()", () => { describe("#getStatus()", () => {