-
Notifications
You must be signed in to change notification settings - Fork 20
refactor: add bundle helpers #54
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
Conversation
| let uuid = bundle | ||
| .replacement_uuid | ||
| .clone() | ||
| .unwrap_or_else(|| Uuid::new_v4().to_string()); | ||
|
|
||
| let uuid = Uuid::parse_str(uuid.as_str()).map_err(|_| format!("Invalid UUID: {uuid}"))?; |
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.
Oh, this isn't what I thought was going to happen. I thought replacement_uuid was going to change from an Option<String> to a Option<Uuid>. Then AcceptedBundle::new() would populate its uuid field with replacement_uuid.unwrap_or_else(|| Uuid::new_v4()) (without the to_string).
If ParsedBundle has its own uuid field, the same bundle is going to get multiple uuids assigned over its lifetime.
Overview
Introduce
BundleTransactionsandBundleParamsto be shared acrossBundleandBundleWithMetadatato easily access utility functions.Also implement
FromandTryFromacross these structs to interchange easily