Skip to content

Commit

Permalink
fix(proto): cover a few other "identical versions"
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Hindess <[email protected]>
Signed-off-by: Dominic Evans <[email protected]>
  • Loading branch information
dnwe and hindessm committed Aug 2, 2023
1 parent d90c2bd commit 27435db
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion add_offsets_to_txn_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (a *AddOffsetsToTxnRequest) headerVersion() int16 {
}

func (a *AddOffsetsToTxnRequest) isValidVersion() bool {
return a.Version == 0
return a.Version >= 0 && a.Version <= 2
}

func (a *AddOffsetsToTxnRequest) requiredVersion() KafkaVersion {
Expand Down
2 changes: 1 addition & 1 deletion add_partitions_to_txn_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (a *AddPartitionsToTxnRequest) headerVersion() int16 {
}

func (a *AddPartitionsToTxnRequest) isValidVersion() bool {
return a.Version == 0
return a.Version >= 0 && a.Version <= 2
}

func (a *AddPartitionsToTxnRequest) requiredVersion() KafkaVersion {
Expand Down
2 changes: 1 addition & 1 deletion end_txn_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (r *EndTxnRequest) headerVersion() int16 {
}

func (a *EndTxnRequest) isValidVersion() bool {
return a.Version == 0
return a.Version >= 0 && a.Version <= 2
}

func (a *EndTxnRequest) requiredVersion() KafkaVersion {
Expand Down
2 changes: 1 addition & 1 deletion init_producer_id_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (i *InitProducerIDRequest) headerVersion() int16 {
}

func (i *InitProducerIDRequest) isValidVersion() bool {
return i.Version >= 0 && i.Version <= 3
return i.Version >= 0 && i.Version <= 4
}

func (i *InitProducerIDRequest) requiredVersion() KafkaVersion {
Expand Down
2 changes: 1 addition & 1 deletion txn_offset_commit_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (a *TxnOffsetCommitRequest) headerVersion() int16 {
}

func (a *TxnOffsetCommitRequest) isValidVersion() bool {
return a.Version == 0
return a.Version >= 0 && a.Version <= 1
}

func (a *TxnOffsetCommitRequest) requiredVersion() KafkaVersion {
Expand Down

0 comments on commit 27435db

Please sign in to comment.