Skip to content

Commit fffbfbc

Browse files
committed
Fix validation do_execute_transactions
1 parent 0bd3b0c commit fffbfbc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pallets/proxy-financial/src/functions.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,8 +1001,10 @@ impl<T: Config> Pallet<T> {
10011001
//Ensure drawdown exists so helper private functions doesn't need to check it
10021002
ensure!(DrawdownsInfo::<T>::contains_key(drawdown_id), Error::<T>::DrawdownNotFound);
10031003

1004-
// Ensure transactions are not empty
1005-
ensure!(!transactions.is_empty(), Error::<T>::EmptyTransactions);
1004+
// Ensure transactions are not empty if submit is true
1005+
if submit == false {
1006+
ensure!(!transactions.is_empty(), Error::<T>::EmptyTransactions);
1007+
}
10061008

10071009
//Todo: create custom error to replace nonevalue error
10081010
for transaction in transactions {
@@ -1039,7 +1041,7 @@ impl<T: Config> Pallet<T> {
10391041
Self::do_calculate_drawdown_total_amount(project_id, drawdown_id)?;
10401042

10411043
// If submit is true, submit drawdown to be approved
1042-
if submit {
1044+
if submit == true {
10431045
Self::do_submit_drawdown(project_id, drawdown_id)?;
10441046
}
10451047

0 commit comments

Comments
 (0)