Skip to content

Commit 9fd5c88

Browse files
committed
Hanlde error in case the function do_execute_transactions do not receive the needed Options
1 parent f4acc9f commit 9fd5c88

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

pallets/proxy-financial/src/functions.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -783,16 +783,16 @@ impl<T: Config> Pallet<T> {
783783
Self::do_create_transaction(
784784
project_id,
785785
drawdown_id,
786-
transaction.0,
787-
transaction.1,
786+
transaction.0.ok_or(Error::<T>::NoneValue)?,
787+
transaction.1.ok_or(Error::<T>::NoneValue)?,
788788
transaction.2,
789789
)?;
790790
},
791791
CUDAction::Update => {
792-
// Update transaction needs (
792+
// Update transaction needs (amount, documents, transaction_id)
793793
Self::do_update_transaction(
794-
transaction.1,
795-
transaction.2,
794+
transaction.1.ok_or(Error::<T>::NoneValue)?,
795+
transaction.2,
796796
transaction.4.ok_or(Error::<T>::TransactionIdNotFound)?,
797797
)?;
798798
},
@@ -806,7 +806,7 @@ impl<T: Config> Pallet<T> {
806806

807807
}
808808

809-
// TOOD: update total_amount of drawdown -> submit/draft drawdown
809+
// TOOD: update total_amount of drawdown -> at submit/draft drawdown (not here)
810810

811811
Self::deposit_event(Event::TransactionsCompleted);
812812
Ok(())

pallets/proxy-financial/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,12 @@ pub mod pallet {
504504
pub fn projects_edit_project(
505505
origin: OriginFor<T>,
506506
project_id: [u8;32],
507-
tittle: Option<BoundedVec<FieldName, T::MaxBoundedVecs>>,
507+
tittle: Option<BoundedVec<FieldName, T::MaxBoundedVecs>>, //typo
508508
description: Option<BoundedVec<FieldDescription, T::MaxBoundedVecs>>,
509509
image: Option<BoundedVec<CID, T::MaxBoundedVecs>>,
510-
adress: Option<BoundedVec<FieldName, T::MaxBoundedVecs>>,
511-
completition_date: Option<u64>,
510+
adress: Option<BoundedVec<FieldName, T::MaxBoundedVecs>>, //typo
511+
completition_date: Option<u64>, //typo
512+
// start_day
512513
) -> DispatchResult {
513514
let who = ensure_signed(origin)?; // origin need to be an admin
514515
//TOREVIEW: Should we allow project_type modification?

0 commit comments

Comments
 (0)