-
Notifications
You must be signed in to change notification settings - Fork 56
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
mock: add proven tx builder #474
Conversation
|
||
fn to_envelope(&self) -> NoteEnvelope { | ||
NoteEnvelope::new(self.id(), self.metadata()) | ||
} |
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.
ToEnvelope
requires PartialEq
, so I couldn't use trait objects.
The OutputNotes<T>
struct is parametrized, and ProvenTransaction
requires it to be OutputNotes<NoteEnvelope>
. So I can't the generic OutputNotes<T>
constructor.
/// Each transaction needs a unique builder. | ||
#[derive(Debug, Clone)] | ||
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] | ||
pub struct ProvenTransactionBuilder { |
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 meant to replace MockProvenTxBuilder
in miden-node
?
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.
If it is possible, I would think it is a good idea. The rationale is that having fewer utilities doing the same is best, and the utilities in miden-base
can be used on the other projects, like miden-client
.
357c06d
to
4ace031
Compare
9f3ea1f
to
188e6d6
Compare
4ace031
to
91c0918
Compare
91c0918
to
69e040d
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
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.
Looks good! Thank you! I left a couple of comments about the dependencies which hopefully help with the failing CI.
On a broader note, I think we may need to revisit the mock
crate soon. Specifically:
- I'm not sure we actually use any of the serialized blockchain data and what we currently have there may be obsolete.
- The crate has features to enable
no_std
- but it is actually not compatible withno_std
(e.g., importing it without default features causes issues on the node).
Let's create an issue for this.
69e040d
to
577fbc5
Compare
Adds a mock builder for proven transactions.
Prep work for 0xPolygonMiden/miden-node#79
Note: This is based on top of #479 , which fixes the clippy warnings.