Skip to content

Commit

Permalink
improvement(header|p2p)!: remove limit status code (#1530)
Browse files Browse the repository at this point in the history
## Overview
Resolves #1529

## Checklist

- [x] New and updated code has appropriate documentation
- [x] New and updated code has new and/or updated testing
- [x] Required CI checks are passing
- [x] Visual proof for any user facing features like CLI or
documentation updates
- [x] Linked issues closed with keywords
  • Loading branch information
vgonkivs committed Dec 22, 2022
1 parent 0d8cb93 commit 7c05ade
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 34 deletions.
2 changes: 0 additions & 2 deletions header/p2p/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ func convertStatusCodeToError(code p2p_pb.StatusCode) error {
return nil
case p2p_pb.StatusCode_NOT_FOUND:
return header.ErrNotFound
case p2p_pb.StatusCode_LIMIT_EXCEEDED:
return header.ErrHeadersLimitExceeded
default:
return fmt.Errorf("unknown status code %d", code)
}
Expand Down
54 changes: 25 additions & 29 deletions header/p2p/pb/extended_header_request.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion header/p2p/pb/extended_header_request.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ enum StatusCode {
INVALID = 0;
OK = 1;
NOT_FOUND = 2;
LIMIT_EXCEEDED = 3;
};

message ExtendedHeaderResponse {
Expand Down
2 changes: 0 additions & 2 deletions header/p2p/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ func (serv *ExchangeServer) requestHandler(stream network.Stream) {
code = p2p_pb.StatusCode_OK
case header.ErrNotFound:
code = p2p_pb.StatusCode_NOT_FOUND
case header.ErrHeadersLimitExceeded:
code = p2p_pb.StatusCode_LIMIT_EXCEEDED
default:
stream.Reset() //nolint:errcheck
return
Expand Down

0 comments on commit 7c05ade

Please sign in to comment.