-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Create runtime-transaction crate to build transaction types with state for runtime use #33471
Create runtime-transaction crate to build transaction types with state for runtime use #33471
Conversation
0ca1826
to
09682ad
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #33471 +/- ##
=======================================
Coverage 81.9% 81.9%
=======================================
Files 812 816 +4
Lines 219645 219688 +43
=======================================
+ Hits 179922 180003 +81
+ Misses 39723 39685 -38 |
c9d6796
to
9f6da2c
Compare
3da7d1f
to
294382c
Compare
294382c
to
edac647
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.
Liking the overall approach here with wire -> sanitized -> tx w/ static -> tx w/ dynamic
f48d15d
to
90dc6ef
Compare
… that comes with metadata
…ing traits for transacion_meta
Co-authored-by: Andrew Fitzgerald <[email protected]>
Co-authored-by: Andrew Fitzgerald <[email protected]>
90dc6ef
to
43eda39
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 - couple of minor things I will follow-up on myself so we can begin using this earlier!
@@ -32,6 +32,11 @@ impl SanitizedVersionedTransaction { | |||
pub fn get_message(&self) -> &SanitizedVersionedMessage { | |||
&self.message | |||
} | |||
|
|||
/// Consumes the SanitizedVersionedTransaction, returning the fields individually. | |||
pub fn destruct(self) -> (Vec<Signature>, SanitizedVersionedMessage) { |
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 could be an impl From<SanitizedVersionedTransaction> for (Vec<Signature>, SanitizedVersionedMessage)
if not make the fields pub
instead of pub (crate)
to allow in place destructuring
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.
Fields on SanitizedVersionedMessage
should not be pub. Them being private is intentional, see the previous discussion on it: #33471 (comment)
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.
From
impl, then. i would assume a method called destruct()
to do something... destructive.
Problem
Add a transaction type for runtime that contains encapsulated internal metadata, which can be accessed/updated as sanitized transaction goes through execution pipeline.
It is an Alternative to #33418
Summary of Changes
Fixes #