-
Notifications
You must be signed in to change notification settings - Fork 14
Migrate IexecOrderManagement unit tests #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate IexecOrderManagement unit tests #101
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #101 +/- ##
========================================
Coverage 83.75% 83.75%
========================================
Files 34 34
Lines 1077 1077
Branches 202 222 +20
========================================
Hits 902 902
Misses 175 175 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered something like:
const appOperation = {
assetName: 'App',
providerAddress: appProvider.address,
tx: iexecPocoAsAppProvider.manageAppOrder(createOrderOperation(appOrder, OrderOperationEnum.SIGN)),
orderHash: appOrderHash
};
[appOperation, datasetOperation, workerpoolOperation, requesterOperation].forEach((operation) => {
it(`Should presign ${operation.assetName} order when operation is sent by app provider`, async () => {
await expect(operation.tx)
.to.emit(iexecPoco, `Signed${operation.assetName}Order`)
.withArgs(operation.orderHash);
expect(await iexecPoco.viewPresigned(operation.orderHash)).equal(operation.providerAddress);
expect(await iexecPoco.verifyPresignature(operation.providerAddress, operation.orderHash)).is.true;
expect(
await iexecPoco.verifyPresignatureOrSignature(
operation.providerAddress,
operation.orderHash,
NULL.SIGNATURE,
),
).is.true;
});
});
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks !
Co-authored-by: Zied Guesmi <26070035+zguesmi@users.noreply.github.com>
Tests