pub fn subscrypt_provider_register_routine(
        subscrypt: &mut Subscrypt,
        account: Account,
        durations: Vec<u64>,
        active_session_limits: Vec<u128>,
        prices: Vec<u128>,
        max_refund_permille_policies: Vec<u128>,
    ) {
        subscrypt.provider_register(
            durations.clone(),
            active_session_limits.clone(),
            prices.clone(),
            max_refund_permille_policies.clone(),
            account,
        );
        for i in 0..durations.len() {
            assert_eq!(
                subscrypt
                    .providers
                    .get(&account)
                    .unwrap()
                    .plans
                    .get(i)
                    .unwrap()
                    .duration,
                durations[i]
            );
            assert_eq!(
                subscrypt
                    .providers
                    .get(&account)
                    .unwrap()
                    .plans
                    .get(i)
                    .unwrap()
                    .active_session_limit,
                active_session_limits[i]
            );
            assert_eq!(
                subscrypt
                    .providers
                    .get(&account)
                    .unwrap()
                    .plans
                    .get(i)
                    .unwrap()
                    .price,
                prices[i]
            );
            assert_eq!(
                subscrypt
                    .providers
                    .get(&account)
                    .unwrap()
                    .plans
                    .get(i)
                    .unwrap()
                    .max_refund_permille_policy,
                max_refund_permille_policies[i]
            );
        }
        assert_eq!(
            subscrypt.providers.get(&account).unwrap().money_address,
            account
        );
    }
/// This function will do the provider registration routines
This function will do the provider registration routines
This function will do the provider registration routines
pub fn subscrypt_provider_register_routine(
        subscrypt: &mut Subscrypt,
        account: Account,
        durations: Vec<u64>,
        active_session_limits: Vec<u128>,
        prices: Vec<u128>,
        max_refund_permille_policies: Vec<u128>,
    ) {
        subscrypt.provider_register(
            durations.clone(),
            active_session_limits.clone(),
            prices.clone(),
            max_refund_permille_policies.clone(),
            account,
        );
        for i in 0..durations.len() {
            assert_eq!(
                subscrypt
                    .providers
                    .get(&account)
                    .unwrap()
                    .plans
                    .get(i)
                    .unwrap()
                    .duration,
                durations[i]
            );
            assert_eq!(
                subscrypt
                    .providers
                    .get(&account)
                    .unwrap()
                    .plans
                    .get(i)
                    .unwrap()
                    .active_session_limit,
                active_session_limits[i]
            );
            assert_eq!(
                subscrypt
                    .providers
                    .get(&account)
                    .unwrap()
                    .plans
                    .get(i)
                    .unwrap()
                    .price,
                prices[i]
            );
            assert_eq!(
                subscrypt
                    .providers
                    .get(&account)
                    .unwrap()
                    .plans
                    .get(i)
                    .unwrap()
                    .max_refund_permille_policy,
                max_refund_permille_policies[i]
            );
        }
        assert_eq!(
            subscrypt.providers.get(&account).unwrap().money_address,
            account
        );
    }
pub fn subscrypt_provider_register_routine ( subscrypt : & mut Subscrypt , account : Account , durations : Vec < u64 > , active_session_limits : Vec < u128 > , prices : Vec < u128 > , max_refund_permille_policies : Vec < u128 > , ) { subscrypt . provider_register ( durations . clone ( ) , active_session_limits . clone ( ) , prices . clone ( ) , max_refund_permille_policies . clone ( ) , account , ) ; for i in 0 .. durations . len ( ) { assert_eq ! ( subscrypt providers get ( account ) unwrap ( ) plans get ( i ) unwrap ( ) duration durations [ i ] ) ; assert_eq ! ( subscrypt providers get ( account ) unwrap ( ) plans get ( i ) unwrap ( ) active_session_limit active_session_limits [ i ] ) ; assert_eq ! ( subscrypt providers get ( account ) unwrap ( ) plans get ( i ) unwrap ( ) price prices [ i ] ) ; assert_eq ! ( subscrypt providers get ( account ) unwrap ( ) plans get ( i ) unwrap ( ) max_refund_permille_policy max_refund_permille_policies [ i ] ) ; } assert_eq ! ( subscrypt providers get ( account ) unwrap ( ) money_address account ) ; }
This function will do the provider registration routines
This function will do the provider registration routines
subscrypt
&mut Subscrypt
account
Account
durations
Vec<u64>
active_session_limits
Vec<u128>
prices
Vec<u128>
max_refund_permille_policies
Vec<u128>
subscrypt
&mut Subscrypt
account
Account
durations
Vec<u64>
active_session_limits
Vec<u128>
prices
Vec<u128>
max_refund_permille_policies
Vec<u128>