Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ impl<ConfigType: LiveBuilderConfig> SyntheticOrdersSource<ConfigType> {
signer: None,
metadata: Metadata {
received_at_timestamp: time::OffsetDateTime::from_unix_timestamp(0).unwrap(),
refund_identity: None,
},
dropping_tx_hashes: Default::default(),
refund: None,
Expand Down
4 changes: 4 additions & 0 deletions crates/rbuilder/src/backtest/redistribute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,10 @@ fn order_redistribution_address(
order: &Order,
protect_signers: &[Address],
) -> Option<(Address, bool)> {
if let Some(refund_identity) = order.metadata().refund_identity {
return Some((refund_identity, false));
}

let signer = match order.signer() {
Some(signer) => signer,
None => {
Expand Down
2 changes: 2 additions & 0 deletions crates/rbuilder/src/primitives/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ use uuid::Uuid;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Metadata {
pub received_at_timestamp: time::OffsetDateTime,
pub refund_identity: Option<Address>,
}

impl Metadata {
pub fn with_current_received_at() -> Self {
Self {
received_at_timestamp: time::OffsetDateTime::now_utc(),
refund_identity: None,
}
}
}
Expand Down
Loading