Skip to content

Commit

Permalink
transaction: remove TODO comment
Browse files Browse the repository at this point in the history
this removes a todo comment asking a question.

> Not finding a BSOD in the TxP means that whoever generated the
> transaction perspective didn't include that data, either because they
> didn't have it (eg the transaction was created but never confirmed by
> the chain and executed) or because they didn't support it in their
> implementation.
>
> We should handle that by graceful degradation, just not rendering the
> BSOD-requiring data if we don't have it.

\- #4164 (comment)
  • Loading branch information
cratelyn authored and aubrika committed Apr 23, 2024
1 parent 7787f56 commit 2bec50c
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions crates/core/transaction/src/is_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,15 +381,13 @@ impl IsAction for Swap {
.find(|bsod| bsod.trading_pair == self.body.trading_pair);

// We can get the denom metadata whether we get a BSOD or not

let denom_1 = txp.denoms.get(&self.body.trading_pair.asset_1()).cloned();
let denom_2 = txp.denoms.get(&self.body.trading_pair.asset_2()).cloned();

match bsod {
None => {
// If we can't find a matching BSOD, we can't compute the output notes
// for the swap.
// TODO: is defaulting to 'None' the right behavior here, or is not matching on a BSOD as above an error?
SwapView::Opaque {
swap: self.to_owned(),
batch_swap_output_data: None,
Expand All @@ -402,10 +400,8 @@ impl IsAction for Swap {
Some(bsod) => {
// If we can find a matching BSOD, use it to compute the output notes
// for the swap.

let (lambda_1_i, lambda_2_i) =
bsod.pro_rata_outputs((self.body.delta_1_i, self.body.delta_2_i));

SwapView::Opaque {
swap: self.to_owned(),
batch_swap_output_data: Some(bsod.clone()),
Expand Down

0 comments on commit 2bec50c

Please sign in to comment.