test(privateListings): cover getPrivateListingConsiderations and getPrivateListingFulfillments - #1996
Closed
devorun wants to merge 1 commit into
Closed
Conversation
…rivateListingFulfillments Complete the unit coverage of the privateListings helpers. The existing spec already covers computePrivateListingValue and constructPrivateListingCounterOrder; this adds the two remaining exported functions: - getPrivateListingConsiderations: stamps the private-sale recipient onto every offer item, preserving order and fields. - getPrivateListingFulfillments: matches each offered NFT to its consideration counterpart, routes every currency consideration item to the counter order's aggregated offer, skips non-currency items, and throws when an offered NFT has no matching consideration item.
Collaborator
|
Taken, thanks. I checked the assertions against the source branch by branch and they match, including the routing of every currency consideration item to the counter order's single offer item, and the throw when an offered NFT has no counterpart. This repo is a read-only mirror, so the tests are recreated in our internal monorepo with you credited as co-author and ship in the next release. Closing in favor of that. |
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.
Summary
Completes the unit coverage of the
privateListingshelpers.test/orders/privateListings.spec.tsalready coverscomputePrivateListingValueandconstructPrivateListingCounterOrder; the other two exported functions were untested. This adds them:getPrivateListingConsiderations— stamps the private-sale recipient onto every offer item, preserving order and fields (plus the empty-offer case).getPrivateListingFulfillments— matches each offered NFT to its consideration counterpart, routes every currency consideration item to the counter order's aggregated offer (orderIndex: 1, itemIndex: 0), skips non-currency items, and throws when an offered NFT has no matching consideration item.Testing
vitest run test/orders/privateListings.spec.ts(16 tests pass)biome checkandtsc -p tsconfig.check.jsonclean