/// This function will do the edit plan of provider routines
This function will do the edit plan of provider routines
This function will do the edit plan of provider routines
pub fn subscrypt_edit_plan_routine(
        subscrypt: &mut Subscrypt,
        account: Account,
        plan_index: u128,
        duration: u64,
        active: u128,
        price: u128,
        max_refund: u128,
        disabled: bool,
    ) {
        subscrypt.edit_plan(plan_index, duration, active, price, max_refund, disabled);
        assert_eq!(
            subscrypt
                .providers
                .get(&account)
                .unwrap()
                .plans
                .get(1)
                .unwrap()
                .active_session_limit,
            active
        );
        assert_eq!(
            subscrypt
                .providers
                .get(&account)
                .unwrap()
                .plans
                .get(1)
                .unwrap()
                .duration,
            duration
        );
        assert_eq!(
            subscrypt
                .providers
                .get(&account)
                .unwrap()
                .plans
                .get(1)
                .unwrap()
                .price,
            price
        );
        assert_eq!(
            subscrypt
                .providers
                .get(&account)
                .unwrap()
                .plans
                .get(1)
                .unwrap()
                .max_refund_permille_policy,
            max_refund
        );
        assert_eq!(
            subscrypt.providers.get(&account).unwrap().money_address,
            account
        );
    }
pub fn subscrypt_edit_plan_routine ( subscrypt : & mut Subscrypt , account : Account , plan_index : u128 , duration : u64 , active : u128 , price : u128 , max_refund : u128 , disabled : bool , ) { subscrypt . edit_plan ( plan_index , duration , active , price , max_refund , disabled ) ; assert_eq ! ( subscrypt providers get ( account ) unwrap ( ) plans get ( 1 ) unwrap ( ) active_session_limit active ) ; assert_eq ! ( subscrypt providers get ( account ) unwrap ( ) plans get ( 1 ) unwrap ( ) duration duration ) ; assert_eq ! ( subscrypt providers get ( account ) unwrap ( ) plans get ( 1 ) unwrap ( ) price price ) ; assert_eq ! ( subscrypt providers get ( account ) unwrap ( ) plans get ( 1 ) unwrap ( ) max_refund_permille_policy max_refund ) ; assert_eq ! ( subscrypt providers get ( account ) unwrap ( ) money_address account ) ; }
This function will do the edit plan of provider routines
This function will do the edit plan of provider routines
subscrypt
&mut Subscrypt
account
Account
plan_index
u128
duration
u64
active
u128
price
u128
max_refund
u128
disabled
bool