Skip to content

Commit e17c160

Browse files
committed
Remove validation match project type to validate expenditure type
1 parent 67597b3 commit e17c160

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

pallets/proxy-financial/src/functions.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -534,26 +534,6 @@ impl<T: Config> Pallet<T> {
534534
// Create expenditure id
535535
let expenditure_id = (project_id, expenditure.0.clone(), expenditure.1, timestamp).using_encoded(blake2_256);
536536

537-
// Match project type to validate expenditure type
538-
match project_data.project_type {
539-
ProjectType::Construction => {
540-
// Ensure expenditure type is valid
541-
ensure!(expenditure.1 == ExpenditureType::HardCost || expenditure.1 == ExpenditureType::SoftCost, Error::<T>::InvalidExpenditureType);
542-
},
543-
ProjectType::ConstructionOperation => {
544-
// Ensure expenditure type is valid
545-
ensure!(expenditure.1 != ExpenditureType::Others, Error::<T>::InvalidExpenditureType);
546-
},
547-
ProjectType::ConstructionBridge => {
548-
// Ensure expenditure type is valid
549-
ensure!(expenditure.1 != ExpenditureType::Operational, Error::<T>::InvalidExpenditureType);
550-
},
551-
ProjectType::Operation => {
552-
// Ensure expenditure type is valid
553-
ensure!(expenditure.1 == ExpenditureType::Operational, Error::<T>::InvalidExpenditureType);
554-
},
555-
}
556-
557537
// Create expenditure data
558538
let expenditure_data = ExpenditureData {
559539
project_id,

pallets/proxy-financial/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,7 @@ pub mod pallet {
512512
// start_day
513513
) -> DispatchResult {
514514
let who = ensure_signed(origin)?; // origin need to be an admin
515-
//TOREVIEW: Should we allow project_type modification?
516-
// It implies to change their expenditure types and so on...
515+
517516
Self::do_edit_project(who, project_id, tittle, description, image, adress, completition_date)
518517
}
519518

0 commit comments

Comments
 (0)