-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add getters to interface #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
also run linter
✅ Deploy Preview for kleros-escrow-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughThis change centralizes type imports to Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor DApp as DApp/Client
participant IEscrow as IEscrow (contract)
rect rgb(240,248,255)
note over DApp,IEscrow: Query transaction details
DApp->>IEscrow: transactions(transactionID)
IEscrow-->>DApp: (buyer, seller, amounts, deadlines, disputeID, fees, timestamp, status, token)
end
rect rgb(245,255,250)
note over DApp,IEscrow: Resolve dispute -> transaction
DApp->>IEscrow: disputeIDtoTransactionID(disputeID)
IEscrow-->>DApp: transactionID
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
contracts/src/interfaces/IEscrow.sol (1)
160-195: Transaction struct order matches IEscrow.transactions() getter
- Definition in contracts/src/interfaces/Types.sol aligns exactly with the interface return values.
- Optional: add a comment by the Transaction struct reminding maintainers to update this interface if fields change.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
contracts/src/EscrowUniversal.sol(1 hunks)contracts/src/EscrowView.sol(2 hunks)contracts/src/interfaces/IEscrow.sol(2 hunks)
🔇 Additional comments (4)
contracts/src/interfaces/IEscrow.sol (1)
5-5: LGTM - Import reorganization improves code clarity.Using named imports from Types.sol makes the dependencies explicit and improves code readability.
contracts/src/EscrowUniversal.sol (1)
13-13: LGTM - Import consolidation aligns with interface changes.The named imports from
Types.solmaintain consistency with the interface definition and make type dependencies explicit.contracts/src/EscrowView.sol (2)
7-8: LGTM - Import organization aligns with codebase changes.The reorganized imports maintain consistency with the changes in
IEscrow.solandEscrowUniversal.sol, ensuring all files use the centralized type definitions fromTypes.sol.
30-43: LGTM - Tuple destructuring reformatted without semantic changes.The reformatting uses explicit leading comma-destructuring for skipped values, which is a common Solidity pattern. The semantic meaning remains unchanged—positions 3, 8, 9, and 12 still correctly extract
amount,buyerFee,sellerFee, andtokenfrom thetransactionsgetter.
f8354ba
transactionsanddisputeIDtoTransactionIDare state variables, and the compilation output of IEscrow.sol doesn’t include the default getters for public variables, so I’m adding two functions to this interface.This is useful for anyone using frontend SDKs like wagmi, which generate TS types based on the ABI file.
PR-Codex overview
This PR focuses on enhancing the
IEscrowinterface in thecontracts/src/interfaces/IEscrow.solfile by adding detailed transaction retrieval and dispute mapping functionalities, and it updates related imports in theEscrowUniversalandEscrowViewcontracts.Detailed summary
NATIVE,Status,Party,Transaction, andResolutionfrom./interfaces/Types.solinEscrowUniversal.sol.EscrowView.solto separateEscrowUniversaland other types.IEscrow.solto includeIERC20,Party,Status,Resolution, andTransactionfrom./Types.sol.transactionsfunction inIEscrowfor detailed transaction information retrieval.disputeIDtoTransactionIDfunction inIEscrowto map dispute IDs to transaction IDs.Summary by CodeRabbit
New Features
Refactor
Style