use custom errors#7
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR replaces string-based require(...) revert reasons with a shared custom-error vocabulary (AgentPayErrors) and updates tests/gas snapshots accordingly.
Changes:
- Introduces
src/lib/AgentPayErrors.soland updates contracts/libraries to use custom errors instead of revert strings. - Updates Foundry tests to assert on custom-error selectors / full error payloads.
- Refreshes gas measurement snapshot files to match the new bytecode/error behavior.
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| test/gas_logs/fine_granularity/IntendSettle-OneState.txt | Updates gas snapshot values for intendSettle fine-grained measurement |
| test/gas_logs/fine_granularity/DepositEthInBatch.txt | Updates gas snapshot values for depositInBatch (ETH) |
| test/gas_logs/PayResolver.txt | Updates PayResolver gas snapshot values |
| test/gas_logs/CelerLedger-ETH.txt | Updates deploy/call gas snapshots for ETH ledger path |
| test/gas_logs/CelerLedger-ERC20.txt | Updates call gas snapshots for ERC20 ledger path |
| test/VirtContractResolver.t.sol | Updates revert assertions to custom errors for VirtContractResolver |
| test/RouterRegistry.t.sol | Updates revert assertions to custom errors for RouterRegistry |
| test/PayResolver.t.sol | Updates revert assertions to custom errors (including full-payload) for PayResolver |
| test/PayRegistry.t.sol | Updates revert assertions to custom errors (including full-payload/partial) for PayRegistry |
| test/CelerWallet.t.sol | Updates revert assertions to custom errors for CelerWallet |
| test/CelerLedger.Migrate.t.sol | Updates revert assertions to custom errors for ledger migration |
| test/CelerLedger.ETH.t.sol | Updates revert assertions to custom errors (some full-payload/partial) for ETH ledger |
| test/CelerLedger.ERC20.t.sol | Updates revert assertions to custom errors for ERC20 ledger |
| src/lib/ledgerlib/LedgerStruct.sol | Bumps Solidity pragma version |
| src/lib/ledgerlib/LedgerOperation.sol | Replaces string reverts with custom errors and adjusts validations |
| src/lib/ledgerlib/LedgerMigrate.sol | Replaces string reverts with custom errors for migration flow |
| src/lib/ledgerlib/LedgerChannel.sol | Replaces string revert with custom error for peer lookup |
| src/lib/data/PbEntity.sol | Bumps Solidity pragma version for generated protobuf code |
| src/lib/data/PbChain.sol | Bumps Solidity pragma version for generated protobuf code |
| src/lib/data/Pb.sol | Bumps Solidity pragma version for generated protobuf code |
| src/lib/AgentPayErrors.sol | Adds shared custom-error definitions used across contracts |
| src/interfaces/IVirtContractResolver.sol | Bumps Solidity pragma version |
| src/interfaces/IRouterRegistry.sol | Bumps Solidity pragma version |
| src/interfaces/IPayResolver.sol | Bumps Solidity pragma version |
| src/interfaces/IPayRegistry.sol | Bumps Solidity pragma version |
| src/interfaces/INumericCond.sol | Bumps Solidity pragma version |
| src/interfaces/INativeWrap.sol | Bumps Solidity pragma version |
| src/interfaces/ICelerWallet.sol | Bumps Solidity pragma version |
| src/interfaces/ICelerLedger.sol | Bumps Solidity pragma version |
| src/interfaces/IBooleanCond.sol | Bumps Solidity pragma version |
| src/helper/WalletTestHelper.sol | Bumps Solidity pragma version |
| src/helper/NumericCondMock.sol | Bumps Solidity pragma version |
| src/helper/NativeWrapMock.sol | Bumps Solidity pragma version |
| src/helper/ERC20ExampleToken.sol | Bumps Solidity pragma version |
| src/helper/BooleanCondMock.sol | Bumps Solidity pragma version |
| src/VirtContractResolver.sol | Replaces require strings with custom errors |
| src/RouterRegistry.sol | Replaces require strings with custom errors |
| src/PayResolver.sol | Replaces require strings with custom errors |
| src/PayRegistry.sol | Replaces require strings with custom errors |
| src/CelerWallet.sol | Replaces require strings with custom errors |
| src/CelerLedgerMock.sol | Bumps Solidity pragma version |
| src/CelerLedger.sol | Replaces require strings with custom errors and updates validations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.