From 2bec50c2c640066957c17391091e21e85000fbed Mon Sep 17 00:00:00 2001 From: katelyn martin Date: Mon, 22 Apr 2024 15:24:22 -0400 Subject: [PATCH] transaction: remove `TODO` comment 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. \- https://github.com/penumbra-zone/penumbra/pull/4164#discussion_r1575246052 --- crates/core/transaction/src/is_action.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/crates/core/transaction/src/is_action.rs b/crates/core/transaction/src/is_action.rs index aa9b04ccb4..d1921a4327 100644 --- a/crates/core/transaction/src/is_action.rs +++ b/crates/core/transaction/src/is_action.rs @@ -381,7 +381,6 @@ 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(); @@ -389,7 +388,6 @@ impl IsAction for Swap { 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, @@ -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()),