-
Notifications
You must be signed in to change notification settings - Fork 22
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
Chore/cleanup state and fees #325
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/v2_contracts #325 +/- ##
========================================================
+ Coverage 88.50% 88.57% +0.07%
========================================================
Files 252 252
Lines 23602 23636 +34
========================================================
+ Hits 20888 20936 +48
+ Misses 2714 2700 -14 ☔ View full report in Codecov by Sentry. |
8a7432d
to
02ac728
Compare
a563d0b
to
9911660
Compare
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.
LGTM, well done! Why can't we remove NATIVE_TOKEN_DECIMALS
already?
/// functionalities. This vector enables the flexibility to introduce new fees without altering | ||
/// the core fee structure. Total of all fees, including custom ones, is validated to not exceed | ||
/// 100%, ensuring a balanced and fair fee distribution. | ||
pub extra_fees: Vec<Fee>, |
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.
👀
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.
Is this something you came up with or did you discuss it with @Sen-Com ? I like the idea of having a vector of fees so we don't need to be changing the core structure constantly 👍
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.
I think the 3 of us discussed it ages ago when making the spec about having the possibility of having custom fees but I thought it was already implemented. Since I was working on fees already I added this in so its just one extra thing out of the way.
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.
Something that comes to my mind is in future I would prefer if this was an Map or maybe slightly more complex fee such that we have a fee name included too that way we know what custom fees correspond to what.
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.
Yeah that sounds great, good idea
pair_info.asset_decimals.clone() | ||
} | ||
// Remove after adding decimals to pair info | ||
pub const NATIVE_TOKEN_DECIMALS: Map<&[u8], u8> = Map::new("allow_native_token"); |
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.
What prevents us from removing NATIVE_TOKEN_DECIMALS
right away?
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.
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.
ah you are right!
Closes #317
Closes #305
Removes some unused functions, reworks code a lil bit to accomodate changes. Made changes to fees and moved to fee.rs for custom fees too.
Update index.md
)cargo fmt --all --
.cargo clippy -- -D warnings
.cargo schema
.