Skip to content

Commit 2300b87

Browse files
committed
fixup! 19581f3
1 parent 0e4b5c7 commit 2300b87

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

simln-lib/src/lib.rs

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ impl<C: Clock + 'static> Simulation<C> {
10911091
select! {
10921092
biased;
10931093
_ = listener.clone() => {
1094-
return Ok(())
1094+
return Ok::<(), SimulationError>(())
10951095
},
10961096
_ = async {} => {
10971097
match heap.pop() {
@@ -1121,23 +1121,14 @@ impl<C: Clock + 'static> Simulation<C> {
11211121
// Only proceed with a payment if the amount is non-zero, otherwise skip this round. If we can't get
11221122
// a payment amount something has gone wrong (because we should have validated that we can always
11231123
// generate amounts), so we exit.
1124-
let payment_amount = payload.executor.payment_generator.payment_amount(capacity);
1125-
let amount = match payment_amount {
1126-
Ok(amt) => {
1127-
if amt == 0 {
1128-
log::debug!(
1129-
"Skipping zero amount payment for {source} -> {}.", destination
1130-
);
1131-
generate_payment(&mut heap, pubkey, payload.current_count, &mut payment_event_payloads).await?;
1132-
continue;
1133-
}
1134-
amt
1135-
},
1136-
Err(e) => {
1137-
return Err(SimulationError::PaymentGenerationError(e));
1138-
},
1139-
};
1124+
let amount = payload.executor.payment_generator.payment_amount(capacity).map_err(SimulationError::PaymentGenerationError)?;
11401125
generate_payment(&mut heap, pubkey, payload.current_count + 1, &mut payment_event_payloads).await?;
1126+
if amount == 0 {
1127+
log::debug!(
1128+
"Skipping zero amount payment for {source} -> {}.", destination
1129+
);
1130+
continue;
1131+
}
11411132

11421133
// Wait until our time to next payment has elapsed then execute a random amount payment to a random
11431134
// destination.

0 commit comments

Comments
 (0)