byte[] getSignature() { return getEnvelope().getSignature().toByteArray(); }
EnvelopeInfo(EnvelopeDeserializer envelopeDeserializer) { this.envelopeDeserializer = envelopeDeserializer; headerDeserializer = envelopeDeserializer.getPayload().getHeader(); filteredTx = null; }
/** * @return whether this Transaction is marked as TxValidationCode.VALID */ public boolean isValid() { return BlockInfo.this.isFiltered() ? filteredTx.getTxValidationCode().getNumber() == FabricTransaction.TxValidationCode.VALID_VALUE : envelopeDeserializer.isValid(); }
EnvelopeDeserializer ed = EnvelopeDeserializer.newInstance(block.getBlock().getData().getData(envelopeIndex), block.getTransActionsMetaData()[envelopeIndex]); switch (ed.getType()) { case Common.HeaderType.ENDORSER_TRANSACTION_VALUE: ret = new TransactionEnvelopeInfo((EndorserTransactionEnvDeserializer) ed);
/** * @return the validation code of this Transaction (enumeration TxValidationCode in Transaction.proto) */ public byte getValidationCode() { if (BlockInfo.this.isFiltered()) { return (byte) filteredTx.getTxValidationCode().getNumber(); } return envelopeDeserializer.validationCode(); }
EnvelopeDeserializer getData(int index) throws InvalidProtocolBufferException { if (index >= getData().getDataCount()) { return null; } WeakReference<EnvelopeDeserializer> envelopeWeakReference = envelopes.get(index); if (null != envelopeWeakReference) { EnvelopeDeserializer ret = envelopeWeakReference.get(); if (null != ret) { return ret; } } EnvelopeDeserializer envelopeDeserializer = EnvelopeDeserializer.newInstance(getData().getData(index), getTransActionsMetaData()[index]); envelopes.put(index, new WeakReference<>(envelopeDeserializer)); return envelopeDeserializer; }
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; }
EnvelopeDeserializer ed = EnvelopeDeserializer.newInstance(block.getBlock().getData().getData(envelopeIndex), block.getTransActionsMetaData()[envelopeIndex]); switch (ed.getType()) { case Common.HeaderType.ENDORSER_TRANSACTION_VALUE: ret = new TransactionEnvelopeInfo((EndorserTransactionEnvDeserializer) ed);
/** * @return the validation code of this Transaction (enumeration TxValidationCode in Transaction.proto) */ public byte getValidationCode() { if (BlockInfo.this.isFiltered()) { return (byte) filteredTx.getTxValidationCode().getNumber(); } return envelopeDeserializer.validationCode(); }
EnvelopeDeserializer getData(int index) throws InvalidProtocolBufferException { if (index >= getData().getDataCount()) { return null; } WeakReference<EnvelopeDeserializer> envelopeWeakReference = envelopes.get(index); if (null != envelopeWeakReference) { EnvelopeDeserializer ret = envelopeWeakReference.get(); if (null != ret) { return ret; } } EnvelopeDeserializer envelopeDeserializer = EnvelopeDeserializer.newInstance(getData().getData(index), getTransActionsMetaData()[index]); envelopes.put(index, new WeakReference<>(envelopeDeserializer)); return envelopeDeserializer; }
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; }
EnvelopeDeserializer ed = EnvelopeDeserializer.newInstance(block.getBlock().getData().getData(envelopeIndex), block.getTransActionsMetaData()[envelopeIndex]); switch (ed.getType()) { case Common.HeaderType.ENDORSER_TRANSACTION_VALUE: ret = new TransactionEnvelopeInfo((EndorserTransactionEnvDeserializer) ed);
int getType() { if (type == null) { type = getPayload().getHeader().getChannelHeader().getType(); } return type; }
PayloadDeserializer getPayload() { PayloadDeserializer ret = null; if (payload != null) { ret = payload.get(); } if (ret == null) { ret = new PayloadDeserializer(getEnvelope().getPayload()); payload = new WeakReference<>(ret); } return ret; }
/** * @return whether this Transaction is marked as TxValidationCode.VALID */ public boolean isValid() { return BlockInfo.this.isFiltered() ? filteredTx.getTxValidationCode().getNumber() == FabricTransaction.TxValidationCode.VALID_VALUE : envelopeDeserializer.isValid(); }
/** * @return the validation code of this Transaction (enumeration TxValidationCode in Transaction.proto) */ public byte getValidationCode() { if (BlockInfo.this.isFiltered()) { return (byte) filteredTx.getTxValidationCode().getNumber(); } return envelopeDeserializer.validationCode(); }
EnvelopeDeserializer getData(int index) throws InvalidProtocolBufferException { if (index >= getData().getDataCount()) { return null; } WeakReference<EnvelopeDeserializer> envelopeWeakReference = envelopes.get(index); if (null != envelopeWeakReference) { EnvelopeDeserializer ret = envelopeWeakReference.get(); if (null != ret) { return ret; } } EnvelopeDeserializer envelopeDeserializer = EnvelopeDeserializer.newInstance(getData().getData(index), getTransActionsMetaData()[index]); envelopes.put(index, new WeakReference<>(envelopeDeserializer)); return envelopeDeserializer; }
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; }
EnvelopeInfo(EnvelopeDeserializer envelopeDeserializer) { this.envelopeDeserializer = envelopeDeserializer; headerDeserializer = envelopeDeserializer.getPayload().getHeader(); filteredTx = null; }
byte[] getSignature() { return getEnvelope().getSignature().toByteArray(); }