diff --git a/CHANGELOG.md b/CHANGELOG.md index ad029fea..477e1411 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ # Changelog ## vNEXT +- Index first parameter of match an claim events in `Voucher` contract. (#61, #72) - Add upgrade workflow. (#64) - Add Halborn "Poco v5.5 & Voucher v1.0" audit report ( #70) -- Add `dealId` to `TaskClaimedWithVoucher` event. (#61) - Add type-checking script (#53) - Run partial upgrade tests on fork. - Should maintain consistent voucher addresses (#61) diff --git a/contracts/beacon/IVoucher.sol b/contracts/beacon/IVoucher.sol index 7f263b00..9bbaaefd 100644 --- a/contracts/beacon/IVoucher.sol +++ b/contracts/beacon/IVoucher.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2024-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 import {IexecLibOrders_v5} from "@iexec/poco/contracts/libs/IexecLibOrders_v5.sol"; @@ -11,7 +11,7 @@ interface IVoucher { event AccountUnauthorized(address indexed account); event OrdersMatchedWithVoucher(bytes32 indexed dealId); event OrdersBoostMatchedWithVoucher(bytes32 indexed dealId); - event TaskClaimedWithVoucher(bytes32 indexed taskId, bytes32 indexed dealId); + event TaskClaimedWithVoucher(bytes32 indexed taskId); function setExpiration(uint256 expiration) external; function authorizeAccount(address account) external; diff --git a/contracts/beacon/Voucher.sol b/contracts/beacon/Voucher.sol index 3b464322..a680ed79 100644 --- a/contracts/beacon/Voucher.sol +++ b/contracts/beacon/Voucher.sol @@ -214,8 +214,7 @@ contract Voucher is Initializable, IVoucher { if (task.status != IexecLibCore_v5.TaskStatusEnum.FAILED) { IexecPoco2(iexecPoco).claim(taskId); } - bytes32 dealId = task.dealid; - IexecLibCore_v5.Deal memory deal = IexecPocoAccessors(iexecPoco).viewDeal(dealId); + IexecLibCore_v5.Deal memory deal = IexecPocoAccessors(iexecPoco).viewDeal(task.dealid); // If the deal was matched by the voucher, then the voucher should be refunded. // If the deal was partially or not sponsored by the voucher, then the requester // should be refunded. @@ -230,7 +229,7 @@ contract Voucher is Initializable, IVoucher { deal.requester ); } - emit TaskClaimedWithVoucher(taskId, dealId); + emit TaskClaimedWithVoucher(taskId); } /** @@ -263,7 +262,7 @@ contract Voucher is Initializable, IVoucher { deal.requester ); } - emit TaskClaimedWithVoucher(taskId, dealId); + emit TaskClaimedWithVoucher(taskId); } /** diff --git a/docs/IVoucher.md b/docs/IVoucher.md index d47dc809..d8c66322 100644 --- a/docs/IVoucher.md +++ b/docs/IVoucher.md @@ -35,7 +35,7 @@ event OrdersBoostMatchedWithVoucher(bytes32 dealId) ### TaskClaimedWithVoucher ```solidity -event TaskClaimedWithVoucher(bytes32 taskId, bytes32 dealId) +event TaskClaimedWithVoucher(bytes32 taskId) ``` ### setExpiration diff --git a/package.json b/package.json index 699b706f..2ab2b14e 100644 --- a/package.json +++ b/package.json @@ -35,11 +35,8 @@ "lint": "solhint 'contracts/**/*.sol' --fix && eslint . --fix" }, "lint-staged": { - "*.ts": [ - "npm run lint:ts" - ], - "*.sol": [ - "npm run lint:sol" + "*.{ts,sol}": [ + "npm run lint" ] }, "devDependencies": { diff --git a/scripts/voucherHubUtils.ts b/scripts/voucherHubUtils.ts index 475dff16..5c7fc9b5 100644 --- a/scripts/voucherHubUtils.ts +++ b/scripts/voucherHubUtils.ts @@ -89,6 +89,6 @@ export async function getExpectedVoucherProxyCodeHash(voucherBeaconAddress: stri * * Also see test/NextVersionUpgrade.test.ts to double check behavior. */ - return '0x31a4f4707138270dd34b040129096c67e1039fb242deebb8a0d0f8ed9da82232'; + return '0xe0f74e59778f75b77efb2064c8358a84106c7a95517a2c8503e38996071e6522'; } } diff --git a/test/beacon/Voucher.test.ts b/test/beacon/Voucher.test.ts index d832b07c..3fa53a24 100644 --- a/test/beacon/Voucher.test.ts +++ b/test/beacon/Voucher.test.ts @@ -769,7 +769,7 @@ describe('Voucher', function () { .to.emit(voucherHub, 'VoucherRefunded') .withArgs(voucherAddress, taskSponsoredAmount) .to.emit(voucherAsOwner, 'TaskClaimedWithVoucher') - .withArgs(taskId, dealId); + .withArgs(taskId); const { voucherCreditBalance: voucherCreditBalancePostClaim, voucherSrlcBalance: voucherSrlcBalancePostClaim,