-
Notifications
You must be signed in to change notification settings - Fork 0
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
update #19
base: main
Are you sure you want to change the base?
update #19
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Reviewer's Guide by SourceryThis PR refactors and extends auction-related functionalities in the marketplace extension. It introduces new utility functions for preparing auction and bid transaction parameters, enhances tests across the English auctions, direct listings, ClaimButton, and ZKSync transaction flows, and adds several miscellaneous utility tests (RPC, chain utils, promise limits, etc.) to improve robustness and consistency. Sequence diagram for the auction bid processsequenceDiagram
participant Tester as actor
participant BID as bidInAuction
participant PREP as prepareBidInAuctionParams
participant GET as GetAuction
participant CONV as convertErc20Amount
participant WIN as GetWinningBid
Tester->>BID: Initiate bid transaction
BID->>PREP: Call prepareBidInAuctionParams(options)
PREP->>GET: Retrieve auction details
alt bidAmount in wei provided
PREP-->>PREP: Use provided bidAmountWei
else bidAmount conversion required
PREP->>CONV: convertErc20Amount(options.bidAmount)
CONV-->>PREP: resolved bid amount in wei
end
PREP->>PREP: Validate: bid not zero, not above buyout
PREP->>WIN: Get existing winning bid
alt existing winning bid exists
PREP-->>PREP: Check if new bid outbids current winning bid
else No winning bid
PREP-->>PREP: Validate against minimum bid
end
PREP-->>BID: Return prepared bid parameters
BID->>Tester: Transaction ready for submission
Tester->>BID: sendAndConfirmTransaction
BID->>WIN: Query updated winning bid
WIN-->>BID: Return updated winning bid info
BID-->>Tester: Bid successful, new winning bid confirmed
Class diagram for Auction Utility FunctionsclassDiagram
class AuctionCreator {
+createAuction(options)
+prepareCreateAuctionParams(options)
-validateAsset(assetContract): Boolean
-toUnits(amount, decimals)
-validateTimestamps(start, end)
}
class AuctionBidder {
+bidInAuction(options)
+prepareBidInAuctionParams(options)
-getResolvedBidAmount(options): bigint
-validateBidAmount(amount, auction)
}
class AuctionMapper {
+mapEnglishAuction(rawAuction, latestBlock)
}
AuctionCreator <|-- AuctionMapper : uses
AuctionBidder <|-- AuctionCreator : similar utilities
note for AuctionCreator "Handles auction creation and parameter preparation"
note for AuctionBidder "Validates and prepares bid transactions"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @Dargon789 - I've reviewed your changes - here's some feedback:
Overall Comments:
- Extract the repeated bid and amount conversion logic into a common helper to reduce duplication in prepareCreateAuctionParams and prepareBidInAuctionParams.
- Mock the block timestamp in auction tests for more deterministic assertions rather than relying on the latest block time.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟡 Testing: 2 issues found
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
packages/thirdweb/src/extensions/marketplace/english-auctions/write/createAuction.ts
Show resolved
Hide resolved
packages/thirdweb/src/extensions/marketplace/english-auctions/write/createAuction.ts
Show resolved
Hide resolved
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.
update #19
title: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"
If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):
Notes for the reviewer
Anything important to call out? Be sure to also clarify these in your comments.
How to test
Unit tests, playground, etc.
Summary by Sourcery
Refactor the English Auction extension to improve the developer experience by adding helper functions for preparing transaction parameters and validating inputs. Add support for ERC20 tokens in English Auctions. Update tests to use the new helper functions and cover the new ERC20 support. Add a new utility function to get all valid auctions.
Enhancements:
Tests: