Skip to content

Commit

Permalink
Merge pull request #961 from multiversx/small-router-fixes
Browse files Browse the repository at this point in the history
Small router fixes
  • Loading branch information
psorinionut authored Oct 16, 2024
2 parents 3449c93 + c6c045d commit 41c20f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions dex/router/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ pub trait EventsModule {
self.multi_pair_swap_event(
caller.clone(),
token_in.clone(),
amount_in.clone(),
token_out.token_identifier.clone(),
token_out.amount.clone(),
epoch,
MultiPairSwapEvent {
caller,
Expand Down Expand Up @@ -148,7 +150,9 @@ pub trait EventsModule {
&self,
#[indexed] caller: ManagedAddress,
#[indexed] token_in: TokenIdentifier,
#[indexed] amount_in: BigUint,
#[indexed] token_out: TokenIdentifier,
#[indexed] amount_out: BigUint,
#[indexed] epoch: u64,
multi_pair_swap_event: MultiPairSwapEvent<Self::Api>,
);
Expand Down
5 changes: 4 additions & 1 deletion dex/router/src/multi_pair_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ pub trait MultiPairSwap:
);

last_payment = payment;
payments.push(residuum);

if residuum.amount > 0 {
payments.push(residuum);
}
} else {
sc_panic!("Invalid function to call");
}
Expand Down

0 comments on commit 41c20f7

Please sign in to comment.