// This test confirms that if `set_gossip_config_to_default` = false and the
// existing subnet record does not have a gossip config and some gossip related
// fields are set to override, `merge_subnet_record` panics as expected.
This test confirms that if `set_gossip_config_to_default` = false and the
existing subnet record does not have a gossip config and some gossip related
fields are set to override, `merge_subnet_record` panics as expected.
This test confirms that if ` set_gossip_config_to_default ` = false and the existing subnet record does not have a gossip config and some gossip related fields are set to override ` merge_subnet_record ` panics as expected .
fn can_handle_invalid_combination_of_set_gossip_config_to_default() {
        let subnet_record = SubnetRecord {
            membership: vec![],
            max_ingress_bytes_per_message: 60 * 1024 * 1024,
            max_block_payload_size: 4 * 1024 * 1024,
            max_ingress_messages_per_block: 1000,
            unit_delay_millis: 500,
            initial_notary_delay_millis: 1500,
            replica_version_id: "version_42".to_string(),
            dkg_interval_length: 0,
            dkg_dealings_per_block: 1,
            gossip_config: None,
            start_as_nns: false,
            subnet_type: SubnetType::Application.into(),
            is_halted: false,
            max_instructions_per_message: 5_000_000_000,
            max_instructions_per_round: 7_000_000_000,
            max_instructions_per_install_code: 200_000_000_000,
            features: None,
            max_number_of_canisters: 0,
            ssh_readonly_access: vec![],
            ssh_backup_access: vec![],
            ecdsa_config: None,
        };
        let payload = UpdateSubnetPayload {
            subnet_id: SubnetId::from(
                PrincipalId::from_str(
                    "bn3el-jdvcs-a3syn-gyqwo-umlu3-avgud-vq6yl-hunln-3jejb-226vq-mae",
                )
                .unwrap(),
            ),
            max_ingress_bytes_per_message: None,
            max_block_payload_size: None,
            unit_delay_millis: Some(100),
            initial_notary_delay_millis: None,
            dkg_interval_length: Some(2),
            dkg_dealings_per_block: Some(1),
            max_artifact_streams_per_peer: Some(0),
            max_chunk_wait_ms: Some(10),
            max_duplicity: None,
            max_chunk_size: None,
            receive_check_cache_size: Some(200),
            pfn_evaluation_period_ms: None,
            registry_poll_period_ms: None,
            retransmission_request_ms: None,
            advert_best_effort_percentage: None,
            set_gossip_config_to_default: false,
            start_as_nns: None,
            subnet_type: Some(SubnetType::Application),
            is_halted: None,
            max_instructions_per_message: None,
            max_instructions_per_round: None,
            max_instructions_per_install_code: None,
            features: None,
            ecdsa_config: None,
            max_number_of_canisters: None,
            ssh_readonly_access: None,
            ssh_backup_access: None,
        };
        merge_subnet_record(subnet_record, payload);
    }
fn can_handle_invalid_combination_of_set_gossip_config_to_default ( ) { let subnet_record = SubnetRecord { membership : vec ! [ ] , max_ingress_bytes_per_message : 60 * 1024 * 1024 , max_block_payload_size : 4 * 1024 * 1024 , max_ingress_messages_per_block : 1000 , unit_delay_millis : 500 , initial_notary_delay_millis : 1500 , replica_version_id : " " . to_string ( ) , dkg_interval_length : 0 , dkg_dealings_per_block : 1 , gossip_config : None , start_as_nns : false , subnet_type : SubnetType :: Application . into ( ) , is_halted : false , max_instructions_per_message : 5_000_000_000 , max_instructions_per_round : 7_000_000_000 , max_instructions_per_install_code : 200_000_000_000 , features : None , max_number_of_canisters : 0 , ssh_readonly_access : vec ! [ ] , ssh_backup_access : vec ! [ ] , ecdsa_config : None , } ; let payload = UpdateSubnetPayload { subnet_id : SubnetId :: from ( PrincipalId :: from_str ( " " , ) . unwrap ( ) , ) , max_ingress_bytes_per_message : None , max_block_payload_size : None , unit_delay_millis : Some ( 100 ) , initial_notary_delay_millis : None , dkg_interval_length : Some ( 2 ) , dkg_dealings_per_block : Some ( 1 ) , max_artifact_streams_per_peer : Some ( 0 ) , max_chunk_wait_ms : Some ( 10 ) , max_duplicity : None , max_chunk_size : None , receive_check_cache_size : Some ( 200 ) , pfn_evaluation_period_ms : None , registry_poll_period_ms : None , retransmission_request_ms : None , advert_best_effort_percentage : None , set_gossip_config_to_default : false , start_as_nns : None , subnet_type : Some ( SubnetType :: Application ) , is_halted : None , max_instructions_per_message : None , max_instructions_per_round : None , max_instructions_per_install_code : None , features : None , ecdsa_config : None , max_number_of_canisters : None , ssh_readonly_access : None , ssh_backup_access : None , } ; merge_subnet_record ( subnet_record , payload ) ; }
This test confirms that if `set_gossip_config_to_default` = false and the
existing subnet record does not have a gossip config and some gossip related
fields are set to override, `merge_subnet_record` panics as expected.
This test confirms that if ` set_gossip_config_to_default ` = false and the existing subnet record does not have a gossip config and some gossip related fields are set to override ` merge_subnet_record ` panics as expected .