Skip to content

Commit

Permalink
fix(builder): fix entity removal in bundle building
Browse files Browse the repository at this point in the history
  • Loading branch information
dancoombs committed Dec 20, 2024
1 parent a77876c commit d9729c3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/builder/src/bundle_proposer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,11 @@ impl<UO: UserOperation> ProposalContext<UO> {

fn reject_aggregator(&mut self, address: Address) {
self.groups_by_aggregator.remove(&Some(address));
if let Some(group) = self.groups_by_aggregator.remove(&Some(address)) {
for op in group.ops_with_simulations {
self.rejected_ops.push((op.op, op.simulation.entity_infos));
}
}
}

fn reject_paymaster(&mut self, address: Address) -> Vec<Address> {
Expand All @@ -1310,6 +1315,8 @@ impl<UO: UserOperation> ProposalContext<UO> {
for op in mem::take(&mut group.ops_with_simulations) {
if !filter(&op.op) {
group.ops_with_simulations.push(op);
} else {
self.rejected_ops.push((op.op, op.simulation.entity_infos));
}
}
if group.ops_with_simulations.is_empty() {
Expand Down Expand Up @@ -1998,7 +2005,7 @@ mod tests {
},
]
);
assert_eq!(bundle.rejected_ops, vec![]);
assert_eq!(bundle.rejected_ops, vec![op1, op2, op4, op5]);
assert_eq!(
bundle.ops_per_aggregator,
vec![UserOpsPerAggregator {
Expand Down

0 comments on commit d9729c3

Please sign in to comment.