Skip to content

Commit

Permalink
evil: #2428
Browse files Browse the repository at this point in the history
  • Loading branch information
grarco committed Jan 24, 2024
1 parent 037a46e commit 5d3799a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
2 changes: 1 addition & 1 deletion crates/namada/src/ledger/native_vp/masp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use token::storage_key::{
masp_commitment_anchor_key, masp_commitment_tree_key,
masp_convert_anchor_key, masp_nullifier_key, masp_pin_tx_key,
};
use token::{Amount, MaspDenom};
use token::Amount;

use crate::ledger::native_vp;
use crate::ledger::native_vp::{Ctx, NativeVp};
Expand Down
33 changes: 10 additions & 23 deletions crates/sdk/src/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2710,30 +2710,17 @@ pub async fn gen_ibc_shielded_transfer<N: Namada>(
.await
.map_err(|err| TxSubmitError::MaspError(err.to_string()))?;

let mut transfer = token::Transfer {
source: source.clone(),
target: MASP,
token: token.clone(),
amount: validated_amount,
key,
shielded: None,
};
if let Some(shielded_transfer) = shielded_transfer {
// TODO: Workaround for decoding the asset_type later
let mut shielded = context.shielded_mut().await;
for denom in MaspDenom::iter() {
let epoch = shielded_transfer.epoch;
shielded
.get_asset_type(context.client(), epoch, token.clone(), denom)
.await
.map_err(|_| {
Error::Other("unable to create asset type".to_string())
})?;
}
let _ = shielded.save().await;

transfer.shielded =
Some(Section::MaspTx(shielded_transfer.masp_tx.clone()).get_hash());
let transfer = token::Transfer {
source,
target: MASP,
token,
amount: validated_amount,
key,
shielded: Some(
Section::MaspTx(shielded_transfer.masp_tx.clone()).get_hash(),
),
};
Ok(Some(IbcShieldedTransfer {
transfer,
masp_tx: shielded_transfer.masp_tx,
Expand Down

0 comments on commit 5d3799a

Please sign in to comment.