-
Notifications
You must be signed in to change notification settings - Fork 271
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: builder fns for PrivateTransactionRequest and inner props (#1954) #2023
base: main
Are you sure you want to change the base?
feat: builder fns for PrivateTransactionRequest and inner props (#1954) #2023
Conversation
…y-rs#1954) Signed-off-by: Aliaksei Misiukevich <[email protected]>
afaik, you lot don't cover such functionality with tests, do you? |
Signed-off-by: Aliaksei Misiukevich <[email protected]>
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.
cool, smol nit
Signed-off-by: Aliaksei Misiukevich <[email protected]>
c1ab985
to
2ac88db
Compare
Signed-off-by: Aliaksei Misiukevich <[email protected]>
I was struggling to understand usage of this request |
Self { | ||
tx: envelope.encoded_2718().into(), | ||
max_block_number: None, | ||
preferences: PrivateTransactionPreferences { | ||
fast: None, | ||
validity: None, | ||
privacy: None, | ||
}, |
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.
can we use a new function for this as well, from functions alone are more obfuscated
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 empty Bytes allowed?
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 but all those fields are pub,
the only thing missing here is this from fn as
impl PrivateTransactionRequest {
pub fn new<T>() -> Self {
Self {
tx: envelope.encoded_2718().into(),
max_block_number: None,
preferences: PrivateTransactionPreferences {
fast: None,
validity: None,
privacy: None,
},
}
and then the from function would just call PrivateTransactionRequest::new(tx)
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.
makes some sense
Motivation
Builder style functions for PrivateTransactionRequest
Solution
Added PrivateTransactionRequest's and inner properties implementation blocks containing builder fns
PR Checklist