Skip to content

Commit

Permalink
find_landed_orders.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
intls committed Jan 18, 2025
1 parent 2f8800a commit c13d9cb
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl OrderChunk {

let mut accumulated_chunks = Vec::new();

let mut prev_element_payed_refund = false;
let mut prev_element_paid_refund = false;
let mut current_chunk_txs = Vec::new();

let release_chunk = |current_chunk_txs: &mut Vec<(B256, TxRevertBehavior)>,
Expand All @@ -96,8 +96,8 @@ impl OrderChunk {
for (idx, body) in inner.body.iter().enumerate() {
let current_element_pays_refund = !inner.refund.iter().any(|r| r.body_idx == idx);

if prev_element_payed_refund != current_element_pays_refund {
let chunk_refund_percent = if prev_element_payed_refund {
if prev_element_paid_refund != current_element_pays_refund {
let chunk_refund_percent = if prev_element_paid_refund {
total_refund_percent
} else {
0
Expand All @@ -107,15 +107,15 @@ impl OrderChunk {
&mut accumulated_chunks,
chunk_refund_percent,
);
prev_element_payed_refund = current_element_pays_refund;
prev_element_paid_refund = current_element_pays_refund;
}

match body {
ShareBundleBody::Tx(tx) => {
current_chunk_txs.push((tx.hash(), tx.revert_behavior));
}
ShareBundleBody::Bundle(inner_bundle) => {
let chunk_refund_percent = if prev_element_payed_refund {
let chunk_refund_percent = if prev_element_paid_refund {
total_refund_percent
} else {
0
Expand Down Expand Up @@ -143,7 +143,7 @@ impl OrderChunk {
}
}

let chunk_refund_percent = if prev_element_payed_refund {
let chunk_refund_percent = if prev_element_paid_refund {
total_refund_percent
} else {
0
Expand Down

0 comments on commit c13d9cb

Please sign in to comment.