Skip to content

Commit

Permalink
Remove panic
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Jan 15, 2024
1 parent 1a9f820 commit e0fc11f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sdk/src/client/api/block_builder/input_selection/remainder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,19 @@ impl InputSelection {
.as_ref()
.map(|chain_id| self.automatically_transitioned.contains(chain_id))
.unwrap_or(false)
// Foundries can'ty hold mana so they are not considered here.
&& !output.is_foundry()
})
.next();
if let Some(output) = output {
*output = match output {
Output::Account(output) => AccountOutputBuilder::from(&*output)
.with_mana(output.mana() + mana_diff)
.finish_output()?,
Output::Foundry(_) => panic!(),
Output::Nft(output) => NftOutputBuilder::from(&*output)
.with_mana(output.mana() + mana_diff)
.finish_output()?,
_ => panic!("only account, nft and foundry can be automatically created"),
_ => panic!("only account, nft can be automatically created and can hold mana"),
};
}

Expand Down

0 comments on commit e0fc11f

Please sign in to comment.