/// This function will do the add plan of provider routines
This function will do the add plan of provider routines
This function will do the add plan of provider routines
pub fn subscrypt_add_plan_routine(
        subscrypt: &mut Subscrypt,
        account: Account,
        durations: Vec<u64>,
        active_session_limits: Vec<u128>,
        prices: Vec<u128>,
        max_refund_permille_policies: Vec<u128>,
    ) {
        subscrypt.add_plan(
            durations.clone(),
            active_session_limits.clone(),
            prices.clone(),
            max_refund_permille_policies.clone(),
        );
        assert_eq!(
            subscrypt
                .providers
                .get(&account)
                .unwrap()
                .plans
                .get(2)
                .unwrap()
                .active_session_limit,
            active_session_limits[0]
        );
        assert_eq!(
            subscrypt
                .providers
                .get(&account)
                .unwrap()
                .plans
                .get(2)
                .unwrap()
                .duration,
            durations[0]
        );
        assert_eq!(
            subscrypt
                .providers
                .get(&account)
                .unwrap()
                .plans
                .get(2)
                .unwrap()
                .price,
            prices[0]
        );
        assert_eq!(
            subscrypt
                .providers
                .get(&account)
                .unwrap()
                .plans
                .get(2)
                .unwrap()
                .max_refund_permille_policy,
            max_refund_permille_policies[0]
        );
        assert_eq!(
            subscrypt.providers.get(&account).unwrap().money_address,
            account
        );
    }
pub fn subscrypt_add_plan_routine ( subscrypt : & mut Subscrypt , account : Account , durations : Vec < u64 > , active_session_limits : Vec < u128 > , prices : Vec < u128 > , max_refund_permille_policies : Vec < u128 > , ) { subscrypt . add_plan ( durations . clone ( ) , active_session_limits . clone ( ) , prices . clone ( ) , max_refund_permille_policies . clone ( ) , ) ; assert_eq ! ( subscrypt providers get ( account ) unwrap ( ) plans get ( 2 ) unwrap ( ) active_session_limit active_session_limits [ 0 ] ) ; assert_eq ! ( subscrypt providers get ( account ) unwrap ( ) plans get ( 2 ) unwrap ( ) duration durations [ 0 ] ) ; assert_eq ! ( subscrypt providers get ( account ) unwrap ( ) plans get ( 2 ) unwrap ( ) price prices [ 0 ] ) ; assert_eq ! ( subscrypt providers get ( account ) unwrap ( ) plans get ( 2 ) unwrap ( ) max_refund_permille_policy max_refund_permille_policies [ 0 ] ) ; assert_eq ! ( subscrypt providers get ( account ) unwrap ( ) money_address account ) ; }
This function will do the add plan of provider routines
This function will do the add plan of provider routines
subscrypt
&mut Subscrypt
account
Account
durations
Vec<u64>
active_session_limits
Vec<u128>
prices
Vec<u128>
max_refund_permille_policies
Vec<u128>