Skip to content

Allow multiple currency tokens in an order#259

Merged
ryanio merged 3 commits intoProjectOpenSea:mainfrom
orenyomtov:multi-currency
Jun 1, 2023
Merged

Allow multiple currency tokens in an order#259
ryanio merged 3 commits intoProjectOpenSea:mainfrom
orenyomtov:multi-currency

Conversation

@orenyomtov
Copy link
Contributor

Motivation

Fixing the problem faced in issue #236

Solution

Turns out this restriction is in place mainly to make fee calculation simpler - so I limited it to apply only for cases where you want to the library to calculate fees for you.

My attempt at implementing a multi-token fee calculation, caused all the [Accept offer] tests to break because the current design assumes the same fees will be applied for an order and its mirrored order - which for example isn't really possible in the case of an ERC20 <=> ERC20 order.

I wasn't sure if the way these [Accept offer] tests are written represent the library's requirements (the same fees will be applied for an order and its mirrored order), or just an internal test implementation.
I took them for requirements, but am open to hear your opinions.

@ryanio
Copy link
Collaborator

ryanio commented May 31, 2023

great PR and nice tests, thanks for working on this! can you kindly resolve the conflicts to run the workflows (test folder was moved outside src)

@orenyomtov
Copy link
Contributor Author

@ryanio my pleasure! conflicts resolved

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.09 🎉

Comparison is base (cb447e9) 98.02% compared to head (ca352d8) 98.11%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #259      +/-   ##
==========================================
+ Coverage   98.02%   98.11%   +0.09%     
==========================================
  Files          33       33              
  Lines       13440    13824     +384     
  Branches      646      662      +16     
==========================================
+ Hits        13175    13564     +389     
+ Misses        259      255       -4     
+ Partials        6        5       -1     
Impacted Files Coverage Δ
src/seaport.ts 96.34% <100.00%> (+0.17%) ⬆️
test/basic-fulfill.spec.ts 100.00% <100.00%> (ø)
test/create-order.spec.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ryanio ryanio merged commit a34b214 into ProjectOpenSea:main Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants