pub fn clone_with(&self, config: CloneConfig) -> Self {
        BeaconState {
            genesis_time: self.genesis_time,
            genesis_validators_root: self.genesis_validators_root,
            slot: self.slot,
            fork: self.fork,
            latest_block_header: self.latest_block_header.clone(),
            block_roots: self.block_roots.clone(),
            state_roots: self.state_roots.clone(),
            historical_roots: self.historical_roots.clone(),
            eth1_data: self.eth1_data.clone(),
            eth1_data_votes: self.eth1_data_votes.clone(),
            eth1_deposit_index: self.eth1_deposit_index,
            validators: self.validators.clone(),
            balances: self.balances.clone(),
            randao_mixes: self.randao_mixes.clone(),
            slashings: self.slashings.clone(),
            previous_epoch_attestations: self.previous_epoch_attestations.clone(),
            current_epoch_attestations: self.current_epoch_attestations.clone(),
            justification_bits: self.justification_bits.clone(),
            previous_justified_checkpoint: self.previous_justified_checkpoint,
            current_justified_checkpoint: self.current_justified_checkpoint,
            finalized_checkpoint: self.finalized_checkpoint,
            committee_caches: if config.committee_caches {
                self.committee_caches.clone()
            } else {
                [
                    CommitteeCache::default(),
                    CommitteeCache::default(),
                    CommitteeCache::default(),
                ]
            },
            pubkey_cache: if config.pubkey_cache {
                self.pubkey_cache.clone()
            } else {
                PubkeyCache::default()
            },
            exit_cache: if config.exit_cache {
                self.exit_cache.clone()
            } else {
                ExitCache::default()
            },
            tree_hash_cache: if config.tree_hash_cache {
                self.tree_hash_cache.clone()
            } else {
                None
            },
        }
    }
/// Clone the state whilst preserving only the selected caches.
Clone the state whilst preserving only the selected caches.
Clone the state whilst preserving only the selected caches .
pub fn clone_with(&self, config: CloneConfig) -> Self {
        BeaconState {
            genesis_time: self.genesis_time,
            genesis_validators_root: self.genesis_validators_root,
            slot: self.slot,
            fork: self.fork,
            latest_block_header: self.latest_block_header.clone(),
            block_roots: self.block_roots.clone(),
            state_roots: self.state_roots.clone(),
            historical_roots: self.historical_roots.clone(),
            eth1_data: self.eth1_data.clone(),
            eth1_data_votes: self.eth1_data_votes.clone(),
            eth1_deposit_index: self.eth1_deposit_index,
            validators: self.validators.clone(),
            balances: self.balances.clone(),
            randao_mixes: self.randao_mixes.clone(),
            slashings: self.slashings.clone(),
            previous_epoch_attestations: self.previous_epoch_attestations.clone(),
            current_epoch_attestations: self.current_epoch_attestations.clone(),
            justification_bits: self.justification_bits.clone(),
            previous_justified_checkpoint: self.previous_justified_checkpoint,
            current_justified_checkpoint: self.current_justified_checkpoint,
            finalized_checkpoint: self.finalized_checkpoint,
            committee_caches: if config.committee_caches {
                self.committee_caches.clone()
            } else {
                [
                    CommitteeCache::default(),
                    CommitteeCache::default(),
                    CommitteeCache::default(),
                ]
            },
            pubkey_cache: if config.pubkey_cache {
                self.pubkey_cache.clone()
            } else {
                PubkeyCache::default()
            },
            exit_cache: if config.exit_cache {
                self.exit_cache.clone()
            } else {
                ExitCache::default()
            },
            tree_hash_cache: if config.tree_hash_cache {
                self.tree_hash_cache.clone()
            } else {
                None
            },
        }
    }
pub fn clone_with ( & self , config : CloneConfig ) -> Self { BeaconState { genesis_time : self . genesis_time , genesis_validators_root : self . genesis_validators_root , slot : self . slot , fork : self . fork , latest_block_header : self . latest_block_header . clone ( ) , block_roots : self . block_roots . clone ( ) , state_roots : self . state_roots . clone ( ) , historical_roots : self . historical_roots . clone ( ) , eth1_data : self . eth1_data . clone ( ) , eth1_data_votes : self . eth1_data_votes . clone ( ) , eth1_deposit_index : self . eth1_deposit_index , validators : self . validators . clone ( ) , balances : self . balances . clone ( ) , randao_mixes : self . randao_mixes . clone ( ) , slashings : self . slashings . clone ( ) , previous_epoch_attestations : self . previous_epoch_attestations . clone ( ) , current_epoch_attestations : self . current_epoch_attestations . clone ( ) , justification_bits : self . justification_bits . clone ( ) , previous_justified_checkpoint : self . previous_justified_checkpoint , current_justified_checkpoint : self . current_justified_checkpoint , finalized_checkpoint : self . finalized_checkpoint , committee_caches : if config . committee_caches { self . committee_caches . clone ( ) } else { [ CommitteeCache :: default ( ) , CommitteeCache :: default ( ) , CommitteeCache :: default ( ) , ] } , pubkey_cache : if config . pubkey_cache { self . pubkey_cache . clone ( ) } else { PubkeyCache :: default ( ) } , exit_cache : if config . exit_cache { self . exit_cache . clone ( ) } else { ExitCache :: default ( ) } , tree_hash_cache : if config . tree_hash_cache { self . tree_hash_cache . clone ( ) } else { None } , } }
Clone the state whilst preserving only the selected caches.
Clone the state whilst preserving only the selected caches .
&self
config
CloneConfig