commit d9724b8fbfab3c36f9c9f491dc29cd71c2857c0d
parent 02edf7f4fb4fee8206ad68d0bdb8e55be33b8b4e
Author: triesap <tyson@radroots.org>
Date: Sun, 5 Jul 2026 09:30:47 +0000
trade: retire legacy order DTO names
Diffstat:
3 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/crates/trade/src/dto.rs b/crates/trade/src/dto.rs
@@ -7,7 +7,7 @@ use crate::listing::{
model::{RadrootsTradeListingSubtotal, RadrootsTradeListingTotal},
validation::RadrootsTradeListing,
};
-use crate::order::RadrootsTradeOrderWorkflowProjection;
+use crate::order::RadrootsOrderWorkflowProjection;
use crate::workflow::RadrootsTradeWorkflowState;
pub fn dto_roots() -> [RootDescriptor; 5] {
@@ -16,7 +16,7 @@ pub fn dto_roots() -> [RootDescriptor; 5] {
RootDescriptor::new::<RadrootsTradeListingSubtotal>(),
RootDescriptor::new::<RadrootsTradeListingTotal>(),
RootDescriptor::new::<RadrootsTradeWorkflowState>(),
- RootDescriptor::new::<RadrootsTradeOrderWorkflowProjection>(),
+ RootDescriptor::new::<RadrootsOrderWorkflowProjection>(),
]
}
@@ -234,7 +234,7 @@ mod tests {
"RadrootsTradeListingSubtotal",
"RadrootsTradeListingTotal",
"RadrootsTradeWorkflowState",
- "RadrootsTradeOrderWorkflowProjection",
+ "RadrootsOrderWorkflowProjection",
];
#[test]
@@ -299,7 +299,7 @@ mod tests {
#[test]
fn trade_order_workflow_projection_models_missing_state_with_optional_evidence() {
let registry = build_registry(dto_roots());
- let projection = find_struct(®istry, "RadrootsTradeOrderWorkflowProjection");
+ let projection = find_struct(®istry, "RadrootsOrderWorkflowProjection");
assert!(field_names(projection).contains(&"status"));
for optional_field in [
@@ -316,7 +316,7 @@ mod tests {
"last_event_id",
] {
let presence = registry
- .struct_field_presence("RadrootsTradeOrderWorkflowProjection", optional_field)
+ .struct_field_presence("RadrootsOrderWorkflowProjection", optional_field)
.expect("projection field presence");
assert!(
!presence.required_on_deserialize,
@@ -332,7 +332,7 @@ mod tests {
#[test]
fn trade_order_workflow_projection_omits_binding_only_discount_fields() {
let registry = build_registry(dto_roots());
- let projection = find_struct(®istry, "RadrootsTradeOrderWorkflowProjection");
+ let projection = find_struct(®istry, "RadrootsOrderWorkflowProjection");
let fields = field_names(projection);
for stale_field in [
diff --git a/crates/trade/src/dvm.rs b/crates/trade/src/dvm.rs
@@ -199,7 +199,7 @@ pub struct RadrootsTradeInventoryBinWitnessDto {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(deny_unknown_fields))]
#[derive(Clone, Debug, PartialEq, Eq)]
-pub struct RadrootsTradeOrderItemWitnessDto {
+pub struct RadrootsOrderItemWitnessDto {
pub bin_id: RadrootsInventoryBinId,
pub bin_count: u32,
}
@@ -209,19 +209,19 @@ pub struct RadrootsTradeOrderItemWitnessDto {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(deny_unknown_fields))]
#[derive(Clone, Debug, PartialEq, Eq)]
-pub struct RadrootsTradeOrderRequestWitnessDto {
+pub struct RadrootsOrderRequestWitnessDto {
pub order_id: RadrootsOrderId,
pub listing_addr: RadrootsListingAddress,
pub buyer_pubkey: RadrootsPublicKey,
pub seller_pubkey: RadrootsPublicKey,
- pub items: Vec<RadrootsTradeOrderItemWitnessDto>,
+ pub items: Vec<RadrootsOrderItemWitnessDto>,
}
#[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))]
#[cfg_attr(feature = "dto-bindgen", dto(export))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Clone, Debug, PartialEq, Eq)]
-pub enum RadrootsTradeOrderDecisionWitnessDto {
+pub enum RadrootsOrderDecisionWitnessDto {
Accepted {
inventory_commitments: Vec<RadrootsTradeInventoryCommitmentWitnessDto>,
},
@@ -245,12 +245,12 @@ pub struct RadrootsTradeInventoryCommitmentWitnessDto {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(deny_unknown_fields))]
#[derive(Clone, Debug, PartialEq, Eq)]
-pub struct RadrootsTradeOrderDecisionEventWitnessDto {
+pub struct RadrootsOrderDecisionEventWitnessDto {
pub order_id: RadrootsOrderId,
pub listing_addr: RadrootsListingAddress,
pub buyer_pubkey: RadrootsPublicKey,
pub seller_pubkey: RadrootsPublicKey,
- pub decision: RadrootsTradeOrderDecisionWitnessDto,
+ pub decision: RadrootsOrderDecisionWitnessDto,
}
#[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))]
@@ -265,8 +265,8 @@ pub struct RadrootsTradeTransitionProofRequestV1 {
pub request_event_id: RadrootsEventId,
pub decision_event_id: RadrootsEventId,
pub event_evidence: Vec<RadrootsTradeCanonicalEventEvidenceDto>,
- pub request: RadrootsTradeOrderRequestWitnessDto,
- pub decision: RadrootsTradeOrderDecisionEventWitnessDto,
+ pub request: RadrootsOrderRequestWitnessDto,
+ pub decision: RadrootsOrderDecisionEventWitnessDto,
pub inventory_bins: Vec<RadrootsTradeInventoryBinWitnessDto>,
pub inventory_sequence: u128,
pub previous_state_root: Option<String>,
@@ -806,22 +806,22 @@ mod tests {
request_event_id: event_id(2),
decision_event_id: event_id(3),
event_evidence: Vec::new(),
- request: RadrootsTradeOrderRequestWitnessDto {
+ request: RadrootsOrderRequestWitnessDto {
order_id: RadrootsOrderId::parse("order-1").expect("order id"),
listing_addr: listing_addr(),
buyer_pubkey: public_key(BUYER),
seller_pubkey: public_key(SELLER),
- items: vec![RadrootsTradeOrderItemWitnessDto {
+ items: vec![RadrootsOrderItemWitnessDto {
bin_id: RadrootsInventoryBinId::parse("bin-1").expect("bin id"),
bin_count: 2,
}],
},
- decision: RadrootsTradeOrderDecisionEventWitnessDto {
+ decision: RadrootsOrderDecisionEventWitnessDto {
order_id: RadrootsOrderId::parse("order-1").expect("order id"),
listing_addr: listing_addr(),
buyer_pubkey: public_key(BUYER),
seller_pubkey: public_key(SELLER),
- decision: RadrootsTradeOrderDecisionWitnessDto::Accepted {
+ decision: RadrootsOrderDecisionWitnessDto::Accepted {
inventory_commitments: vec![RadrootsTradeInventoryCommitmentWitnessDto {
bin_id: RadrootsInventoryBinId::parse("bin-1").expect("bin id"),
bin_count: 2,
diff --git a/crates/trade/src/order.rs b/crates/trade/src/order.rs
@@ -627,7 +627,7 @@ impl RadrootsOrderProjection {
#[cfg_attr(feature = "dto-bindgen", dto(export))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Clone, Debug, PartialEq, Eq)]
-pub struct RadrootsTradeOrderWorkflowProjection {
+pub struct RadrootsOrderWorkflowProjection {
pub order_id: RadrootsOrderId,
pub status: RadrootsTradeWorkflowState,
pub request_event_id: Option<RadrootsEventId>,
@@ -647,7 +647,7 @@ pub struct RadrootsTradeOrderWorkflowProjection {
pub issues: Vec<RadrootsOrderIssue>,
}
-impl From<RadrootsOrderProjection> for RadrootsTradeOrderWorkflowProjection {
+impl From<RadrootsOrderProjection> for RadrootsOrderWorkflowProjection {
fn from(projection: RadrootsOrderProjection) -> Self {
Self {
order_id: projection.order_id,
@@ -671,7 +671,7 @@ impl From<RadrootsOrderProjection> for RadrootsTradeOrderWorkflowProjection {
}
}
-impl From<&RadrootsOrderProjection> for RadrootsTradeOrderWorkflowProjection {
+impl From<&RadrootsOrderProjection> for RadrootsOrderWorkflowProjection {
fn from(projection: &RadrootsOrderProjection) -> Self {
projection.clone().into()
}
@@ -2641,7 +2641,7 @@ mod tests {
RadrootsOrderDecisionRecord, RadrootsOrderEventRecord, RadrootsOrderIssue,
RadrootsOrderReductionInputs, RadrootsOrderRequestRecord,
RadrootsOrderRevisionDecisionRecord, RadrootsOrderRevisionProposalRecord,
- RadrootsTradeLocatorProjectionResolution, RadrootsTradeOrderWorkflowProjection,
+ RadrootsOrderWorkflowProjection, RadrootsTradeLocatorProjectionResolution,
RadrootsTradeWorkflowState, reduce_listing_inventory_accounting,
reduce_order_event_records, reduce_order_event_records_for_trade_locator,
reduce_order_events,
@@ -4894,7 +4894,7 @@ mod tests {
cancellations: Vec::<RadrootsOrderCancellationRecord>::new(),
},
);
- let missing_dto = RadrootsTradeOrderWorkflowProjection::from(&missing);
+ let missing_dto = RadrootsOrderWorkflowProjection::from(&missing);
assert_eq!(missing_dto.status, RadrootsTradeWorkflowState::Missing);
assert!(missing_dto.request_event_id.is_none());
@@ -4917,7 +4917,7 @@ mod tests {
}
let requested = reduce(Vec::new(), Vec::new(), Vec::new(), Vec::new());
- let requested_dto = RadrootsTradeOrderWorkflowProjection::from(&requested);
+ let requested_dto = RadrootsOrderWorkflowProjection::from(&requested);
assert_eq!(requested_dto.status, RadrootsTradeWorkflowState::Requested);
assert_eq!(requested_dto.request_event_id, Some(event_id(1)));