fn internal_add_farm(&mut self, terms: &HRSimpleFarmTerms, min_deposit: Balance) -> FarmId {
        
        // let mut farm_seed = self.get_seed_default(&terms.seed_id, min_deposit);
        let mut farm_seed: VersionedFarmSeed;
        if let Some(fs) = self.get_seed_wrapped(&terms.seed_id) {
            farm_seed = fs;
            env::log(
                format!(
                    "New farm created In seed {}, with existed min_deposit {}",
                    terms.seed_id, farm_seed.get_ref().min_deposit
                )
                .as_bytes(),
            );
        } else {
            farm_seed = VersionedFarmSeed::new(&terms.seed_id, min_deposit);
            env::log(
                format!(
                    "The first farm created In seed {}, with min_deposit {}",
                    terms.seed_id, farm_seed.get_ref().min_deposit
                )
                .as_bytes(),
            );
        }

        let farm_id: FarmId = gen_farm_id(&terms.seed_id, farm_seed.get_ref().next_index as usize);

        let farm = Farm::SimpleFarm(SimpleFarm::new(
            farm_id.clone(),
            terms.into(),
        ));
        
        farm_seed.get_ref_mut().farms.insert(farm_id.clone());
        farm_seed.get_ref_mut().next_index += 1;
        self.data_mut().seeds.insert(&terms.seed_id, &farm_seed);
        self.data_mut().farms.insert(&farm_id.clone(), &farm);
        farm_id
    }
/// Adds given farm to the vec and returns it's id.
/// If there is not enough attached balance to cover storage, fails.
/// If too much attached - refunds it back.
Adds given farm to the vec and returns it's id.
If there is not enough attached balance to cover storage, fails.
If too much attached - refunds it back.
Adds given farm to the vec and returns it ' s id . If there is not enough attached balance to cover storage fails . If too much attached - refunds it back .
fn internal_add_farm(&mut self, terms: &HRSimpleFarmTerms, min_deposit: Balance) -> FarmId {
        // let mut farm_seed = self.get_seed_default(&terms.seed_id, min_deposit);
        let mut farm_seed: VersionedFarmSeed;
        if let Some(fs) = self.get_seed_wrapped(&terms.seed_id) {
            farm_seed = fs;
            env::log(
                format!(
                    "New farm created In seed {}, with existed min_deposit {}",
                    terms.seed_id, farm_seed.get_ref().min_deposit
                )
                .as_bytes(),
            );
        } else {
            farm_seed = VersionedFarmSeed::new(&terms.seed_id, min_deposit);
            env::log(
                format!(
                    "The first farm created In seed {}, with min_deposit {}",
                    terms.seed_id, farm_seed.get_ref().min_deposit
                )
                .as_bytes(),
            );
        }
        let farm_id: FarmId = gen_farm_id(&terms.seed_id, farm_seed.get_ref().next_index as usize);
        let farm = Farm::SimpleFarm(SimpleFarm::new(
            farm_id.clone(),
            terms.into(),
        ));
        farm_seed.get_ref_mut().farms.insert(farm_id.clone());
        farm_seed.get_ref_mut().next_index += 1;
        self.data_mut().seeds.insert(&terms.seed_id, &farm_seed);
        self.data_mut().farms.insert(&farm_id.clone(), &farm);
        farm_id
    }
fn internal_add_farm ( & mut self , terms : & HRSimpleFarmTerms , min_deposit : Balance ) -> FarmId { // let mut farm_seed = self.get_seed_default(&terms.seed_id, min_deposit); let mut farm_seed : VersionedFarmSeed ; if let Some ( fs ) = self . get_seed_wrapped ( & terms . seed_id ) { farm_seed = fs ; env :: log ( format ! ( " " terms seed_id farm_seed get_ref ( ) min_deposit ) . as_bytes ( ) , ) ; } else { farm_seed = VersionedFarmSeed :: new ( & terms . seed_id , min_deposit ) ; env :: log ( format ! ( " " terms seed_id farm_seed get_ref ( ) min_deposit ) . as_bytes ( ) , ) ; } let farm_id : FarmId = gen_farm_id ( & terms . seed_id , farm_seed . get_ref ( ) . next_index as usize ) ; let farm = Farm :: SimpleFarm ( SimpleFarm :: new ( farm_id . clone ( ) , terms . into ( ) , ) ) ; farm_seed . get_ref_mut ( ) . farms . insert ( farm_id . clone ( ) ) ; farm_seed . get_ref_mut ( ) . next_index += 1 ; self . data_mut ( ) . seeds . insert ( & terms . seed_id , & farm_seed ) ; self . data_mut ( ) . farms . insert ( & farm_id . clone ( ) , & farm ) ; farm_id }
Adds given farm to the vec and returns it's id.
Adds given farm to the vec and returns it ' s id .
&mut self
terms
&HRSimpleFarmTerms
min_deposit
Balance
&mut self
terms
&HRSimpleFarmTerms
min_deposit
Balance