func (params ConsensusParams) Update(params2 *abci.ConsensusParams) ConsensusParams {
	res := params // explicit copy

	if params2 == nil {
		return res
	}

	// we must defensively consider any structs may be nil
	if params2.Block != nil {
		res.Block.MaxBytes = params2.Block.MaxBytes
		res.Block.MaxGas = params2.Block.MaxGas
	}
	if params2.Evidence != nil {
		res.Evidence.MaxAge = params2.Evidence.MaxAge
	}
	if params2.Validator != nil {
		// Copy params2.Validator.PubkeyTypes, and set result's value to the copy.
		// This avoids having to initialize the slice to 0 values, and then write to it again.
		res.Validator.PubKeyTypes = append([]string{}, params2.Validator.PubKeyTypes...)
	}
	return res
}
// Update returns a copy of the params with updates from the non-zero fields of p2.
// NOTE: note: must not modify the original
Update returns a copy of the params with updates from the non-zero fields of p2.
NOTE: note: must not modify the original
// Update returns a copy of the params with updates from the non - zero fields of p2 . // NOTE : note : must not modify the original
func (params ConsensusParams) Update(params2 *abci.ConsensusParams) ConsensusParams {
	res := params 
	if params2 == nil {
		return res
	}
	if params2.Block != nil {
		res.Block.MaxBytes = params2.Block.MaxBytes
		res.Block.MaxGas = params2.Block.MaxGas
	}
	if params2.Evidence != nil {
		res.Evidence.MaxAge = params2.Evidence.MaxAge
	}
	if params2.Validator != nil {
		res.Validator.PubKeyTypes = append([]string{}, params2.Validator.PubKeyTypes...)
	}
	return res
}
func ( params ConsensusParams ) Update ( params2 * abci . ConsensusParams ) ConsensusParams { res := params if params2 == nil { return res } if params2 . Block != nil { res . Block . MaxBytes = params2 . Block . MaxBytes res . Block . MaxGas = params2 . Block . MaxGas } if params2 . Evidence != nil { res . Evidence . MaxAge = params2 . Evidence . MaxAge } if params2 . Validator != nil { res . Validator . PubKeyTypes = append ( [ ] string { } , params2 . Validator . PubKeyTypes ... ) } return res }
Update returns a copy of the params with updates from the non-zero fields of p2.
Update returns a copy of the params with updates from the non - zero fields of p2 .
// explicit copy // we must defensively consider any structs may be nil // Copy params2.Validator.PubkeyTypes, and set result's value to the copy. // This avoids having to initialize the slice to 0 values, and then write to it again.