fn try_to_close_file(cid: &MerkleRoot, curr_bn: BlockNumber) {
        if let Some((file_info, used_info)) = <Files<T>>::get(cid) {
            // If it's already expired.
            if file_info.expired_on <= curr_bn && file_info.expired_on == file_info.calculated_at {
                Self::update_files_size(file_info.file_size, used_info.reported_group_count, 0);
                let total_amount = file_info.amount.saturating_add(file_info.prepaid);
                T::Currency::transfer(&Self::storage_pot(), &Self::reserved_pot(), total_amount, KeepAlive).expect("Something wrong during transferring");
                Self::move_into_trash(cid, used_info, file_info.file_size);
            };
        }
    }
/// Close file, maybe move into trash
Close file, maybe move into trash
Close file maybe move into trash
fn try_to_close_file(cid: &MerkleRoot, curr_bn: BlockNumber) {
        if let Some((file_info, used_info)) = <Files<T>>::get(cid) {
            // If it's already expired.
            if file_info.expired_on <= curr_bn && file_info.expired_on == file_info.calculated_at {
                Self::update_files_size(file_info.file_size, used_info.reported_group_count, 0);
                let total_amount = file_info.amount.saturating_add(file_info.prepaid);
                T::Currency::transfer(&Self::storage_pot(), &Self::reserved_pot(), total_amount, KeepAlive).expect("Something wrong during transferring");
                Self::move_into_trash(cid, used_info, file_info.file_size);
            };
        }
    }
fn try_to_close_file ( cid : & MerkleRoot , curr_bn : BlockNumber ) { if let Some ( ( file_info , used_info ) ) = < Files < T > > :: get ( cid ) { // If it's already expired. if file_info . expired_on <= curr_bn && file_info . expired_on == file_info . calculated_at { Self :: update_files_size ( file_info . file_size , used_info . reported_group_count , 0 ) ; let total_amount = file_info . amount . saturating_add ( file_info . prepaid ) ; T :: Currency :: transfer ( & Self :: storage_pot ( ) , & Self :: reserved_pot ( ) , total_amount , KeepAlive ) . expect ( " " ) ; Self :: move_into_trash ( cid , used_info , file_info . file_size ) ; } ; } }
Close file, maybe move into trash
Close file maybe move into trash
cid
&MerkleRoot
curr_bn
BlockNumber