Skip to content

Conversation

gfournieriExec
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Oct 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.58%. Comparing base (e79bf26) to head (37a9704).
Report is 9 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #145   +/-   ##
========================================
  Coverage    84.58%   84.58%           
========================================
  Files           35       35           
  Lines         1077     1077           
  Branches       221      221           
========================================
  Hits           911      911           
  Misses         166      166           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 782 to 783
const task = await iexecPoco.viewTask(taskId);
await time.setNextBlockTimestamp(task.revealDeadline);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const task = await iexecPoco.viewTask(taskId);
await time.setNextBlockTimestamp(task.revealDeadline);
const task = await iexecPoco.viewTask(taskId);
expect(task.status).to.equal(TaskStatusEnum.REVEALING);
expect(task.revealCounter).to.equal(1);
// caller is scheduler, task status is revealing, before final deadline,
// reveal counter is reached
// but resultsCallback is bad

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done here

const { resultsCallback } = buildResultCallbackAndDigest(567);
await expect(
iexecPocoAsScheduler.finalize(taskId, results, resultsCallback),
).to.be.revertedWithoutReason();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
).to.be.revertedWithoutReason();
).to.be.revertedWithoutReason(); // require#4 (part 2)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done here

).to.be.revertedWithoutReason();
});

it('Should finalize task when result callback is invalid', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you say result callback is invalid?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the invalid callback is because callback: appAddress, and should have been callback: oracleConsumerInstance.address,
It's to mimic the test incallback.js => describe('invalid callback', async () => {
https://github.com/iExecBlockchainComputing/PoCo/blob/feature/migrate-erc1154-UT/test/ERC1154/callback.js.skip#L501

.to.not.emit(oracleConsumerInstance, 'GotResult');
});

it('Should finalize task when callback is EOA', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move this closer to "should tests" maybe below "Should finalize task of deal payed by requester (no callback, no dataset)" (?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated here

.reveal(taskId, callbackResultDigest)
.then((tx) => tx.wait());
const task = await iexecPoco.viewTask(taskId);
await time.setNextBlockTimestamp(task.revealDeadline);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you fly to reveal deadline?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed here

Copy link
Contributor

@james-toussaint james-toussaint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you :)

gfournieriExec and others added 2 commits October 21, 2024 16:03
Co-authored-by: Jérémy James Toussaint <33313130+jeremyjams@users.noreply.github.com>
assets: ordersAssets,
requester: requester.address,
prices: ordersPrices,
callback: appAddress, // Non-EIP1154 contract
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use another random address to avoid confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here the appAddress was to meant to have a smart contract address and not a EOA without code in it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about that

randomContract = await new OwnableMock__factory()
.connect(anyone)
.deploy()
.then((contract) => contract.deployed());

Or at least add a comment to explain than it's a random contract.

Copy link
Member

@zguesmi zguesmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

@gfournieriExec gfournieriExec merged commit 99033ad into develop Oct 22, 2024
5 checks passed
@gfournieriExec gfournieriExec deleted the feature/migrate-erc1154-UT branch October 22, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants