Search in sources :

Example 1 with TxReadWriteSet

use of org.hyperledger.fabric.protos.ledger.rwset.Rwset.TxReadWriteSet in project fabric-sdk-java by hyperledger.

the class ProposalResponse method getChaincodeActionResponseReadWriteSetInfo.

/**
 * getChaincodeActionResponseReadWriteSetInfo get this proposals read write set.
 *
 * @return The read write set. See {@link TxReadWriteSetInfo}
 * @throws InvalidArgumentException
 */
public TxReadWriteSetInfo getChaincodeActionResponseReadWriteSetInfo() throws InvalidArgumentException {
    if (isInvalid()) {
        throw new InvalidArgumentException("Proposal response is invalid.");
    }
    try {
        final ProposalResponsePayloadDeserializer proposalResponsePayloadDeserializer = getProposalResponsePayloadDeserializer();
        TxReadWriteSet txReadWriteSet = proposalResponsePayloadDeserializer.getExtension().getResults();
        if (txReadWriteSet == null) {
            return null;
        }
        return new TxReadWriteSetInfo(txReadWriteSet);
    } catch (Exception e) {
        throw new InvalidArgumentException(e);
    }
}
Also used : TxReadWriteSet(org.hyperledger.fabric.protos.ledger.rwset.Rwset.TxReadWriteSet) InvalidArgumentException(org.hyperledger.fabric.sdk.exception.InvalidArgumentException) InvalidProtocolBufferException(com.google.protobuf.InvalidProtocolBufferException) InvalidArgumentException(org.hyperledger.fabric.sdk.exception.InvalidArgumentException) ProposalException(org.hyperledger.fabric.sdk.exception.ProposalException) CryptoException(org.hyperledger.fabric.sdk.exception.CryptoException)

Aggregations

InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 TxReadWriteSet (org.hyperledger.fabric.protos.ledger.rwset.Rwset.TxReadWriteSet)1 CryptoException (org.hyperledger.fabric.sdk.exception.CryptoException)1 InvalidArgumentException (org.hyperledger.fabric.sdk.exception.InvalidArgumentException)1 ProposalException (org.hyperledger.fabric.sdk.exception.ProposalException)1