pub fn process(
            &mut self,
            provider_address: AccountId,
            day_id: u64,
        ) -> ProcessReturningData {
            let linked_list: &mut LinkedList = &mut self
                .providers
                .get_mut(&provider_address)
                .unwrap()
                .payment_manager;
            let mut sum: u128 = 0;
            let mut reduced_length = 0;
            let mut cur_id: u64 = linked_list.head;
            while day_id >= cur_id {
                sum += self
                    .daily_locked_amounts
                    .get(&(provider_address, cur_id))
                    .unwrap()
                    .amount;
                cur_id = self
                    .daily_locked_amounts
                    .get(&(provider_address, cur_id))
                    .unwrap()
                    .next_day;
                reduced_length += 1;
                if cur_id == linked_list.back {
                    break;
                }
            }

            ProcessReturningData {
                withdrawing_amount: sum,
                current_linked_list_head: cur_id,
                reduced_length,
            }
        }
/// process : when providers withdraw this function calculates the amount of money
/// # arguments:
/// * provider_address
/// * day_id : the calculation formula is : (finish date - contract start date) / 86400
process : when providers withdraw this function calculates the amount of money
process : when providers withdraw this function calculates the amount of money
pub fn process(
            &mut self,
            provider_address: AccountId,
            day_id: u64,
        ) -> ProcessReturningData {
            let linked_list: &mut LinkedList = &mut self
                .providers
                .get_mut(&provider_address)
                .unwrap()
                .payment_manager;
            let mut sum: u128 = 0;
            let mut reduced_length = 0;
            let mut cur_id: u64 = linked_list.head;
            while day_id >= cur_id {
                sum += self
                    .daily_locked_amounts
                    .get(&(provider_address, cur_id))
                    .unwrap()
                    .amount;
                cur_id = self
                    .daily_locked_amounts
                    .get(&(provider_address, cur_id))
                    .unwrap()
                    .next_day;
                reduced_length += 1;
                if cur_id == linked_list.back {
                    break;
                }
            }
            ProcessReturningData {
                withdrawing_amount: sum,
                current_linked_list_head: cur_id,
                reduced_length,
            }
        }
pub fn process ( & mut self , provider_address : AccountId , day_id : u64 , ) -> ProcessReturningData { let linked_list : & mut LinkedList = & mut self . providers . get_mut ( & provider_address ) . unwrap ( ) . payment_manager ; let mut sum : u128 = 0 ; let mut reduced_length = 0 ; let mut cur_id : u64 = linked_list . head ; while day_id >= cur_id { sum += self . daily_locked_amounts . get ( & ( provider_address , cur_id ) ) . unwrap ( ) . amount ; cur_id = self . daily_locked_amounts . get ( & ( provider_address , cur_id ) ) . unwrap ( ) . next_day ; reduced_length += 1 ; if cur_id == linked_list . back { break ; } } ProcessReturningData { withdrawing_amount : sum , current_linked_list_head : cur_id , reduced_length , } }
process : when providers withdraw this function calculates the amount of money
process : when providers withdraw this function calculates the amount of money
&mut self
provider_address
AccountId
day_id
u64
&mut self
provider_address
AccountId
day_id
u64
arguments:
provider_address
day_id : the calculation formula is : (finish date - contract start date) / 86400
provider_address day_id : the calculation formula is : ( finish date - contract start date ) / 86400