This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add dedicated FeePolynomial struct
#13612
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
da5acf8
Add FeePolynomial struct
ggwpez 7b697e0
Add Weight::without_{ref_time, proof_size}
ggwpez 6add0b4
Docs
ggwpez e0489de
Cleanup code
ggwpez 005138c
Add docs
ggwpez 984cafa
doc
ggwpez 2bae1f7
Fix docs
ggwpez 52251d3
docs
ggwpez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,6 +74,16 @@ impl Weight { | |
| &mut self.proof_size | ||
| } | ||
|
|
||
| /// Return self but discard any reference time. | ||
| pub const fn without_ref_time(&self) -> Self { | ||
| Self { ref_time: 0, proof_size: self.proof_size } | ||
| } | ||
|
|
||
| /// Return self but discard any proof size. | ||
| pub const fn without_proof_size(&self) -> Self { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are these 2 functions needed?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are just convenience in cases where we want to selectively exclude specific dimensions. Currently there are only two, so it is a bit boring.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is ever useful, but actually very dangerous. |
||
| Self { ref_time: self.ref_time, proof_size: 0 } | ||
| } | ||
|
|
||
| pub const MAX: Self = Self { ref_time: u64::MAX, proof_size: u64::MAX }; | ||
|
|
||
| /// Get the conservative min of `self` and `other` weight. | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.