diff --git a/bddtests/common/common_pb2.py b/bddtests/common/common_pb2.py index 4915ad86823..3dd8c53a571 100644 --- a/bddtests/common/common_pb2.py +++ b/bddtests/common/common_pb2.py @@ -21,11 +21,54 @@ name='common/common.proto', package='common', syntax='proto3', - serialized_pb=_b('\n\x13\x63ommon/common.proto\x12\x06\x63ommon\x1a\x1fgoogle/protobuf/timestamp.proto\"d\n\x06Header\x12(\n\x0b\x63hainHeader\x18\x01 \x01(\x0b\x32\x13.common.ChainHeader\x12\x30\n\x0fsignatureHeader\x18\x02 \x01(\x0b\x32\x17.common.SignatureHeader\"l\n\x0b\x43hainHeader\x12\x0c\n\x04type\x18\x01 \x01(\x05\x12\x0f\n\x07version\x18\x02 \x01(\x05\x12-\n\ttimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07\x63hainID\x18\x04 \x01(\x0c\"@\n\x0fSignatureHeader\x12\x0f\n\x07\x63reator\x18\x01 \x01(\x0c\x12\r\n\x05nonce\x18\x02 \x01(\x0c\x12\r\n\x05\x65poch\x18\x03 \x01(\x04\"7\n\x07Payload\x12\x1e\n\x06header\x18\x01 \x01(\x0b\x32\x0e.common.Header\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\".\n\x08\x45nvelope\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"v\n\x05\x42lock\x12#\n\x06Header\x18\x01 \x01(\x0b\x32\x13.common.BlockHeader\x12\x1f\n\x04\x44\x61ta\x18\x02 \x01(\x0b\x32\x11.common.BlockData\x12\'\n\x08Metadata\x18\x03 \x01(\x0b\x32\x15.common.BlockMetadata\"E\n\x0b\x42lockHeader\x12\x0e\n\x06Number\x18\x01 \x01(\x04\x12\x14\n\x0cPreviousHash\x18\x02 \x01(\x0c\x12\x10\n\x08\x44\x61taHash\x18\x03 \x01(\x0c\"\x19\n\tBlockData\x12\x0c\n\x04\x44\x61ta\x18\x01 \x03(\x0c\"!\n\rBlockMetadata\x12\x10\n\x08Metadata\x18\x01 \x03(\x0c*j\n\nHeaderType\x12\x0b\n\x07MESSAGE\x10\x00\x12\x1d\n\x19\x43ONFIGURATION_TRANSACTION\x10\x01\x12\x16\n\x12\x43ONFIGURATION_ITEM\x10\x02\x12\x18\n\x14\x45NDORSER_TRANSACTION\x10\x03\x42-Z+github.com/hyperledger/fabric/protos/commonb\x06proto3') + serialized_pb=_b('\n\x13\x63ommon/common.proto\x12\x06\x63ommon\x1a\x1fgoogle/protobuf/timestamp.proto\"d\n\x06Header\x12(\n\x0b\x63hainHeader\x18\x01 \x01(\x0b\x32\x13.common.ChainHeader\x12\x30\n\x0fsignatureHeader\x18\x02 \x01(\x0b\x32\x17.common.SignatureHeader\"l\n\x0b\x43hainHeader\x12\x0c\n\x04type\x18\x01 \x01(\x05\x12\x0f\n\x07version\x18\x02 \x01(\x05\x12-\n\ttimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07\x63hainID\x18\x04 \x01(\x0c\"@\n\x0fSignatureHeader\x12\x0f\n\x07\x63reator\x18\x01 \x01(\x0c\x12\r\n\x05nonce\x18\x02 \x01(\x0c\x12\r\n\x05\x65poch\x18\x03 \x01(\x04\"7\n\x07Payload\x12\x1e\n\x06header\x18\x01 \x01(\x0b\x32\x0e.common.Header\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\".\n\x08\x45nvelope\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"v\n\x05\x42lock\x12#\n\x06Header\x18\x01 \x01(\x0b\x32\x13.common.BlockHeader\x12\x1f\n\x04\x44\x61ta\x18\x02 \x01(\x0b\x32\x11.common.BlockData\x12\'\n\x08Metadata\x18\x03 \x01(\x0b\x32\x15.common.BlockMetadata\"E\n\x0b\x42lockHeader\x12\x0e\n\x06Number\x18\x01 \x01(\x04\x12\x14\n\x0cPreviousHash\x18\x02 \x01(\x0c\x12\x10\n\x08\x44\x61taHash\x18\x03 \x01(\x0c\"\x19\n\tBlockData\x12\x0c\n\x04\x44\x61ta\x18\x01 \x03(\x0c\"!\n\rBlockMetadata\x12\x10\n\x08Metadata\x18\x01 \x03(\x0c*\x8b\x01\n\x06Status\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0c\n\x07SUCCESS\x10\xc8\x01\x12\x10\n\x0b\x42\x41\x44_REQUEST\x10\x90\x03\x12\x0e\n\tFORBIDDEN\x10\x93\x03\x12\x0e\n\tNOT_FOUND\x10\x94\x03\x12\x1a\n\x15INTERNAL_SERVER_ERROR\x10\xf4\x03\x12\x18\n\x13SERVICE_UNAVAILABLE\x10\xf7\x03*j\n\nHeaderType\x12\x0b\n\x07MESSAGE\x10\x00\x12\x1d\n\x19\x43ONFIGURATION_TRANSACTION\x10\x01\x12\x16\n\x12\x43ONFIGURATION_ITEM\x10\x02\x12\x18\n\x14\x45NDORSER_TRANSACTION\x10\x03\x42-Z+github.com/hyperledger/fabric/protos/commonb\x06proto3') , dependencies=[google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) _sym_db.RegisterFileDescriptor(DESCRIPTOR) +_STATUS = _descriptor.EnumDescriptor( + name='Status', + full_name='common.Status', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SUCCESS', index=1, number=200, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BAD_REQUEST', index=2, number=400, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FORBIDDEN', index=3, number=403, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='NOT_FOUND', index=4, number=404, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='INTERNAL_SERVER_ERROR', index=5, number=500, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SERVICE_UNAVAILABLE', index=6, number=503, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=701, + serialized_end=840, +) +_sym_db.RegisterEnumDescriptor(_STATUS) + +Status = enum_type_wrapper.EnumTypeWrapper(_STATUS) _HEADERTYPE = _descriptor.EnumDescriptor( name='HeaderType', full_name='common.HeaderType', @@ -51,12 +94,19 @@ ], containing_type=None, options=None, - serialized_start=700, - serialized_end=806, + serialized_start=842, + serialized_end=948, ) _sym_db.RegisterEnumDescriptor(_HEADERTYPE) HeaderType = enum_type_wrapper.EnumTypeWrapper(_HEADERTYPE) +UNKNOWN = 0 +SUCCESS = 200 +BAD_REQUEST = 400 +FORBIDDEN = 403 +NOT_FOUND = 404 +INTERNAL_SERVER_ERROR = 500 +SERVICE_UNAVAILABLE = 503 MESSAGE = 0 CONFIGURATION_TRANSACTION = 1 CONFIGURATION_ITEM = 2 @@ -442,6 +492,7 @@ DESCRIPTOR.message_types_by_name['BlockHeader'] = _BLOCKHEADER DESCRIPTOR.message_types_by_name['BlockData'] = _BLOCKDATA DESCRIPTOR.message_types_by_name['BlockMetadata'] = _BLOCKMETADATA +DESCRIPTOR.enum_types_by_name['Status'] = _STATUS DESCRIPTOR.enum_types_by_name['HeaderType'] = _HEADERTYPE Header = _reflection.GeneratedProtocolMessageType('Header', (_message.Message,), dict( diff --git a/bddtests/orderer/ab_pb2.py b/bddtests/orderer/ab_pb2.py index dbc17b5ca6c..03197766433 100644 --- a/bddtests/orderer/ab_pb2.py +++ b/bddtests/orderer/ab_pb2.py @@ -3,7 +3,6 @@ import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -21,61 +20,11 @@ name='orderer/ab.proto', package='orderer', syntax='proto3', - serialized_pb=_b('\n\x10orderer/ab.proto\x12\x07orderer\x1a\x13\x63ommon/common.proto\"4\n\x11\x42roadcastResponse\x12\x1f\n\x06Status\x18\x01 \x01(\x0e\x32\x0f.orderer.Status\"\xa8\x01\n\x08SeekInfo\x12*\n\x05Start\x18\x01 \x01(\x0e\x32\x1b.orderer.SeekInfo.StartType\x12\x17\n\x0fSpecifiedNumber\x18\x02 \x01(\x04\x12\x12\n\nWindowSize\x18\x03 \x01(\x04\x12\x0f\n\x07\x43hainID\x18\x04 \x01(\x0c\"2\n\tStartType\x12\n\n\x06NEWEST\x10\x00\x12\n\n\x06OLDEST\x10\x01\x12\r\n\tSPECIFIED\x10\x02\"!\n\x0f\x41\x63knowledgement\x12\x0e\n\x06Number\x18\x01 \x01(\x04\"o\n\rDeliverUpdate\x12\x33\n\x0f\x41\x63knowledgement\x18\x01 \x01(\x0b\x32\x18.orderer.AcknowledgementH\x00\x12!\n\x04Seek\x18\x02 \x01(\x0b\x32\x11.orderer.SeekInfoH\x00\x42\x06\n\x04Type\"[\n\x0f\x44\x65liverResponse\x12 \n\x05\x45rror\x18\x01 \x01(\x0e\x32\x0f.orderer.StatusH\x00\x12\x1e\n\x05\x42lock\x18\x02 \x01(\x0b\x32\r.common.BlockH\x00\x42\x06\n\x04Type*\x8b\x01\n\x06Status\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0c\n\x07SUCCESS\x10\xc8\x01\x12\x10\n\x0b\x42\x41\x44_REQUEST\x10\x90\x03\x12\x0e\n\tFORBIDDEN\x10\x93\x03\x12\x0e\n\tNOT_FOUND\x10\x94\x03\x12\x1a\n\x15INTERNAL_SERVER_ERROR\x10\xf4\x03\x12\x18\n\x13SERVICE_UNAVAILABLE\x10\xf7\x03\x32\x95\x01\n\x0f\x41tomicBroadcast\x12?\n\tBroadcast\x12\x10.common.Envelope\x1a\x1a.orderer.BroadcastResponse\"\x00(\x01\x30\x01\x12\x41\n\x07\x44\x65liver\x12\x16.orderer.DeliverUpdate\x1a\x18.orderer.DeliverResponse\"\x00(\x01\x30\x01\x42.Z,github.com/hyperledger/fabric/protos/ordererb\x06proto3') + serialized_pb=_b('\n\x10orderer/ab.proto\x12\x07orderer\x1a\x13\x63ommon/common.proto\"3\n\x11\x42roadcastResponse\x12\x1e\n\x06Status\x18\x01 \x01(\x0e\x32\x0e.common.Status\"\xa8\x01\n\x08SeekInfo\x12*\n\x05Start\x18\x01 \x01(\x0e\x32\x1b.orderer.SeekInfo.StartType\x12\x17\n\x0fSpecifiedNumber\x18\x02 \x01(\x04\x12\x12\n\nWindowSize\x18\x03 \x01(\x04\x12\x0f\n\x07\x43hainID\x18\x04 \x01(\x0c\"2\n\tStartType\x12\n\n\x06NEWEST\x10\x00\x12\n\n\x06OLDEST\x10\x01\x12\r\n\tSPECIFIED\x10\x02\"!\n\x0f\x41\x63knowledgement\x12\x0e\n\x06Number\x18\x01 \x01(\x04\"o\n\rDeliverUpdate\x12\x33\n\x0f\x41\x63knowledgement\x18\x01 \x01(\x0b\x32\x18.orderer.AcknowledgementH\x00\x12!\n\x04Seek\x18\x02 \x01(\x0b\x32\x11.orderer.SeekInfoH\x00\x42\x06\n\x04Type\"Z\n\x0f\x44\x65liverResponse\x12\x1f\n\x05\x45rror\x18\x01 \x01(\x0e\x32\x0e.common.StatusH\x00\x12\x1e\n\x05\x42lock\x18\x02 \x01(\x0b\x32\r.common.BlockH\x00\x42\x06\n\x04Type2\x95\x01\n\x0f\x41tomicBroadcast\x12?\n\tBroadcast\x12\x10.common.Envelope\x1a\x1a.orderer.BroadcastResponse\"\x00(\x01\x30\x01\x12\x41\n\x07\x44\x65liver\x12\x16.orderer.DeliverUpdate\x1a\x18.orderer.DeliverResponse\"\x00(\x01\x30\x01\x42.Z,github.com/hyperledger/fabric/protos/ordererb\x06proto3') , dependencies=[common_dot_common__pb2.DESCRIPTOR,]) _sym_db.RegisterFileDescriptor(DESCRIPTOR) -_STATUS = _descriptor.EnumDescriptor( - name='Status', - full_name='orderer.Status', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='UNKNOWN', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SUCCESS', index=1, number=200, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='BAD_REQUEST', index=2, number=400, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='FORBIDDEN', index=3, number=403, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='NOT_FOUND', index=4, number=404, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='INTERNAL_SERVER_ERROR', index=5, number=500, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SERVICE_UNAVAILABLE', index=6, number=503, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=517, - serialized_end=656, -) -_sym_db.RegisterEnumDescriptor(_STATUS) - -Status = enum_type_wrapper.EnumTypeWrapper(_STATUS) -UNKNOWN = 0 -SUCCESS = 200 -BAD_REQUEST = 400 -FORBIDDEN = 403 -NOT_FOUND = 404 -INTERNAL_SERVER_ERROR = 500 -SERVICE_UNAVAILABLE = 503 _SEEKINFO_STARTTYPE = _descriptor.EnumDescriptor( @@ -99,8 +48,8 @@ ], containing_type=None, options=None, - serialized_start=223, - serialized_end=273, + serialized_start=222, + serialized_end=272, ) _sym_db.RegisterEnumDescriptor(_SEEKINFO_STARTTYPE) @@ -132,7 +81,7 @@ oneofs=[ ], serialized_start=50, - serialized_end=102, + serialized_end=101, ) @@ -184,8 +133,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=105, - serialized_end=273, + serialized_start=104, + serialized_end=272, ) @@ -215,8 +164,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=275, - serialized_end=308, + serialized_start=274, + serialized_end=307, ) @@ -256,8 +205,8 @@ name='Type', full_name='orderer.DeliverUpdate.Type', index=0, containing_type=None, fields=[]), ], - serialized_start=310, - serialized_end=421, + serialized_start=309, + serialized_end=420, ) @@ -297,11 +246,11 @@ name='Type', full_name='orderer.DeliverResponse.Type', index=0, containing_type=None, fields=[]), ], - serialized_start=423, - serialized_end=514, + serialized_start=422, + serialized_end=512, ) -_BROADCASTRESPONSE.fields_by_name['Status'].enum_type = _STATUS +_BROADCASTRESPONSE.fields_by_name['Status'].enum_type = common_dot_common__pb2._STATUS _SEEKINFO.fields_by_name['Start'].enum_type = _SEEKINFO_STARTTYPE _SEEKINFO_STARTTYPE.containing_type = _SEEKINFO _DELIVERUPDATE.fields_by_name['Acknowledgement'].message_type = _ACKNOWLEDGEMENT @@ -312,7 +261,7 @@ _DELIVERUPDATE.oneofs_by_name['Type'].fields.append( _DELIVERUPDATE.fields_by_name['Seek']) _DELIVERUPDATE.fields_by_name['Seek'].containing_oneof = _DELIVERUPDATE.oneofs_by_name['Type'] -_DELIVERRESPONSE.fields_by_name['Error'].enum_type = _STATUS +_DELIVERRESPONSE.fields_by_name['Error'].enum_type = common_dot_common__pb2._STATUS _DELIVERRESPONSE.fields_by_name['Block'].message_type = common_dot_common__pb2._BLOCK _DELIVERRESPONSE.oneofs_by_name['Type'].fields.append( _DELIVERRESPONSE.fields_by_name['Error']) @@ -325,7 +274,6 @@ DESCRIPTOR.message_types_by_name['Acknowledgement'] = _ACKNOWLEDGEMENT DESCRIPTOR.message_types_by_name['DeliverUpdate'] = _DELIVERUPDATE DESCRIPTOR.message_types_by_name['DeliverResponse'] = _DELIVERRESPONSE -DESCRIPTOR.enum_types_by_name['Status'] = _STATUS BroadcastResponse = _reflection.GeneratedProtocolMessageType('BroadcastResponse', (_message.Message,), dict( DESCRIPTOR = _BROADCASTRESPONSE, diff --git a/core/committer/noopssinglechain/committer.go b/core/committer/noopssinglechain/committer.go index c5d674f1860..7452199a097 100644 --- a/core/committer/noopssinglechain/committer.go +++ b/core/committer/noopssinglechain/committer.go @@ -27,6 +27,7 @@ import ( "github.com/hyperledger/fabric/core/chaincode" "github.com/hyperledger/fabric/core/committer" "github.com/hyperledger/fabric/core/ledger/kvledger" + cb "github.com/hyperledger/fabric/protos/common" ab "github.com/hyperledger/fabric/protos/orderer" putils "github.com/hyperledger/fabric/protos/utils" "golang.org/x/net/context" @@ -127,7 +128,7 @@ func (r *deliverClient) readUntilClose() { switch t := msg.Type.(type) { case *ab.DeliverResponse_Error: - if t.Error == ab.Status_SUCCESS { + if t.Error == cb.Status_SUCCESS { fmt.Println("ERROR! Received success in error field") return } diff --git a/orderer/kafka/broadcast.go b/orderer/kafka/broadcast.go index 9976656e676..f764ef51812 100644 --- a/orderer/kafka/broadcast.go +++ b/orderer/kafka/broadcast.go @@ -145,7 +145,7 @@ func (b *broadcasterImpl) recvRequests(stream ab.AtomicBroadcast_BroadcastServer } b.batchChan <- msg - reply.Status = ab.Status_SUCCESS // TODO This shouldn't always be a success + reply.Status = cb.Status_SUCCESS // TODO This shouldn't always be a success if err := stream.Send(reply); err != nil { logger.Info("Cannot send broadcast reply to client") diff --git a/orderer/kafka/broadcast_test.go b/orderer/kafka/broadcast_test.go index 4c19a279070..b4a41a9ead8 100644 --- a/orderer/kafka/broadcast_test.go +++ b/orderer/kafka/broadcast_test.go @@ -24,7 +24,6 @@ import ( "github.com/golang/protobuf/proto" cb "github.com/hyperledger/fabric/protos/common" - ab "github.com/hyperledger/fabric/protos/orderer" ) func TestBroadcastInit(t *testing.T) { @@ -81,7 +80,7 @@ func TestBroadcastResponse(t *testing.T) { for { select { case reply := <-mbs.outgoing: - if reply.Status != ab.Status_SUCCESS { + if reply.Status != cb.Status_SUCCESS { t.Fatal("Client should have received a SUCCESS reply") } return diff --git a/orderer/kafka/client_deliver.go b/orderer/kafka/client_deliver.go index 932d111f8b6..6354c21457f 100644 --- a/orderer/kafka/client_deliver.go +++ b/orderer/kafka/client_deliver.go @@ -105,16 +105,16 @@ func (cd *clientDelivererImpl) sendBlocks(stream ab.AtomicBroadcast_DeliverServe err = cd.processACK(t) } if err != nil { - var errorStatus ab.Status + var errorStatus cb.Status // TODO Will need to flesh this out into // a proper error handling system eventually. switch err.Error() { case seekOutOfRangeError: - errorStatus = ab.Status_NOT_FOUND + errorStatus = cb.Status_NOT_FOUND case ackOutOfRangeError, windowOutOfRangeError: - errorStatus = ab.Status_BAD_REQUEST + errorStatus = cb.Status_BAD_REQUEST default: - errorStatus = ab.Status_SERVICE_UNAVAILABLE + errorStatus = cb.Status_SERVICE_UNAVAILABLE } reply = new(ab.DeliverResponse) reply.Type = &ab.DeliverResponse_Error{Error: errorStatus} diff --git a/orderer/main.go b/orderer/main.go index 0a85cb8b350..b9d605b1826 100644 --- a/orderer/main.go +++ b/orderer/main.go @@ -94,7 +94,7 @@ func retrieveConfiguration(rl rawledger.Reader) *cb.ConfigurationEnvelope { select { case <-it.ReadyChan(): block, status := it.Next() - if status != ab.Status_SUCCESS { + if status != cb.Status_SUCCESS { panic(fmt.Errorf("Error parsing blockchain at startup: %v", status)) } // ConfigTxs should always be by themselves diff --git a/orderer/rawledger/blackbox_test.go b/orderer/rawledger/blackbox_test.go index c62bb791e7a..e93be2c8fbc 100644 --- a/orderer/rawledger/blackbox_test.go +++ b/orderer/rawledger/blackbox_test.go @@ -43,7 +43,7 @@ func getBlock(number uint64, li ReadWriter) *cb.Block { select { case <-i.ReadyChan(): block, status := i.Next() - if status != ab.Status_SUCCESS { + if status != cb.Status_SUCCESS { return nil } return block @@ -155,7 +155,7 @@ func testRetrieval(lf ledgerFactory, t *testing.T) { t.Fatalf("Should be ready for block read") } block, status := it.Next() - if status != ab.Status_SUCCESS { + if status != cb.Status_SUCCESS { t.Fatalf("Expected to successfully read the genesis block") } if block.Header.Number != 0 { @@ -168,7 +168,7 @@ func testRetrieval(lf ledgerFactory, t *testing.T) { t.Fatalf("Should still be ready for block read") } block, status = it.Next() - if status != ab.Status_SUCCESS { + if status != cb.Status_SUCCESS { t.Fatalf("Expected to successfully read the second block") } if block.Header.Number != 1 { @@ -199,7 +199,7 @@ func testBlockedRetrieval(lf ledgerFactory, t *testing.T) { t.Fatalf("Should now be ready for block read") } block, status := it.Next() - if status != ab.Status_SUCCESS { + if status != cb.Status_SUCCESS { t.Fatalf("Expected to successfully read the second block") } if block.Header.Number != 1 { diff --git a/orderer/rawledger/fileledger/fileledger.go b/orderer/rawledger/fileledger/fileledger.go index f0db3d8ac1b..c1921606a6d 100644 --- a/orderer/rawledger/fileledger/fileledger.go +++ b/orderer/rawledger/fileledger/fileledger.go @@ -200,16 +200,16 @@ func (fl *fileLedger) Iterator(startType ab.SeekInfo_StartType, specified uint64 } // Next blocks until there is a new block available, or returns an error if the next block is no longer retrievable -func (cu *cursor) Next() (*cb.Block, ab.Status) { +func (cu *cursor) Next() (*cb.Block, cb.Status) { // This only loops once, as signal reading indicates the new block has been written for { block, found := cu.fl.readBlock(cu.blockNumber) if found { if block == nil { - return nil, ab.Status_SERVICE_UNAVAILABLE + return nil, cb.Status_SERVICE_UNAVAILABLE } cu.blockNumber++ - return block, ab.Status_SUCCESS + return block, cb.Status_SUCCESS } <-cu.fl.signal } diff --git a/orderer/rawledger/fileledger/fileledger_test.go b/orderer/rawledger/fileledger/fileledger_test.go index 325a0335af0..29f0f251d2a 100644 --- a/orderer/rawledger/fileledger/fileledger_test.go +++ b/orderer/rawledger/fileledger/fileledger_test.go @@ -122,7 +122,7 @@ func TestRetrieval(t *testing.T) { t.Fatalf("Should be ready for block read") } block, status := it.Next() - if status != ab.Status_SUCCESS { + if status != cb.Status_SUCCESS { t.Fatalf("Expected to successfully read the genesis block") } if block.Header.Number != 0 { @@ -135,7 +135,7 @@ func TestRetrieval(t *testing.T) { t.Fatalf("Should still be ready for block read") } block, status = it.Next() - if status != ab.Status_SUCCESS { + if status != cb.Status_SUCCESS { t.Fatalf("Expected to successfully read the second block") } if block.Header.Number != 1 { @@ -163,7 +163,7 @@ func TestBlockedRetrieval(t *testing.T) { t.Fatalf("Should now be ready for block read") } block, status := it.Next() - if status != ab.Status_SUCCESS { + if status != cb.Status_SUCCESS { t.Fatalf("Expected to successfully read the second block") } if block.Header.Number != 1 { diff --git a/orderer/rawledger/ramledger/ramledger.go b/orderer/rawledger/ramledger/ramledger.go index 97de2d1bd33..fdd888138dc 100644 --- a/orderer/rawledger/ramledger/ramledger.go +++ b/orderer/rawledger/ramledger/ramledger.go @@ -115,12 +115,12 @@ func (rl *ramLedger) Iterator(startType ab.SeekInfo_StartType, specified uint64) } // Next blocks until there is a new block available, or returns an error if the next block is no longer retrievable -func (cu *cursor) Next() (*cb.Block, ab.Status) { +func (cu *cursor) Next() (*cb.Block, cb.Status) { // This only loops once, as signal reading indicates non-nil next for { if cu.list.next != nil { cu.list = cu.list.next - return cu.list.block, ab.Status_SUCCESS + return cu.list.block, cb.Status_SUCCESS } <-cu.list.signal diff --git a/orderer/rawledger/rawledger.go b/orderer/rawledger/rawledger.go index 271677a7719..50ceb8bb689 100644 --- a/orderer/rawledger/rawledger.go +++ b/orderer/rawledger/rawledger.go @@ -24,14 +24,14 @@ import ( // Iterator is useful for a chain Reader to stream blocks as they are created type Iterator interface { // Next blocks until there is a new block available, or returns an error if the next block is no longer retrievable - Next() (*cb.Block, ab.Status) + Next() (*cb.Block, cb.Status) // ReadyChan supplies a channel which will block until Next will not block ReadyChan() <-chan struct{} } // Reader allows the caller to inspect the raw ledger type Reader interface { - // Iterator retrieves an Iterator, as specified by an ab.SeekInfo message, returning an iterator, and it's starting block number + // Iterator retrieves an Iterator, as specified by an cb.SeekInfo message, returning an iterator, and it's starting block number Iterator(startType ab.SeekInfo_StartType, specified uint64) (Iterator, uint64) // Height returns the highest block number in the chain, plus one Height() uint64 diff --git a/orderer/rawledger/util.go b/orderer/rawledger/util.go index 4e1e5bfcaef..16da3993cda 100644 --- a/orderer/rawledger/util.go +++ b/orderer/rawledger/util.go @@ -18,7 +18,6 @@ package rawledger import ( cb "github.com/hyperledger/fabric/protos/common" - ab "github.com/hyperledger/fabric/protos/orderer" ) var closedChan chan struct{} @@ -28,12 +27,12 @@ func init() { close(closedChan) } -// NotFoundErrorIterator simply always returns an error of ab.Status_NOT_FOUND, and is generally useful for implementations of the Reader interface +// NotFoundErrorIterator simply always returns an error of cb.Status_NOT_FOUND, and is generally useful for implementations of the Reader interface type NotFoundErrorIterator struct{} -// Next returns nil, ab.Status_NOT_FOUND -func (nfei *NotFoundErrorIterator) Next() (*cb.Block, ab.Status) { - return nil, ab.Status_NOT_FOUND +// Next returns nil, cb.Status_NOT_FOUND +func (nfei *NotFoundErrorIterator) Next() (*cb.Block, cb.Status) { + return nil, cb.Status_NOT_FOUND } // ReadyChan returns a closed channel diff --git a/orderer/sample_clients/broadcast_timestamp/client.go b/orderer/sample_clients/broadcast_timestamp/client.go index 1160b19cef8..a38ba10d778 100644 --- a/orderer/sample_clients/broadcast_timestamp/client.go +++ b/orderer/sample_clients/broadcast_timestamp/client.go @@ -50,7 +50,7 @@ func (s *broadcastClient) getAck() error { if err != nil { return err } - if msg.Status != ab.Status_SUCCESS { + if msg.Status != cb.Status_SUCCESS { return fmt.Errorf("Got unexpected status: %v", msg.Status) } return nil diff --git a/orderer/sample_clients/deliver_stdout/client.go b/orderer/sample_clients/deliver_stdout/client.go index 3dad131a4cf..74166f40552 100644 --- a/orderer/sample_clients/deliver_stdout/client.go +++ b/orderer/sample_clients/deliver_stdout/client.go @@ -20,6 +20,7 @@ import ( "fmt" "github.com/hyperledger/fabric/orderer/config" + cb "github.com/hyperledger/fabric/protos/common" ab "github.com/hyperledger/fabric/protos/orderer" "golang.org/x/net/context" "google.golang.org/grpc" @@ -79,7 +80,7 @@ func (r *deliverClient) readUntilClose() { switch t := msg.Type.(type) { case *ab.DeliverResponse_Error: - if t.Error == ab.Status_SUCCESS { + if t.Error == cb.Status_SUCCESS { fmt.Println("ERROR! Received success in error field") return } diff --git a/orderer/sbft/backend/backend.go b/orderer/sbft/backend/backend.go index 0c3d37295ef..6811efb49e5 100644 --- a/orderer/sbft/backend/backend.go +++ b/orderer/sbft/backend/backend.go @@ -330,7 +330,7 @@ func (t *Backend) LastBatch() *s.Batch { it, _ := t.ledger.Iterator(ab.SeekInfo_NEWEST, 0) block, status := it.Next() data := block.Data.Data - if status != ab.Status_SUCCESS { + if status != cb.Status_SUCCESS { panic("Fatal ledger error: unable to get last block.") } header := []byte{} diff --git a/orderer/sbft/backend/backendab.go b/orderer/sbft/backend/backendab.go index 0738d2adfc6..1c27384bb8c 100644 --- a/orderer/sbft/backend/backendab.go +++ b/orderer/sbft/backend/backendab.go @@ -19,6 +19,7 @@ package backend import ( "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/orderer/solo" + cb "github.com/hyperledger/fabric/protos/common" ab "github.com/hyperledger/fabric/protos/orderer" ) @@ -44,7 +45,7 @@ func (b *BackendAB) Broadcast(srv ab.AtomicBroadcast_BroadcastServer) error { } if envelope.Payload == nil { - err = srv.Send(&ab.BroadcastResponse{Status: ab.Status_BAD_REQUEST}) + err = srv.Send(&ab.BroadcastResponse{Status: cb.Status_BAD_REQUEST}) if err != nil { return err } @@ -54,7 +55,7 @@ func (b *BackendAB) Broadcast(srv ab.AtomicBroadcast_BroadcastServer) error { panic(err) } b.backend.enqueueRequest(req) - err = srv.Send(&ab.BroadcastResponse{Status: ab.Status_SUCCESS}) + err = srv.Send(&ab.BroadcastResponse{Status: cb.Status_SUCCESS}) if err != nil { return err } diff --git a/orderer/solo/broadcast.go b/orderer/solo/broadcast.go index f83a3f1cbfe..90e4407c036 100644 --- a/orderer/solo/broadcast.go +++ b/orderer/solo/broadcast.go @@ -178,14 +178,14 @@ func (b *broadcaster) queueEnvelopes(srv ab.AtomicBroadcast_BroadcastServer) err case broadcastfilter.Accept: select { case b.queue <- msg: - err = srv.Send(&ab.BroadcastResponse{Status: ab.Status_SUCCESS}) + err = srv.Send(&ab.BroadcastResponse{Status: cb.Status_SUCCESS}) default: - err = srv.Send(&ab.BroadcastResponse{Status: ab.Status_SERVICE_UNAVAILABLE}) + err = srv.Send(&ab.BroadcastResponse{Status: cb.Status_SERVICE_UNAVAILABLE}) } case broadcastfilter.Forward: fallthrough case broadcastfilter.Reject: - err = srv.Send(&ab.BroadcastResponse{Status: ab.Status_BAD_REQUEST}) + err = srv.Send(&ab.BroadcastResponse{Status: cb.Status_BAD_REQUEST}) default: logger.Fatalf("Unknown filter action :%v", action) } diff --git a/orderer/solo/broadcast_test.go b/orderer/solo/broadcast_test.go index 692d07ef659..51fac4a4ebe 100644 --- a/orderer/solo/broadcast_test.go +++ b/orderer/solo/broadcast_test.go @@ -134,14 +134,14 @@ func TestQueueOverflow(t *testing.T) { for i := 0; i < 2; i++ { m.recvChan <- &cb.Envelope{Payload: []byte("Some bytes")} reply := <-m.sendChan - if reply.Status != ab.Status_SUCCESS { + if reply.Status != cb.Status_SUCCESS { t.Fatalf("Should have successfully queued the message") } } m.recvChan <- &cb.Envelope{Payload: []byte("Some bytes")} reply := <-m.sendChan - if reply.Status != ab.Status_SERVICE_UNAVAILABLE { + if reply.Status != cb.Status_SERVICE_UNAVAILABLE { t.Fatalf("Should not have successfully queued the message") } @@ -163,7 +163,7 @@ func TestMultiQueueOverflow(t *testing.T) { for i := 0; i < 2; i++ { m.recvChan <- &cb.Envelope{Payload: []byte("Some bytes")} reply := <-m.sendChan - if reply.Status != ab.Status_SUCCESS { + if reply.Status != cb.Status_SUCCESS { t.Fatalf("Should have successfully queued the message") } } @@ -172,7 +172,7 @@ func TestMultiQueueOverflow(t *testing.T) { for _, m := range ms { m.recvChan <- &cb.Envelope{Payload: []byte("Some bytes")} reply := <-m.sendChan - if reply.Status != ab.Status_SERVICE_UNAVAILABLE { + if reply.Status != cb.Status_SERVICE_UNAVAILABLE { t.Fatalf("Should not have successfully queued the message") } } @@ -187,7 +187,7 @@ func TestEmptyEnvelope(t *testing.T) { m.recvChan <- &cb.Envelope{} reply := <-m.sendChan - if reply.Status != ab.Status_BAD_REQUEST { + if reply.Status != cb.Status_BAD_REQUEST { t.Fatalf("Should have rejected the null message") } diff --git a/orderer/solo/deliver.go b/orderer/solo/deliver.go index faed3a88bd8..a588f8cce96 100644 --- a/orderer/solo/deliver.go +++ b/orderer/solo/deliver.go @@ -92,7 +92,7 @@ func (d *deliverer) main() { } case <-signal: block, status := d.cursor.Next() - if status != ab.Status_SUCCESS { + if status != cb.Status_SUCCESS { logger.Errorf("Error reading from channel, cause was: %v", status) if !d.sendErrorReply(status) { return @@ -139,7 +139,7 @@ func (d *deliverer) recv() error { } } -func (d *deliverer) sendErrorReply(status ab.Status) bool { +func (d *deliverer) sendErrorReply(status cb.Status) bool { err := d.srv.Send(&ab.DeliverResponse{ Type: &ab.DeliverResponse_Error{Error: status}, }) @@ -175,7 +175,7 @@ func (d *deliverer) processUpdate(update *ab.SeekInfo) bool { if update == nil || update.WindowSize == 0 || update.WindowSize > uint64(d.ds.maxWindow) { close(d.exitChan) - return d.sendErrorReply(ab.Status_BAD_REQUEST) + return d.sendErrorReply(cb.Status_BAD_REQUEST) } d.windowSize = update.WindowSize diff --git a/orderer/solo/deliver_test.go b/orderer/solo/deliver_test.go index e7f5dbb2a52..d9d6e1cf94f 100644 --- a/orderer/solo/deliver_test.go +++ b/orderer/solo/deliver_test.go @@ -163,7 +163,7 @@ func TestBadSeek(t *testing.T) { select { case blockReply := <-m.sendChan: - if blockReply.GetError() != ab.Status_NOT_FOUND { + if blockReply.GetError() != cb.Status_NOT_FOUND { t.Fatalf("Received wrong error on the reply channel") } case <-time.After(time.Second): @@ -174,7 +174,7 @@ func TestBadSeek(t *testing.T) { select { case blockReply := <-m.sendChan: - if blockReply.GetError() != ab.Status_NOT_FOUND { + if blockReply.GetError() != cb.Status_NOT_FOUND { t.Fatalf("Received wrong error on the reply channel") } case <-time.After(time.Second): @@ -196,7 +196,7 @@ func TestBadWindow(t *testing.T) { select { case blockReply := <-m.sendChan: - if blockReply.GetError() != ab.Status_BAD_REQUEST { + if blockReply.GetError() != cb.Status_BAD_REQUEST { t.Fatalf("Received wrong error on the reply channel") } case <-time.After(time.Second): diff --git a/protos/common/common.pb.go b/protos/common/common.pb.go index d44ee7c6d7d..dbca55cc221 100644 --- a/protos/common/common.pb.go +++ b/protos/common/common.pb.go @@ -45,6 +45,43 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +// These status codes are intended to resemble selected HTTP status codes +type Status int32 + +const ( + Status_UNKNOWN Status = 0 + Status_SUCCESS Status = 200 + Status_BAD_REQUEST Status = 400 + Status_FORBIDDEN Status = 403 + Status_NOT_FOUND Status = 404 + Status_INTERNAL_SERVER_ERROR Status = 500 + Status_SERVICE_UNAVAILABLE Status = 503 +) + +var Status_name = map[int32]string{ + 0: "UNKNOWN", + 200: "SUCCESS", + 400: "BAD_REQUEST", + 403: "FORBIDDEN", + 404: "NOT_FOUND", + 500: "INTERNAL_SERVER_ERROR", + 503: "SERVICE_UNAVAILABLE", +} +var Status_value = map[string]int32{ + "UNKNOWN": 0, + "SUCCESS": 200, + "BAD_REQUEST": 400, + "FORBIDDEN": 403, + "NOT_FOUND": 404, + "INTERNAL_SERVER_ERROR": 500, + "SERVICE_UNAVAILABLE": 503, +} + +func (x Status) String() string { + return proto.EnumName(Status_name, int32(x)) +} +func (Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + type HeaderType int32 const ( @@ -70,7 +107,7 @@ var HeaderType_value = map[string]int32{ func (x HeaderType) String() string { return proto.EnumName(HeaderType_name, int32(x)) } -func (HeaderType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (HeaderType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } type Header struct { ChainHeader *ChainHeader `protobuf:"bytes,1,opt,name=chainHeader" json:"chainHeader,omitempty"` @@ -242,45 +279,54 @@ func init() { proto.RegisterType((*BlockHeader)(nil), "common.BlockHeader") proto.RegisterType((*BlockData)(nil), "common.BlockData") proto.RegisterType((*BlockMetadata)(nil), "common.BlockMetadata") + proto.RegisterEnum("common.Status", Status_name, Status_value) proto.RegisterEnum("common.HeaderType", HeaderType_name, HeaderType_value) } func init() { proto.RegisterFile("common/common.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 542 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x5c, 0x54, 0x5d, 0x8f, 0xd2, 0x40, - 0x14, 0xb5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0x3c, - 0x8d, 0xef, 0x69, 0xec, 0xe9, 0xc5, 0x72, 0x35, 0xd4, 0x82, 0xaa, 0x70, 0x21, 0xf9, 0x82, 0xe4, - 0x33, 0x8c, 0xaf, 0xa1, 0x96, 0x99, 0x15, 0xe1, 0xca, 0x6d, 0xac, 0x76, 0x41, 0x84, 0x2b, 0xce, - 0xb8, 0x03, 0x4f, 0x73, 0x16, 0xc5, 0xb4, 0x6c, 0x17, 0x25, 0xcc, 0xf0, 0xfb, 0x5f, 0x00, 0xca, - 0xef, 0x42, 0xdc, 0x52, 0x1b, 0x2a, 0x13, 0x67, 0x3e, 0xef, 0xdf, 0x39, 0x8d, 0x27, 0xe8, 0x0d, - 0xbc, 0x1a, 0xce, 0xa6, 0x5f, 0xc7, 0x77, 0xdf, 0x48, 0x7f, 0x31, 0x9e, 0x4d, 0x7f, 0x2e, 0x48, - 0x7f, 0x3a, 0xef, 0x0f, 0xc5, 0xb9, 0x61, 0xa1, 0x2b, 0x40, 0x79, 0x7a, 0xbc, 0x70, 0x26, 0x8d, - 0x33, 0xd4, 0x84, 0x4b, 0x67, 0x3a, 0x9a, 0x91, 0xb9, 0x43, 0x72, 0x1d, 0x85, 0xc1, 0x87, 0x1f, - 0x9d, 0xb5, 0x9f, 0x78, 0xe9, 0x52, 0x24, 0xd9, 0xf3, 0xf6, 0x21, 0x8b, 0x36, 0x6c, 0xb5, 0x66, - 0x51, 0xef, 0x91, 0x2e, 0x23, 0xdf, 0x55, 0x7f, 0xf3, 0x58, 0x7f, 0x0a, 0x96, 0x65, 0x09, 0x3f, - 0xfd, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xa4, 0x57, 0xb1, 0x3c, 0x22, 0x04, 0x00, 0x00, + // 667 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x5c, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0xad, 0xeb, 0xfc, 0x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0x29, 0x44, 0xef, 0xa0, + 0x92, 0x6d, 0x55, 0xd3, 0xe5, 0xa3, 0xeb, 0x0d, 0xb5, 0x77, 0x23, 0xdd, 0xbb, 0xe1, 0xa7, 0x0a, + 0xfa, 0x20, 0x16, 0x33, 0xe5, 0x26, 0x4e, 0xa7, 0x56, 0x38, 0xd0, 0x0e, 0xab, 0x34, 0x85, 0xd6, + 0x0d, 0x6c, 0x3d, 0x72, 0x2d, 0xc5, 0x21, 0x0b, 0x62, 0xae, 0xa2, 0x11, 0x62, 0x05, 0xd1, 0x0e, + 0x14, 0xe7, 0x7c, 0x3e, 0x60, 0xd2, 0x58, 0x95, 0x2a, 0x20, 0xaa, 0x6c, 0xc1, 0x07, 0x63, 0x69, + 0xa9, 0x40, 0x15, 0xb0, 0x30, 0x94, 0xaf, 0x82, 0xfb, 0x29, 0x0f, 0x86, 0xe8, 0x25, 0x94, 0xc6, + 0xab, 0x51, 0x6f, 0xa6, 0x79, 0x25, 0x31, 0x25, 0xac, 0x48, 0x63, 0x18, 0xc4, 0x41, 0x32, 0x5d, + 0x9e, 0xad, 0x16, 0x6c, 0xe0, 0xf9, 0x1d, 0x9b, 0x72, 0x95, 0xcc, 0x42, 0x8d, 0x4c, 0x8d, 0x25, + 0x10, 0x3d, 0x83, 0x4a, 0x16, 0x75, 0xd2, 0xfe, 0x50, 0xb0, 0xbe, 0x69, 0x50, 0x6c, 0x4d, 0xf9, + 0xe0, 0x33, 0x3a, 0x4e, 0xff, 0x03, 0x8f, 0x2f, 0x5d, 0xd2, 0xa9, 0x9d, 0x24, 0x87, 0x17, 0x50, + 0xe8, 0xa4, 0x76, 0x8c, 0x93, 0xff, 0x73, 0x52, 0x41, 0x50, 0x49, 0xa3, 0xd7, 0xb0, 0x71, 0xc9, + 0xe2, 0x40, 0x3a, 0x57, 0x97, 0xb2, 0x9b, 0x93, 0xa6, 0x24, 0xcd, 0x64, 0x16, 0x03, 0x63, 0xe5, + 0x81, 0x68, 0x0f, 0x4a, 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, 0x3c, 0xfb, 0x0c, 0x9b, 0x6b, 0xe8, 0x39, 0x3c, + 0x6d, 0xbb, 0xe4, 0xd4, 0x39, 0xeb, 0x52, 0xdb, 0x77, 0x5c, 0xd2, 0xf3, 0xa9, 0x4d, 0x3c, 0xbb, + 0x2d, 0xce, 0xa6, 0x86, 0xf6, 0x00, 0xe5, 0x69, 0xc7, 0xc7, 0x97, 0xe6, 0x3a, 0xaa, 0xc1, 0x0e, + 0x26, 0x1d, 0x97, 0x7a, 0x98, 0xe6, 0x3a, 0xf4, 0xd6, 0xab, 0x8f, 0xc7, 0xa3, 0x49, 0x3c, 0x5e, + 0xf6, 0xc5, 0xbd, 0x36, 0xc7, 0xf7, 0x0b, 0x16, 0x4e, 0xd9, 0x70, 0xc4, 0xc2, 0xe6, 0x6d, 0xd0, + 0x0f, 0x27, 0x03, 0xf5, 0xd1, 0x89, 0x92, 0x0f, 0x53, 0xbf, 0x24, 0xe1, 0x9b, 0x7f, 0x01, 0x00, + 0x00, 0xff, 0xff, 0x0e, 0x0d, 0x13, 0x2b, 0xb0, 0x04, 0x00, 0x00, } diff --git a/protos/common/common.proto b/protos/common/common.proto index 3c10600f3f3..4b7a881cb9e 100644 --- a/protos/common/common.proto +++ b/protos/common/common.proto @@ -22,6 +22,17 @@ option go_package = "github.com/hyperledger/fabric/protos/common"; package common; +// These status codes are intended to resemble selected HTTP status codes +enum Status { + UNKNOWN = 0; + SUCCESS = 200; + BAD_REQUEST = 400; + FORBIDDEN = 403; + NOT_FOUND = 404; + INTERNAL_SERVER_ERROR = 500; + SERVICE_UNAVAILABLE = 503; +} + enum HeaderType { MESSAGE = 0; // Used for messages which are signed but opaque CONFIGURATION_TRANSACTION = 1; // Used for messages which reconfigure the chain diff --git a/protos/orderer/ab.pb.go b/protos/orderer/ab.pb.go index 82dbf891070..156018acc0a 100644 --- a/protos/orderer/ab.pb.go +++ b/protos/orderer/ab.pb.go @@ -38,43 +38,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package -// These status codes are intended to resemble selected HTTP status codes -type Status int32 - -const ( - Status_UNKNOWN Status = 0 - Status_SUCCESS Status = 200 - Status_BAD_REQUEST Status = 400 - Status_FORBIDDEN Status = 403 - Status_NOT_FOUND Status = 404 - Status_INTERNAL_SERVER_ERROR Status = 500 - Status_SERVICE_UNAVAILABLE Status = 503 -) - -var Status_name = map[int32]string{ - 0: "UNKNOWN", - 200: "SUCCESS", - 400: "BAD_REQUEST", - 403: "FORBIDDEN", - 404: "NOT_FOUND", - 500: "INTERNAL_SERVER_ERROR", - 503: "SERVICE_UNAVAILABLE", -} -var Status_value = map[string]int32{ - "UNKNOWN": 0, - "SUCCESS": 200, - "BAD_REQUEST": 400, - "FORBIDDEN": 403, - "NOT_FOUND": 404, - "INTERNAL_SERVER_ERROR": 500, - "SERVICE_UNAVAILABLE": 503, -} - -func (x Status) String() string { - return proto.EnumName(Status_name, int32(x)) -} -func (Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - // Start may be specified to a specific block number, or may be request from the newest or oldest available // The start location is always inclusive, so the first reply from NEWEST will contain the newest block at the time // of reception, it will must not wait until a new block is created. Similarly, when SPECIFIED, and SpecifiedNumber = 10 @@ -104,7 +67,7 @@ func (x SeekInfo_StartType) String() string { func (SeekInfo_StartType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } type BroadcastResponse struct { - Status Status `protobuf:"varint,1,opt,name=Status,enum=orderer.Status" json:"Status,omitempty"` + Status common.Status `protobuf:"varint,1,opt,name=Status,enum=common.Status" json:"Status,omitempty"` } func (m *BroadcastResponse) Reset() { *m = BroadcastResponse{} } @@ -272,7 +235,7 @@ type isDeliverResponse_Type interface { } type DeliverResponse_Error struct { - Error Status `protobuf:"varint,1,opt,name=Error,enum=orderer.Status,oneof"` + Error common.Status `protobuf:"varint,1,opt,name=Error,enum=common.Status,oneof"` } type DeliverResponse_Block struct { Block *common.Block `protobuf:"bytes,2,opt,name=Block,oneof"` @@ -288,11 +251,11 @@ func (m *DeliverResponse) GetType() isDeliverResponse_Type { return nil } -func (m *DeliverResponse) GetError() Status { +func (m *DeliverResponse) GetError() common.Status { if x, ok := m.GetType().(*DeliverResponse_Error); ok { return x.Error } - return Status_UNKNOWN + return common.Status_UNKNOWN } func (m *DeliverResponse) GetBlock() *common.Block { @@ -337,7 +300,7 @@ func _DeliverResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *prot return true, proto.ErrInternalBadWireType } x, err := b.DecodeVarint() - m.Type = &DeliverResponse_Error{Status(x)} + m.Type = &DeliverResponse_Error{common.Status(x)} return true, err case 2: // Type.Block if wire != proto.WireBytes { @@ -377,7 +340,6 @@ func init() { proto.RegisterType((*Acknowledgement)(nil), "orderer.Acknowledgement") proto.RegisterType((*DeliverUpdate)(nil), "orderer.DeliverUpdate") proto.RegisterType((*DeliverResponse)(nil), "orderer.DeliverResponse") - proto.RegisterEnum("orderer.Status", Status_name, Status_value) proto.RegisterEnum("orderer.SeekInfo_StartType", SeekInfo_StartType_name, SeekInfo_StartType_value) } @@ -561,42 +523,34 @@ var _AtomicBroadcast_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("orderer/ab.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 581 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x53, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xcd, 0x36, 0x69, 0x42, 0x26, 0x6d, 0xe3, 0x6e, 0x45, 0x65, 0x05, 0x09, 0x55, 0x96, 0x50, - 0x03, 0x42, 0x36, 0x84, 0x2b, 0x12, 0xb2, 0xe3, 0xad, 0x6a, 0x11, 0xd9, 0xb0, 0x8e, 0x5b, 0x89, - 0x4b, 0xe4, 0xd8, 0xdb, 0xd6, 0x6a, 0xe2, 0xb5, 0x36, 0x6e, 0xab, 0xf2, 0x01,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, 0xae, 0xf2, 0x5d, 0xc6, 0xae, 0x37, - 0x1c, 0x1d, 0x79, 0x81, 0x6b, 0x2b, 0x3f, 0xaa, 0xb8, 0x03, 0x8f, 0x1d, 0x77, 0x48, 0xa8, 0x6b, - 0x0e, 0x46, 0x3e, 0xa1, 0x27, 0x84, 0x8e, 0x08, 0xa5, 0x1e, 0x55, 0xfe, 0x54, 0xb1, 0x0a, 0x7b, - 0x05, 0xe4, 0xf4, 0xc9, 0x28, 0x70, 0xcd, 0x13, 0xd3, 0x19, 0x98, 0xd6, 0x80, 0x28, 0x7f, 0xab, - 0xbd, 0x9f, 0x08, 0xda, 0x66, 0xce, 0xa7, 0x49, 0xb4, 0xdc, 0x64, 0xfc, 0x0e, 0x9a, 0x77, 0x81, - 0xb2, 0x78, 0x0e, 0x49, 0xaf, 0xd9, 0x84, 0x67, 0xac, 0xd3, 0x59, 0x3a, 0xb1, 0xb6, 0xfc, 0x5a, - 0xa5, 0x8b, 0x5e, 0x21, 0x6c, 0x42, 0xa3, 0x74, 0x13, 0xef, 0x2f, 0xc9, 0x0f, 0xe6, 0xdc, 0x51, - 0x57, 0xf1, 0x87, 0x2d, 0x2c, 0xfd, 0xd3, 0xcb, 0xf3, 0x24, 0xbf, 0xb8, 0x1a, 0x17, 0xf2, 0xc6, - 0xc5, 0x6d, 0xc6, 0x84, 0x1c, 0xaf, 0x30, 0xce, 0xc2, 0xb1, 0x48, 0x22, 0x43, 0xfe, 0x81, 0x33, - 0xa3, 0xec, 0x32, 0xae, 0xcb, 0xf8, 0xcd, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x53, 0xa4, 0x53, - 0x62, 0xc3, 0x03, 0x00, 0x00, + // 463 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x52, 0xdd, 0x6e, 0xd3, 0x4c, + 0x10, 0xf5, 0xf6, 0x4b, 0x9c, 0x2f, 0x53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0xcb, 0x4a, 0x9c, 0x4e, 0xbb, 0xfd, 0x0f, 0x8e, 0xcd, 0xd4, 0x2c, 0xf2, 0x96, + 0xd0, 0x39, 0x0c, 0xd4, 0xfa, 0xf4, 0xac, 0x23, 0x3f, 0x32, 0x76, 0x6a, 0xec, 0xe3, 0x8f, 0x47, + 0x2c, 0xec, 0xef, 0x6f, 0xae, 0x33, 0xb1, 0xd9, 0xc5, 0xb5, 0xbc, 0xb3, 0xb9, 0x2f, 0x91, 0x4b, + 0x3f, 0xb9, 0xb3, 0x8e, 0x62, 0x9e, 0x25, 0x8e, 0xbc, 0xf8, 0xca, 0x51, 0x53, 0x62, 0x5d, 0xe6, + 0xef, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x22, 0xc6, 0xf5, 0x3a, 0x33, 0x03, 0x00, 0x00, } diff --git a/protos/orderer/ab.proto b/protos/orderer/ab.proto index e607e48fc6d..959e9be7cb6 100644 --- a/protos/orderer/ab.proto +++ b/protos/orderer/ab.proto @@ -22,19 +22,8 @@ option go_package = "github.com/hyperledger/fabric/protos/orderer"; package orderer; -// These status codes are intended to resemble selected HTTP status codes -enum Status { - UNKNOWN = 0; - SUCCESS = 200; - BAD_REQUEST = 400; - FORBIDDEN = 403; - NOT_FOUND = 404; - INTERNAL_SERVER_ERROR = 500; - SERVICE_UNAVAILABLE = 503; -} - message BroadcastResponse { - Status Status = 1; + common.Status Status = 1; } message SeekInfo { @@ -67,7 +56,7 @@ message DeliverUpdate { message DeliverResponse { oneof Type { - Status Error = 1; + common.Status Error = 1; common.Block Block = 2; } }