Skip to content

Commit aaf7224

Browse files
committed
chore: Do some cleaning
1 parent a9ece58 commit aaf7224

File tree

5 files changed

+29
-9
lines changed

5 files changed

+29
-9
lines changed

deploy/0_deploy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export default async function deploy() {
181181
rlcInstanceAddress,
182182
'Staked RLC',
183183
'SRLC',
184-
9, // TODO: generic ?
184+
9,
185185
appRegistryAddress,
186186
datasetRegistryAddress,
187187
workerpoolRegistryAddress,

test/byContract/IexecAccessors/IexecAccessors.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ describe('IexecAccessors', async () => {
209209
expect(contribution.weight).to.equal(1);
210210
});
211211

212-
it('viewScore', async function () {
213-
// TODO
212+
it.skip('[TODO] viewScore', async function () {
214213
expect(await iexecPoco.viewScore(worker1.address)).to.equal(0);
215214
});
216215

test/byContract/IexecConfiguration/IexecConfiguration.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ describe('IexecConfiguration', async () => {
114114
});
115115

116116
describe('Import score', () => {
117-
it('[TODO] Should import score', async () => {
118-
// Not tested
119-
});
117+
it.skip('[TODO] Should import score', async () => {});
118+
120119
it('Should not import score when no v3_iexecHub configured', async () => {
121120
await expect(iexecPoco.importScore(worker.address)).to.be.revertedWithoutReason();
122121
});
122+
123123
it('Should not import score when already imported', async () => {
124124
const workerScoreImportedSlot = ethers.stripZerosLeft(
125125
ethers.keccak256(

test/byContract/IexecEscrow/IexecEscrowNative.test.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ if (config.isNativeChain()) {
7676
});
7777
});
7878

79-
// TODO 'Should deposit with zero value'
8079
describe('Deposit', () => {
8180
it('Should deposit native tokens', async () => {
8281
expect(await iexecPocoAsAccountA.deposit.staticCall(...depositArgs)).to.be.true;
@@ -106,6 +105,16 @@ if (config.isNativeChain()) {
106105
.withArgs(AddressZero, accountA.address, depositAmount);
107106
});
108107

108+
it('Should deposit amount zero', async () => {
109+
expect(await iexecPocoAsAccountA.deposit.staticCall({ value: 0 })).to.be.true;
110+
const tx = iexecPocoAsAccountA.deposit({ value: 0 });
111+
await expect(tx).to.changeEtherBalances([accountA, iexecPoco], [0, 0]);
112+
await expect(tx).to.changeTokenBalances(iexecPoco, [accountA], [0]);
113+
await expect(tx)
114+
.to.emit(iexecPoco, 'Transfer')
115+
.withArgs(AddressZero, accountA.address, 0);
116+
});
117+
109118
it('Should not deposit native tokens when caller is address 0', async () => {
110119
const zeroAddressSigner = await ethers.getImpersonatedSigner(ZeroAddress);
111120
const iexecPocoAsAddress0 = iexecPoco.connect(zeroAddressSigner);
@@ -215,7 +224,6 @@ if (config.isNativeChain()) {
215224
});
216225
});
217226

218-
// TODO 'Should withdraw with zero value'
219227
describe('Withdraw', () => {
220228
it('Should withdraw native tokens', async () => {
221229
await iexecPocoAsAccountA.deposit(...depositArgs);
@@ -232,6 +240,19 @@ if (config.isNativeChain()) {
232240
.withArgs(accountA.address, AddressZero, withdrawAmount);
233241
});
234242

243+
it('Should withdraw amount zero', async () => {
244+
await iexecPocoAsAccountA.deposit(...depositArgs);
245+
expect(await iexecPocoAsAccountA.withdraw.staticCall(0)).to.be.true;
246+
const tx = iexecPocoAsAccountA.withdraw(0);
247+
await expect(tx).to.changeEtherBalances([accountA, iexecPoco], [0, 0]);
248+
await expect(tx).to.changeTokenBalances(iexecPoco, [accountA], [0]);
249+
await expect(tx)
250+
.to.emit(iexecPoco, 'Transfer')
251+
.withArgs(accountA.address, AddressZero, 0);
252+
// User balance haven't changed.
253+
expect(await iexecPoco.balanceOf(accountA.address)).to.equal(depositAmount);
254+
});
255+
235256
it('Should not withdraw native tokens with empty balance', async () => {
236257
await expect(
237258
iexecPocoAsAccountA.withdraw(...withdrawArg),

test/byContract/IexecPoco/IexecPoco2-contribute-and-finalize.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ describe('IexecPoco2#contributeAndFinalize', () => {
350350
).to.be.revertedWithoutReason(); // require#2
351351
});
352352

353-
it('Should not contributeAndFinalize when someone else has already contributed', async () => {
353+
it.skip('[TODO] Should not contributeAndFinalize when someone else has already contributed', async () => {
354354
// TODO require#3
355355
});
356356

0 commit comments

Comments
 (0)