static EnvelopeDeserializer newInstance(ByteString byteString, byte b) throws InvalidProtocolBufferException { EnvelopeDeserializer ret; final int type = ChannelHeader.parseFrom(Payload.parseFrom(Envelope.parseFrom(byteString).getPayload()) .getHeader().getChannelHeader()).getType(); /* MESSAGE = 0; // Used for messages which are signed but opaque CONFIG = 1; // Used for messages which express the channel config CONFIG_UPDATE = 2; // Used for transactions which update the channel config ENDORSER_TRANSACTION = 3; // Used by the SDK to submit endorser based transactions ORDERER_TRANSACTION = 4; // Used internally by the orderer for management DELIVER_SEEK_INFO = 5; // Used as the type for Envelope messages submitted to instruct the Deliver API to seek CHAINCODE_PACKAGE = 6; // Used for packaging chaincode artifacts for install */ switch (type) { case 3: ret = new EndorserTransactionEnvDeserializer(byteString, b); break; default: //just assume base properties. ret = new EnvelopeDeserializer(byteString, b); break; } return ret; }
static EnvelopeDeserializer newInstance(ByteString byteString, byte b) throws InvalidProtocolBufferException { EnvelopeDeserializer ret; final int type = ChannelHeader.parseFrom(Payload.parseFrom(Envelope.parseFrom(byteString).getPayload()) .getHeader().getChannelHeader()).getType(); /* MESSAGE = 0; // Used for messages which are signed but opaque CONFIG = 1; // Used for messages which express the channel config CONFIG_UPDATE = 2; // Used for transactions which update the channel config ENDORSER_TRANSACTION = 3; // Used by the SDK to submit endorser based transactions ORDERER_TRANSACTION = 4; // Used internally by the orderer for management DELIVER_SEEK_INFO = 5; // Used as the type for Envelope messages submitted to instruct the Deliver API to seek CHAINCODE_PACKAGE = 6; // Used for packaging chaincode artifacts for install */ switch (type) { case 3: ret = new EndorserTransactionEnvDeserializer(byteString, b); break; default: //just assume base properties. ret = new EnvelopeDeserializer(byteString, b); break; } return ret; }
static EnvelopeDeserializer newInstance(ByteString byteString, byte b) throws InvalidProtocolBufferException { EnvelopeDeserializer ret; final int type = ChannelHeader.parseFrom(Payload.parseFrom(Envelope.parseFrom(byteString).getPayload()) .getHeader().getChannelHeader()).getType(); /* MESSAGE = 0; // Used for messages which are signed but opaque CONFIG = 1; // Used for messages which express the channel config CONFIG_UPDATE = 2; // Used for transactions which update the channel config ENDORSER_TRANSACTION = 3; // Used by the SDK to submit endorser based transactions ORDERER_TRANSACTION = 4; // Used internally by the orderer for management DELIVER_SEEK_INFO = 5; // Used as the type for Envelope messages submitted to instruct the Deliver API to seek CHAINCODE_PACKAGE = 6; // Used for packaging chaincode artifacts for install */ switch (type) { case 3: ret = new EndorserTransactionEnvDeserializer(byteString, b); break; default: //just assume base properties. ret = new EnvelopeDeserializer(byteString, b); break; } return ret; }