Note that the block number is an unsigned 64-bit integer, with the sign bit used to hold the top bit of 16 | * the number.
17 | * @return A block number. 18 | */ 19 | long getBlockNumber(); 20 | 21 | /** 22 | * Transaction that emitted this chaincode event. 23 | * @return Transaction ID. 24 | */ 25 | String getTransactionId(); 26 | 27 | /** 28 | * Chaincode that emitted this event. 29 | * @return Chaincode name. 30 | */ 31 | String getChaincodeName(); 32 | 33 | /** 34 | * Name of the emitted event. 35 | * @return Event name. 36 | */ 37 | String getEventName(); 38 | 39 | /** 40 | * Application defined payload data associated with this event. 41 | * @return Event payload. 42 | */ 43 | byte[] getPayload(); 44 | } 45 | -------------------------------------------------------------------------------- /java/src/main/java/org/hyperledger/fabric/client/ChaincodeEventIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package org.hyperledger.fabric.client; 8 | 9 | import java.util.Collections; 10 | import java.util.Iterator; 11 | import org.hyperledger.fabric.protos.gateway.ChaincodeEventsResponse; 12 | 13 | final class ChaincodeEventIterator implements CloseableIteratorNote that the block number is an unsigned 64-bit integer, with the sign bit used to hold the top bit of 18 | * the number.
19 | * @param blockNumber a ledger block number. 20 | * @throws IOException if an I/O error occurs. 21 | */ 22 | void checkpointBlock(long blockNumber) throws IOException; 23 | 24 | /** 25 | * Checkpoint a transaction within a block. 26 | * @param blockNumber a ledger block number. 27 | * @param transactionId transaction id within the block. 28 | * @throws IOException if an I/O error occurs. 29 | */ 30 | void checkpointTransaction(long blockNumber, String transactionId) throws IOException; 31 | 32 | /** 33 | * Checkpoint a chaincode event. 34 | * @param event a chaincode event. 35 | * @throws IOException if an I/O error occurs. 36 | */ 37 | void checkpointChaincodeEvent(ChaincodeEvent event) throws IOException; 38 | } 39 | -------------------------------------------------------------------------------- /java/src/main/java/org/hyperledger/fabric/client/CloseableIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package org.hyperledger.fabric.client; 8 | 9 | import java.util.Iterator; 10 | 11 | /** 12 | * An iterator that can be closed when the consumer does not want to read any more elements, freeing up resources that 13 | * may be held by the iterator. 14 | *Note that iteration may throw {@link GatewayRuntimeException} if the gRPC connection fails.
15 | * @paramIf both a start block and checkpoint are specified, and the checkpoint has a valid position set, the 13 | * checkpoint position is used and the specified start block is ignored. If the checkpoint is unset then the start block 14 | * is used.
15 | * 16 | *If no start position is specified, eventing begins from the next committed block.
17 | * 18 | * @paramNote that the block number is an unsigned 64-bit integer, with the sign bit used to hold the top bit of 24 | * the number.
25 | * @param blockNumber a ledger block number. 26 | * @return This builder. 27 | */ 28 | EventsBuilderNote that the returned iterator may throw {@link GatewayRuntimeException} during iteration if a gRPC 21 | * connection error occurs.
22 | * @return Ordered sequence of events. 23 | */ 24 | default CloseableIteratorNote that the returned iterator may throw {@link GatewayRuntimeException} during iteration if a gRPC 32 | * connection error occurs.
33 | * @param options Function that transforms call options. 34 | * @return Ordered sequence of events. 35 | */ 36 | CloseableIteratorNote that the returned iterator may throw {@link GatewayRuntimeException} during iteration if a gRPC 42 | * connection error occurs.
43 | * @param options Call options. 44 | * @return Ordered sequence of events. 45 | * @deprecated Replaced by {@link #getEvents(UnaryOperator)}. 46 | */ 47 | @Deprecated 48 | default CloseableIteratorNote that the block number is an unsigned 64-bit integer, with the sign bit used to hold the top bit of 24 | * the number.
25 | * @return A block number. 26 | */ 27 | long getBlockNumber(); 28 | 29 | /** 30 | * Get the committed transaction status code. 31 | * @return Transaction status code. 32 | */ 33 | TxValidationCode getCode(); 34 | 35 | /** 36 | * Check whether the transaction committed successfully. 37 | * @return {@code true} if the transaction committed successfully; otherwise {@code false}. 38 | */ 39 | boolean isSuccessful(); 40 | } 41 | -------------------------------------------------------------------------------- /java/src/main/java/org/hyperledger/fabric/client/StatusImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package org.hyperledger.fabric.client; 8 | 9 | import org.hyperledger.fabric.protos.gateway.CommitStatusResponse; 10 | import org.hyperledger.fabric.protos.peer.TxValidationCode; 11 | 12 | /** 13 | * Information about a transaction that is committed to the ledger. 14 | */ 15 | final class StatusImpl implements Status { 16 | private final String transactionId; 17 | private final long blockNumber; 18 | private final TxValidationCode code; 19 | 20 | StatusImpl(final String transactionId, final CommitStatusResponse response) { 21 | this.transactionId = transactionId; 22 | this.blockNumber = response.getBlockNumber(); 23 | this.code = response.getResult(); 24 | } 25 | 26 | @Override 27 | public String getTransactionId() { 28 | return transactionId; 29 | } 30 | 31 | @Override 32 | public long getBlockNumber() { 33 | return blockNumber; 34 | } 35 | 36 | @Override 37 | public TxValidationCode getCode() { 38 | return code; 39 | } 40 | 41 | @Override 42 | public boolean isSuccessful() { 43 | return code == TxValidationCode.VALID; 44 | } 45 | 46 | @Override 47 | public String toString() { 48 | return GatewayUtils.toString( 49 | this, 50 | "transactionId: " + transactionId, 51 | "code: " + code.getNumber() + " (" + code.name() + ")", 52 | "blockNumber: " + blockNumber); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /java/src/main/java/org/hyperledger/fabric/client/SubmitException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package org.hyperledger.fabric.client; 8 | 9 | import io.grpc.StatusRuntimeException; 10 | 11 | /** 12 | * Thrown when a failure occurs submitting an endorsed transaction to the orderer. 13 | */ 14 | public class SubmitException extends TransactionException { 15 | private static final long serialVersionUID = 1L; 16 | 17 | /** 18 | * Constructs a new exception with the specified cause. 19 | * @param transactionId a transaction ID. 20 | * @param cause the cause. 21 | */ 22 | public SubmitException(final String transactionId, final StatusRuntimeException cause) { 23 | super(transactionId, cause); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /java/src/main/java/org/hyperledger/fabric/client/SubmittedTransaction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package org.hyperledger.fabric.client; 8 | 9 | /** 10 | * Allows access to the transaction result and its commit status on the ledger. 11 | */ 12 | public interface SubmittedTransaction extends Commit { 13 | /** 14 | * Get the transaction result. This is obtained during the endorsement process when the transaction proposal is 15 | * run on endorsing peers and so is available immediately. The transaction might subsequently fail to commit 16 | * successfully. 17 | * @return Transaction result. 18 | */ 19 | byte[] getResult(); 20 | } 21 | -------------------------------------------------------------------------------- /java/src/main/java/org/hyperledger/fabric/client/SubmittedTransactionImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package org.hyperledger.fabric.client; 8 | 9 | import com.google.protobuf.ByteString; 10 | import org.hyperledger.fabric.protos.gateway.SignedCommitStatusRequest; 11 | 12 | final class SubmittedTransactionImpl extends CommitImpl implements SubmittedTransaction { 13 | private final ByteString result; 14 | 15 | SubmittedTransactionImpl( 16 | final GatewayClient client, 17 | final SigningIdentity signingIdentity, 18 | final String transactionId, 19 | final SignedCommitStatusRequest signedRequest, 20 | final ByteString result) { 21 | super(client, signingIdentity, transactionId, signedRequest); 22 | this.result = result; 23 | } 24 | 25 | @Override 26 | public byte[] getResult() { 27 | return result.toByteArray(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /java/src/main/java/org/hyperledger/fabric/client/TransactionContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package org.hyperledger.fabric.client; 8 | 9 | import com.google.protobuf.ByteString; 10 | import java.nio.charset.StandardCharsets; 11 | import java.security.SecureRandom; 12 | import org.bouncycastle.util.encoders.Hex; 13 | import org.hyperledger.fabric.protos.common.SignatureHeader; 14 | 15 | final class TransactionContext { 16 | private static final int NONCE_LENGTH = 24; 17 | private static final SecureRandom RANDOM = new SecureRandom(); 18 | 19 | private final SigningIdentity signingIdentity; 20 | private final byte[] nonce; 21 | private final String transactionId; 22 | private final SignatureHeader signatureHeader; 23 | 24 | TransactionContext(final SigningIdentity signingIdentity) { 25 | this.signingIdentity = signingIdentity; 26 | nonce = newNonce(); 27 | 28 | transactionId = newTransactionId(); 29 | signatureHeader = newSignatureHeader(); 30 | } 31 | 32 | private static byte[] newNonce() { 33 | byte[] values = new byte[NONCE_LENGTH]; 34 | RANDOM.nextBytes(values); 35 | return values; 36 | } 37 | 38 | private String newTransactionId() { 39 | byte[] saltedCreator = GatewayUtils.concat(nonce, signingIdentity.getCreator()); 40 | byte[] rawTransactionId = Hash.SHA256.apply(saltedCreator); 41 | byte[] hexTransactionId = Hex.encode(rawTransactionId); 42 | return new String(hexTransactionId, StandardCharsets.UTF_8); 43 | } 44 | 45 | private SignatureHeader newSignatureHeader() { 46 | return SignatureHeader.newBuilder() 47 | .setCreator(ByteString.copyFrom(signingIdentity.getCreator())) 48 | .setNonce(ByteString.copyFrom(nonce)) 49 | .build(); 50 | } 51 | 52 | public String getTransactionId() { 53 | return transactionId; 54 | } 55 | 56 | public SignatureHeader getSignatureHeader() { 57 | return signatureHeader; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /java/src/main/java/org/hyperledger/fabric/client/TransactionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package org.hyperledger.fabric.client; 8 | 9 | import io.grpc.StatusRuntimeException; 10 | 11 | /** 12 | * Thrown when a failure occurs invoking a transaction. 13 | */ 14 | public class TransactionException extends GatewayException { 15 | private static final long serialVersionUID = 1L; 16 | 17 | private final String transactionId; 18 | 19 | /** 20 | * Constructs a new exception with the specified cause. 21 | * @param transactionId a transaction ID. 22 | * @param cause the cause. 23 | */ 24 | public TransactionException(final String transactionId, final StatusRuntimeException cause) { 25 | super(cause); 26 | this.transactionId = transactionId; 27 | } 28 | 29 | /** 30 | * The ID of the transaction. 31 | * @return a transaction ID. 32 | */ 33 | public String getTransactionId() { 34 | return transactionId; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /java/src/main/java/org/hyperledger/fabric/client/identity/ECPrivateKeySigner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package org.hyperledger.fabric.client.identity; 8 | 9 | import java.math.BigInteger; 10 | import java.security.GeneralSecurityException; 11 | import java.security.interfaces.ECPrivateKey; 12 | import org.bouncycastle.asn1.ASN1Integer; 13 | 14 | final class ECPrivateKeySigner implements Signer { 15 | private static final String ALGORITHM_NAME = "NONEwithECDSA"; 16 | 17 | private final Signer signer; 18 | private final BigInteger curveN; 19 | private final BigInteger halfCurveN; 20 | 21 | ECPrivateKeySigner(final ECPrivateKey privateKey) { 22 | signer = new PrivateKeySigner(privateKey, ALGORITHM_NAME); 23 | curveN = privateKey.getParams().getOrder(); 24 | halfCurveN = curveN.divide(BigInteger.valueOf(2)); 25 | } 26 | 27 | @Override 28 | public byte[] sign(final byte[] digest) throws GeneralSecurityException { 29 | byte[] rawSignature = signer.sign(digest); 30 | ECSignature signature = ECSignature.fromBytes(rawSignature); 31 | signature = preventMalleability(signature); 32 | return signature.getBytes(); 33 | } 34 | 35 | private ECSignature preventMalleability(final ECSignature signature) { 36 | BigInteger s = signature.getS().getValue(); 37 | if (s.compareTo(halfCurveN) > 0) { 38 | s = curveN.subtract(s); 39 | return new ECSignature(signature.getR(), new ASN1Integer(s)); 40 | } 41 | return signature; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /java/src/main/java/org/hyperledger/fabric/client/identity/Identity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package org.hyperledger.fabric.client.identity; 8 | 9 | /** 10 | * Represents a client identity used to interact with a Fabric network. The identity consists of an identifier for the 11 | * organization to which the identity belongs, and implementation-specific credentials describing the identity. 12 | */ 13 | public interface Identity { 14 | /** 15 | * Member services provider to which this identity is associated. 16 | * @return A member services provider identifier. 17 | */ 18 | String getMspId(); 19 | 20 | /** 21 | * Implementation-specific credentials. 22 | * @return Credential data. 23 | */ 24 | byte[] getCredentials(); 25 | } 26 | -------------------------------------------------------------------------------- /java/src/main/java/org/hyperledger/fabric/client/identity/PrivateKeySigner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package org.hyperledger.fabric.client.identity; 8 | 9 | import java.security.GeneralSecurityException; 10 | import java.security.PrivateKey; 11 | import java.security.Provider; 12 | import java.security.Signature; 13 | import org.bouncycastle.jce.provider.BouncyCastleProvider; 14 | 15 | final class PrivateKeySigner implements Signer { 16 | private static final Provider PROVIDER = new BouncyCastleProvider(); 17 | 18 | private final PrivateKey privateKey; 19 | private final String algorithm; 20 | 21 | PrivateKeySigner(final PrivateKey privateKey, final String algorithm) { 22 | this.privateKey = privateKey; 23 | this.algorithm = algorithm; 24 | } 25 | 26 | @Override 27 | public byte[] sign(final byte[] digest) throws GeneralSecurityException { 28 | Signature signer = Signature.getInstance(algorithm, PROVIDER); 29 | signer.initSign(privateKey); 30 | signer.update(digest); 31 | return signer.sign(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /java/src/main/java/org/hyperledger/fabric/client/identity/Signer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package org.hyperledger.fabric.client.identity; 8 | 9 | import java.security.GeneralSecurityException; 10 | 11 | /** 12 | * A signing implementation used to generate digital signatures. Standard implementations can be obtained using factory 13 | * methods on the {@link Signers} class. 14 | */ 15 | @FunctionalInterface 16 | public interface Signer { 17 | /** 18 | * Signs the supplied message digest. The digest is typically a hash of the message. 19 | * @param digest A message digest. 20 | * @return A digital signature. 21 | * @throws GeneralSecurityException if a signing error occurs. 22 | */ 23 | byte[] sign(byte[] digest) throws GeneralSecurityException; 24 | } 25 | -------------------------------------------------------------------------------- /java/src/main/java/org/hyperledger/fabric/client/identity/Signers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package org.hyperledger.fabric.client.identity; 8 | 9 | import java.security.PrivateKey; 10 | import java.security.interfaces.ECPrivateKey; 11 | 12 | /** 13 | * Factory methods to create standard signing implementations. 14 | */ 15 | public final class Signers { 16 | private static final String ED25519_ALGORITHM = "Ed25519"; 17 | 18 | /** 19 | * Create a new signer that uses the supplied private key for signing. The {@link Identities} class provides static 20 | * methods to create a {@code PrivateKey} object from PEM-format data. 21 | * 22 | *Currently supported private key types are:
23 | *Note that the Sign implementations have different expectations on the input data supplied to them.
29 | * 30 | *The ECDSA signers operate on a pre-computed message digest, and should be combined with an appropriate hash 31 | * algorithm. P-256 is typically used with a SHA-256 hash, and P-384 is typically used with a SHA-384 hash.
32 | * 33 | *The Ed25519 signer operates on the full message content, and should be combined with a 34 | * {@link org.hyperledger.fabric.client.Hash#NONE NONE} (or no-op) hash implementation to ensure the complete 35 | * message is passed to the signer.
36 | * @param privateKey A private key. 37 | * @return A signer implementation. 38 | */ 39 | public static Signer newPrivateKeySigner(final PrivateKey privateKey) { 40 | if (privateKey instanceof ECPrivateKey) { 41 | return new ECPrivateKeySigner((ECPrivateKey) privateKey); 42 | } 43 | 44 | if (ED25519_ALGORITHM.equals(privateKey.getAlgorithm())) { 45 | return new PrivateKeySigner(privateKey, ED25519_ALGORITHM); 46 | } 47 | 48 | throw new IllegalArgumentException("Unsupported private key type: " 49 | + privateKey.getClass().getTypeName() + " (" + privateKey.getAlgorithm() + ")"); 50 | } 51 | 52 | // Private constructor to prevent instantiation 53 | private Signers() {} 54 | } 55 | -------------------------------------------------------------------------------- /java/src/main/java/org/hyperledger/fabric/client/identity/X509Identity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package org.hyperledger.fabric.client.identity; 8 | 9 | import java.nio.charset.StandardCharsets; 10 | import java.security.cert.X509Certificate; 11 | import java.util.Arrays; 12 | import java.util.Objects; 13 | 14 | /** 15 | * A client identity described by an X.509 certificate. The {@link Identities} class provides static methods to create 16 | * an {@code X509Certificate} object from PEM-format data. 17 | */ 18 | public final class X509Identity implements Identity { 19 | private final String mspId; 20 | private final X509Certificate certificate; 21 | private final byte[] credentials; 22 | 23 | /** 24 | * Constructor. 25 | * @param mspId A membership service provider identifier. 26 | * @param certificate An X.509 certificate. 27 | */ 28 | public X509Identity(final String mspId, final X509Certificate certificate) { 29 | this.mspId = mspId; 30 | this.certificate = certificate; 31 | credentials = Identities.toPemString(certificate).getBytes(StandardCharsets.UTF_8); 32 | } 33 | 34 | /** 35 | * Get the certificate for this identity. 36 | * @return An X.509 certificate. 37 | */ 38 | public X509Certificate getCertificate() { 39 | return certificate; 40 | } 41 | 42 | @Override 43 | public String getMspId() { 44 | return mspId; 45 | } 46 | 47 | @Override 48 | public byte[] getCredentials() { 49 | return credentials.clone(); 50 | } 51 | 52 | @Override 53 | public boolean equals(final Object other) { 54 | if (this == other) { 55 | return true; 56 | } 57 | if (!(other instanceof X509Identity)) { 58 | return false; 59 | } 60 | 61 | X509Identity that = (X509Identity) other; 62 | return Objects.equals(this.mspId, that.mspId) && Arrays.equals(this.credentials, that.credentials); 63 | } 64 | 65 | @Override 66 | public int hashCode() { 67 | return Objects.hash(mspId, Arrays.hashCode(credentials)); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /java/src/main/java/org/hyperledger/fabric/client/identity/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | /** 8 | *Provides classes and interfaces for describing client identity and for creating digital signatures on behalf of 9 | * client identities.
10 | */ 11 | package org.hyperledger.fabric.client.identity; 12 | -------------------------------------------------------------------------------- /java/src/main/java/org/hyperledger/fabric/client/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | /** 8 | *This package provides the set of interfaces that enable a Java application to 9 | * interact with a Fabric blockchain network. It provides a simple API to 10 | * submit transactions to a ledger or query the contents of a ledger with minimal code. 11 | * The Gateway SDK implements the Fabric programming model as described in the 12 | * Running a Fabric Application 13 | * tutorial of the Fabric documentation.
14 | * 15 | *The entry point into this package is {@link org.hyperledger.fabric.client.Gateway Gateway}.
16 | * 17 | * @see Running a Fabric Application 18 | */ 19 | package org.hyperledger.fabric.client; 20 | -------------------------------------------------------------------------------- /java/src/main/javadoc/resources/fonts/DejaVuLGCSans-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger/fabric-gateway/6b09d8b135b7f111a3a0e6f8e2ba08059589b62c/java/src/main/javadoc/resources/fonts/DejaVuLGCSans-Bold.woff2 -------------------------------------------------------------------------------- /java/src/main/javadoc/resources/fonts/DejaVuLGCSans-BoldOblique.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger/fabric-gateway/6b09d8b135b7f111a3a0e6f8e2ba08059589b62c/java/src/main/javadoc/resources/fonts/DejaVuLGCSans-BoldOblique.woff2 -------------------------------------------------------------------------------- /java/src/main/javadoc/resources/fonts/DejaVuLGCSans-Oblique.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger/fabric-gateway/6b09d8b135b7f111a3a0e6f8e2ba08059589b62c/java/src/main/javadoc/resources/fonts/DejaVuLGCSans-Oblique.woff2 -------------------------------------------------------------------------------- /java/src/main/javadoc/resources/fonts/DejaVuLGCSans.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger/fabric-gateway/6b09d8b135b7f111a3a0e6f8e2ba08059589b62c/java/src/main/javadoc/resources/fonts/DejaVuLGCSans.woff2 -------------------------------------------------------------------------------- /java/src/main/javadoc/resources/fonts/DejaVuLGCSansMono-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger/fabric-gateway/6b09d8b135b7f111a3a0e6f8e2ba08059589b62c/java/src/main/javadoc/resources/fonts/DejaVuLGCSansMono-Bold.woff2 -------------------------------------------------------------------------------- /java/src/main/javadoc/resources/fonts/DejaVuLGCSansMono-BoldOblique.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger/fabric-gateway/6b09d8b135b7f111a3a0e6f8e2ba08059589b62c/java/src/main/javadoc/resources/fonts/DejaVuLGCSansMono-BoldOblique.woff2 -------------------------------------------------------------------------------- /java/src/main/javadoc/resources/fonts/DejaVuLGCSansMono-Oblique.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger/fabric-gateway/6b09d8b135b7f111a3a0e6f8e2ba08059589b62c/java/src/main/javadoc/resources/fonts/DejaVuLGCSansMono-Oblique.woff2 -------------------------------------------------------------------------------- /java/src/main/javadoc/resources/fonts/DejaVuLGCSansMono.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger/fabric-gateway/6b09d8b135b7f111a3a0e6f8e2ba08059589b62c/java/src/main/javadoc/resources/fonts/DejaVuLGCSansMono.woff2 -------------------------------------------------------------------------------- /java/src/main/javadoc/resources/fonts/DejaVuLGCSerif-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger/fabric-gateway/6b09d8b135b7f111a3a0e6f8e2ba08059589b62c/java/src/main/javadoc/resources/fonts/DejaVuLGCSerif-Bold.woff2 -------------------------------------------------------------------------------- /java/src/main/javadoc/resources/fonts/DejaVuLGCSerif-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger/fabric-gateway/6b09d8b135b7f111a3a0e6f8e2ba08059589b62c/java/src/main/javadoc/resources/fonts/DejaVuLGCSerif-BoldItalic.woff2 -------------------------------------------------------------------------------- /java/src/main/javadoc/resources/fonts/DejaVuLGCSerif-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger/fabric-gateway/6b09d8b135b7f111a3a0e6f8e2ba08059589b62c/java/src/main/javadoc/resources/fonts/DejaVuLGCSerif-Italic.woff2 -------------------------------------------------------------------------------- /java/src/main/javadoc/resources/fonts/DejaVuLGCSerif.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger/fabric-gateway/6b09d8b135b7f111a3a0e6f8e2ba08059589b62c/java/src/main/javadoc/resources/fonts/DejaVuLGCSerif.woff2 -------------------------------------------------------------------------------- /java/src/main/javadoc/resources/fonts/dejavu.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'DejaVu Sans Mono'; 3 | src: url('DejaVuLGCSansMono.woff2') format('woff2'); 4 | font-weight: normal; 5 | font-style: normal; 6 | } 7 | @font-face { 8 | font-family: 'DejaVu Sans Mono'; 9 | src: url('DejaVuLGCSansMono-Oblique.woff2') format('woff2'); 10 | font-weight: normal; 11 | font-style: italic; 12 | } 13 | @font-face { 14 | font-family: 'DejaVu Sans Mono'; 15 | src: url('DejaVuLGCSansMono-Bold.woff2') format('woff2'); 16 | font-weight: bold; 17 | font-style: normal; 18 | } 19 | @font-face { 20 | font-family: 'DejaVu Sans Mono'; 21 | src: url('DejaVuLGCSansMono-BoldOblique.woff2') format('woff2'); 22 | font-weight: bold; 23 | font-style: italic; 24 | } 25 | 26 | @font-face { 27 | font-family: 'DejaVu Sans'; 28 | src: url('DejaVuLGCSans.woff2') format('woff2'); 29 | font-weight: normal; 30 | font-style: normal; 31 | } 32 | @font-face { 33 | font-family: 'DejaVu Sans'; 34 | src: url('DejaVuLGCSans-Oblique.woff2') format('woff2'); 35 | font-weight: normal; 36 | font-style: italic; 37 | } 38 | @font-face { 39 | font-family: 'DejaVu Sans'; 40 | src: url('DejaVuLGCSans-Bold.woff2') format('woff2'); 41 | font-weight: bold; 42 | font-style: normal; 43 | } 44 | @font-face { 45 | font-family: 'DejaVu Sans'; 46 | src: url('DejaVuLGCSans-BoldOblique.woff2') format('woff2'); 47 | font-weight: bold; 48 | font-style: italic; 49 | } 50 | 51 | @font-face { 52 | font-family: 'DejaVu Serif'; 53 | src: url('DejaVuLGCSerif.woff2') format('woff2'); 54 | font-weight: normal; 55 | font-style: normal; 56 | } 57 | @font-face { 58 | font-family: 'DejaVu Serif'; 59 | src: url('DejaVuLGCSerif-Italic.woff2') format('woff2'); 60 | font-weight: normal; 61 | font-style: italic; 62 | } 63 | @font-face { 64 | font-family: 'DejaVu Serif'; 65 | src: url('DejaVuLGCSerif-Bold.woff2') format('woff2'); 66 | font-weight: bold; 67 | font-style: normal; 68 | } 69 | @font-face { 70 | font-family: 'DejaVu Serif'; 71 | src: url('DejaVuLGCSerif-BoldItalic.woff2') format('woff2'); 72 | font-weight: bold; 73 | font-style: italic; 74 | } 75 | -------------------------------------------------------------------------------- /java/src/test/java/org/hyperledger/fabric/client/BlockEventsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 IBM All Rights Reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package org.hyperledger.fabric.client; 8 | 9 | import static org.mockito.Mockito.any; 10 | import static org.mockito.Mockito.doReturn; 11 | import static org.mockito.Mockito.doThrow; 12 | 13 | import io.grpc.CallOptions; 14 | import java.util.function.UnaryOperator; 15 | import java.util.stream.Stream; 16 | import org.hyperledger.fabric.protos.common.Block; 17 | import org.hyperledger.fabric.protos.common.BlockHeader; 18 | import org.hyperledger.fabric.protos.common.Envelope; 19 | import org.hyperledger.fabric.protos.peer.DeliverResponse; 20 | 21 | public final class BlockEventsTest extends CommonBlockEventsTest