Skip to content

Commit d8962ee

Browse files
Index first parameter of match an claim events in Voucher contract
1 parent 0899fb5 commit d8962ee

File tree

7 files changed

+10
-14
lines changed

7 files changed

+10
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Changelog
22

33
## vNEXT
4+
- Index first parameter of match an claim events in `Voucher` contract. (#61, #72)
45
- Add upgrade workflow. (#64)
56
- Add Halborn "Poco v5.5 & Voucher v1.0" audit report ( #70)
6-
- Add `dealId` to `TaskClaimedWithVoucher` event. (#61)
77
- Add type-checking script (#53)
88
- Run partial upgrade tests on fork.
99
- Should maintain consistent voucher addresses (#61)

contracts/beacon/IVoucher.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface IVoucher {
1111
event AccountUnauthorized(address indexed account);
1212
event OrdersMatchedWithVoucher(bytes32 indexed dealId);
1313
event OrdersBoostMatchedWithVoucher(bytes32 indexed dealId);
14-
event TaskClaimedWithVoucher(bytes32 indexed taskId, bytes32 indexed dealId);
14+
event TaskClaimedWithVoucher(bytes32 indexed taskId);
1515

1616
function setExpiration(uint256 expiration) external;
1717
function authorizeAccount(address account) external;

contracts/beacon/Voucher.sol

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,7 @@ contract Voucher is Initializable, IVoucher {
214214
if (task.status != IexecLibCore_v5.TaskStatusEnum.FAILED) {
215215
IexecPoco2(iexecPoco).claim(taskId);
216216
}
217-
bytes32 dealId = task.dealid;
218-
IexecLibCore_v5.Deal memory deal = IexecPocoAccessors(iexecPoco).viewDeal(dealId);
217+
IexecLibCore_v5.Deal memory deal = IexecPocoAccessors(iexecPoco).viewDeal(task.dealid);
219218
// If the deal was matched by the voucher, then the voucher should be refunded.
220219
// If the deal was partially or not sponsored by the voucher, then the requester
221220
// should be refunded.
@@ -230,7 +229,7 @@ contract Voucher is Initializable, IVoucher {
230229
deal.requester
231230
);
232231
}
233-
emit TaskClaimedWithVoucher(taskId, dealId);
232+
emit TaskClaimedWithVoucher(taskId);
234233
}
235234

236235
/**
@@ -263,7 +262,7 @@ contract Voucher is Initializable, IVoucher {
263262
deal.requester
264263
);
265264
}
266-
emit TaskClaimedWithVoucher(taskId, dealId);
265+
emit TaskClaimedWithVoucher(taskId);
267266
}
268267

269268
/**

docs/IVoucher.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ event OrdersBoostMatchedWithVoucher(bytes32 dealId)
3535
### TaskClaimedWithVoucher
3636

3737
```solidity
38-
event TaskClaimedWithVoucher(bytes32 taskId, bytes32 dealId)
38+
event TaskClaimedWithVoucher(bytes32 taskId)
3939
```
4040

4141
### setExpiration

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,8 @@
3535
"lint": "solhint 'contracts/**/*.sol' --fix && eslint . --fix"
3636
},
3737
"lint-staged": {
38-
"*.ts": [
39-
"npm run lint:ts"
40-
],
41-
"*.sol": [
42-
"npm run lint:sol"
38+
"*.{ts,sol}": [
39+
"npm run lint"
4340
]
4441
},
4542
"devDependencies": {

scripts/voucherHubUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ export async function getExpectedVoucherProxyCodeHash(voucherBeaconAddress: stri
8989
*
9090
* Also see test/NextVersionUpgrade.test.ts to double check behavior.
9191
*/
92-
return '0x31a4f4707138270dd34b040129096c67e1039fb242deebb8a0d0f8ed9da82232';
92+
return '0x1904181fa3fbe85a0796789e46d9ee31e5585fbdbabce28931332862d68c9313';
9393
}
9494
}

test/beacon/Voucher.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ describe('Voucher', function () {
769769
.to.emit(voucherHub, 'VoucherRefunded')
770770
.withArgs(voucherAddress, taskSponsoredAmount)
771771
.to.emit(voucherAsOwner, 'TaskClaimedWithVoucher')
772-
.withArgs(taskId, dealId);
772+
.withArgs(taskId);
773773
const {
774774
voucherCreditBalance: voucherCreditBalancePostClaim,
775775
voucherSrlcBalance: voucherSrlcBalancePostClaim,

0 commit comments

Comments
 (0)