Skip to content
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

feat: add registerPreviousMarkets function to migrate previous markets #35

Merged
merged 7 commits into from
Apr 7, 2023

Conversation

graykode
Copy link
Contributor

@graykode graykode commented Apr 7, 2023

Features

Create registerPreviousMarkets function to support migrating previous markets

Description:

This pull request adds a new function called registerPreviousMarkets to the codebase. This function supports migrating previous markets and will help ensure that market data is properly carried over to new versions of the code.

@codecov-commenter
Copy link

codecov-commenter commented Apr 7, 2023

Codecov Report

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

Comparison is base (c3a0c42) 99.27% compared to head (8241249) 99.28%.

❗ Current head 8241249 differs from pull request most recent head c45dd9b. Consider uploading reports for the commit c45dd9b to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #35      +/-   ##
==========================================
+ Coverage   99.27%   99.28%   +0.01%     
==========================================
  Files           9        9              
  Lines         550      562      +12     
  Branches      100      103       +3     
==========================================
+ Hits          546      558      +12     
  Misses          1        1              
  Partials        3        3              
Impacted Files Coverage Δ
contracts/MarketRouter.sol 97.56% <100.00%> (+0.68%) ⬆️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

contracts/MarketRouter.sol Outdated Show resolved Hide resolved
contracts/MarketRouter.sol Outdated Show resolved Hide resolved
contracts/MarketRouter.sol Outdated Show resolved Hide resolved
@github-actions

This comment has been minimized.

Copy link
Contributor

@onemonster onemonster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please allow the factory owner to unregister markets as well. Also, the word previous seems a bit redundant and unnecessary.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@graykode graykode merged commit 72f946f into main Apr 7, 2023
10 checks passed
@graykode graykode deleted the feat/router-registeration branch April 7, 2023 07:45
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Apr 7, 2023

Test with 51e4ae3.

  • EHET : Empty heap with empty segment tree
  • EHDT : Empty heap with dirty segment tree
  • FHET : Filled heap with empty segment tree
  • FHFT : Filled heap with filled segment tree

Changes to gas cost

Generated at commit: 51e4ae3a815a19d1c1d56cd463b2af73abf502e0, compared to commit: 2e25be0dd23c93b9e1b8520b2fd187194616512a

🧾 Summary (10% most significant diffs)

Contract Method Avg (+/-) %
GasReporter contract EHDT_PartiallyMarketBid
EHET_PartiallyMarketBid
FHET_PartiallyMarketBid
FHFT_PartiallyMarketBid
+2,253 ❌
+2,185 ❌
+2,185 ❌
+2,253 ❌
+2.09%
+2.41%
+2.41%
+2.09%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
GasReporter contract 948,376 (0) EHDT_FullyMarketAsk
EHDT_FullyMarketBid
EHDT_LimitAsk
EHDT_LimitBid
EHDT_PartiallyMarketAsk
EHDT_PartiallyMarketBid
EHET_FullyMarketAsk
EHET_FullyMarketBid
EHET_LimitAsk
EHET_LimitBid
EHET_PartiallyMarketAsk
EHET_PartiallyMarketBid
FHET_FullyMarketAsk
FHET_FullyMarketBid
FHET_LimitAsk
FHET_LimitBid
FHET_PartiallyMarketAsk
FHET_PartiallyMarketBid
FHFT_FullyMarketAsk
FHFT_FullyMarketBid
FHFT_LimitAsk
FHFT_LimitBid
FHFT_PartiallyMarketAsk
FHFT_PartiallyMarketBid
limitAskOrder
limitBidOrder
marketAskOrder
marketBidOrder
114,048 (+2,208)
117,227 (+2,253)
146,063 (+2,209)
159,048 (+2,143)
114,070 (+2,208)
109,814 (+2,253)
114,135 (+2,208)
102,102 (+1,802)
263,196 (+2,209)
241,910 (+2,143)
114,069 (+2,208)
92,716 (+2,185)
114,136 (+2,208)
102,136 (+1,803)
189,458 (+2,209)
168,492 (+2,143)
114,069 (+2,208)
92,716 (+2,185)
114,092 (+2,208)
117,249 (+2,253)
123,744 (+2,209)
119,727 (+2,143)
114,070 (+2,208)
109,836 (+2,253)
47,188 (+168)
44,960 (+115)
84,181 (+208)
45,524 (+203)
+1.97%
+1.96%
+1.54%
+1.37%
+1.97%
+2.09%
+1.97%
+1.80%
+0.85%
+0.89%
+1.97%
+2.41%
+1.97%
+1.80%
+1.18%
+1.29%
+1.97%
+2.41%
+1.97%
+1.96%
+1.82%
+1.82%
+1.97%
+2.09%
+0.36%
+0.26%
+0.25%
+0.45%
114,048 (+2,208)
117,227 (+2,253)
146,063 (+2,209)
159,048 (+2,143)
114,070 (+2,208)
109,814 (+2,253)
114,135 (+2,208)
102,102 (+1,802)
263,196 (+2,209)
241,910 (+2,143)
114,069 (+2,208)
92,716 (+2,185)
114,136 (+2,208)
102,136 (+1,803)
189,458 (+2,209)
168,492 (+2,143)
114,069 (+2,208)
92,716 (+2,185)
114,092 (+2,208)
117,249 (+2,253)
123,744 (+2,209)
119,727 (+2,143)
114,070 (+2,208)
109,836 (+2,253)
74,855 (+201)
84,710 (+137)
85,181 (+208)
50,214 (+228)
+1.97%
+1.96%
+1.54%
+1.37%
+1.97%
+2.09%
+1.97%
+1.80%
+0.85%
+0.89%
+1.97%
+2.41%
+1.97%
+1.80%
+1.18%
+1.29%
+1.97%
+2.41%
+1.97%
+1.96%
+1.82%
+1.82%
+1.97%
+2.09%
+0.27%
+0.16%
+0.24%
+0.46%
114,048 (+2,208)
117,227 (+2,253)
146,063 (+2,209)
159,048 (+2,143)
114,070 (+2,208)
109,814 (+2,253)
114,135 (+2,208)
102,102 (+1,802)
263,196 (+2,209)
241,910 (+2,143)
114,069 (+2,208)
92,716 (+2,185)
114,136 (+2,208)
102,136 (+1,803)
189,458 (+2,209)
168,492 (+2,143)
114,069 (+2,208)
92,716 (+2,185)
114,092 (+2,208)
117,249 (+2,253)
123,744 (+2,209)
119,727 (+2,143)
114,070 (+2,208)
109,836 (+2,253)
80,016 (+209)
97,131 (+143)
85,181 (+208)
50,214 (+228)
+1.97%
+1.96%
+1.54%
+1.37%
+1.97%
+2.09%
+1.97%
+1.80%
+0.85%
+0.89%
+1.97%
+2.41%
+1.97%
+1.80%
+1.18%
+1.29%
+1.97%
+2.41%
+1.97%
+1.96%
+1.82%
+1.82%
+1.97%
+2.09%
+0.26%
+0.15%
+0.24%
+0.46%
114,048 (+2,208)
117,227 (+2,253)
146,063 (+2,209)
159,048 (+2,143)
114,070 (+2,208)
109,814 (+2,253)
114,135 (+2,208)
102,102 (+1,802)
263,196 (+2,209)
241,910 (+2,143)
114,069 (+2,208)
92,716 (+2,185)
114,136 (+2,208)
102,136 (+1,803)
189,458 (+2,209)
168,492 (+2,143)
114,069 (+2,208)
92,716 (+2,185)
114,092 (+2,208)
117,249 (+2,253)
123,744 (+2,209)
119,727 (+2,143)
114,070 (+2,208)
109,836 (+2,253)
215,416 (+209)
236,541 (+2,143)
86,181 (+208)
54,904 (+253)
+1.97%
+1.96%
+1.54%
+1.37%
+1.97%
+2.09%
+1.97%
+1.80%
+0.85%
+0.89%
+1.97%
+2.41%
+1.97%
+1.80%
+1.18%
+1.29%
+1.97%
+2.41%
+1.97%
+1.96%
+1.82%
+1.82%
+1.97%
+2.09%
+0.10%
+0.91%
+0.24%
+0.46%
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
245,784 (0)
245,784 (0)
4 (0)
4 (0)

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.

None yet

4 participants