Skip to content

Commit 6754f06

Browse files
committed
Fix bug in finding authorizers masp vp must check from the actions
1 parent 20346b9 commit 6754f06

File tree

1 file changed

+7
-3
lines changed
  • crates/shielded_token/src

1 file changed

+7
-3
lines changed

crates/shielded_token/src/vp.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! MASP native VP
22
3+
use std::borrow::Cow;
34
use std::cmp::Ordering;
45
use std::collections::{BTreeMap, BTreeSet};
56
use std::marker::PhantomData;
@@ -480,7 +481,7 @@ where
480481
ctx: &'ctx CTX,
481482
shielded_tx: &MaspFeeType,
482483
batched_tx: &BatchedTxRef<'_>,
483-
actions_authorizers: &mut HashSet<&Address>,
484+
actions_authorizers: &mut HashSet<Cow<'_, Address>>,
484485
) -> Result<()> {
485486
let has_trans_inputs = shielded_tx
486487
.masp_tx()
@@ -690,14 +691,17 @@ where
690691
}
691692
}
692693

693-
let mut actions_authorizers: HashSet<&Address> = actions
694+
let mut actions_authorizers: HashSet<Cow<'_, Address>> = actions
694695
.iter()
695696
.filter_map(|action| {
696697
if let namada_tx::action::Action::Masp(
697698
namada_tx::action::MaspAction::MaspAuthorizer(addr),
698699
) = action
699700
{
700-
Some(addr)
701+
Some(Cow::Borrowed(addr))
702+
} else if let namada_tx::action::Action::IbcShielding ( data ) = action
703+
{
704+
data.get_signer().map(|s| Cow::Owned(Address::from(s)))
701705
} else {
702706
None
703707
}

0 commit comments

Comments
 (0)