fn _update_loan(
            &mut self,
            loan_id: Id,
            new_borrow_amount: Balance,
            new_timestamp: Timestamp,
            new_collateral_amount: Balance,
        ) -> Result<(), PSP721Error> {
            let loan_info = self.loan_info.get(&loan_id);

            if loan_info.is_none() {
                return Err(PSP721Error::Custom(String::from("This loan does not exist!")))
            }

            let mut loan_info = loan_info.cloned().unwrap();
            loan_info.collateral_amount = new_collateral_amount;
            loan_info.borrow_amount = new_borrow_amount;
            loan_info.timestamp = new_timestamp;

            self.loan_info.insert(loan_id, loan_info);

            Ok(())
        }
/// internal function to update data of a loan
internal function to update data of a loan
internal function to update data of a loan
fn _update_loan(
            &mut self,
            loan_id: Id,
            new_borrow_amount: Balance,
            new_timestamp: Timestamp,
            new_collateral_amount: Balance,
        ) -> Result<(), PSP721Error> {
            let loan_info = self.loan_info.get(&loan_id);
            if loan_info.is_none() {
                return Err(PSP721Error::Custom(String::from("This loan does not exist!")))
            }
            let mut loan_info = loan_info.cloned().unwrap();
            loan_info.collateral_amount = new_collateral_amount;
            loan_info.borrow_amount = new_borrow_amount;
            loan_info.timestamp = new_timestamp;
            self.loan_info.insert(loan_id, loan_info);
            Ok(())
        }
fn _update_loan ( & mut self , loan_id : Id , new_borrow_amount : Balance , new_timestamp : Timestamp , new_collateral_amount : Balance , ) -> Result < ( ) , PSP721Error > { let loan_info = self . loan_info . get ( & loan_id ) ; if loan_info . is_none ( ) { return Err ( PSP721Error :: Custom ( String :: from ( " " ) ) ) } let mut loan_info = loan_info . cloned ( ) . unwrap ( ) ; loan_info . collateral_amount = new_collateral_amount ; loan_info . borrow_amount = new_borrow_amount ; loan_info . timestamp = new_timestamp ; self . loan_info . insert ( loan_id , loan_info ) ; Ok ( ( ) ) }
internal function to update data of a loan
internal function to update data of a loan
&mut self
loan_id
Id
new_borrow_amount
Balance
new_timestamp
Timestamp
new_collateral_amount
Balance
&mut self
loan_id
Id
new_borrow_amount
Balance
new_timestamp
Timestamp
new_collateral_amount
Balance