-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat!: add possibility to place a predefined gas amount for predicate #1655
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
base: master
Are you sure you want to change the base?
Conversation
@@ -16,6 +16,7 @@ pub enum Input { | |||
resource: CoinType, | |||
code: Vec<u8>, | |||
data: Vec<u8>, | |||
gas_used: u64, |
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.
this is a breaking change unless we annotated this previously with the non_exhaustive
attribute.
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.
Added
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.
adding non_exhaustive
also makes this change a breaking change, but prevents breaking changes in the future, was that intended?
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.
in any case, having non_exhaustive
only on one enum variant makes it a little annoying for the consumer of this library, so perhaps we can just annotate the whole enum with it?
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.
No, I wanted this to be non breaking. Removed for now. Making the PR draft because I might not need it
} | ||
} | ||
|
||
pub const fn resource_predicate_with_gas( |
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.
As it is already a breaking change I would add the gas_used
directly to the resource_predicate
fn
Useful to be forced to
estimate_predicates
and let the user define it if he wants. Tried to make it non-breaking by using a new constructor (I don't know if the new field in the enum variant is considered breaking)Release notes
In this release, we:
Input
:resource_predicate_with_gas
to let user place a predefined amountChecklist